Skip to content

Instantly share code, notes, and snippets.

View berdoezt's full-sized avatar

Albert Mario berdoezt

View GitHub Profile
package main
import (
"errors"
"io"
"log"
"net/http"
"time"
"github.com/sony/gobreaker"
package main
// input
// process(input) = result
// expected
// result == expected
// 90
// B
@berdoezt
berdoezt / array_incr.py
Created November 25, 2021 03:10
Given array representing a digit (123 = [1, 2, 3]) write a function to increment the number by 1 digit. Source problem: https://www.youtube.com/watch?v=gcxyiFoEpyU
# Given array representing a digit (123 = [1, 2, 3]) write a function to increment the number by 1 digit
def incr(a):
l = 8
for i in range(len(a) - 1, -1, -1):
a[i] += l
l = a[i] / 10
a[i] = a[i] % 10
if l == 0:
break
@berdoezt
berdoezt / time.py
Created December 18, 2017 18:26
first solver
a = [0x6E, 0x69, 0x64, 0x73, 0x61, 0x7C, 0x53, 0x6F, 0x36,0x74, 0x58, 0x26, 0x74, 0x58, 0x6D, 0x52, 0x74, 0x73, 0x58, 0x73, 0x6F, 0x34, 0x58, 0x45, 0x34, 0x60, 0x6E,0x69, 0x49, 0x6E, 0x69, 0x60, 0x7A]
print "".join(chr(i ^ 7) for i in a)
@berdoezt
berdoezt / warmheap.py
Created December 18, 2017 18:02
if it fails, run it again
#!/usr/bin/env python
from pwn import *
a = process('./warm_heap', env = {'LD_PRELOAD':'./libc.so.6'})
libc = ELF('./libc.so.6')
def add(index, size, input):
a.recvuntil('>>')
a.sendline('1')
#!/usr/bin/env python
from pwn import *
a = remote('cupheap01.3dsctf.org', 8007)
a.recvuntil(' Give up')
a.sendline('1')
a.recv()
a.recv()
hasil = a.recv()
#!/usr/bin/env python
from pwn import *
import sys
LOCAL = 1
if LOCAL:
a = process('./stupidrop')
if len(sys.argv) == 2:
gdb.attach(a, 'b *0x0000000000400637')
@berdoezt
berdoezt / warmup.py
Created December 18, 2017 13:20
solution for warmup on pwn category inctf 2017
#!/usr/bin/env python
from pwn import *
import sys
LOCAL = 1
libc = ELF('./libc.so.6')
if LOCAL:
a = process('./warmup', env={"LD_PRELOAD":"./libc.so.6"})