2015-12-29 30 views
0

我正在做一個掃描工作,並且需要發送沒有urlencode的http請求。 Web應用程序使用$ _SERVER ['REQUEST_URI'](php)來獲取URL,並且我必須使用「<」或「>」來執行我的掃描工作。但python請求會將「>」編碼爲「%3E」。有沒有辦法發送沒有urlencode(請求,urllib,urllib2)的http請求,除了使用套接字發送http請求?如何發送沒有urlencode的http請求?

首先,我使用的要求去做:

import requests requests.get("http://test.com/index.php?id=1 and 1>1")

但事實URL的請求得到的是:http://test.com/index.php?id=1和1%3E1

這個問題一直困惑我好幾天了,我我很樂意從你那裏得到任何解決方案,並感謝所有。

回答

0

您可以使用params參數傳遞string參數。像這樣:

requests.get("http://test.com/index.php", params="id=1 and 1>1") 
+0

請在你的答案中加一些解釋! –

+0

對不起,我試過這種方式,但在burpsuite中它仍然是http://test.com/index.php?id=1%20and%201%3E1「 – friday