Bypassing BurpSuite "Failed to connect to website:port" issue
Hi readers,
When performing penetration testing, it’s common to run into situations where an application or web portal works perfectly in a browser, but refuses to load once you route traffic through your interception proxy(e.g. Burp suite). Instead of the expected traffic flow, you might be greeted with errors such as:
Failed to Connect to <website:port>
The Solution: Proxy Chaining (Upstream Proxy):
The workaround is to introduce an additional proxy layer that sits between your BurpSuite and the destination server. Your interception proxy connects to this new proxy, which then handles the final connection to the target.
This approach is commonly called proxy chaining or upstream proxying. It ensures that your interception tool can still capture and modify traffic, while the upstream proxy takes care of establishing a compliant connection with the target.
Graphical representation of this architecture:
A Custom Python Proxy
To address this, I built a lightweight Python upstream proxy with the help of AI(no shame in accepting this) that acts as a middleman.
- It listens locally on a port you define (e.g., default 127.0.0.1:8081).
- It accepts connections from your BurpSuite proxy.
- For normal HTTP requests, it forwards them to the target using modern libraries that support HTTP/2 and TLS 1.3.
- For HTTPS (CONNECT requests), it sets up a raw tunnel, allowing your interception proxy to handle SSL/TLS interception as usual.
Make sure to install httpx before running the script --> pip install httpx
How to Run
-
Save the script as
bypass_proxy.py
. -
Start it with: python bypass_proxy.py -p 8081 -v
Once the script is running, Go to
Thats it, open the browser in which burp proxy is configured, and start browsing the webapp, now you will not see the error which we faced before, you can also see the logs in the script console.
Comments
Post a Comment