Jump to content
  • Entries

    16114
  • Comments

    7952
  • Views

    863551679

Contributors to this blog

  • HireHackking 16114

About this blog

Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.

En este post vamos a estar resolviendo el laboratorio de PortSwigger: “Reflected XSS into HTML context with nothing encoded”.

image 193

Para resolver el laboratorio tenemos que realizar un Cross-site Scripting que llame a la función alert.

Cuando entramos en el laboratorio, vemos un campo de búsqueda:

image 194

Vamos a probar a buscar cualquier cosa:

image 195
image 196

Si nos fijamos, el término de búsqueda se ve reflejado en la web. Por lo que, podemos probar a meter un código Javascript usando el atributo onerror en el tag <img>.

De tal forma, que si falla al cargar la imagen que especificamos en el atributo src, se nos ejecutará lo que escribimos en onerror:

image 197
image 198

Como vemos, efectivamente vemos que ha fallado al cargar la imagen, por tanto, se nos ejecuta el alert. De esta forma, conseguimos resolver el laboratorio.