Using the requests library, I am trying to make request to a url. I've set the target to the specific url and checked, "And URL Is in Target Scope" in both Request interception rules and Response Interception rules.
Here's a snippet.
import requests
url = "https://some_url.net/"
proxies = {"http":"http://127.0.0.1:8080" , "https":"http://127.0.0.1/"}
r = requests.get(url, proxies = proxies, verify=False)
The request is showing in the proxy's intercept, but when I forward the request, I do not get to see the response in burp. However I do get it in the python console, returning cookies and other headers. Here's the request I sent which shows up in burp
GET / HTTP/1.1
Host: xyz.net
User-Agent: python-requests/2.28.1
Accept-Encoding: gzip, deflate
Accept: */*
Connection: close
For this request I don't receive any response on burp when I forward it. i know it is saying connection closed, However here's what I get in the python's console on requesting headers using r.headers
{'Set-Cookie': 'TrackingId=5lkTrr8GwfrXvxGS; Secure; HttpOnly, session=gQHLcPtXqmYAQ2JhQNitbTrDdjYNeu5j; Secure; HttpOnly; SameSite=None', 'Content-Type': 'text/html; charset=utf-8', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Length': '10933'}
and also response is received when I request content using r.content
Here are the headers when I make the same request manually:
GET / HTTP/2
Host: xyz.net
Cookie: TrackingId=0nfDJnMqVqEF8jjp; session=J96kEOZ4EeUJrmNoNKRhpxP5vorwgUVM
User-Agent: Mozilla/n.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://portswigger.net/
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: cross-site
Sec-Fetch-User: ?1
Te: trailers
What changes do I need to make changes in my burp or my request to get a response to show up on burp as well, which looks like down below ( when done manually )
GET /xyzLabHeader HTTP/2
Host: xyz.net
User-Agent: Mozilla/n.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Sec-Websocket-Version: 13
Origin: xyz.net
Sec-Websocket-Key: jKacksiH9k/Xu/9yXm2Jzw==
Connection: keep-alive, Upgrade
Cookie: TrackingId=0nfDJnMqVqEF8jjp; session=J96kEOZ4EeUJrmNoNKRhpxP5vorwgUVM
Sec-Fetch-Dest: websocket
Sec-Fetch-Mode: websocket
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket