Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Pentesting Assignment Here is your task: The str _ ireplace ( script , null, ) function disallows the SCRIPT element used in Reflected XSS lab

Pentesting Assignment
Here is your task: The str_ireplace(script, null, ) function disallows the SCRIPT element used in Reflected XSS lab from being executed. However, if you understand how the control works, then you can bypass this control. Your task is to bypass the control by allowing a different SCRIPT element to execute.
To bypass this function, follow these steps:
Refer to reputable sources for an explanation of how the str_ireplace function works.
Research code vulnerability databases to see how others have bypassed this control.
Pentest the site armed with the information learned and the procedure demonstrated in this section.
image035.jpg
Perform these steps prior to pentesting:
Click the START button in the adjoining window.
image002.jpg
Click the Kali workstation icon in the topology.
image009.png
Type root in the Username field and press Enter.
image010.jpg
Type P@ssw0rd into the Password field and press Enter.
image011.jpg
Click on the terminal icon.
image012.jpg
Execute the following command and provide the support users password to establish an SSH session with the backend web server.
root@Hacker:~# ssh support@urbank.com
support@urbank.coms password: P@ssw0rd
Note: The password of P@ssw0rd will not be displayed when you type it for security purposes.
image014L5b.jpg
Execute the following command and provide the sudo password when prompted, to run all the steps prior to this lab.
support@Web:~$ LAB05B
[sudo] password for support: P@ssw0rd
Note: if you submit an incorrect password, then script may only partially run and you may have to restart the session. Also note: you should wait for the script to complete before continuing.
ex setup.PNG
Execute the following command to open index.php into with the nano text editor.
support@Web:~$ sudo nano c /var/www/WebServer/index.php
image028.jpg
Add str_ireplace(script, null, ) to line 15.
image029.jpg
Press and hold the Ctrl key and the x key (Ctrl+x).
image030.jpg
Press the y key.
image031.jpg
Press Enter.
image032.jpg
Click the minimize button on the terminal.
min term.PNG
Click the Iceweasel icon.
image019.jpg
Type urbank.com to the browser's search field and press Enter. Type the query parameter ?myusername= and append your SCRIPT element and press Enter.
pen1_0.PNG
There are two ways to tell if your attack was successful:
If the JavaScript executes
If the complete SCRIPT element is injected

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions