URL 공격 의 실례 설명
http://www.myfreax.com/category.php?category=mysql3
공격 자 는 뒤의 매개 변수 인 my sql 3 의 수 치 를 변경 하여 추측 하거나 다른 수단 과 결합 할 수 있 습 니 다. 저 는 두 개의 Linux 발행 판 이 공격 도 구 를 전문 적 으로 하 는 것 과 테스트 하 는 것 이 매우 강하 고 모두 ubuntu 를 바탕 으로 제 작 된 것 을 알 고 있 습 니 다.
BackTrack # Linux ,
blackbox Linux #
다음은 실례 입 니 다.
<?php
/**
*
* @author Freax
* @2014-3-24
* @contact [email protected]
*
*/
define('FREAX', true);
require_once 'include/init.php';
'http://www.myfreax.com/category.php?category=PHP5';// url
class category{
/**
*
* @var Object
*/
public $db;
/**
* smarty
* @var Object
*/
public $smarty;
/**
*
* @var String
*/
public $action;
/**
*
* @var Object
*/
public $Page;
/**
* id
* @var string
*/
public $cacheid;
/**
*
* @var String
*/
public function __construct($db,$smarty,$page){ //
$this->db=$db;
$this->smarty=$smarty;
$this->Page=$page;
$this->getAtion();
$this->getData();
$this->display();
}
/**
*
* , ,
*/
public function getAtion(){
$bool=preg_match_all('/\d+/', $_SERVER['QUERY_STRING'],$match);
/* url , , ,
* , id,
* id , sql , */
if (!$bool) {
header("HTTP/1.1 301 Moved Permanently"); // 404, , 404 ,
// ,
header("location:http://".WEB);
exit(); // , php \?\>
}else {
$this->action=$match[0][0];
}
}
/**
* id
* @return string
*/
public function getcacheid(){
$this->cacheid=(isset($_GET['category'])?$_GET['category']:'').@(isset($_GET['page'])?$_GET['page']:'');
return $this->cacheid;
}
/**
*
* smarty
*
*
*/
public function getData(){
/* cacheid , , cacheid ,
* http://www.myfreax.com/category.php?category=PHP2&page=23 url , , ,
* ,cacheid , , , , N
* $_GET , , $article=$this->db->selectArrs。。。。。。。。。。。。 , */
if (!$this->smarty->isCached('index.html',$this->getcacheid())){
$nav=$this->db->selectArrs('select * from '.PREFIX.'class');
$this->Page->getTotalPageClass($this->db,PREFIX.'article','typeid',$this->action);
$this->Page->getcurrPage();
$this->Page->getStartPage();
$article=$this->db->selectArrs('select '.PREFIX.'article.*,'.PREFIX.'class.name from '.PREFIX.'article left join blog_class on ('.PREFIX.'article.typeid='.PREFIX.'class.id) where typeid= '.$this->action.' order by id desc limit '.$this->Page->startPage .','. $this->Page->paging);
/*
* */
if (!$article) {
header("HTTP/1.1 301 Moved Permanently");
header("location:http://".WEB);
exit();
}
$this->Page->getLinkPage('category.php');
$this->Page->getClassPage($article[0]['name'].$article[0]['typeid']);
$pagelink=$this->Page->createPageLinks();
$navAtcion=@$article[0]['name'];
$this->smarty->assign('articles',$article);
$this->smarty->assign('navs',$nav);
$this->smarty->assign('navAction',$navAtcion);
$this->smarty->assign('pagelink',$pagelink);
}
}
/**
*
*
*/
public function display(){
$this->smarty->display('index.html',$this->getcacheid());
}
}
/**
* category
*/
new category($db,$smarty,$page);
?>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
laravel에 yo에서 angularJs&coffeescript를 사용할 수 있도록 한다.먼저 yo 명령을 사용할 수 있어야하므로 아래에서 설치 global에 설치한 곳에서 laravel의 프로젝트 루트로 이동. 클라이언트 코드를 관리하는 디렉토리를 만들고 이동합니다. 클라이언트 환경 만들기 이것으로 히...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.