Skip to main content
Buffer Overflow
Attacks
A humble introduction
$whoami
• Security Enthusiast with an interest in knowing
things inside out.
DISCLAIMER
Without rwx-r-x-r
• Breaking software is ILLEGAL
• Hacking into networks is ILLEGAL
• Launching worms/virus attacks is ILLEGAL
• Governed by Indian Law - Information Technology Act, 2000.
• Section 65/66/66A…F/67 etc.
• This ppt is only for demo purposes and I am in no way responsible
for any damage done through this knowledge to self or otherwise.
What is it about?
• Buffer overflow
• Stack smashing
Don’t Expect
• Tool internals
• Tool tutorials
• Tool specifications
• Social engineering techniques
• Exploit/Payload writing
Live Attack Demo
• Real life attacks are actually REAL !
• Vulnerable Unzip Utility
• Impact
• What do you loose if you are “NAIVE”
Some useful basics?
• ESP, EIP
• Return address
• EBP
• Environment - 32bit Ubuntu 15 - ASLR disabled
and gcc - stack smashing protection - disabled.
Function call and stack
arrangement ?
• ESP, EIP
• Return address
• EBP
• funcall.c
• funCall gdb analysis
GOAL
• Control execution flow
• How ?
• Control EIP
• Where ?
• Control it in the stack (for stack smashing)
• Why ?
• User input makes it’s way to the buffers in the stack
• CALL and RET instruction auto-handle what goes in the EIP
writing exit shell code
• justQuit.c
• disassemble justQuit and figure out _exit
• exitInAsm.s
• objdump exitInAsm to get the shell code
using the exit shell code
• exitShellCode.c
• exitShellCode gdb analysis
attacker-vicim demo
• actual shell code - spawning a shell
• check in exitShellCode.c
• attack crafting concept
• default address to anything
• gdb analysis - address change and exploit
The $M ? “Who & Why”
• Several flaws in VLC
• GHOST in glibc
• getaddrinfo in glibc
• Several flaws in Apache/IIS/nginx
• All of this for FUN and PROFIT.
HUGE Thanks
• Security Tube
• Numerous blogs
• StackOverflow
• Null.co.in
• SecurityXploded
• Sans.org
• LinuxFoundation.org