Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am 1project on github.
* I am 1project (https://keybase.io/1project) on keybase.
* I have a public key whose fingerprint is C364 10AB 32A0 D578 2A3F 609C D3F4 0589 DC33 3195
To claim this, I am signing this object:
@1Project
1Project / angr_solution.py
Last active October 31, 2017 18:20
Zeronights 2017 SSB Task 3 Writeup
import angr
p = angr.Project('./task_2.elf', auto_load_libs=False)
# Create a blank state
st = p.factory.blank_state()
# Constrain to be non-null and non-newline:
for _ in xrange(12):
k = st.posix.files[0].read_from(1)
@1Project
1Project / solution.py
Last active October 31, 2017 12:38
SSB task solution
import angr
p = angr.Project('./task_0.elf', auto_load_libs=False)
# Create a blank state
st = p.factory.blank_state()
# Constrain to be non-null and non-newline:
for _ in xrange(12):
k = st.posix.files[0].read_from(1)
def sbox(binary):
# assert len(binary)=8 hz kak
i = int(binary[0]+binary[5], 2) # v1 vector
j = int(binary[1:5], 2) # v2 vector
sbox_table = \
((14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7),
(0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8),
(4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0),
(15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13))