I'm trying to route certain requests through burp. These would be HTTPS requests
I have burp properly installed, and placed the cacert.der
certificate in the current working directory that the code is contained. I've looked at https://curl.haxx.se/libcurl/c/curl_easy_setopt.html, but can't get it working.
This is the current code I'm using to attempt this
@classmethod
def CURLpageThroughBurp(cls, encodedURL):
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, str(encodedURL))
c.setopt(c.CAINFO, certifi.where())
c.setopt(c.PROXY, '127.0.0.1')
c.setopt(c.PROXYPORT, 8080)
c.setopt(c.PROXY_SSLCERT, "cacert.der")
c.setopt(c.PROXY_SSLCERTTYPE, "DER")
c.setopt(c.FOLLOWLOCATION, True)
##c.setopt(c.PROXYTYPE, c.PROXYTYPE_SOCKS5_HOSTNAME)
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()
webpage = buffer.getvalue()
return webpage
Here's the error I receive:
File "randomcode,py", line 111 c.perform()
pycurl.error: (60, 'SSL certificate problem: self signed certificate in certificate chain')
HTTP requests:
When I have "intercept on" enabled on Burp, the HTTP requests are intercepted, and they actually successfully can be forwarded and I receive responses from the destination server.
HTTPS requets:
When I have "intercept on" enabled on Burp, the HTTPS requests aren't intercepted, so I am unable to forward them, because they don't pop on the intercept tab. And I get the pycurl.error seen above.
NOTE: I can successfully send both HTTP and HTTPS requests with curl when not using Burp proxy