The Burp Suite User Forum was discontinued on the 1st November 2024.

Burp Suite User Forum

For support requests, go to the Support Center. To discuss with other Burp users, head to our Discord page.

SUPPORT CENTER DISCORD

How do I configure python to proxy through BurpSuite for https?

Oscar | Last updated: Feb 03, 2017 07:17PM UTC

I have BurpSuite configured as a proxy. I have generated and installed a certificate for Burp in my Mac's keychain. On a Kali box I have also configured Iceweasel to proxy through my Burp Proxy running on my Mac. I can can browse from Kali to both http and https sites and burp intercepts the requests. I forward them through and confirm the security exceptions and the browser eventually displays web pages. From the Kali command line I exported the following two variables export http_proxy=http://172.xx.yy.z:8081 export https_proxy=http://172.xx.yy.z:8081 I wrote one python script: (env) ojblass@kali:~/effective_python$ cat ojblass_urllib_http.py import urllib url = urllib.urlopen("http://www.hotmail.com") data = url.read() print data This correctly hits the BurpSuite proxy; however, when I attempt to run https traffic through the request is not intercepted: (env) ojblass@kali:~/effective_python$ cat ojblass_urllib_https.py import urllib url = urllib.urlopen("https://mail.live.com/default.aspx") data = url.read() print data Instead the following error is printed: <html><head><title>Burp Suite Professional</title> <style type="text/css"> body { background: #dedede; font-family: Arial, sans-serif; color: #404042; -webkit-font-smoothing: antialiased; } #container { padding: 0 15px; margin: 10px auto; background-color: #ffffff; } a { word-wrap: break-word; } a:link, a:visited { color: #e06228; text-decoration: none; } a:hover, a:active { color: #404042; text-decoration: underline; } h1 { font-size: 1.6em; line-height: 1.2em; font-weight: normal; color: #404042; } h2 { font-size: 1.3em; line-height: 1.2em; padding: 0; margin: 0.8em 0 0.3em 0; font-weight: normal; color: #404042;} .title, .navbar { color: #ffffff; background: #e06228; padding: 10px 15px; margin: 0 -15px 10px -15px; overflow: hidden; } .title h1 { color: #ffffff; padding: 0; margin: 0; font-size: 1.8em; } div.navbar {position: absolute; top: 18px; right: 25px;}div.navbar ul {list-style-type: none; margin: 0; padding: 0;} div.navbar li {display: inline; margi-left: 20px;} div.navbar a {color: white; padding: 10px} div.navbar a:hover, div.navbar a:active {text-decoration: none; background: #404042;} </style> </head> <body> <div id="container"> <div class="title"><h1>Burp Suite Professional</h1></div> <h1>Error</h1><p>Invalid&#32;client&#32;request&#32;received&#58;&#32;First&#32;line&#32;of&#32;request&#32;did&#32;not&#32;contain&#32;an&#32;absolute&#32;URL&#32;&#45;&#32;try&#32;enabling&#32;invisible&#32;proxy&#32;support&#46;</p> <div class="request">GET&nbsp;https://mail.live.com/default.aspx&nbsp;HTTP/1.0<br> User-Agent:&nbsp;Python-urllib/1.17<br> Accept:&nbsp;*/*<br> <br> </div><p>&nbsp;</p> </div> </body> </html> The main content of the error states 'Invalid client request received. First line of request did not contain an absolute URL. I have googled this error but everything I seem to come does not appear relevant. I am new to this and would appreciate any insight you might have.

Liam, PortSwigger Agent | Last updated: Feb 06, 2017 09:46AM UTC

Hi Oscar Thanks for your message. I noticed that you found a workaround and posted it on stack exchange: - http://security.stackexchange.com/questions/150329/proxying-requests-through-python-and-burpsuite-not-working Are you now able to use Burp in the required manner? Please let us know if you need any further assistance.

Burp User | Last updated: Mar 27, 2019 01:06PM UTC