# HTTP security headers

## General <a href="#http-security-headers-curl" id="http-security-headers-curl"></a>

<table><thead><tr><th width="269">HTTP header</th><th>Estado</th></tr></thead><tbody><tr><td>Strict-Transport-Security</td><td>Recomendado</td></tr><tr><td>Content-Security-Policy</td><td>Recomendado</td></tr><tr><td>X-Content-Type-Options</td><td>Recomendado</td></tr><tr><td>Content-Type</td><td>Recomendado</td></tr><tr><td>X-Frame-Options</td><td>Opcional según contexto</td></tr><tr><td>Referrer-Policy</td><td>Opcional según contexto</td></tr><tr><td>Cache-Control</td><td>Opcional según contexto</td></tr></tbody></table>

<details>

<summary>Strict-Transport-Security</summary>

{% code fullWidth="false" %}

```http
Strict-Transport-Security: max-age=31536000; includeSubDomains
```

{% endcode %}

</details>

<details>

<summary>Content-Security-Policy</summary>

```http
Content-Security-Policy: default-src 'self'; form-action 'self'; object-src 'none'; frame-ancestors 'none'; upgrade-insecure-requests; block-all-mixed-content
```

</details>

<details>

<summary>X-Content-Type-Options</summary>

```http
X-Content-Type-Options: nosniff
```

</details>

<details>

<summary>Content-Type</summary>

```http
Content-Type: application/json
Content-Type: application/xml
```

</details>

<details>

<summary><a href="../../explotacion/clickjacking#x-frame-options">X-Frame-Options</a></summary>

```http
X-Frame-Options: DENY
X-Frame-Options: SAMEORIGIN
X-Frame-Options: ALLOW-FROM <URI>
```

</details>

<details>

<summary>Referrer-Policy</summary>

```http
Referrer-Policy: no-referrer
```

</details>

<details>

<summary>Cache-Control</summary>

```http
Cache-Control: no-store
```

</details>

## cURL <a href="#http-security-headers-curl" id="http-security-headers-curl"></a>

```shell
curl -I -L --url <target>
```

* -I = headers.
* -L = seguir redireccionamientos.
* \--url = URL (Uniform Resource Locator).
  * \<target> = objetivo.

## Nmap <a href="#http-security-headers-nmap" id="http-security-headers-nmap"></a>

```shell
nmap -p 80,443 --script http-security-headers <target> -oN nmap-http-security-headers.txt
```

* -p = puertos.
* \--script http-security-headers = HTTP security headers.&#x20;
* \<target> = objetivo.

## Nuclei

```sh
nuclei -u <target> -t http/misconfiguration/http-missing-security-headers.yaml -ts -silent
```

## securityheaders

* <https://github.com/juerkkil/securityheaders>

```shell
securityheaders.py <target>
```

## shcheck

* <https://github.com/santoru/shcheck>

```shell
shcheck.py -i -k <target>
```

## Mozilla Observatory

* <https://observatory.mozilla.org/>

## OWASP Secure Headers Project

* <https://owasp.org/www-project-secure-headers/>

## Security Headers <a href="#security-headers" id="security-headers"></a>

* <https://securityheaders.com/>


---

# 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://web.mrw0l05zyn.cl/escaneo-y-enumeracion/http-security-headers.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.
