<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                1.存儲型XSS與反射型XSS有什么區別? 1、存儲型XSS是持久化,反射型式非持久化。 2、危害更大 2.前臺代碼html ``` <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <head> <title>存儲型xss測試頁面</title> </head> <div > <form name="xx" action="store.php" method="GET"> <p>填寫你的個人信息</p> <tr><td>姓名:<td><td><input type="text" name="name"></td></tr><br> <tr><td>愛好:<td><td><input type="text" name="interest"></td></tr> <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <input type="submit" value="提交"> </form> <form name="xx" action="find_store.php" method="GET"> <p>查詢個人信息</p> <tr><td>姓名:<td><td><input type="text" name="name"></td></tr><br> <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; <input type="submit" value="查詢"> </form> </div> </html> ``` 3.保存提交信息 ``` <?php error_reporting(0); $name = $_GET["name"]; $interest = $_GET["interest"]; //連接服務器 $conn = mysql_connect("127.0.0.1","root","root"); //打開數據庫 mysql_select_db("xss",$conn); //執行SQL mysql_query("set names 'utf8'"); $sql_insert = "insert into xss(name,interest) values('$name','$interest')"; $result = mysql_query($sql_insert,$conn); echo 'success!!'; ?> ``` 4.查詢信息 ``` <?php error_reporting(0); $name = $_GET["name"]; //連接服務器 $conn = mysql_connect("127.0.0.1","root","root"); //打開數據庫 mysql_select_db("xss",$conn); //執行SQL mysql_query("set names 'utf8'"); $sql_select = "select * from xss where name like '%".$name."%'"; $results = mysql_fetch_array(mysql_query($sql_select)); ?> <html> <?php echo $results[name].'<br>'; echo $results[interest]; ?> </html> ``` 5.str_replace、 mysql_real_escape_string方法介紹 ![](https://img.kancloud.cn/ff/1d/ff1d63c431e211275ade8a9e71c327ec_819x279.png) 6.存儲型xss漏洞修復方案 1、插入攔截器,對輸入內容進行過濾。 ``` str_replace('<script>',?'',?$_GET['name’]); str_replace('<script>',?'',?$_GET['interest’]); $name?=?mysql_real_escape_string($name); ``` 2、采用安全的API ``` htmlspecialchars($_GET['name']); $name?=?mysql_real_escape_string($name); ``` htmlspecialchars定義和用法 htmlspecialchars() 函數把預定義的字符轉換為 HTML 實體。 預定義的字符是: & (和號)成為 & " (雙引號)成為 " ' (單引號)成為 ' < (小于)成為 < > (大于)成為 > 3、將輸出的內容進行過濾。 ``` str_replace('<script>',?'',?$_GET['name’]); htmlspecialchars($_GET['name']); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看