session:12
LDAP: couldn't connect to LDAP server
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| session:12 [2020/06/17 20:27] – Rareş-Mihail VISALOM (67101) | session:12 [2020/07/20 14:34] (current) – [1. Challenge: Using ROP to Leak and Call system()] Liza-Elena BABU (78556) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | = 0x0B. Return Oriented Programming (advanced) | + | ====== 0x0B. Return Oriented Programming (advanced) |
| - | == Slides | + | ===== Slides |
| [[https:// | [[https:// | ||
| Line 9: | Line 9: | ||
| [[https:// | [[https:// | ||
| - | == Setup | + | ===== Setup ===== |
| The ROPgadget version installed in the [[start|Kali virtual machine]] needs to be upgraded to work properly. Please use the command below (as '' | The ROPgadget version installed in the [[start|Kali virtual machine]] needs to be upgraded to work properly. Please use the command below (as '' | ||
| Line 21: | Line 21: | ||
| </ | </ | ||
| - | == Tutorials | + | ===== Tutorials |
| In this lab we are going to dive deeper into ROP (//Return Oriented Programming// | In this lab we are going to dive deeper into ROP (//Return Oriented Programming// | ||
| Line 33: | Line 33: | ||
| As the basis of the lab we will use a CTF challenge called **ropasaurusrex** and gradually make exploitation harder. | As the basis of the lab we will use a CTF challenge called **ropasaurusrex** and gradually make exploitation harder. | ||
| - | === Calling Conventions in the ROP Context | + | ==== Calling Conventions in the ROP Context |
| As you know, the [[: | As you know, the [[: | ||
| Line 90: | Line 90: | ||
| - | === Intro to pwntools | + | ==== Intro to pwntools |
| Writing exploits in command line using expressions such as the following is prone to errors: | Writing exploits in command line using expressions such as the following is prone to errors: | ||
| Line 147: | Line 147: | ||
| - interact with the process using '' | - interact with the process using '' | ||
| - | === Challenge 0 walkthrough | + | ==== Challenge 0 walkthrough |
| Let's do a walkthrough/ | Let's do a walkthrough/ | ||
| Line 275: | Line 275: | ||
| - | == Challenges | + | ===== Challenges |
| - | === 1. Challenge: Using ROP to Leak and Call system() | + | ==== 1. Challenge: Using ROP to Leak and Call system() |
| - | Having completed the recap in the walkthrough above let's proceed to more advanced things. Use the '' | + | Having completed the recap in the walkthrough above let's proceed to more advanced things. Use the '' |
| You can now call the functions in the binary but '' | You can now call the functions in the binary but '' | ||
| Line 352: | Line 352: | ||
| For the actual parameter use the '' | For the actual parameter use the '' | ||
| </ | </ | ||
| - | === 2. Challenge: Handling Low Stack Space | + | ==== 2. Challenge: Handling Low Stack Space ==== |
| The previous binary had the luxury of plenty of stack space to be overflown. It is often the case that we don't have enough space for a long ROP chain. Let's handle that. | The previous binary had the luxury of plenty of stack space to be overflown. It is often the case that we don't have enough space for a long ROP chain. Let's handle that. | ||
| - | For the current task, switch to the '' | + | For the current task, switch to the '' |
| Find out how much space you have in the overflow and assess the situation. | Find out how much space you have in the overflow and assess the situation. | ||
| Line 389: | Line 389: | ||
| Use a new ropchain to call '' | Use a new ropchain to call '' | ||
| </ | </ | ||
| - | === 3. Challenge: Stack Pivoting | + | ==== 3. Challenge: Stack Pivoting |
| Let's assume that '' | Let's assume that '' | ||
| Line 427: | Line 427: | ||
| </ | </ | ||
| - | === 4. Challenge [Hard]: Change Memory Protection and Write Shellcode | + | /*==== 4. Challenge [Hard]: Change Memory Protection and Write Shellcode |
| We want to exploit a more constrained environment. The constraint is to remove the '' | We want to exploit a more constrained environment. The constraint is to remove the '' | ||
| Line 460: | Line 460: | ||
| Use the [[http:// | Use the [[http:// | ||
| </ | </ | ||
| + | */ | ||
| - | === 5. Challenge [Bonus] | + | ==== 4. Challenge [Bonus] |
| - | Switch to '' | + | Switch to '' |
| * First overflow the buffer and call vuln_gate. You will need to prepare registers for the 64 bit calling convention. | * First overflow the buffer and call vuln_gate. You will need to prepare registers for the 64 bit calling convention. | ||
| * Then overflow the second buffer and issue a syscall for **execve("/ | * Then overflow the second buffer and issue a syscall for **execve("/ | ||
| * Extra: Pop a shell. | * Extra: Pop a shell. | ||
| - | === Resources: | + | ==== Resources: |
| * https:// | * https:// | ||
session/12.1592425624.txt.gz · Last modified: by Rareş-Mihail VISALOM (67101)
