我有一个WS2008 x64服务器,它让NodeJS应用程序在其80个端口上工作。服务器不断收到来自不同IP地址的查询,这些IP地址试图将我的应用程序用作代理。NodeJS (使用快捷模块)正在回复404错误,但在会话初始化期间(使用Everyauth模块)失败。
所以,我把这个问题分成两部分:
以下是来自攻击者的典型请求:
GET http://www.baidu.com/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Accept: */*
Referer: http://www.baidu.com/
Host: www.baidu.com
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive我尝试用cURL重新创建它(用主机中服务器的IP地址替换www.baidu.com )
curl -H "Host: www.baidu.com" -H "Referer: http://www.baidu.com" -H "Accept-Encoding: gzip, deflate" -H "Proxy-Connection: keep-alive" -H "User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)" -H "Content-Type: application/x-www-form-urlencoded" -v -X GET http://www.baidu.com/,但它是作为
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Accept: */*
Referer: http://www.baidu.com
Host: www.baidu.com
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive因此,我的问题是-如何在GET请求中添加http://www.baidu.com而不是/(斜杠)?
发布于 2014-12-15 05:54:12
因此,我的问题是-如何在GET请求中添加http://www.baidu.com而不是/(斜杠)?
您想要的请求不是坏请求,而是代理请求。要创建它,只需将目标主机指定为代理即可。除此之外,curl可能不是生成真正糟糕请求的合适工具。
https://serverfault.com/questions/652567
复制相似问题