Skip to content

Commit

Permalink
Add symcalcpy writeup
Browse files Browse the repository at this point in the history
  • Loading branch information
qhdwight committed May 9, 2022
1 parent 787b9c5 commit eb6b782
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sd-ctf-2021/rbash-symcalcpy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SymCalc.py

### Approach

1) Use `breakpoint` as your favorite word (and thus builtin)
2) Abuse the fact that `_` is punctuation and in Python is a reference to the result of the last command
3) Run `_()` to call this builtin and enter the Python debugger
4) In the Python debugger `!` can be used to run in a sub-interpreter, so run `!import os; os.system('/bin/sh')` and get the flag

### Note

This is not the intended solution, but works just the same! And in my opinion is a little simpler.

0 comments on commit eb6b782

Please sign in to comment.