# Web application penetration testing

## Reconocimiento y recolección de información

<details>

<summary><a href="../reconocimiento-y-recoleccion-de-informacion/web-application-firewall-waf">Web Application Firewall (WAF)</a></summary>

```sh
wafw00f <target>
nuclei -u <target> -t dns/dns-waf-detect.yaml,http/technologies/secui-waf-detect.yaml,http/technologies/waf-detect.yaml -ts -silent
```

</details>

<details>

<summary><a href="https://app.gitbook.com/s/-M885ZMMY91-3v53_ySd/reconocimiento-y-recoleccion-de-informacion/domain-name-system-dns">Domain Name System (DNS)</a></summary>

```sh
dig any <target> @<dns-server>
dnsrecon -d <target>
nuclei -u <target> -t dns -ts -silent
```

</details>

<details>

<summary><a href="../reconocimiento-y-recoleccion-de-informacion/subdominios-y-virtual-host-vhost">Subdominios y Virtual Host (VHost)</a></summary>

```sh
# Subdominios
subfinder -d <target> -recursive -all -silent | alterx -en -silent | dnsx -silent -o subdomains.txt
dnsx -d <target> -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -silent -o dnsx-subdomains.txt
ffuf -u http://FUZZ.<target>/ -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt:FUZZ -c -o ffuf-subdomains.html -of html
# Virtual Host (VHost)
ffuf -u http://<target>/ -w <path-wordlist>:FUZZ -H 'Host: FUZZ.<target>' -fs <size> -c -o ffuf-vhost.html -of html
```

</details>

<details>

<summary><a href="../reconocimiento-y-recoleccion-de-informacion/ssl-tls-y-algoritmos-de-cifrados">SSL/TLS y algoritmos de cifrados</a></summary>

```bash
sslscan <target>
nuclei -u <target> -t ssl -ts -silent
```

</details>

<details>

<summary><a href="../reconocimiento-y-recoleccion-de-informacion/tecnologias-web">Tecnologías web</a></summary>

```sh
whatweb -v -a 1 <target>
nuclei -u <target> -t http/technologies -ts --silent
```

</details>

<details>

<summary>Otros</summary>

* Revisión de archivo `robots.txt`.

```sh
curl <target>/robots.txt
```

* Revisión de código fuente.
  * Meta tags de HTML.
  * Titulo y pie de página (footer).
  * Comentarios.
  * Funciones y endpoints/APIs en archivos JavaScript.&#x20;
* [Google hacking / dorks](https://app.gitbook.com/s/-M885ZMMY91-3v53_ySd/reconocimiento-y-recoleccion-de-informacion/google-hacking-dorks).

</details>

## Escaneo y enumeración

<details>

<summary><a href="../escaneo-y-enumeracion/http-security-headers">HTTP security headers</a></summary>

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

</details>

<details>

<summary>Redireccionamiento estricto de HTTP a HTTPS</summary>

```sh
nmap -sV -p 80,443 -n -Pn <host>
curl -I -l http://<target>
curl https://<target>
```

</details>

<details>

<summary><a href="../escaneo-y-enumeracion/crawling-y-spidering">Crawling y spidering</a></summary>

```sh
echo 'http://<target>' | hakrawler | sort -u
cewl http://<target> -d 2 -m 5 -w wordlist-crawling-01.txt
cewl http://<target> -d 3 -m 3 -w wordlist-crawling-02.txt
```

</details>

<details>

<summary><a href="../escaneo-y-enumeracion/fuzzing">Fuzzing</a></summary>

[Fuzzing general](https://web.mrw0l05zyn.cl/escaneo-y-enumeracion/fuzzing).

```sh
# General
dirsearch -u http://<target>/ -o $(pwd)/dirsearch-fuzzing.txt
# Búsqueda recursiva
dirsearch -u http://<target>/ -o $(pwd)/dirsearch-fuzzing-recursive.txt -r
```

[Fuzzing de directorios](https://web.mrw0l05zyn.cl/escaneo-y-enumeracion/fuzzing/directorios).

```sh
# Wordlist
ffuf -u http://<target>/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-large-directories.txt:FUZZ -c -mc all -fc 404 -o ffuf-fuzzing-directories.html -of html
# Wordlist crawling
ffuf -u http://<target>/FUZZ -w <wordlist-crawling.txt>:FUZZ -c -mc all -fc 404 -o ffuf-fuzzing-directories-crawling.html -of html
```

[Fuzzing de archivos](https://web.mrw0l05zyn.cl/escaneo-y-enumeracion/fuzzing/archivos).

```sh
# Wordlist
ffuf -u http://<target>/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-large-files.txt:FUZZ -c -mc all -fc 404 -o ffuf-fuzzing-files.html -of html
```

[Fuzzing por extensiones](https://web.mrw0l05zyn.cl/escaneo-y-enumeracion/fuzzing/extensiones).

```sh
# Identificación de extensiones
ffuf -u http://<target>/indexFUZZ -w /usr/share/seclists/Discovery/Web-Content/web-extensions.txt:FUZZ -c -mc all -fc 404
# Wordlist + extensiones (.html, .js, .php, .jsp, .aspx)
ffuf -u http://<target>/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-large-words.txt:FUZZ -e .html,.js,.php,.jsp,.aspx -c -mc all -fc 404 -o ffuf-fuzzing-extensions.html -of html
# Wordlist + extensiones (ocultos / .txt, .config, .old, .bak, .inc)
ffuf -u http://<target>/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-large-words.txt:FUZZ -e .txt,.config,.old,.bak,.inc -c -mc all -fc 404 -o ffuf-fuzzing-extensions-hidden.html -of html
# Wordlist crawling + extensiones
ffuf -u http://<target>/FUZZ -w <wordlist-crawling.txt>:FUZZ -e .html,.js,.php,.jsp,.aspx,.txt,.config,.old,.bak,.inc -c -mc all -fc 404 -o ffuf-fuzzing-crawling-extensions.html -of html
```

</details>

<details>

<summary>Escaneo automatizado</summary>

* Burp Suite Professional.
* Nuclei.

```sh
nuclei -u <target> -ts -silent
```

* OWASP Zed Attack Proxy (ZAP).
* Nessus.

</details>

## **Explotación**

* [API keys](https://web.mrw0l05zyn.cl/explotacion/api-keys)
* [Clickjacking](https://web.mrw0l05zyn.cl/explotacion/clickjacking)
* [HTTP methods (verbs)](https://web.mrw0l05zyn.cl/explotacion/http-methods-verbs)
* [Input data validation](https://web.mrw0l05zyn.cl/explotacion/input-data-validation)
* [HTTP Host header](https://web.mrw0l05zyn.cl/explotacion/http-host-header)
* [Autenticación y autorización](https://web.mrw0l05zyn.cl/explotacion/autenticacion-y-autorizacion)
* [Same-origin policy (SOP)](https://web.mrw0l05zyn.cl/explotacion/same-origin-policy-sop)
* [Cross-site scripting (XSS)](https://web.mrw0l05zyn.cl/explotacion/cross-site-scripting-xss)
* [Cross-site request forgery (CSRF)](https://web.mrw0l05zyn.cl/explotacion/cross-site-request-forgery-csrf)
* [File upload](https://web.mrw0l05zyn.cl/explotacion/file-upload)
* [Path traversal & file inclusion](https://web.mrw0l05zyn.cl/explotacion/path-traversal-and-file-inclusion)
* [Command injection](https://web.mrw0l05zyn.cl/explotacion/command-injection)
* [SQL injection (SQLi)](https://web.mrw0l05zyn.cl/explotacion/sql-injection-sqli)
* [NoSQL injection (NoSQLi)](https://web.mrw0l05zyn.cl/explotacion/nosql-injection-nosqli)
* [XML external entity (XXE) injection](https://web.mrw0l05zyn.cl/explotacion/xml-external-entity-xxe-injection)
* [CRLF injection](https://web.mrw0l05zyn.cl/explotacion/crlf-injection)
* [XPath injection](https://web.mrw0l05zyn.cl/explotacion/xpath-injection)
* [LDAP injection](https://web.mrw0l05zyn.cl/explotacion/ldap-injection)
* [PDF injection](https://web.mrw0l05zyn.cl/explotacion/pdf-injection)
* [Server-side template injection (SSTI)](https://web.mrw0l05zyn.cl/explotacion/server-side-template-injection-ssti)
* [Server-side include (SSI) injection](https://web.mrw0l05zyn.cl/explotacion/server-side-include-ssi-injection)
* [Server-side request forgery (SSRF)](https://web.mrw0l05zyn.cl/explotacion/server-side-request-forgery-ssrf)
* [Web cache poisoning](https://web.mrw0l05zyn.cl/explotacion/web-cache-poisoning)
* [HTTP request smuggling](https://web.mrw0l05zyn.cl/explotacion/http-request-smuggling)
* [Prototype pollution](https://web.mrw0l05zyn.cl/explotacion/prototype-pollution)
* [Web API](https://web.mrw0l05zyn.cl/checklist/web-api-penetration-testing)
  * [GraphQL](https://web.mrw0l05zyn.cl/explotacion/graphql)
* Webservices
  * Obtención de archivo WSDL
  * Análisis de archivo WSDL para obtener información general sobre la estructura de cada operación y la existencia de métodos ocultos
  * SOAPAction spoofing
* [Open redirect](https://web.mrw0l05zyn.cl/explotacion/open-redirect)
* [Content Management System (CMS)](https://web.mrw0l05zyn.cl/explotacion/content-management-system-cms)
  * [WordPress](https://web.mrw0l05zyn.cl/explotacion/content-management-system-cms/wordpress)
* [Websocket](https://web.mrw0l05zyn.cl/explotacion/websocket)
* [Deserialization](https://web.mrw0l05zyn.cl/explotacion/deserialization)
* [Flash](https://web.mrw0l05zyn.cl/explotacion/flash)
