Proxy

代理攻擊模擬

  • December 15, 2014

我有一個 WS2008 x64 伺服器,它的 NodeJS 應用程序在其 80 埠上工作。伺服器不斷接收來自不同 IP 地址的查詢,這些 IP 地址試圖將我的應用程序用作代理。NodeJS(使用 Express 模組)回复 404 錯誤,但在會話初始化期間失敗(使用 Everyauth 模組)。

因此,我將問題分為兩部分:

  1. 我需要找到模擬攻擊者請求的方法;
  2. 找出為什麼這些請求以錯誤的方式處理(這個我將在另一個論壇上問)

這是來自攻擊者的典型請求:

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 重新創建它(將 www.baidu.com 替換為主機中我的伺服器的 IP 地址)

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而不是/ (SLASH) ?**

所以,我的問題是 - 我如何在 GET 請求中輸入http://www.baidu.com而不是 / (SLASH) ?

您想要的請求不是一個壞請求,而只是一個代理請求。要創建它,只需將您的目標主機指定為代理。除此之外, curl 可能不是生成真正錯誤請求的正確工具。

引用自:https://serverfault.com/questions/652567