Saturday, 27 June 2015

PHP: Patch mysql injection

<?php
$patch_array = array($_GET['id'],$_GET['page']);
foreach ($patch_array as $key)
{
$patch_getter = $key;
$patch_1 = ereg("-", $patch_getter);
$patch_2 = ereg("order", $patch_getter);
$patch_3 = ereg("_", $patch_getter);
$patch_4 = ereg("concat", $patch_getter);
$patch_5 = ereg("concat/*!()*/", $patch_getter);
$patch_6 = ereg("/*!concat()*/", $patch_getter);
$patch_7 = ereg("%20order%20", $patch_getter);
$patch_8 = ereg("/*!00000uNiOn*/+/*!00000sElEcT*/", $patch_getter);
$patch_9 = ereg("\*order\*", $patch_getter);
$patch_10 = ereg("\+order\+", $patch_getter);
$patch_11 = ereg("%20union%20", $patch_getter);
$patch_12 = ereg("union", $patch_getter);
$patch_13 = ereg("\*union\*", $patch_getter);
$patch_14 = ereg("\+union\+", $patch_getter);
$patch_15 = ereg("\*", $patch_getter);
$patch_16 = ereg("'", $patch_getter);
$patch_17 = ereg("/*!uNiOn*/+/*!sElEcT*/", $patch_getter);
if($patch_1||$patch_2||$patch_3||$patch_4||$patch_5||$patch_6||$patch_7||$patch_8||$patch_9||$patch_10||$patch_11||$patch_12||$patch_13||$patch_14||$patch_15||$patch_16||$patch_17)
{
exit();
}
}
?>

0 comments:

Post a Comment