ClearRequestHeaders
清除之前使用 AddHeader 方法设置的所有标头。
语法
ClearRequestHeaders
返回值
不返回数据。
示例
此脚本将修改一些标头,尝试启动日志文件分析程序上的跨站点脚本攻击:
函数 Main
Dim HTTPObj As Object
Dim headers As Variant
ip = "www.gfi.com"
port = 80
cr = Chr(13) + Chr(10)
XSSTest = "<script>alert('新的 GFI LanGuard 包含跨站脚本攻击检测功能')</script>"
Set HTTPobj = HTTP.Connect (ip,port)
'要尝试的标头
headers = Array ( "Host", "User-Agent", "Accept", "X-Header1" , "X-Proxy", "Cookie" )
HTTPobj.GetURL("/")
HTTPobj.Authentication = 1
'可能要使用的每个标头的循环
'插入 XSS 签名。 每次发送一个请求
For a = LBound(headers) To UBound(headers)
HTTPobj.ClearRequestHeaders
HTTPobj.AddHeader headers(a), XSSTest
'使用我们自定义的标头发送 GET 请求
HTTPResponse = HTTPobj.SendRequest ()
echo CStr(a) + " result: " + CStr(HTTPResponse)+cr
下一步
End 函数