Write up/CTF
[Codegate2017 Pre] EasyCrack101
KuroNeko_
2017. 2. 11. 11:03
반응형
쉽다. angr로 코딩해서 돌려주면 되는데 양이 많다.
어쨋든 아래의 소스코드를 참조하면 된다.
#!/usr/bin/env python import angr for i in range(1, 102): p = angr.Project("./prob" + str(i)) offset = 0 with open("./prob" + str(i), "rb") as f: buf = f.read() offset = buf.index("\x83\xF8\x01\x75\x0C") + 5 print hex(offset) arg1 = angr.claripy.BVS("arg1", 8*8*90) # 90 bytes st = p.factory.entry_state(args=["./prob" + str(i), arg1]) pt = p.factory.path(st) ex = p.surveyors.Explorer(start=pt, find=0x400000 + offset) ex.run() print ex.found[0].state.se.any_str(arg1)