> For the complete documentation index, see [llms.txt](https://hackerlab.gitbook.io/wiki.hackerlab.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hackerlab.gitbook.io/wiki.hackerlab.cz/web-pentesting/http-proxy-override.md).

# HTTP Proxy Override

## OS Linux - Terminal

The app or a library has to be coded to reflect these specific environment variables. Otherwise, explore a specific app configuration or CLI parameters for HTTP proxy features.

```bash
export http_proxy='127.0.0.1:8080'    
export https_proxy='127.0.0.1:8080'
```

You can unset back the variables by

```markup
unset http_proxy
unset https_proxy
```

## Metasploit

```
msf> set Proxies http:127.0.0.1:8080
```

There are different types of proxies you can define.

```
set Proxies socks4:127.0.0.1:5555
set Proxies socks5:127.0.0.1:5555
```

## Java (VM)

Forward HTTP/HTTPS traffic for your Java app to Burp Suite Proxy. The same analogy applies to FTP, explore the following Java documentation.

{% embed url="<https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html>" %}

### HTTP

Before you start your java application, add the following parameters to JVM.

```bash
java -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080
```

### HTTP & HTTPS

```bash
"%JAVA_HOME%\bin\java" …  
-Dhttp.proxyHost=127.0.0.1 
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=127.0.0.1      
-Dhttps.proxyPort=8080 
-Dhttp.nonProxyHosts=localhost 
-Djavax.net.ssl.trustStore=C:\Users\Administrator\.keystore
-Djavax.net.ssl.trustStorePassword=changeme
```

{% hint style="info" %}
**HTTPS Troubleshooting** - add the following JVM parameter to track SSL/TLS handshake and certificate look up errors **Djavax.net.debug=ssl,handshake**
{% endhint %}

### Create Java Keystore

Briefly, Java Key Store (JKS) is a secured storage protected by password (trustStorePassword).

```bash
cd %JAVA_HOME%/bin
keytool.exe -keystore C:/Users/Administrator/.keystore -genkey -alias client
```

### Import certificate (CER or DER)

```bash
keytool.exe -importcert -file certificate.cer -keystore C:\Users\Administrator\.keystore -alias "BurpCert" 
```

## Visual Studio 2015|2019

Find VS software home (installation directory)&#x20;

**%ProgramFiles%\Microsoft Visual Studio\2019\Enterprise\Common7\IDE%**

edit **devenv.exe.config** file

```markup
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
    <proxy bypassonlocal="true" proxyaddress="http://127.0.0.1:8080" />
</defaultProxy>
</system.net>
```

with authentication option

```markup
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
    <proxy bypassonlocal="true" proxyaddress="http://Username:Password@yourproxyaddress.net:8080" />
</defaultProxy>
</system.net>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hackerlab.gitbook.io/wiki.hackerlab.cz/web-pentesting/http-proxy-override.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
