How to temporarily disable XSS protection in modern browsers for testing?

后端 未结 7 432
一向
一向 2021-01-31 08:35

Is it possible to temporarily disable the XSS protection found in modern browsers for testing purposes?

I\'m trying to explain to a co-worker what happens when one sends

相关标签:
7条回答
  • 2021-01-31 09:15

    You can redirect the user to another local web page when the form is submitted and print the infected data. Chrome will not detect that.

    Hint: You can use sessions / cookies to store the infected data between the 2 pages.

    Example in PHP:

    index.php

    <?php    
        setcookie('infected', $_POST['infected']);
    
        if($_POST['infected'])
            header('location: show.php');
    ?>
    
    <form action="index.php" method="POST" />
        <p>
            Username: <input type="text" name="infected" />
            <input type="submit" value="Add Comment" />
        </p>
    </form>
    

    show.php

    echo $_COOKIE['data'];
    
    0 讨论(0)
提交回复
热议问题