bWAPP - Cross Site Scripting Reflected (PHP_Self)

bWAPP – Cross Site Scripting Reflected (PHP_Self)

In this walk through, we will be going through the Cross Site Scripting Reflected (PHP_Self) vulnerability section from bWAPP Labs. We will be exploring and exploiting Reflected Cross Scripting vulnerability in PHP_Self implementations and learn how application are affected because of it. So, let’s get started with the Hacking without any delay.

Cross Site Scripting Reflected (PHP_Self)

Security: Low

  • Setting the security level to Low.

Security Level Low

  • The application page uses user’s First and last name and display that on page. It issues a GET request to xss_php_self.php file for the execution.

PHP_SELF

Burpsuite intercept

  • I used the below payload in the Last name field to generate a pop-up alert and confirming the XSS vulnerability on the page.

<script>alert("Hacked")</script>

Payload

Pop up alert

Security: Medium

  • Setting the security level to Medium.

Security level medium

  • I used the previously used payload and it didn’t work as the application has slashes in the string – Hacked.

payload

Page source code

  • I used the below payload instead and it worked.

<script>alert(1)</script>

Payload

Pop up alert

  • Not working in High level due to HTML addslashes.

Also Read: bWAPP – Cross Site Scripting Reflected (AJAX-JSON)

Conclusion:

Conclusion

So, we finally completed all the security levels for the bWAPP Cross Site Scripting Reflected (PHP_Self) Vulnerability. We looked into the various ways how application has been set up in various levels and how we can bypass the security controls implemented. Reflected-XSS attacks can be mitigated by performing input sanitization on endpoints, whitelist the allowed characters in the input and using a WAF. Along with that, we can prevent data from any untrusted source to be dynamically written to the HTML document. On that note, i will take your leave and will meet you in next one with another bWAPP vulnerability writeup, till then “Keep Hacking”.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top