Skip to content

Commit

Permalink
Merge pull request #608 from AxelHowe/lab7
Browse files Browse the repository at this point in the history
[LAB7] 312552019
  • Loading branch information
TaiYou-TW authored Jun 27, 2024
2 parents ebd7b77 + 854350b commit 94aa56e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lab7/sol.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import angr, sys



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

def fail_condition(state):
return b"Login failed" in state.posix.dumps(sys.stdout.fileno())


proj = angr.Project('./login')

initial_state = proj.factory.entry_state()
simulation = proj.factory.simgr(initial_state)
simulation.explore(find=success_condition, avoid=fail_condition)

soulution = simulation.found[0]
print(soulution.posix.dumps(sys.stdin.fileno()))

0 comments on commit 94aa56e

Please sign in to comment.