Skip to content

Exploits

Convert py2 to py3

2to3 ms08_067_2018.py -w -n -o py3dir

Switch python version

If python2 still needed :

  • https://www.kali.org/docs/general-use/using-eol-python-versions/
pyenv versions # show available versions 
pyenv global 2.7.18 # set python to version 2.7.18
pyenv global system # # set python to default python3

Compile 32bits exploits

  • https://vulp3cula.gitbook.io/hackers-grimoire/exploitation/working-with-exploits

32-bit is usually represented by i686 and 64-bit is usually represented by x86_64.

Identify arch :

uname -a
cat /proc/version
dpkg --print-architecture
arch
file /sbin/init

If a C compiler is missing or inaccessible on your victim machine, you can compile the exploits on your Kali machine but you need some extra libraries on Kali.

apt-get install gcc-multilib
apt-get install g++-multilib

Then add add the -m32 flag to your compile command.

If "error while loading shared libraries: requires glibc 2.5 or later dynamic linker" :

  • https://stackoverflow.com/questions/12075403/gcc-reduce-libc-required-version
gcc -m32 -Wl,--hash-style=both exploit.c -o exploit

Cross-compiling

apt-get install mingw-w64
x86_64-w64-mingw32-gcc shell.c -o shell.exe     # for 64bits Windows
i686-w64-mingw32-gcc shell.c -o shell.exe       # for 32bits Windows