Файл: Luxe-Shop v6.0/application/views/sheild/classes/class.sqlinj.php
Строк: 49
<?php
class sql
{
private $sql;
private $strongsql;
private $type;
private $symbol;
public function __construct()
{
$this->sql=array('SELECT ','select ','delete ','DELETE ','from ','FROM ','DROP ','drop ','UPDATE ','update ',' if',' IF', 'WHERE ','where ');
$this->strongsql=array('SELECT','select','delete','DELETE','from','FROM','DROP','drop','`',''','UPDATE','update','in','IN','if','IF', 'WHERE','where', ' ', '(', ')', '{', '}', '=', '`', ''', '"', '-', '<', '>');
//$this->strongsql=addslashes($this->strongsql);
}
public function getlist()
{
return $this->sql;
}
public function getstronglist()
{
return $this->strongsql;
}
}
class sqlinj
{
private $status;
private $array;
private function compare($value)
{
$o=new sql();
foreach ($o->getlist() as $sqloperator)
{
if (ereg($sqloperator, $value))
{
$this->symbol=strstr($value, $sqloperator);
return 1;
}
}
return 0;
}
private function strongcompare($value)
{
$o=new sql();
foreach ($o->getstronglist() as $sqloperator)
{
if (ereg($sqloperator, $value))
{
$this->symbol=strstr($value, $sqloperator);
return 1;
}
}
return 0;
}
public function __construct()
{
$this->status=0;
if ($_POST)
{
foreach ($_POST as $value)
{
$result=$this->compare($value);
if ($result==1)
{
$this->status=1;
$this->type='POST';
}
}
}
if ($_GET)
{
foreach ($_GET as $value)
{
$result=$this->strongcompare($value);
if ($result==1)
{
$this->status=1;
$this->type='GET';
}
}
}
/*if (isset($_COOKIE))
{
foreach ($_COOKIE as $value)
{
$result=$this->compare($value);
if ($result==1)
{
$this->status=1;
$this->type='COOKIE';
}
}
}*/
if ($_SESSION)
{
foreach ($_SESSION as $value)
{
$result=$this->strongcompare($value);
if ($result==1)
{
$this->status=1;
$this->type='SESSION';
}
}
}
}
public function getstatus()
{
return $this->status;
}
public function alert()
{
header("Location: sheild/html/hacker.html");
exit;
}
public function gettype()
{
return 'sql injection attacks and code change by adress line block system@'.$this->type.':'.$this->symbol;
}
}
?>