Web API penetration testing

chevron-rightWeb Application Firewall (WAF)hashtag
wafw00f <URL>
nuclei -u <URL> -t dns/dns-waf-detect.yaml,http/technologies/secui-waf-detect.yaml,http/technologies/waf-detect.yaml -H "Authorization: Bearer <token>" -ts -silent
chevron-rightHTTP security headershashtag
shcheck.py -i -k <URL>
nuclei -u <URL> -t http/misconfiguration/http-missing-security-headers.yaml -H "Authorization: Bearer <token>" -ts -silent

No HTTP headers con divulgación de información.

  • Server

  • X-Powered-By

  • X-AspNet*

Expresión regular para identificar HTTP security headers recomendados.

Strict-Transport-Security|Content-Security-Policy|X-Content-Type-Options|Content-Type|X-Frame-Options|Referrer-Policy
chevron-rightHTTP methods (verbs)hashtag

Utilizar el método HTTP apropiado para cada operación y responder con un error 405 Method Not Allowed si el método de la petición no es el apropiado.

chevron-rightContent-Typehashtag

Validar los Content-Type enviados (request) contra los Content-Type aceptados (response).

Incluir en la respuesta (response) el HTTP header X-Content-Type-Options.

X-Content-Type-Options: nosniff
chevron-rightRedireccionamiento estricto de HTTP a HTTPShashtag
nmap -sV -p 80,443 -n -Pn <target>
curl -I -l <HTTP-URL> -H "Authorization: Bearer <token>"
curl <HTTPS-URL> -H "Authorization: Bearer <token>"
chevron-rightSSL/TLS y algoritmos de cifradoshashtag
sslscan <target>
nuclei -u <URL> -t ssl -ts -silent
chevron-rightFuzzinghashtag

Fuzzing de paths.

Fuzzing de versiones (v1, v2, v3...).

Fuzzing parámetros GET.

Fuzzing valor de parámetros GET.

Fuzzing parámetros POST.

Fuzzing valor de parámetros POST.

Fuzzing de archivos (según contexto de revisión).

chevron-rightAutenticación y autorizaciónhashtag
  • Consumo de API con token de autenticación incorrecto.

  • Consumo de API con HTTP header de autenticación, pero sin valor.

  • Consumo de API sin HTTP header de autenticación.

  • Consumo de API con token de autenticación expirado.

  • No utilizar Basic Authentication.

  • Insecure Direct Object References (IDOR).

chevron-rightExposición de datoshashtag
  • Divulgación de datos sensibles.

  • Exposición de datos confidenciales a través del "query strings" en URL.

  • Entrega de información excesiva.

chevron-rightInput data validationhashtag

Fuzzing y consumo de API con parámetros de entrada inválidos.

Manejo de errores.

  • Mensajes de errores genéricos.

  • No revelar detalles del error innecesariamente.

  • No entregar detalles técnicos referente al error.

chevron-rightCross-origin resource sharing (CORS)hashtag
chevron-rightRestricciones de consumohashtag
  • Rate Limit: garantiza un número total de solicitudes en un intervalo de tiempo determinado. Comprueba si el número de solicitudes se encuentra dentro del intervalo de tiempo configurado, independientemente del tiempo entre cada solicitud. Cuando finaliza el intervalo, comienza uno nuevo y también se reinicia el recuento de solicitudes.

  • Spike Arrest: garantiza una distancia de tiempo mínima entre dos solicitudes. Si no se respeta el tiempo entre dos solicitudes, no se aceptará la segunda y el código de error HTTP devuelto será 429.

  • Caching: almacenamiento en caché.

  • Batching attack (GraphQL).

chevron-rightEscaneo automatizadohashtag
  • Burp Suite Professional.

  • Nuclei.

  • Burp Bounty Pro.

  • OWASP Zed Attack Proxy (ZAP).

chevron-rightVulnerabilidadeshashtag

Última actualización