Skip to content

Instantly share code, notes, and snippets.

@doegox
doegox / simplepdf_mount_tmp_and_attack.sh
Created October 20, 2016 21:07
Hack.lu 2016 simplepdf write-up
#!/bin/bash
mkdir -p tmp
mount|grep -q $(pwd)/tmp || sudo mount -t tmpfs -o mode=01777,size=200m tmpfs tmp
cp simplepdf*.pdf tmp/0.pdf
cd tmp
for ((i=0;i<11000;i++)); do
qpdf --show-object=6 --filtered-stream-data $i.pdf > $(($i+1)).pdf
file $(($i+1)).pdf|grep PDF||break
rm $i.pdf
@doegox
doegox / keybase.md
Created August 6, 2016 14:02
Keybase proof

Keybase proof

I hereby claim:

  • I am doegox on github.
  • I am doegox (https://keybase.io/doegox) on keybase.
  • I have a public key ASBy2tVJN_uwAZ0JQ7eUsLqzCH_qUpKIVo1Jll0Lc2J_cwo

To claim this, I am signing this object:

@doegox
doegox / debug().py
Created March 15, 2009 16:26
Forces jump to PDB prompt
def debug():
"""Forces jump to PDB prompt"""
print "<<< You are in the PDB debugger."
import pdb
pdb.set_trace()
@doegox
doegox / set_interactive().py
Created March 15, 2009 16:25
Forces interactive mode with autocompletion
def set_interactive():
"""Forces interactive mode with autocompletion"""
print "<<< Autocompletion was turned on"
# Prepare autocompletion mode (rlcompleter is not used per se,.
# just for initialisation but that's the way it works)
import rlcompleter, readline
readline.parse_and_bind('tab: complete')
# Force interactive mode
os.environ['PYTHONINSPECT'] = '1'