0% found this document useful (0 votes)
12 views

ms03 049 Netapi

This document provides a 23 step tutorial for using the Metasploit GUI to exploit the Microsoft Workstation Service NetAddAlternateComputerName Overflow vulnerability on Windows XP. It demonstrates selecting the exploit module and payload, configuring options, running the exploit to get a meterpreter session on the target, using meterpreter commands like ps, migrate, keyscan_start to view keystrokes, screenshot to take screenshots, and cd, ls, upload to navigate the filesystem and upload files. It also shows forcing a system shutdown after executing uploaded code to restart autoloading files. The tutorial concludes by shutting down the target system after exploiting it.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

ms03 049 Netapi

This document provides a 23 step tutorial for using the Metasploit GUI to exploit the Microsoft Workstation Service NetAddAlternateComputerName Overflow vulnerability on Windows XP. It demonstrates selecting the exploit module and payload, configuring options, running the exploit to get a meterpreter session on the target, using meterpreter commands like ps, migrate, keyscan_start to view keystrokes, screenshot to take screenshots, and cd, ls, upload to navigate the filesystem and upload files. It also shows forcing a system shutdown after executing uploaded code to restart autoloading files. The tutorial concludes by shutting down the target system after exploiting it.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

ENTREGA FINAL USANDO

METAEXPLOIT (GUI)
David Fajardo

Microsoft Workstation Service NetAddAlternateComputerName


Overflow
(http://www.metasploit.com/modules/exploit/windows/smb/ms0
3_049_netapi)

Este módulo explota una capacidad excesiva de búfer de la pila, en la


función NetApi32 NetAddAlternateComputerName que utiliza el
servicio de Estación de trabajo en Windows XP.

Exploit Información de Uso


Exploit Modulo de las Opciones

RHOST The target address

RPORT Set the SMB service port (default: 445)

SMBPIPE The pipe name to use (BROWSER, WKSSVC) (default: BROWSER)

CHOST The local client address

CPORT The local client port

ConnectTimeout Maximum number of seconds to establish a TCP connection

ContextInformationFile The information file that contains context information

DCERPC::ReadTimeout The number of seconds to wait for DCERPC responses

DisablePayloadHandler Disable the handler code for the selected payload

EnableContextEncoding Use transient context when encoding payloads

Always send the LANMAN response (except when NTLMv2_session


NTLM::SendLM
is specified)

Activate the 'Negotiate NTLM key' flag, indicating the use of NTLM
NTLM::SendNTLM
responses

Send an avp of type SPN in the ntlmv2 client Blob, this allow
NTLM::SendSPN
authentification on windows Seven/2008r2 when SPN is required

Activate the 'Negotiate Lan Manager Key' flag, using the LM key
NTLM::UseLMKey
when the LM response is sent

Activate the 'Negotiate NTLM2 key' flag, forcing the use of a


NTLM::UseNTLM2_session
NTLMv2_session

Use NTLMv2 instead of NTLM2_session when 'Negotiate NTLM2'


NTLM::UseNTLMv2
key is true

Proxies Use a proxy chain

The chunk size for SMB segments, bigger values will increase speed
SMB::ChunkSize
but break NT 4.0 and SMB signing

SMB::Native_LM The Native LM to send during authentication

SMB::Native_OS The Native OS to send during authentication

SMB::VerifySignature Enforces client-side verification of server response signatures


SMBDirect The target port is a raw SMB service (not NetBIOS)

SMBDomain The Windows domain to use for authentication

SMBName The NetBIOS hostname (required for port 139 connections)

SMBPass The password for the specified username

SMBUser The username to authenticate as

SSL Negotiate SSL for outgoing connections

Specify the version of SSL that should be used (accepted: SSL2,


SSLVersion
SSL3, TLS1)

VERBOSE Enable detailed status messages

WORKSPACE Specify the workspace for this module

WfsDelay Additional delay when waiting for a session

DCERPC::fake_bind_multi Use multi-context bind calls

DCERPC::fake_bind_multi_append Set the number of UUIDs to append the target

DCERPC::fake_bind_multi_prepend Set the number of UUIDs to prepend before the target

DCERPC::max_frag_size Set the DCERPC packet fragmentation size

Use a different delivery method for accessing named pipes


DCERPC::smb_pipeio
(accepted: rw, trans)

SMB::obscure_trans_pipe_level Obscure PIPE string in TransNamedPipe (level 0-3)

SMB::pad_data_level Place extra padding between headers and data (level 0-3)

SMB::pad_file_level Obscure path names used in open/create (level 0-3)

SMB::pipe_evasion Enable segmented read/writes for SMB Pipes

SMB::pipe_read_max_size Maximum buffer size for pipe reads

SMB::pipe_read_min_size Minimum buffer size for pipe reads

SMB::pipe_write_max_size Maximum buffer size for pipe writes

SMB::pipe_write_min_size Minimum buffer size for pipe writes

TCP::max_send_size Maxiumum tcp segment size. (0 = disable)

TCP::send_delay Delays inserted before every send. (0 = disable)


1. Buscamos nuestro “exploit” en el menú
2. Después seleccionamos el PAYLOAD
Y se habilitaran las opciones de este
3. Colocamos los datos requeridos, también se pueden colocar los
opcionales si algo no les funciona bien.
4. Le damos “Run in console” y se abre la siguiente pestaña
Para después abrir esta, en la cual miraremos cuales son los comandos que
podemos usar y que hace cada uno
5. Después de ver y detallar algunos de los comandos mas importantes
podemos ver que, si ejecutamos el comando “ps” nos mostrara los
procesos de la victima
Como podemos ver los procesos cada uno con su identificador único (PID)
para ejecutarse con otros comandos, que veremos más adelante
6. Usaremos el comando “migrate” para tomar control de este proceso,
así podremos ver que es lo que esta haciendo nuestra victima
7. Como vemos en la siguiente imagen se usa “migrate PID-DEL-
PROCESO” y no del nombre ya que pueden haber mas de un proceso
con el mismo nombre
8. Ahora, miramos los comandos que podemos usar a nivel grafico
9. A continuación ejecutaremos el comando “keyscan_start” para
empezar a escanear lo que esta haciendo la victima
10.Para mostrar lo que esta haciendo podemos usar el comando
“keyscan_dump” que nos mostrara lo último que escaneo.
11.Al parecer nuestro victima esta redactando un correo o un documento,
como vemos que es algo importante echaremos una mirada.
12.Para ello tomamos una impresión de pantalla del usuario con el
comando “screenshot”, ahora podemos ver el mensaje claramente,
como ven, el distingue las teclas aunque tengan el mismo valor, que en
este caso se puede ver en los números.
Trataremos de colocar en el arranque del sistema un ejecutable cualquiera,
que hagan lo que cada quien necesite, en este caso estamos viendo la ruta en
nuestro equipo para exportar el archivo .reg o pueden copiar un programa
que lo haga a la victima y ejecutarlo con execute –H –f “ruta_archivo” (el –H
es para que el proceso no se vea)
13.Como vemos en la imagen cuando tomamos el pantallazo de la victima
él lo guardo en la ruta, iremos allí y pegaremos nuestro archivo para
copiárselo a la victima
14.Primero que todo no movemos con el comando “cd” al lugar donde se
quiere copiar el archivo y después de eso usaremos el comando
“upload” y el nombre del archivo que esta en nuestra maquina en la
ruta predeterminada, en la imagen anterior
15.Ahora trataremos de ingresar el registro, para que quede en el
arranque del sistema
Aquí nos moveremos por varios directorios, y crearemos algunos para
verificar a que puedo acceder
Como pueden ver en la victima no se muestra ninguna pantalla de consola ya
que lo ejecutamos con la opción -H, solo se ven las carpetas que creamos en
el escritorio
Nos seguimos moviendo por los directorios para ver que encontramos por
hay con el comando “cd” y “ls” para mostrar el contenido de este
16.Ahora estamos parados en la raíz del C:\\ y trataremos de borrar el
archivo “ntldr” o ver un archivo con el comando “cat”
17.Al parecer usar directamente los comandos para hacer cosas que
podrían se riesgosas hace que se desconecte la sesión con la que nos
estábamos comunicando, con esto podemos confirmar que es mejor
hacer un programa y copiárselo a la victima ya que con este podremos
hacer muchas mas cosas ya que estará personalizado a nuestra
necesidad.
18.Ahora nos despediremos de la victima con un mensaje pero al parecer
la sintaxis del “shutdown” se trunca con la del comando “execute” por
lo que no podemos usar el –f que es para forzar al equipo a cerrar todo
19.Ahora crearemos un archivo “salir.bat” para ejecutarlo en nuestra
victima y lo copiaremos en C:\\ahorasi y lo ejecutaremos
20.Aunque también podemos usar el “shutdown” desde la consola, basta
con que un archivo de texto anule el apagado dándole en canelar para
guardar los cambios del archivo
21.Por esa causa aquí miraremos que PID tiene la aplicación que cancela
el apagado y mataremos su proceso con el comando “kill PID-DEL-
PROCESO”
22.Ahora si apago, como vemos en la img.
23.Y con esto acabaría el tutorial de metasploit (GUI), usado con el exploit
“ms03_049_netapi”

You might also like