Lab: Reflected XSS into HTML context with most tags and attributes blocked

Hacking Truth
0



Reflected XSS into HTML context with most tags and attributes blocked



This lab contains a reflected cross-site scripting vulnerability in the search functionality but uses a web application firewall (WAF) to protect against common XSS vectors.


To solve the lab, perform a cross-site scripting attack that bypasses the WAF and alerts document.cookie. Reflected XSS into HTML context with most tags and attributes blocked


Note: Your solution must not require any user interaction. Manually triggering an alert in your own browser will not solve the lab.

 

Access the lab


Click Here :- Lab
 

 

Solution


Inject a standard XSS payload such as: <img src=1 onerror=alert(document.cookie)>

 

Observe that this payload gets blocked.

 

Use Burp Intruder to test which tags and attributes are being blocked:

 

With your browser proxying traffic through Burp Suite, use the search function in the lab.

 

 Send the resulting request to Burp Intruder.

 

In Burp Intruder, in the Positions tab, click "Clear §".

 

In the request template, replace the value of the search term with: <>

 

Place the cursor between the angle brackets and click "Add §" twice, to create a payload position. The value of the search term should now look like: <§§>
Visit the XSS cheat sheet and click "copy tags to clipboard".

 

In Burp Intruder, in the Payloads tab, click "Paste" to paste the list of tags into the payloads list.

 

Click "Start attack".


 

When the attack completes, review the results. Note that all payloads caused an 

HTTP 400 response, except for the body payload, which caused a 200 response.

 

Go back to the Positions tab in Burp Intruder.

 

Replace your search term with: <body%20=1>
 

 

Place the cursor before the = character and click "Add §" twice, to create a 

payload position.

 

The value of the search term should now look like: <body%20§§=1>
 

Visit the XSS cheat sheet and click "copy events to clipboard".

 

In Burp Intruder, in the Payloads tab, click "Clear" to remove the previous 

 

payloads. Then click "Paste" to paste the list of attributes into the payloads list.

 

Click "Start attack".

 

When the attack completes, review the results. Note that all payloads caused an 

HTTP 400 response, except for the onresize payload, which caused a 200 response.
 

Lab: Reflected XSS into HTML context with most tags and attributes blocked



Go to the exploit server and paste the following code, replacing your-lab-id with 

your lab ID:



<iframe src="https://your-lab-id.web-security-academy.net/?search=%22%3E

%3Cbody%20onresize=alert(document.cookie)%3E" 

onload=this.style.width='100px'>



Click "Store" and "Deliver exploit to victim".
 

 

 
Video Tutorial :-



    

 

 

Disclaimer


This was written for educational purpose and pentest only.
The author will not be responsible for any damage ..!
The author of this tool is not responsible for any misuse of the information.
You will not misuse the information to gain unauthorized access.
This information shall only be used to expand knowledge and not for causing  malicious or damaging attacks. Performing any hacks without written permission is illegal ..!


All video’s and tutorials are for informational and educational purposes only. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. We believe that it is impossible to defend yourself from hackers without knowing how hacking is done. The tutorials and videos provided on www.hackingtruth.in is only for those who are interested to learn about Ethical Hacking, Security, Penetration Testing and malware analysis. Hacking tutorials is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used.


All tutorials and videos have been made using our own routers, servers, websites and other resources, they do not contain any illegal activity. We do not promote, encourage, support or excite any illegal activity or hacking without written permission in general. We want to raise security awareness and inform our readers on how to prevent themselves from being a victim of hackers. If you plan to use the information for illegal purposes, please leave this website now. We cannot be held responsible for any misuse of the given information.



- Hacking Truth by Kumar Atul Jaiswal



I hope you liked this post, then you should not forget to share this post at all.
Thank you so much :-)


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !