SlideShare a Scribd company logo
Exploit generation automation
with WinDBG
Csaba Fitzl
whoami
blue teamer
security researcher, blogger
husband, father
hiker
Exploit writing challenges
Time consuming
Heavily manual intensive process
Discovering memory layout
Finding bad characters
While (exploit doesn’t work == True):
Start process, attach debugger, crash, Modify exploit
Exploit writing methodology -
BoF
Find EIP overwrite location
Examine memory layout, registries
Somehow jump to shellcode
Generate shellcode
Put all together
The task
A tool which can automate the entire exploit writing
process
From crash PoC to working Exploit
If possible n0 manual interaction
The tool
Written in Python
Uses the “pykd” library to interact with WinDBG
What can it do?
Currently works for classic BoFs
Can bypass ASLR
Works for network and file based exploits
Will create a successful exploit from a simple crash
Automates the entire process (even finding bad characters!)
No need to manually start the process / WinDBG
The logic
Find EIP overwrite location / offset
Find registers pointing to the buffers
Find bad characters
Find a way to jump to the shellcode (JMP, CALL, etc…)
Generate shellcode
Put it all together
demo time
How to use it?
Some pre-work needs to be done
Exploit is a Class
Has to be populated with initial info (crash)
What has to be changed?
def exploit(self):
"""
This function runs the actual exploit
"""
sleep(1)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1',80))
message = "GET " + ''.join(self.buffer) + " HTTP/
1.1rnrn"
sock.send(message)
sock.close()
?
twitter: @theevilbit
tool:
https://github.com/theevilbit/exploit_generator

More Related Content

PDF
Browser controller testing for webapps (in Windows environment)
PDF
Look beyond PHP
PPTX
De was doen. gr 1 2.pptx
PPTX
Windows custom shellcoding
PDF
Dive into exploit development
PDF
From SEH Overwrite with Egg Hunter to Get a Shell!
PDF
From SEH Overwrite with Egg Hunter to Get a Shell_by_RodolphoConcurde
PDF
Fuzzing: Finding Your Own Bugs and 0days! at Arab Security Conference
Browser controller testing for webapps (in Windows environment)
Look beyond PHP
De was doen. gr 1 2.pptx
Windows custom shellcoding
Dive into exploit development
From SEH Overwrite with Egg Hunter to Get a Shell!
From SEH Overwrite with Egg Hunter to Get a Shell_by_RodolphoConcurde
Fuzzing: Finding Your Own Bugs and 0days! at Arab Security Conference

Similar to Exploit generation automation with WinDBG (Hacktivity 2017) (20)

PDF
2011-03 Developing Windows Exploits
PDF
Writing simple buffer_overflow_exploits
PDF
Fuzzing: Finding Your Own Bugs and 0days! 1.0
PDF
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
PPTX
Anatomy of a Buffer Overflow Attack
PPTX
Baab (Bug as a Backdoor) through automatic exploit generation (CRAX)
PPTX
Tranning-2
PDF
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
PDF
smash the stack , Menna Essa
PDF
Toorcon Seattle 2011 - Browser Exploit Packs
PPTX
ETCSS: Into the Mind of a Hacker
PDF
Unix executable buffer overflow
PDF
A CTF Hackers Toolbox
ODP
Exploiting buffer overflows
PPTX
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
PPTX
Fuzzing | Null OWASP Mumbai | 2016 June
PDF
Efficient Bytecode Analysis: Linespeed Shellcode Detection
PPTX
Fun with exploits old and new
PDF
What is Remote Buffer Overflow Attack.pdf
2011-03 Developing Windows Exploits
Writing simple buffer_overflow_exploits
Fuzzing: Finding Your Own Bugs and 0days! 1.0
stackconf 2021 | Fuzzing: Finding Your Own Bugs and 0days!
Anatomy of a Buffer Overflow Attack
Baab (Bug as a Backdoor) through automatic exploit generation (CRAX)
Tranning-2
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
smash the stack , Menna Essa
Toorcon Seattle 2011 - Browser Exploit Packs
ETCSS: Into the Mind of a Hacker
Unix executable buffer overflow
A CTF Hackers Toolbox
Exploiting buffer overflows
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
Fuzzing | Null OWASP Mumbai | 2016 June
Efficient Bytecode Analysis: Linespeed Shellcode Detection
Fun with exploits old and new
What is Remote Buffer Overflow Attack.pdf

More from Csaba Fitzl (14)

PDF
The Final Chapter - Unlimited Ways to Bypass Your macOS Privacy Mechanisms
PDF
Launch and Environment Constraints Overview
PDF
macOS Vulnerabilities Hiding in Plain Sight
PDF
SecurityFest-22-Fitzl-beyond.pdf
PDF
Mitigating Exploits Using Apple's Endpoint Security
PDF
Csaba fitzl - Mount(ain) of Bugs
PDF
20+ ways to bypass your mac os privacy mechanisms
PDF
Exploiting Directory Permissions on macOS
PDF
Exploiting XPC in AntiVirus
PDF
GateKeeper - bypass or not bypass?
PDF
Getting root with benign app store apps vsecurityfest
PDF
Getting root with benign app store apps
PDF
Exploit generation and javascript analysis automation with WinDBG lu
PDF
How to convince a malware to avoid us
The Final Chapter - Unlimited Ways to Bypass Your macOS Privacy Mechanisms
Launch and Environment Constraints Overview
macOS Vulnerabilities Hiding in Plain Sight
SecurityFest-22-Fitzl-beyond.pdf
Mitigating Exploits Using Apple's Endpoint Security
Csaba fitzl - Mount(ain) of Bugs
20+ ways to bypass your mac os privacy mechanisms
Exploiting Directory Permissions on macOS
Exploiting XPC in AntiVirus
GateKeeper - bypass or not bypass?
Getting root with benign app store apps vsecurityfest
Getting root with benign app store apps
Exploit generation and javascript analysis automation with WinDBG lu
How to convince a malware to avoid us

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Machine learning based COVID-19 study performance prediction
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Machine learning based COVID-19 study performance prediction
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
cuic standard and advanced reporting.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Understanding_Digital_Forensics_Presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Exploit generation automation with WinDBG (Hacktivity 2017)

  • 2. whoami blue teamer security researcher, blogger husband, father hiker
  • 3. Exploit writing challenges Time consuming Heavily manual intensive process Discovering memory layout Finding bad characters While (exploit doesn’t work == True): Start process, attach debugger, crash, Modify exploit
  • 4. Exploit writing methodology - BoF Find EIP overwrite location Examine memory layout, registries Somehow jump to shellcode Generate shellcode Put all together
  • 5. The task A tool which can automate the entire exploit writing process From crash PoC to working Exploit If possible n0 manual interaction
  • 6. The tool Written in Python Uses the “pykd” library to interact with WinDBG
  • 7. What can it do? Currently works for classic BoFs Can bypass ASLR Works for network and file based exploits Will create a successful exploit from a simple crash Automates the entire process (even finding bad characters!) No need to manually start the process / WinDBG
  • 8. The logic Find EIP overwrite location / offset Find registers pointing to the buffers Find bad characters Find a way to jump to the shellcode (JMP, CALL, etc…) Generate shellcode Put it all together
  • 10. How to use it? Some pre-work needs to be done Exploit is a Class Has to be populated with initial info (crash)
  • 11. What has to be changed? def exploit(self): """ This function runs the actual exploit """ sleep(1) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('127.0.0.1',80)) message = "GET " + ''.join(self.buffer) + " HTTP/ 1.1rnrn" sock.send(message) sock.close()