HTML injection-reflected (GET)
Enter the interface,
HTML tag Injection
Low level is not protected
1 functionHtmli ($data)2 {3 4 Switch($_cookie["Security_level"])5 {6 7 Case"0":8 9 $data= No_check ($data); Ten Break; One A Case"1": - - $data= Xss_check_1 ($data); the Break; - - Case"2": - + $data= Xss_check_3 ($data); - Break; + A default: at - $data= No_check ($data); - Break;; - - } - in return $data; - to } + -<label>set your security level:</label><br/> the *<select name= "Security_level" > $ Panax Notoginseng<option value= "0" >low</option> -<option value= "1" >medium</option> the<option value= "2" >high</option> + A</select>
This is the core code
1<div id= "Main" >2 34 5<p>enter your first and last name:</p>6 7<form action= "<?php Echo ($_server["Script_name"]);? > "method=" GET ">8 9<p><label for= "FirstName" >first name:</label><br/>Ten<input type= "text" id= "FirstName" name= "FirstName" ></p>//first Name box One A<p><label for= "LastName" >last name:</label><br/>//last Name box -<input type= "text" id= "LastName" Name= "LastName" ></p> - the<button type= "Submit" name= "form" value= "submit" >Go</button>//Button label - -</form> - +<br/> -<?PHP + A if(isset($_get["FirstName"]) &&isset($_get["LastName"])//Get the FirstName and Lastname,isset detection of form delivery in the Get mode is present at { - - $firstname=$_get["FirstName"]; Accept Parameters - $lastname=$_get["LastName"]; - - if($firstname= = "" or$lastname== "")//If one of them is empty, the bottom content is displayed in { - to Echo"<font color=\" red\ ">please enter both fields...</font>"; + - } the * Else $ { Panax Notoginseng - Echo"Welcome". Htmli ($firstname) . " " . Htmli ($lastname); Without any filtering, show it directly the + } A the } + -?> $ $</div>
can <script> tags add XSS
Bwapp--low--html injection-reflected (GET)