Here's the vulnerable code (/levels/level09.c):
#include <stdio.h>
#include <string.h>I hereby claim:
To claim this, I am signing this object:
| # Install the latest opam and ocaml | |
| sudo add-apt-repository ppa:avsm/ppa | |
| sudo apt-get update | |
| sudo apt-get install ocaml ocaml-native-compilers camlp4-extra opam | |
| # Initialize the right switch in opam, along with version ocaml version 4.02.3 | |
| opam init --comp=4.02.3 | |
| # Set up the environment variables in the current session | |
| eval `opam config env` |
Go to the IDAPython binaries page.
Download the latest _linux.zip file and extract it. In my case, it was idapython-6.9.0-python2.7-linux.zip.
Follow the instructions in its README.txt.
For simplicity, I have copy pasted the relevant portions here:
Screenshots of IDA from running the code at this asciinema link.
The generated python files are from the commands:
bap coreutils_O3_uniq --taint-reg='%000026e1' --taint --emit-ida-script-file=tr.py --emit-ida-script-attr=tainted-reg --emit-ida-script
bap coreutils_O3_uniq --taint-reg='%000026e1' --taint --map-terms-with='((taints) (color green))' --map-terms --emit-ida-script-file=c.py --emit-ida-script-attr=color --emit-ida-script
The coreutils_O3_uniq file is taken from BinaryAnalysisPlatform/arm-binaries.
| #! /usr/bin/env python | |
| import requests | |
| import shutil | |
| import subprocess | |
| import os | |
| url_form = 'http://localhost:31337/captcha/example6/' | |
| url_submit = url_form + 'submit' | |
| captcha_image_path = 'captcha_image.png' |