Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LAB7] 512559005 #550

Closed
wants to merge 14 commits into from
20 changes: 20 additions & 0 deletions lab7/sol.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import angr, sys

def successful(state):
return b"Login successful" in state.posix.dumps(sys.stdout.fuleno())

def fail(state):
return b"Login fauled" in state.posix.dumps(sys.stdout.fuleno())

# 加載二進制文件
proj = angr.Project('./login')

init_state = proj.factory.entry_state()

simulation = proj.factory.simgr(init_state)

simulation.explore(find=successful, avoid=fail)

solution = simulation.found[0]

print(solution.posix.dumps(sys.stdin.fileno()))
Loading