Modern Offensive and Defensive Solutions
We discuss modern offensive and defensive solutions, focusing on recent research on application and system security.
- Slides for this session:
Tasks
Download the session task archive.
Open the session task archive and access the
rop-shell/subfolder. Your goal is to open a shell by callingsystem("/bin/sh"). You can jump directly to wheresystem()is called. You need to store the address of"sh"in RDI using a gadget. You can find the address of"sh"in the executable by usingfindin GDB PEDA.Construct the ROP-based payload in
exploit.pysimilar to theexploit.pyfile in therop-demo/subfolder.You can look for ROP gadgets by issuing the command
ROPgadget --binary vuln
Open the session task archive and access the
rop-chain/subfolder. You goal is to callmega_checker()after thechecker()call. Both the"ihahaha!"and the"Uberihahaha!"messages need to be printed. For themega_checker()to be properly called you need to initialized both the RDI register (1st parameter) and the RSI register (2nd parameter).Construct the ROP-based payload in
exploit.py.First make sure you have a recent version of Clang/LLVM (3.8+) installed. If you use the lab machines, use
apt-getto install theclang-4.0package.Open the session task archive and access the
dop/subfolder. Opendop.c. What is the vulnerability? Notice there is a buffer overflow infand thatfcontains a while loop that acts as an interpreter.Open
payload.cand study the example payload. What does it do? Fill in the missing addresses inpayload.c. Generate the payload and feed it todop. It should print “End of program: FAILAA!”.Devise a similar payload that makes
dopprint “End of program: SISPWN!”.Recompile
dopwith the-fsanitize=safe-stackflag and run the exploit again. What happened? Why?