session:06
Differences
This shows you the differences between two versions of the page.
| session:06 [2018/06/28 16:36] – [03. Smashthestack Level7] Razvan Deaconescu | session:06 [2020/07/19 09:49] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | = 0x06. Buffer | + | ====== 0x05. Buffer |
| - | == Slides | + | ===== Resources ===== |
| - | Slides are available | + | [[https:// |
| - | [[https:// | + | [[https:// |
| [[https:// | [[https:// | ||
| - | == Tutorials | ||
| - | == Buffers | + | / |
| + | |||
| + | ===== Tutorials ===== | ||
| + | |||
| + | ===== Buffers | ||
| A buffer is an area of contiguous data in memory, determined by a starting address, contents and length. Understanding how buffers are used (or misused) is vital for both offensive and defensive purposes. | A buffer is an area of contiguous data in memory, determined by a starting address, contents and length. Understanding how buffers are used (or misused) is vital for both offensive and defensive purposes. | ||
| Line 215: | Line 218: | ||
| Can you guess how the resulting code will look like, disassembled? | Can you guess how the resulting code will look like, disassembled? | ||
| - | === Stack buffer overflows | + | ==== Stack buffer overflows |
| As we have seen in previous sessions, the stack serves multiple purposes: | As we have seen in previous sessions, the stack serves multiple purposes: | ||
| Line 405: | Line 408: | ||
| </ | </ | ||
| - | === Diverting code execution | + | ==== Diverting code execution |
| We attempted to use the wonderful '' | We attempted to use the wonderful '' | ||
| Line 548: | Line 551: | ||
| </ | </ | ||
| - | === Overwriting the stored return address | + | ==== Overwriting the stored return address |
| Let's wrap up our stack smashing adventure by changing the code flow through overwriting the return address stored on the stack. | Let's wrap up our stack smashing adventure by changing the code flow through overwriting the return address stored on the stack. | ||
| Line 706: | Line 709: | ||
| </ | </ | ||
| - | == Challenges | + | ===== Challenges |
| <note important> | <note important> | ||
| Line 725: | Line 728: | ||
| Use the following [[http:// | Use the following [[http:// | ||
| - | === 01. Parrot | + | ==== 01. Parrot |
| Some programs feature a "stack smashing protection" | Some programs feature a "stack smashing protection" | ||
| Line 747: | Line 750: | ||
| </ | </ | ||
| - | === 02. Indexing | + | ==== 02. Indexing |
| More complex programs require some form of protocol or user interaction. This is where the great [[https:// | More complex programs require some form of protocol or user interaction. This is where the great [[https:// | ||
| Line 779: | Line 782: | ||
| That is, you will trace the program being exploited and see '' | That is, you will trace the program being exploited and see '' | ||
| </ | </ | ||
| - | === 03. Smashthestack Level7 | + | ==== 03. Smashthestack Level7 |
| Now you can tackle a real challenge. See if you can figure out how you can get a shell from this one. | Now you can tackle a real challenge. See if you can figure out how you can get a shell from this one. | ||
| Line 787: | Line 790: | ||
| </ | </ | ||
| - | < | + | < |
| - | What are the four 32 bit values that multiplied by '' | + | What are the four 32 bit values that multiplied by '' |
| </ | </ | ||
| - | === 04. Neighbourly | ||
| - | Let's overwrite | + | <note tip> |
| + | In order to run a program that receives command line arguments under gdb, you can do the following: | ||
| - | === 05. Bonus: Birds | + | <code gdb> |
| + | $ gdb ./main | ||
| + | gdb$ set args arg1 arg2 arg3 | ||
| + | gdb$ start | ||
| + | </ | ||
| + | </ | ||
| + | ==== 04. Neighbourly ==== | ||
| - | Time for a more complex challenge. Be patient and don't speed through it. | + | Let's overwrite |
| - | === 06. Uninitialized | + | <note tip> |
| + | The '' | ||
| + | </ | ||
| + | |||
| + | ==== 05. Uninitialized | ||
| There' | There' | ||
| Line 805: | Line 818: | ||
| Do **not** use pwntools for this task. | Do **not** use pwntools for this task. | ||
| </ | </ | ||
| - | === 07: Bonus: Uninitialized 2 | + | ==== 06: Bonus: Uninitialized 2 ==== |
| There' | There' | ||
| <note tip> | <note tip> | ||
| - | Use '' | + | Use '' |
| </ | </ | ||
| Line 816: | Line 829: | ||
| Create a pwntools-based script to solve both the initial executable and the bonus one. | Create a pwntools-based script to solve both the initial executable and the bonus one. | ||
| </ | </ | ||
| + | |||
| + | ==== 05. Bonus: Birds ==== | ||
| + | |||
| + | Time for a more complex challenge. Be patient and don't speed through it. | ||
session/06.1530203816.txt.gz · Last modified: by Razvan Deaconescu
