Post

Reflected XSS into HTML context with nothing encoded

Reflected XSS into HTML context with nothing encoded

Web Security Academy #1

Lab: Reflected XSS into HTML context with nothing encoded

Lab Description

Lab Level - APPRENTICE

This lab contains a simple reflected cross-site scripting vulnerability in the search functionality.

To solve the lab, perform a cross-site scripting attack that calls the alert function.

01 Lab Description

Step to Solve the Lab

  • Access the lab by click on ACCESS THE LAB.
  • After access the lab you will see a simple blog web page with a search functionality, also some posts
  • As a normal user you can search for any blog post in the search bar.
  • To solve the lab first inject some simple HTML and see if the HTML is reflected as a HTML tag or the web server sanitized the payload.
  • I inject a simple <i> tag and it reflected as a HTML tag.
1
<i>R3DW4N</i>

02 Confirming HTML Injection

  • I confirm that the website is not able to sanitized HTML codes.
  • Now I inject a simple Cross Site Scripting Payload
1
<script>alert("R3DW4N")</script>

03 Conforming Cross Site Scripting and Solve the lab

Congratulations, you solved the lab!.

  • Here is the source code

04 Source code

And that’s it for this write-ups. If you want to connect with me, here are my social media links

I create a website where you can find more Bug Bounty Related Write-Ups. Here is the website link : Hacker-Write-Ups

Also I want to create a community where you can communicate with other hackers and much more fun stuff : We-Are-Anonymous

Assalamu alaikum wa rahmatullah.

This post is licensed under CC BY 4.0 by the author.