반응형

쉽다. 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)


'Write up > CTF' 카테고리의 다른 글

[Codegate 2019] writeup  (0) 2019.01.29
[RCTF 2017] RCalc  (0) 2017.05.22
[Codegate2017 Pre] BabyMISC  (0) 2017.02.11
[Codegate2017 Pre] BabyPwn  (0) 2017.02.11
[RC3 2016] IMS-easy (150pt) *수정  (0) 2016.11.20
블로그 이미지

KuroNeko_

KuroNeko

,