root@mr-resetti:~$

Binary Exploitation Notes

Just a bunch of notes for me to remember when learning Binary Exploitation, in no particular order, I just write as I go

Before we get started, here are some super sick GDB/GEF commands you gonna want to remember:

(gdb) x/x $eip
0x8048384 <main+16>: 0x00fc45c7

image

image

image

image

(14 was the wrong value, 20 was the correct amount of bytes)

image

image

image

image

image

image

image

for i in range(9):
    try:
        inp = str(p.recvline()[19:].strip())[2:].strip("'") # Get the address from the leak
    except:
        log.info("")

print("leak is:", inp)

image

image

real.

image

image

image

image

image

image

image

^^^ Examples of Stack Canaries ^^^

For more information on Stack Canary bruteforcing, go here.

image

image

Example:

```user@si485H-base:demo$ ./format_error “Hello World” Hello World user@si485H-base:demo$ ./format_error “Go Navy” Go Navy user@si485H-base:demo$ ./format_error “%x” b7fff000


- ```%x``` caused the program to output an address on the stack

```user@si485H-base:demo$ ./format_error "%s.%s.%s.%s.%s.%s.%s"
4.??u?.UW1?VS???????unull).(null).?$?U?
user@si485H-base:demo$ ./format_error "%s.%s.%s.%s.%s.%s.%s.%s"
Segmentation fault (core dumped)

Screenshot_20230602_113606

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image