Version 1.0
This commit is contained in:
64
index.php
64
index.php
@@ -1,28 +1,48 @@
|
||||
<?php
|
||||
|
||||
$user_IP = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
|
||||
$user_IP = ($user_IP) ? $user_IP : $_SERVER["REMOTE_ADDR"];
|
||||
//sometimes we only need "referfer".
|
||||
/*
|
||||
if(count($_GET)==0&&count($_POST)==0&&count($_COOKIE)==0)
|
||||
exit();
|
||||
*/
|
||||
require_once("util.php");
|
||||
require_once("dio.php");
|
||||
|
||||
if($_GET["get"])
|
||||
{
|
||||
$info = array();
|
||||
|
||||
$txt = $_GET["get"];
|
||||
debug($user_IP);
|
||||
debug($txt);
|
||||
}
|
||||
else
|
||||
{
|
||||
debug($user_IP);
|
||||
|
||||
}
|
||||
$user_IP = getIP();
|
||||
$user_port = isset($_SERVER['REMOTE_PORT'])?$_SERVER['REMOTE_PORT']:"unknown";
|
||||
$protocol = isset($_SERVER['SERVER_PROTOCOL'])?$_SERVER['SERVER_PROTOCOL']:"unknown";
|
||||
$request_method = isset($_SERVER['REQUEST_METHOD'])?$_SERVER['REQUEST_METHOD']:"unknown";
|
||||
$request_URI = isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:"unknown";
|
||||
$request_time = isset($_SERVER['REQUEST_TIME'])?$_SERVER['REQUEST_TIME']:time();
|
||||
|
||||
$headers_data =getallheaders();
|
||||
|
||||
$get_data=$_GET;
|
||||
$decoded_get_data=tryBase64Decode($_GET);
|
||||
$post_data=$_POST;
|
||||
$decoded_post_data=tryBase64Decode($_POST);
|
||||
$cookie_data=$_COOKIE;
|
||||
$decoded_cookie_data=tryBase64Decode($_COOKIE);
|
||||
|
||||
$info['user_IP'] = $user_IP;
|
||||
$info['user_port'] = $user_port;
|
||||
$info['protocol'] = $protocol;
|
||||
$info['request_method'] = $request_method;
|
||||
$info['request_URI'] = $request_URI;
|
||||
$info['request_time'] = $request_time;
|
||||
$info['headers_data'] = $headers_data;
|
||||
$info['get_data'] = $get_data;
|
||||
if($decoded_get_data)
|
||||
$info['decoded_get_data'] = $decoded_get_data;
|
||||
$info['post_data'] = $post_data;
|
||||
if($decoded_post_data)
|
||||
$info['decoded_post_data'] = $decoded_post_data;
|
||||
$info['cookie_data'] = $cookie_data;
|
||||
if($decoded_cookie_data)
|
||||
$info['decoded_cookie_data'] = $decoded_cookie_data;
|
||||
|
||||
saveInfo(json_encode($info),$request_time);
|
||||
|
||||
function debug( $s )
|
||||
{
|
||||
$logfile = dirname( __FILE__ ) . '/xss.log';
|
||||
!file_exists( $logfile ) && @touch( $logfile );
|
||||
$str = file_get_contents( $logfile );
|
||||
$str = date( 'Y-m-d H:i:s' ) . "\r\n" . var_export( $s, true ) . "\r\n\r\n" . $str;
|
||||
@file_put_contents( $logfile, $str );
|
||||
unset( $str );
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user