1. 程式人生 > >WEB安全系列之如何挖掘任意檔案讀取漏洞

WEB安全系列之如何挖掘任意檔案讀取漏洞

  1. $fp="../template/".$siteskin."/area_show.htm";
  2. $f = fopen($fp,'r');
  3. $strout = fread($f,filesize($fp));
  4. fclose($f);
  5. $strout=str_replace("{#siteskin}",$siteskin,$strout) ;
  6. $strout=str_replace("{#sitename}",sitename,$strout) ;
  7. $strout=str_replace("{#siteurl}",siteurl,$strout) ;
  8. $strout=str_replace("{#pagetitle}",$province.sitetitle,$strout);
  9. $strout=str_replace("{#pagekeywords}",$province.sitekeyword,$strout);
  10. $strout=str_replace("{#pagedescription}",sitedescription,$strout);
  11. $strout=str_replace("{#province}",$province,$strout) ;
  12. $strout=str_replace("{#sitebottom}",sitebottom(),$strout);
  13. $strout=str_replace("{#sitetop}",sitetop(),$strout);
  14. $strout=showlabel($strout);
  15. echo  $strout;