description | cover | coverY |
---|---|---|
A Buffer Overflow (BOF) occurs when the amount of data in the buffer exceeds its storage capacity. Once this happens, the extra data overflows into other memory location and RCE can occur. |
0 |
- Part 1: https://www.corelan.be/index.php/2009/07/19/exploit-writing-tutorial-part-1-stack-based-overflows/
- Part 2: https://www.corelan.be/index.php/2009/07/23/writing-buffer-overflow-exploits-a-quick-and-basic-tutorial-part-2/
The stack is overflowed and is replaced with malicious shellcode.
{% content-ref url="overflow1.md" %} overflow1.md {% endcontent-ref %}
{% content-ref url="overflow2.md" %} overflow2.md {% endcontent-ref %}
{% content-ref url="overflow3.md" %} overflow3.md {% endcontent-ref %}
- We need to overflow buffer space → write over buffer space down to EIP → Control the stack → spawn reverse shell
- Remember, the buffer overflow methodology consists of several steps:
- Spiking
- Method to find the vulnerable part of the program.
- Fuzzing
- Sending a bunch of characters/messages to a program to break it.
- Finding the offset
- At what point did we break it? This is called the offset.
- Overwriting the EIP
- The offset will then be utilized to overwrite the EIP.
- Finding bad characters
- We need to find out which characters are compatible with the shellcode and which characters are not.
- Finding the correct module
- Looking for a DLL or something similar within a program that does not contain memory protections.
- Mona Modules + Immunity Debugger
- Generate shellcode that leads to RCE
- Spiking
https://www.youtube.com/watch?v=3x2KT4cRP9o&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=2
https://www.youtube.com/watch?v=FCIfWTAtPr0&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=3
https://www.youtube.com/watch?v=GqwyonqLYdQ&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=4
https://www.youtube.com/watch?v=Wh9wRKBzajo&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=5
https://www.youtube.com/watch?v=uIFYNVqpZ0k&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=6
https://www.youtube.com/watch?v=k9D9RuFT02I&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=7
https://www.youtube.com/watch?v=qSjxR8tfokg&list=PLLKT__MCUeix3O0DPbmuaRuR_4Hxo4m3G&index=8
TryHackMe | Buffer Overflow Prep
The following binaries are vulnerable to BOFs:
- Vulnserver: https://samsclass.info/127/proj/vuln-server.htm
- Minishare 1.4.1: https://www.exploit-db.com/exploits/636
- Savant Web Server 3.1: https://www.exploit-db.com/exploits/10434
- Freefloat FTP Server 1.0: https://www.exploit-db.com/exploits/40673
- Core FTP Server 1.2: https://www.exploit-db.com/exploits/39480
- WarFTP 1.65: https://www.exploit-db.com/exploits/3570
- VUPlayer 2.4.9: https://www.exploit-db.com/exploits/40018
The following binaries are vulnerable to BOFs:
- Brainpan 1: https://www.vulnhub.com/entry/brainpan-1,51/
- Pinky’s Palace version 1: https://www.vulnhub.com/entry/pinkys-palace-v1,225/
- Stack Overflows for Beginners: https://www.vulnhub.com/entry/stack-overflows-for-beginners-101,290/
- SmashTheTux: https://www.vulnhub.com/entry/smashthetux-101,138/
- Pandora’s Box: https://www.vulnhub.com/entry/pandoras-box-1,111/