SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
Fuzzing and Exploit
Development with
Metasploit Framework
Who am I
• Elliott Cutright aka Nullthreat
• Senior Information Security Analyst
• Do not take anything I say as fact. I have
been wrong before and I will be wrong
again.
What is an overflow
• Too much data in a space not designed for
it
• Stack Based (Focus on today)
• Heap Based
• Smashing the stack for fun and profit
• Phrack 49 by Aleph One
What is the Stack
• Holds the functions and function variables
• User Input
• Data needed by the app
• First in, first out
The Stack
The Stack (now with more data)
The Stack (Smashed)
Fuzzing
• Sending random info to the application and
monitor for a crash
• Make the app cry
• GET /AAAAAAAAAAAAAA......
• EIP = 0x41414141
X86 Registers
• EIP - Address of next instruction
• ESP - Address for the top of the stack
• EBP - Stack Base Address
• EAX/ECX/EDX - Holds variables and data
for the application
x86 Registers
• EIP = Instruction Pointer
• ESP = Stack Pointer
• EAX = Accumulator
• EBX = Base Index
• ECX = Counter
• EDX = Data
• ESI = Source Index
• EDI = Destination Index
Lets Break Some Stuff
• DEMO
• Fuzzing
Awesome...wait..what?
• EIP = 0x41414141
• 0x41 = A
• We control EIP, so we can tell the
application what to do
• Now we need to find the location of the
EIP overwrite
Enter Pattern_create()
• MSF Pattern Create creates a easy-to-
predict string to assist with EIP location
• EIP overwritten with pattern and use MSF
Pattern Offset to determine location
Lets Break Some Stuff
• DEMO
• MSF Pattern Create/Offset
EIP Overwrite
• We now know it takes 256 bytes to get to
the EIP over write
• Use this to build out skeleton exploit
Skeleton Exploit
“x00x01” - Sets the mode in TFTP
“x41” * 256 - Sends 256 A’s, overflow buffer
“x42” * 4 - Sets EIP to 0x42424242
“x43” * 250 - Sends 250 C’s as fake payload
“x00” - Ends the packet
Exploit in Metasploit
crash = "x00x01"
crash += "x41" * 256
crash += [target.ret].pack('V')
crash += "x43" * 250
crash += "x00"
Lets Break Some Stuff
• DEMO
• Skeleton Exploit
A Closer Look
0x42424242
0x42424242
0x0012FBE0
0x0012FBE0
Find the JMP
• We control EIP and ESP
• The data we want it is ESP
• We want to find a JMP ESP
• This will place us at the start of our
“shellcode”
Finding the JMP
• Ollydbg or ImmunityDBG
• Use the search feature
• Find in application or windows lib
Testing the return
• Use break point at the address
• Make sure we jump to the right spot
Lets Break Some Stuff
• DEMO
• Finding and adding the JMP
• Testing the JMP
Adding the Shellcode
• Metasploit has a large library
• Very easy to add to exploit
• replace “x43” * 250 with
payload.encoded
• This exploit has small space for shellcode
• For this proof of concept we will launch
calc.exe
Lets Break Some Stuff
• DEMO
• Shellcode and Final Exploit
Buzz Kills
• ASLR - Address Space Layout
Randomization
• Vista and Server ’08 enabled by default
• DEP - Data Execution Prevention
• XP SP2 and newer
• Prevents code execution in non-
executable memory
Resources
• www.nullthreat.net - Slides and demos
• www.offsec.com - Cracking the Perimeter
• www.corelan.be:8800 - Awesome tutorials
on exploit dev
• DHAtEnclaveForensics -Youtube channel
• www.exploit-db.com - take working
exploits apart and re-write them
Q&A

Mais conteúdo relacionado

Mais procurados

Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
Erik Hatcher
 
Repl internals
Repl internalsRepl internals
Repl internals
MongoDB
 

Mais procurados (16)

High Performance Solr
High Performance SolrHigh Performance Solr
High Performance Solr
 
Solr Indexing and Analysis Tricks
Solr Indexing and Analysis TricksSolr Indexing and Analysis Tricks
Solr Indexing and Analysis Tricks
 
Spark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted MalaskaSpark Summit EU talk by Ted Malaska
Spark Summit EU talk by Ted Malaska
 
SFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
SFBay Area Solr Meetup - June 18th: Benchmarking Solr PerformanceSFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
SFBay Area Solr Meetup - June 18th: Benchmarking Solr Performance
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
Webinar: What's New in Solr 6
Webinar: What's New in Solr 6Webinar: What's New in Solr 6
Webinar: What's New in Solr 6
 
Search-time Parallelism: Presented by Shikhar Bhushan, Etsy
Search-time Parallelism: Presented by Shikhar Bhushan, EtsySearch-time Parallelism: Presented by Shikhar Bhushan, Etsy
Search-time Parallelism: Presented by Shikhar Bhushan, Etsy
 
Lucene Revolution 2013 - Scaling Solr Cloud for Large-scale Social Media Anal...
Lucene Revolution 2013 - Scaling Solr Cloud for Large-scale Social Media Anal...Lucene Revolution 2013 - Scaling Solr Cloud for Large-scale Social Media Anal...
Lucene Revolution 2013 - Scaling Solr Cloud for Large-scale Social Media Anal...
 
Scaling Solr with Solr Cloud
Scaling Solr with Solr CloudScaling Solr with Solr Cloud
Scaling Solr with Solr Cloud
 
Apache SolrCloud
Apache SolrCloudApache SolrCloud
Apache SolrCloud
 
Benchmarking Solr Performance at Scale
Benchmarking Solr Performance at ScaleBenchmarking Solr Performance at Scale
Benchmarking Solr Performance at Scale
 
Solr introduction
Solr introductionSolr introduction
Solr introduction
 
How Rackspace Cloud Monitoring uses Cassandra
How Rackspace Cloud Monitoring uses CassandraHow Rackspace Cloud Monitoring uses Cassandra
How Rackspace Cloud Monitoring uses Cassandra
 
Repl internals
Repl internalsRepl internals
Repl internals
 
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!
 

Semelhante a Louisville Infosec - Metasploit Class - Fuzzing and Exploit Development with Metasploit

various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
CODE BLUE
 
backgroundcommunicationandwaitevents-180124221026.pdf
backgroundcommunicationandwaitevents-180124221026.pdfbackgroundcommunicationandwaitevents-180124221026.pdf
backgroundcommunicationandwaitevents-180124221026.pdf
ssuser785ce21
 
SQLT XPLORE - The SQLT XPLAIN Hidden Child
SQLT XPLORE -  The SQLT XPLAIN Hidden ChildSQLT XPLORE -  The SQLT XPLAIN Hidden Child
SQLT XPLORE - The SQLT XPLAIN Hidden Child
Enkitec
 
Bh ad-12-stealing-from-thieves-saher-slides
Bh ad-12-stealing-from-thieves-saher-slidesBh ad-12-stealing-from-thieves-saher-slides
Bh ad-12-stealing-from-thieves-saher-slides
Matt Kocubinski
 

Semelhante a Louisville Infosec - Metasploit Class - Fuzzing and Exploit Development with Metasploit (20)

Sending a for ahuh. win32 exploit development old school
Sending a for ahuh. win32 exploit development old schoolSending a for ahuh. win32 exploit development old school
Sending a for ahuh. win32 exploit development old school
 
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
Saving The World From Guaranteed APOCALYPSE* Using Varnish and Memcached
 
Process Doppelgänging
Process Doppelgänging Process Doppelgänging
Process Doppelgänging
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
Failure Of DEP And ASLR
Failure Of DEP And ASLRFailure Of DEP And ASLR
Failure Of DEP And ASLR
 
fg.workshop: Software vulnerability
fg.workshop: Software vulnerabilityfg.workshop: Software vulnerability
fg.workshop: Software vulnerability
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
various tricks for remote linux exploits  by Seok-Ha Lee (wh1ant)
 
backgroundcommunicationandwaitevents-180124221026.pdf
backgroundcommunicationandwaitevents-180124221026.pdfbackgroundcommunicationandwaitevents-180124221026.pdf
backgroundcommunicationandwaitevents-180124221026.pdf
 
Basic buffer overflow part1
Basic buffer overflow part1Basic buffer overflow part1
Basic buffer overflow part1
 
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)
 
Lie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application FirewallsLie to Me: Bypassing Modern Web Application Firewalls
Lie to Me: Bypassing Modern Web Application Firewalls
 
SQLT XPLORE - The SQLT XPLAIN Hidden Child
SQLT XPLORE -  The SQLT XPLAIN Hidden ChildSQLT XPLORE -  The SQLT XPLAIN Hidden Child
SQLT XPLORE - The SQLT XPLAIN Hidden Child
 
Chapter 4 stack
Chapter 4 stackChapter 4 stack
Chapter 4 stack
 
Bh ad-12-stealing-from-thieves-saher-slides
Bh ad-12-stealing-from-thieves-saher-slidesBh ad-12-stealing-from-thieves-saher-slides
Bh ad-12-stealing-from-thieves-saher-slides
 
Ruxmon cve 2012-2661
Ruxmon cve 2012-2661Ruxmon cve 2012-2661
Ruxmon cve 2012-2661
 
Advanced Windows Exploitation
Advanced Windows ExploitationAdvanced Windows Exploitation
Advanced Windows Exploitation
 
CONFidence 2015: when something overflowing... - Peter Hlavaty
CONFidence 2015: when something overflowing... - Peter HlavatyCONFidence 2015: when something overflowing... - Peter Hlavaty
CONFidence 2015: when something overflowing... - Peter Hlavaty
 
When is something overflowing
When is something overflowingWhen is something overflowing
When is something overflowing
 
ShmooCON 2009 : Re-playing with (Blind) SQL Injection
ShmooCON 2009 : Re-playing with (Blind) SQL InjectionShmooCON 2009 : Re-playing with (Blind) SQL Injection
ShmooCON 2009 : Re-playing with (Blind) SQL Injection
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

Louisville Infosec - Metasploit Class - Fuzzing and Exploit Development with Metasploit

  • 1. Fuzzing and Exploit Development with Metasploit Framework
  • 2. Who am I • Elliott Cutright aka Nullthreat • Senior Information Security Analyst • Do not take anything I say as fact. I have been wrong before and I will be wrong again.
  • 3. What is an overflow • Too much data in a space not designed for it • Stack Based (Focus on today) • Heap Based • Smashing the stack for fun and profit • Phrack 49 by Aleph One
  • 4. What is the Stack • Holds the functions and function variables • User Input • Data needed by the app • First in, first out
  • 6. The Stack (now with more data)
  • 8. Fuzzing • Sending random info to the application and monitor for a crash • Make the app cry • GET /AAAAAAAAAAAAAA...... • EIP = 0x41414141
  • 9. X86 Registers • EIP - Address of next instruction • ESP - Address for the top of the stack • EBP - Stack Base Address • EAX/ECX/EDX - Holds variables and data for the application
  • 10. x86 Registers • EIP = Instruction Pointer • ESP = Stack Pointer • EAX = Accumulator • EBX = Base Index • ECX = Counter • EDX = Data • ESI = Source Index • EDI = Destination Index
  • 11. Lets Break Some Stuff • DEMO • Fuzzing
  • 12. Awesome...wait..what? • EIP = 0x41414141 • 0x41 = A • We control EIP, so we can tell the application what to do • Now we need to find the location of the EIP overwrite
  • 13. Enter Pattern_create() • MSF Pattern Create creates a easy-to- predict string to assist with EIP location • EIP overwritten with pattern and use MSF Pattern Offset to determine location
  • 14. Lets Break Some Stuff • DEMO • MSF Pattern Create/Offset
  • 15. EIP Overwrite • We now know it takes 256 bytes to get to the EIP over write • Use this to build out skeleton exploit
  • 16. Skeleton Exploit “x00x01” - Sets the mode in TFTP “x41” * 256 - Sends 256 A’s, overflow buffer “x42” * 4 - Sets EIP to 0x42424242 “x43” * 250 - Sends 250 C’s as fake payload “x00” - Ends the packet
  • 17. Exploit in Metasploit crash = "x00x01" crash += "x41" * 256 crash += [target.ret].pack('V') crash += "x43" * 250 crash += "x00"
  • 18. Lets Break Some Stuff • DEMO • Skeleton Exploit
  • 20. Find the JMP • We control EIP and ESP • The data we want it is ESP • We want to find a JMP ESP • This will place us at the start of our “shellcode”
  • 21. Finding the JMP • Ollydbg or ImmunityDBG • Use the search feature • Find in application or windows lib
  • 22. Testing the return • Use break point at the address • Make sure we jump to the right spot
  • 23. Lets Break Some Stuff • DEMO • Finding and adding the JMP • Testing the JMP
  • 24. Adding the Shellcode • Metasploit has a large library • Very easy to add to exploit • replace “x43” * 250 with payload.encoded • This exploit has small space for shellcode • For this proof of concept we will launch calc.exe
  • 25. Lets Break Some Stuff • DEMO • Shellcode and Final Exploit
  • 26. Buzz Kills • ASLR - Address Space Layout Randomization • Vista and Server ’08 enabled by default • DEP - Data Execution Prevention • XP SP2 and newer • Prevents code execution in non- executable memory
  • 27. Resources • www.nullthreat.net - Slides and demos • www.offsec.com - Cracking the Perimeter • www.corelan.be:8800 - Awesome tutorials on exploit dev • DHAtEnclaveForensics -Youtube channel • www.exploit-db.com - take working exploits apart and re-write them
  • 28. Q&A