# Host Header Attack

1. You have to find any URL having code 3xx. like 300 / 301/ 302 ...
2. Then you can use below three methods and see if the web page is redirecting.

a. Add X-Forwarded-Host: attacker.com

b. Set Host to attacker.com & X-Forwarded-Host to real website.

c. Set Host to attacker.com and remove x-forwarded-host.

If a web page redirects by modifying the headers as above there is a vulnerability.


---

# 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://modi-arun91.gitbook.io/penetration-testing/web-application-vulnerabilities/host-header-attack.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.
