前言最近有WAF bypass的需要,学习了下分块传输的办法,网上也有burp插件,须要应用python实现一下,在应用requests实现时遇到了一些坑,记录下。
requests块编码申请https://docs.python-requests....
申请参数data提供一个生成器即可
首次引入分块传输:
https://github.com/psf/reques...
应用burp代理分块传输不失效为了能够精确的看到代码是否失效,我给requests配上了burp代理,然而在看burp捕捉的报文中发现分块传输并未失效
论断并不是应用了burp代理后requests分块传输不失效,而是分块传输产生在Client与代理Server之间,burp申请转发并没有应用分块传输,所以在burp上的抓包状况看没有应用分块传输。
抓包验证本地抓包 (Client与代理Server)
POST http://xxcdd.for.test.com/vulnerabilities/exec/ HTTP/1.1Host: xxcdd.for.test.comConnection: closeAccept-Encoding: gzip, deflateAccept: */*User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)Accept-Language: zh-cn,en-us;q=0.7,en;q=0.3Content-Type: application/x-www-form-urlencodedCookie: security=low; PHPSESSID=f49c32abdce4380305503cde9e522e67Transfer-Encoding: chunked2ip3=12173.0.30.11&1S2ub3mit3=Su2bm2it0HTTP/1.1 200 OKDate: Sat, 08 May 2021 08:31:10 GMTServer: Apache/2.4.39 (Unix) OpenSSL/1.0.2s PHP/7.3.7 mod_perl/2.0.8-dev Perl/v5.16.3X-Powered-By: PHP/7.3.7Expires: Tue, 23 Jun 2009 12:00:00 GMTCache-Control: no-cache, must-revalidatePragma: no-cacheContent-Length: 4489Connection: closeContent-Type: text/html;charset=utf-8<!DOCTYPE html>burp申请转发
POST /vulnerabilities/exec/ HTTP/1.1Host: xxcdd.for.test.comConnection: closeAccept-Encoding: gzip, deflateAccept: */*User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)Accept-Language: zh-cn,en-us;q=0.7,en;q=0.3Content-Type: application/x-www-form-urlencodedCookie: security=low; PHPSESSID=f49c32abdce4380305503cde9e522e67Content-Length: 26ip=127.0.0.1&Submit=SubmitHTTP/1.1 200 OKDate: Sat, 08 May 2021 08:34:44 GMTServer: Apache/2.4.39 (Unix) OpenSSL/1.0.2s PHP/7.3.7 mod_perl/2.0.8-dev Perl/v5.16.3X-Powered-By: PHP/7.3.7Expires: Tue, 23 Jun 2009 12:00:00 GMTCache-Control: no-cache, must-revalidatePragma: no-cacheContent-Length: 4489Connection: closeContent-Type: text/html;charset=utf-8<!DOCTYPE html>Debug requests的分块传输过程确定断点requests源代码全局搜寻chunked,确定断点
...