SlideShare ist ein Scribd-Unternehmen logo
1 von 60
Downloaden Sie, um offline zu lesen
Unmanned Aerial Vehicles


               Exploit Automation with
               the Metasploit Framework


                     James Lee




1
# whoami
●   James Lee
●   egypt
●   Core Developer, Metasploit Project
●   Working full time on Metasploit for




2
User Interface


           Scanning for            Fingerprinting
             Servers                   Clients
            Exploiting                  Exploiting
             Servers                     Clients

                            Post-
                         Exploitation
Overview
3
Automating msfconsole
●   Resource files
    ●   A list of commands to be run in sequence
    ●   Can be anything you would type at the msf> prompt
●   setg
●   save




4
Resource files
●   $ ./msfconsole -r foo.rc
●   msf> resource foo.rc
●   ~/.msf3/msfconsole.rc
    ●   Loaded on startup




5
Example Resource File
setg RHOSTS 10.1.1.1-254
setg USERNAME Administrator
setg PASSWORD password
use auxiliary/scanner/smb/smb_login
run
use auxiliary/scanner/telnet/telnet_login
run

6
SERVERS


7
Scanning
●   Have to find servers
    before you can exploit
    them
●   Metasploit has several
    ways to do this
    ●   Run nmap and nexpose
        directly from the console     Israeli Orbiter, surveillance UAV

    ●   Import other tools‟ output
    ●   MSF built-in scanners
        (auxiliary/scanner/*)

8
nmap


●   Two options:
    ●   Run nmap normally with -oX and use db_import to
        store the results
    ●   db_nmap command will run nmap and handle the
        import for you
●   Either way, results get stored in the database


9
●    nexpose_scan
●    db_import
●    If you have a Community license (free), limited to 32
     IP addresses at a time
     ●   Msf will scan the whole range in 32-address chunks




10
Nexpose
●    Also stores vulnerability references
     ●   CVE, BID, …
     ●   Without these, figuring out which exploits to run can
         be more difficult
●    Can be used to launch exploits as well




11
MSF Built-in Scanning
                                ●   Implemented as
                                    auxiliary modules
                                ●   Aux is like an exploit
                                    without a payload
                                    ●   Usage similar to
                                        exploits

FanWing Surveillance Platform   ●   Can go through
                                    meterpreter routes

12
Faster Setup
●    RHOSTS can be nmap-notation or
     “file:<filename>”
●    File should contain nmap-notation address
     ranges
     ●   e.g.:
          10.1.1.2,5,7-254
          10.2.2.*
          10.3.3.0/24


13
Faster Scanning
●    set THREADS 256
     ●   Windows freaks out after 16 threads
     ●   Cygwin doesn‟t handle more than about 200
     ●   Linux? Go to town.
●    Caveat: tunneling through meterpreter




14
Selected Scanners
●    Informational        ●   Pwnage
     ●   smb_version          ●   smb_login
     ●   netbios/nbname       ●   telnet_login
                              ●   mssql_login
                              ●   vnc_none_auth




15
Server Exploits
●    The bulk of msf's exploit modules
     ●   385 as of Jan 9
●    Many protocols implemented in an exploit-
     friendly way
     ●   smtp, imap, http, smb, dcerpc, sunrpc, ftp, …
●    Wide range of protocol-level IDS evasions



16
Automatically Exploiting Servers
●    db_autopwn
●    NeXpose plugin




17
db_autopwn
●    Need to have targets stored in the db
●    If vulnerability references are available, can
     cross-reference against specific hosts
●    Can just use matching ports if you don't have
     refs
●    Checks global MinimumRank to limit exploits to
     a particular safety level


18
NeXpose
●    Scan, detect, exploit all in one command
     ●    nexpose_scan -x <host range>
     1.    Populates the db with hosts, services, vulns
     2.    Cross-references vulns and exploits
     3.    Throws exploits at vulnerable servers
●    Has the potential to give you tons of shells
●    Can take a long time for lots of hosts
●    Uses MinimumRank as well
19
CLIENTS


20
Client Fingerprinting
                ●   User Agent
                    ●   Easy to spoof
                    ●   Easy to change in a
                        proxy
                    ●   Some third-party
                        software changes it
                    ●   Less often changed in
                        JavaScript


21
Fingerprinting the Client
●    Various JS objects only exist in one browser
     ●   window.opera, Array.every
●    Some only exist in certain versions
     ●   window.createPopup, Array.every, window.Iterator
●    Rendering differences and parser bugs
     ●   IE's conditional comments




22
Internet Explorer
●    Parser bugs, conditional comments
     ●   Reliable, but not precise
●    ScriptEngine*Version()
     ●   Almost unique across all combinations of client and
         OS, including service pack
●    ClientCaps



23
Opera
●    window.opera.version()
     ●   Includes minor version, e.g. “9.61”
●    window.opera.buildNumber()
     ●   Different on each platform for a given version
     ●   e.g.: “8501” == Windows
     ●   Not precise, only gives platform, no version or
         service pack



24
Hybrid Approach for FF
●    Existence of
     document.getElementsByClassName
     means Firefox 3.0
●    If UA says IE6, go with FF 3.0
●    If UA says FF 3.0.8, it's probably not lying, so
     use the more specific value




25
Firefox OS Detection
●    Most of the objects used in standard detection
     scripts are affected by the User-Agent
     ●   E.g., when spoofing as iPhone,
         navigator.platform = “iPhone”
●    navigator.oscpu is not
     ●   “Linux i686”
     ●   “Windows NT 6.0”



26
Safari / Webkit
●    Infuriatingly standards compliant in JS
●    Can detect its existence easily
     ●   window.WebkitPoint, many others
●    Most Safari-specific stuff has been around since
     1.2, so not useful for version detection




27
Chrome / Webkit
●    Same javascript engine as Safari
●    So far, no easy way to change UA
●    navigator.vendor is always “Google Inc.”




28
Client Exploits in MSF
●    Extensive HTTP support
     ●   Heapspray in two lines of code
     ●   Sotirov's .NET DLL, heap feng shui
●    Wide range of protocol-level IDS evasion
●    Simple exploit in ~10 lines of code




29
Automatically Exploiting Clients
●    Browser Autopwn Auxiliary module
     ●   I spoke about this at Defcon in 2009
●    Fingerprints a client
     ●   Stores detection in the database
●    Determines what exploits might work
     ●   Uses MinimumRank, too
●    Tries the ones most likely to succeed

30
Advantages of Browser Autopwn
●    OS and client detection is client-side, more
     reliable in presence of spoofed or broken UA
●    Detection results automatically stored in the
     database
●    Not written in PHP
     ●   PHP sucks




31
Browser Autopwn Usage
msf> use auxiliary/server/browser_autopwn
msf (browser_autopwn)> set URIPATH /
msf (browser_autopwn)> set EXCLUDE opera
msf (browser_autopwn)> set MATCH .*
msf (browser_autopwn)> run
[*] Starting exploit modules on host 10.1.1.1...
[*] ---

32
Automating Users
●    Browser Autopwn automates the exploits but
     how do we get users to come to our evil web
     server?




33
Karmetasploit
●    Wireless Access Point of Doom
●    Using aircrack-ng, appears to be every access
     point that anybody probes for
     ●   “Why, yes, I am Office_WiFi, please connect”
●    Lets you control the route, the DNS, everything
     ●   “Yup, I'm your internal web server. And your email
         server. And your file server. And...”



34
More on Karma
●    Actually about 5 years old
●    It still works amazingly well
●    More info about getting it working is on our wiki:
     http://www.metasploit.com/redmine/projects/framework/wiki/Karmetasploit




35
Assagai
●    Complete phishing framework
●    Uses Metasploit exploits and payloads
●    Gathers other statistics
●    Has common email templates




36
37
38
39
Metaphish
●    Use the target‟s public information against them
●    See valsmith, Colin, and dkerb‟s talk from BH
     USA 2009




40
Automating Post-exploitation
●    Meterpreter scripts
     ●   set AutoRunScript <script name>
●    Plugins
     ●   Can be auto loaded at startup with resource files




41
Meterpreter scripts
●    Just a ruby script
●    Easy to write, lots of flexibility
●    Access to Meterpreter API




42
Meterpreter API
●    Core + Extensions
     ●   Core is basic, mostly useful for loading extensions
●    Current extensions:
     ●   Stdapi
     ●   Priv, Incognito
     ●   Espia
     ●   Sniffer


43
Meterpreter Stdapi: process
●    client.sys.process
     ●   Acts like a Hash, where keys are image names and
         values are process IDs
     ●   client.sys.process[„explorer.exe‟]
     ●   => 1408




44
Meterpreter Stdapi: memory
p=
client.sys.process.open(pid,PROCESS_ALL_ACCESS)
addr = p.memory.allocate(length)
p.memory.write(addr, “stuff”)
p.thread.create(addr)




45
Meterpreter Stdapi: filesystem
●    client.fs.file.upload_file(dest, source)
●    client.fs.file.download_file(dest, source)
●    client.fs.file.expand_path(“%TEMP%”)




46
Priv and Incognito
●    Stuff that requires privileges, SYSTEM
     preferred
●    Priv
     ●   Dump hashes, alter file MACE
●    Incognito
     ●   list impersonation/delegation tokens




47
Espia
●    client.espia.espia_image_get_dev_screen
     ●   Returns a bitmap as a String
     ●   From commandline, „screenshot‟ stores to file
●    client.espia.espia_audio_get_dev_audio
     ●   No command for this yet, only available from API




48
Meterpreter Sniffer
●    client.sniffer.capture_start
     ●   Starts capturing
●    client.sniffer.capture_dump
     ●   Puts the captured packets into a buffer we can read
●    client.sniffer.capture_dump_read
     ●   Reads from the buffer




49
Sniffer caveat
●    The packet format isn‟t standard, so we have to
     convert it to PCAP to be useful
●    Console command does it for you




50
Some Nifty Existing Scripts
●    vnc -- Uploads a VNC server to the target and
     tunnels traffic through the current TCP
     connection or a new connect-back
●    packetrecorder -- Starts a sniffer on the target
     and retrieves packets every <interval> seconds
●    persistence -- Builds a meterpreter.exe that
     connects back every <interval> seconds
●    killav -- Runs through a list of known Anti-Virus
     process names and kills anything that matches
51
Colin and Dave‟s talk
●    Don‟t miss it
●    Right after lunch
●    About using meterpreter‟s memory API for
     doing all kinds of crazy stuff




52
MSF Plugins
●    Can extend or replace parts of the framework
●    Full access to Rex and Msf APIs
●    Can add callbacks for various events, add
     commands to the console, anything you can
     think of




53
Hooking sessions from a plugin
include SessionEvent
def on_session_open(session)
      # Do something with the session
end
def initialize(framework, opts)
      framework.events.add_session_subscriber(self)
end


54
Some notable events
●    on_session_open
●    on_module_run
●    on_exploit_success




55
Some Nifty Existing Plugins
●    db_credcollect – automatically retrieves hashes
     from new meterpreter sessions, stores them in
     the database
●    pcap_log – just like running tcpdump in the
     background
●    session_tagger – creates a directory on new
     sessions as proof of compromise


56
Demonstrations




57
Conclusions
●    Lots of automation available that requires no
     programming skills
●    A little bit of ruby gives you lots of power and
     flexibility
●    Don‟t type any more than you have to
     ●   Carpal Tunnel Syndrome sucks




58
Download it
●    svn co http://metasploit.com/svn/framework3/trunk
●    Submit patches to msfdev@metasploit.com




59
Questions?




60

Weitere ähnliche Inhalte

Was ist angesagt?

Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
Mr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_engMr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_engFFRI, Inc.
 
Hacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysisHacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysisTamas K Lengyel
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?Maciej Lasyk
 
We shall play a game....
We shall play a game....We shall play a game....
We shall play a game....Sadia Textile
 
Metasploit - Basic and Android Demo
Metasploit  - Basic and Android DemoMetasploit  - Basic and Android Demo
Metasploit - Basic and Android DemoArpit Agarwal
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesOpersys inc.
 
CrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardwareCrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardwareTamas K Lengyel
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIOpersys inc.
 
A Battle Against the Industry - Beating Antivirus for Meterpreter and More
A Battle Against the Industry - Beating Antivirus for Meterpreter and MoreA Battle Against the Industry - Beating Antivirus for Meterpreter and More
A Battle Against the Industry - Beating Antivirus for Meterpreter and MoreCTruncer
 
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...DefconRussia
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Opersys inc.
 
VM Forking and Hypervisor-based Fuzzing with Xen
VM Forking and Hypervisor-based Fuzzing with XenVM Forking and Hypervisor-based Fuzzing with Xen
VM Forking and Hypervisor-based Fuzzing with XenTamas K Lengyel
 
Pitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisPitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisTamas K Lengyel
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel ExploitationzeroSteiner
 

Was ist angesagt? (19)

Porting Android
Porting AndroidPorting Android
Porting Android
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Mr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_engMr201309 automated on-execute_test_using_virtual_box_eng
Mr201309 automated on-execute_test_using_virtual_box_eng
 
Hacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysisHacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysis
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
We shall play a game....
We shall play a game....We shall play a game....
We shall play a game....
 
Metasploit - Basic and Android Demo
Metasploit  - Basic and Android DemoMetasploit  - Basic and Android Demo
Metasploit - Basic and Android Demo
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
 
CrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardwareCrySys guest-lecture: Virtual machine introspection on modern hardware
CrySys guest-lecture: Virtual machine introspection on modern hardware
 
Cheatsheet: Metasploit
Cheatsheet: MetasploitCheatsheet: Metasploit
Cheatsheet: Metasploit
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
A Battle Against the Industry - Beating Antivirus for Meterpreter and More
A Battle Against the Industry - Beating Antivirus for Meterpreter and MoreA Battle Against the Industry - Beating Antivirus for Meterpreter and More
A Battle Against the Industry - Beating Antivirus for Meterpreter and More
 
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...Noseevich, petukhov   no locked doors no windows barred. hacking open am infr...
Noseevich, petukhov no locked doors no windows barred. hacking open am infr...
 
Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
VM Forking and Hypervisor-based Fuzzing with Xen
VM Forking and Hypervisor-based Fuzzing with XenVM Forking and Hypervisor-based Fuzzing with Xen
VM Forking and Hypervisor-based Fuzzing with Xen
 
Pitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysisPitfalls and limits of dynamic malware analysis
Pitfalls and limits of dynamic malware analysis
 
Practical Windows Kernel Exploitation
Practical Windows Kernel ExploitationPractical Windows Kernel Exploitation
Practical Windows Kernel Exploitation
 

Andere mochten auch

Ncw Suav Presentation
Ncw Suav PresentationNcw Suav Presentation
Ncw Suav Presentationpmatsang
 
Micro Unmanned Aerial Vehicles Presentation
Micro Unmanned Aerial Vehicles PresentationMicro Unmanned Aerial Vehicles Presentation
Micro Unmanned Aerial Vehicles Presentationbm_njoi
 
Best ppt on Micro air vehicle with flapping wings
Best ppt on Micro air vehicle with flapping wingsBest ppt on Micro air vehicle with flapping wings
Best ppt on Micro air vehicle with flapping wingsRonak Thakare
 
Micro air vehicles
Micro air vehiclesMicro air vehicles
Micro air vehiclesUmesh Meher
 

Andere mochten auch (7)

Ncw Suav Presentation
Ncw Suav PresentationNcw Suav Presentation
Ncw Suav Presentation
 
Micro Unmanned Aerial Vehicles Presentation
Micro Unmanned Aerial Vehicles PresentationMicro Unmanned Aerial Vehicles Presentation
Micro Unmanned Aerial Vehicles Presentation
 
Micro air vehicles
Micro air vehiclesMicro air vehicles
Micro air vehicles
 
Nano uav
Nano uavNano uav
Nano uav
 
Best ppt on Micro air vehicle with flapping wings
Best ppt on Micro air vehicle with flapping wingsBest ppt on Micro air vehicle with flapping wings
Best ppt on Micro air vehicle with flapping wings
 
Micro air vehicles
Micro air vehiclesMicro air vehicles
Micro air vehicles
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 

Ähnlich wie Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework

Black hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slidesBlack hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slidesBakry3
 
Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...
Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...
Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...egypt
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
Malware analysis
Malware analysisMalware analysis
Malware analysisxabean
 
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De CoomanOSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De CoomanNETWAYS
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesTrowalts
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Opersys inc.
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsNetsparker
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment Systema3sec
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Amin Astaneh
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For BeginnersRamnath Shenoy
 

Ähnlich wie Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework (20)

Black hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slidesBlack hat dc-2010-egypt-uav-slides
Black hat dc-2010-egypt-uav-slides
 
Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...
Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...
Using Guided Missiles in Drive-bys: Automatic Browser Fingerprinting and Expl...
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De CoomanOSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
OSMC 2008 | Monitoring Tools Shootout by Tom De Cooman
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and Ponies
 
Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013Android Internals at Linaro Connect Asia 2013
Android Internals at Linaro Connect Asia 2013
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Hacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass FirewallsHacking Vulnerable Websites to Bypass Firewalls
Hacking Vulnerable Websites to Bypass Firewalls
 
I hunt sys admins 2.0
I hunt sys admins 2.0I hunt sys admins 2.0
I hunt sys admins 2.0
 
Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011Leveraging Android's Linux Heritage at ELC-E 2011
Leveraging Android's Linux Heritage at ELC-E 2011
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
Metasploit For Beginners
Metasploit For BeginnersMetasploit For Beginners
Metasploit For Beginners
 

Mehr von egypt

Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploitegypt
 
The State of the Metasploit Framework.pdf
The State of the Metasploit Framework.pdfThe State of the Metasploit Framework.pdf
The State of the Metasploit Framework.pdfegypt
 
New Shiny in the Metasploit Framework
New Shiny in the Metasploit FrameworkNew Shiny in the Metasploit Framework
New Shiny in the Metasploit Frameworkegypt
 
Open Source, Security, and Open Source Security.pdf
Open Source, Security, and Open Source Security.pdfOpen Source, Security, and Open Source Security.pdf
Open Source, Security, and Open Source Security.pdfegypt
 
Authenticated Code Execution by Design.pptx
Authenticated Code Execution by Design.pptxAuthenticated Code Execution by Design.pptx
Authenticated Code Execution by Design.pptxegypt
 
One-Liners to Rule Them All
One-Liners to Rule Them AllOne-Liners to Rule Them All
One-Liners to Rule Them Allegypt
 
Offensive Security with Metasploit
Offensive Security with MetasploitOffensive Security with Metasploit
Offensive Security with Metasploitegypt
 
Shiny
ShinyShiny
Shinyegypt
 
already-0wned
already-0wnedalready-0wned
already-0wnedegypt
 
Post Metasploitation
Post MetasploitationPost Metasploitation
Post Metasploitationegypt
 
State of the Framework Address: Recent Developments in the Metasploit Framework
State of the Framework Address: Recent Developments in the Metasploit FrameworkState of the Framework Address: Recent Developments in the Metasploit Framework
State of the Framework Address: Recent Developments in the Metasploit Frameworkegypt
 

Mehr von egypt (11)

Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploit
 
The State of the Metasploit Framework.pdf
The State of the Metasploit Framework.pdfThe State of the Metasploit Framework.pdf
The State of the Metasploit Framework.pdf
 
New Shiny in the Metasploit Framework
New Shiny in the Metasploit FrameworkNew Shiny in the Metasploit Framework
New Shiny in the Metasploit Framework
 
Open Source, Security, and Open Source Security.pdf
Open Source, Security, and Open Source Security.pdfOpen Source, Security, and Open Source Security.pdf
Open Source, Security, and Open Source Security.pdf
 
Authenticated Code Execution by Design.pptx
Authenticated Code Execution by Design.pptxAuthenticated Code Execution by Design.pptx
Authenticated Code Execution by Design.pptx
 
One-Liners to Rule Them All
One-Liners to Rule Them AllOne-Liners to Rule Them All
One-Liners to Rule Them All
 
Offensive Security with Metasploit
Offensive Security with MetasploitOffensive Security with Metasploit
Offensive Security with Metasploit
 
Shiny
ShinyShiny
Shiny
 
already-0wned
already-0wnedalready-0wned
already-0wned
 
Post Metasploitation
Post MetasploitationPost Metasploitation
Post Metasploitation
 
State of the Framework Address: Recent Developments in the Metasploit Framework
State of the Framework Address: Recent Developments in the Metasploit FrameworkState of the Framework Address: Recent Developments in the Metasploit Framework
State of the Framework Address: Recent Developments in the Metasploit Framework
 

Kürzlich hochgeladen

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Kürzlich hochgeladen (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Unmanned Aerial Vehicles: Exploit Automation with the Metasploit Framework

  • 1. Unmanned Aerial Vehicles Exploit Automation with the Metasploit Framework James Lee 1
  • 2. # whoami ● James Lee ● egypt ● Core Developer, Metasploit Project ● Working full time on Metasploit for 2
  • 3. User Interface Scanning for Fingerprinting Servers Clients Exploiting Exploiting Servers Clients Post- Exploitation Overview 3
  • 4. Automating msfconsole ● Resource files ● A list of commands to be run in sequence ● Can be anything you would type at the msf> prompt ● setg ● save 4
  • 5. Resource files ● $ ./msfconsole -r foo.rc ● msf> resource foo.rc ● ~/.msf3/msfconsole.rc ● Loaded on startup 5
  • 6. Example Resource File setg RHOSTS 10.1.1.1-254 setg USERNAME Administrator setg PASSWORD password use auxiliary/scanner/smb/smb_login run use auxiliary/scanner/telnet/telnet_login run 6
  • 8. Scanning ● Have to find servers before you can exploit them ● Metasploit has several ways to do this ● Run nmap and nexpose directly from the console Israeli Orbiter, surveillance UAV ● Import other tools‟ output ● MSF built-in scanners (auxiliary/scanner/*) 8
  • 9. nmap ● Two options: ● Run nmap normally with -oX and use db_import to store the results ● db_nmap command will run nmap and handle the import for you ● Either way, results get stored in the database 9
  • 10. nexpose_scan ● db_import ● If you have a Community license (free), limited to 32 IP addresses at a time ● Msf will scan the whole range in 32-address chunks 10
  • 11. Nexpose ● Also stores vulnerability references ● CVE, BID, … ● Without these, figuring out which exploits to run can be more difficult ● Can be used to launch exploits as well 11
  • 12. MSF Built-in Scanning ● Implemented as auxiliary modules ● Aux is like an exploit without a payload ● Usage similar to exploits FanWing Surveillance Platform ● Can go through meterpreter routes 12
  • 13. Faster Setup ● RHOSTS can be nmap-notation or “file:<filename>” ● File should contain nmap-notation address ranges ● e.g.: 10.1.1.2,5,7-254 10.2.2.* 10.3.3.0/24 13
  • 14. Faster Scanning ● set THREADS 256 ● Windows freaks out after 16 threads ● Cygwin doesn‟t handle more than about 200 ● Linux? Go to town. ● Caveat: tunneling through meterpreter 14
  • 15. Selected Scanners ● Informational ● Pwnage ● smb_version ● smb_login ● netbios/nbname ● telnet_login ● mssql_login ● vnc_none_auth 15
  • 16. Server Exploits ● The bulk of msf's exploit modules ● 385 as of Jan 9 ● Many protocols implemented in an exploit- friendly way ● smtp, imap, http, smb, dcerpc, sunrpc, ftp, … ● Wide range of protocol-level IDS evasions 16
  • 17. Automatically Exploiting Servers ● db_autopwn ● NeXpose plugin 17
  • 18. db_autopwn ● Need to have targets stored in the db ● If vulnerability references are available, can cross-reference against specific hosts ● Can just use matching ports if you don't have refs ● Checks global MinimumRank to limit exploits to a particular safety level 18
  • 19. NeXpose ● Scan, detect, exploit all in one command ● nexpose_scan -x <host range> 1. Populates the db with hosts, services, vulns 2. Cross-references vulns and exploits 3. Throws exploits at vulnerable servers ● Has the potential to give you tons of shells ● Can take a long time for lots of hosts ● Uses MinimumRank as well 19
  • 21. Client Fingerprinting ● User Agent ● Easy to spoof ● Easy to change in a proxy ● Some third-party software changes it ● Less often changed in JavaScript 21
  • 22. Fingerprinting the Client ● Various JS objects only exist in one browser ● window.opera, Array.every ● Some only exist in certain versions ● window.createPopup, Array.every, window.Iterator ● Rendering differences and parser bugs ● IE's conditional comments 22
  • 23. Internet Explorer ● Parser bugs, conditional comments ● Reliable, but not precise ● ScriptEngine*Version() ● Almost unique across all combinations of client and OS, including service pack ● ClientCaps 23
  • 24. Opera ● window.opera.version() ● Includes minor version, e.g. “9.61” ● window.opera.buildNumber() ● Different on each platform for a given version ● e.g.: “8501” == Windows ● Not precise, only gives platform, no version or service pack 24
  • 25. Hybrid Approach for FF ● Existence of document.getElementsByClassName means Firefox 3.0 ● If UA says IE6, go with FF 3.0 ● If UA says FF 3.0.8, it's probably not lying, so use the more specific value 25
  • 26. Firefox OS Detection ● Most of the objects used in standard detection scripts are affected by the User-Agent ● E.g., when spoofing as iPhone, navigator.platform = “iPhone” ● navigator.oscpu is not ● “Linux i686” ● “Windows NT 6.0” 26
  • 27. Safari / Webkit ● Infuriatingly standards compliant in JS ● Can detect its existence easily ● window.WebkitPoint, many others ● Most Safari-specific stuff has been around since 1.2, so not useful for version detection 27
  • 28. Chrome / Webkit ● Same javascript engine as Safari ● So far, no easy way to change UA ● navigator.vendor is always “Google Inc.” 28
  • 29. Client Exploits in MSF ● Extensive HTTP support ● Heapspray in two lines of code ● Sotirov's .NET DLL, heap feng shui ● Wide range of protocol-level IDS evasion ● Simple exploit in ~10 lines of code 29
  • 30. Automatically Exploiting Clients ● Browser Autopwn Auxiliary module ● I spoke about this at Defcon in 2009 ● Fingerprints a client ● Stores detection in the database ● Determines what exploits might work ● Uses MinimumRank, too ● Tries the ones most likely to succeed 30
  • 31. Advantages of Browser Autopwn ● OS and client detection is client-side, more reliable in presence of spoofed or broken UA ● Detection results automatically stored in the database ● Not written in PHP ● PHP sucks 31
  • 32. Browser Autopwn Usage msf> use auxiliary/server/browser_autopwn msf (browser_autopwn)> set URIPATH / msf (browser_autopwn)> set EXCLUDE opera msf (browser_autopwn)> set MATCH .* msf (browser_autopwn)> run [*] Starting exploit modules on host 10.1.1.1... [*] --- 32
  • 33. Automating Users ● Browser Autopwn automates the exploits but how do we get users to come to our evil web server? 33
  • 34. Karmetasploit ● Wireless Access Point of Doom ● Using aircrack-ng, appears to be every access point that anybody probes for ● “Why, yes, I am Office_WiFi, please connect” ● Lets you control the route, the DNS, everything ● “Yup, I'm your internal web server. And your email server. And your file server. And...” 34
  • 35. More on Karma ● Actually about 5 years old ● It still works amazingly well ● More info about getting it working is on our wiki: http://www.metasploit.com/redmine/projects/framework/wiki/Karmetasploit 35
  • 36. Assagai ● Complete phishing framework ● Uses Metasploit exploits and payloads ● Gathers other statistics ● Has common email templates 36
  • 37. 37
  • 38. 38
  • 39. 39
  • 40. Metaphish ● Use the target‟s public information against them ● See valsmith, Colin, and dkerb‟s talk from BH USA 2009 40
  • 41. Automating Post-exploitation ● Meterpreter scripts ● set AutoRunScript <script name> ● Plugins ● Can be auto loaded at startup with resource files 41
  • 42. Meterpreter scripts ● Just a ruby script ● Easy to write, lots of flexibility ● Access to Meterpreter API 42
  • 43. Meterpreter API ● Core + Extensions ● Core is basic, mostly useful for loading extensions ● Current extensions: ● Stdapi ● Priv, Incognito ● Espia ● Sniffer 43
  • 44. Meterpreter Stdapi: process ● client.sys.process ● Acts like a Hash, where keys are image names and values are process IDs ● client.sys.process[„explorer.exe‟] ● => 1408 44
  • 45. Meterpreter Stdapi: memory p= client.sys.process.open(pid,PROCESS_ALL_ACCESS) addr = p.memory.allocate(length) p.memory.write(addr, “stuff”) p.thread.create(addr) 45
  • 46. Meterpreter Stdapi: filesystem ● client.fs.file.upload_file(dest, source) ● client.fs.file.download_file(dest, source) ● client.fs.file.expand_path(“%TEMP%”) 46
  • 47. Priv and Incognito ● Stuff that requires privileges, SYSTEM preferred ● Priv ● Dump hashes, alter file MACE ● Incognito ● list impersonation/delegation tokens 47
  • 48. Espia ● client.espia.espia_image_get_dev_screen ● Returns a bitmap as a String ● From commandline, „screenshot‟ stores to file ● client.espia.espia_audio_get_dev_audio ● No command for this yet, only available from API 48
  • 49. Meterpreter Sniffer ● client.sniffer.capture_start ● Starts capturing ● client.sniffer.capture_dump ● Puts the captured packets into a buffer we can read ● client.sniffer.capture_dump_read ● Reads from the buffer 49
  • 50. Sniffer caveat ● The packet format isn‟t standard, so we have to convert it to PCAP to be useful ● Console command does it for you 50
  • 51. Some Nifty Existing Scripts ● vnc -- Uploads a VNC server to the target and tunnels traffic through the current TCP connection or a new connect-back ● packetrecorder -- Starts a sniffer on the target and retrieves packets every <interval> seconds ● persistence -- Builds a meterpreter.exe that connects back every <interval> seconds ● killav -- Runs through a list of known Anti-Virus process names and kills anything that matches 51
  • 52. Colin and Dave‟s talk ● Don‟t miss it ● Right after lunch ● About using meterpreter‟s memory API for doing all kinds of crazy stuff 52
  • 53. MSF Plugins ● Can extend or replace parts of the framework ● Full access to Rex and Msf APIs ● Can add callbacks for various events, add commands to the console, anything you can think of 53
  • 54. Hooking sessions from a plugin include SessionEvent def on_session_open(session) # Do something with the session end def initialize(framework, opts) framework.events.add_session_subscriber(self) end 54
  • 55. Some notable events ● on_session_open ● on_module_run ● on_exploit_success 55
  • 56. Some Nifty Existing Plugins ● db_credcollect – automatically retrieves hashes from new meterpreter sessions, stores them in the database ● pcap_log – just like running tcpdump in the background ● session_tagger – creates a directory on new sessions as proof of compromise 56
  • 58. Conclusions ● Lots of automation available that requires no programming skills ● A little bit of ruby gives you lots of power and flexibility ● Don‟t type any more than you have to ● Carpal Tunnel Syndrome sucks 58
  • 59. Download it ● svn co http://metasploit.com/svn/framework3/trunk ● Submit patches to msfdev@metasploit.com 59