B.O Steps
Steps used in buffer overflow.
1) Use script to crash program and take a note the bytes needed for.
2) Replicate the crash with the bytes from 1) to see if indeed crashes the program.
3) Generate a pattern with length same as above.
4) Replace the pattern above in place of the bytes.
5) Make a note of the HEX number that overwrites the EIP at the time of the crash.
6) Together with the EIP found in 5) determine the offset.
7) The buffer should look like this
8) Increase buffer if the bytes are not enough for our shellcode.
9) Look for bad characters
10) The main idea is to replace the EIP with ESP but can be difficult to hand code ESP as its not constant.
11) By the time of the crash there are other dll's and functions loaded. We need to find those (with no DEP and noASLR)
12) Use mona
13) Use nasm to make a note of the jmp esp
14) Find the memory address
15) Memory address found in 14) above. Remember it should be in reverse if x86 arch
16) Place a breakpoint at this address and let it run
17) ESP will then be pointed to the next executable which will be our shellcode.
18) Create a shellcode with msfvenom
19) Our buffer at this stage should be the following:
20) Run it!!! We should have a shell.
Last updated