Golang网络刮刀需要从NTLM认证的网页中提取信息.
有了一个有效的用户名和密码,网络刮板如何执行NTLM 4与服务器的握手,以获得访问保护后的网页?
url, username, password := "http://www.some-website.com", "admin", "12345"
client := &http.Client{}
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", "NTLM")
res, _ := client.Do(req)发布于 2016-11-08 14:01:38
在开始抓取之前,您可以使用像Azure/go-ntlmssp这样的包进行身份验证。
url, username, password := "http://www.some-website.com", "admin", "12345"
client := &http.Client{
Transport: ntlmssp.Negotiator{
RoundTripper:&http.Transport{},
},
}
req, _ := http.NewRequest("GET", url, nil)
req.SetBasicAuth(username, password)
res, _ := client.Do(req)https://stackoverflow.com/questions/40488583
复制相似问题