天空教学网

查看: 76|回复: 0

VBS 伪造头信息实现POST登录

[复制链接]

 成长值: 14275

2100

主题

0

精华

1396

积分

管理员

UID
1

Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20

威望
0
贡献
252
资源币
1144
道具币
1260
好友
242
听众
1
收听
0

VIP勋章

发表于 2017-10-10 00:27:32 | 显示全部楼层 |阅读模式
360截图16350914111128149.png


  1. Option Explicit
  2. Dim username,password,buf,oServerXmlHttp,url,cookie,FSO

  3. username = "zz3250183"
  4. password = "zl1230"

  5. buf = "username="&username&"&password="&password&"&question=0&answer=&templateid=0&login=&expires=43200"

  6. 'MsgBox buf

  7. url = "http://bbs.anjian.com/login.aspx?referer=forumindex.aspx"

  8. Set oServerXmlHttp = CreateObject("Msxml2.ServerXMLHTTP.3.0")

  9. oServerXmlHttp.open "POST",url,False
  10. oServerXmlHttp.send buf
  11. cookie = oServerXmlHttp.getResponseHeader("Set-Cookie")
  12. 'MsgBox cookie

  13. oServerXmlHttp.open "POST",url,False
  14. oServerXmlHttp.setRequestHeader "Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
  15. oServerXmlHttp.setRequestHeader "Referer","http://bbs.anjian.com/login.aspx?referer=forumindex.aspx"
  16. oServerXmlHttp.setRequestHeader "Accept-Encoding","gzip, deflate"
  17. oServerXmlHttp.setRequestHeader "Accept-Language","zh-CN,zh;q=0.8"
  18. oServerXmlHttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
  19. oServerXmlHttp.setRequestHeader "User-Agent","Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"
  20. oServerXmlHttp.setRequestHeader "Upgrade-Insecure-Requests","1"
  21. oServerXmlHttp.setRequestHeader "Origin","http://bbs.anjian.com"
  22. oServerXmlHttp.setRequestHeader "Host","bbs.anjian.com"
  23. oServerXmlHttp.setRequestHeader "Connection","keep-alive"
  24. oServerXmlHttp.setRequestHeader "Cache-Control","max-age=0"
  25. oServerXmlHttp.setRequestHeader "Content-Length",Len(buf)
  26. oServerXmlHttp.setRequestHeader "Cookie",cookie
  27. oServerXmlHttp.send buf

  28. Dim html,f
  29. Const ForWriting = 2
  30. oServerXmlHttp.open "GET","http://bbs.anjian.com/",False
  31. oServerXmlHttp.send
  32. html = oServerXmlHttp.responseText
  33. MsgBox html

  34. Set FSO = CreateObject("Scripting.FileSystemObject")
  35. Set f = FSO.OpenTextFile("c:\123.txt",ForWriting,True)
  36. f.Write html

  37. Set FSO =Nothing
  38. Set f =Nothing
  39. Set  oServerXmlHttp =Nothing
复制代码


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

本版积分规则

关闭

站长推荐 上一条 /1 下一条

QQ|Archiver|手机版|小黑屋|天空教学网

GMT+8, 2017-10-23 21:26 , Processed in 0.376980 second(s), 41 queries .

2017 TNEKY 天空网
快速回复 返回顶部 返回列表