HTML Injection - Reflected (GET)
Level: Low
在低级难度,输入数据没有验证
First name:
hello
Last name:
world
也可以注入XSS
Level: Medium
在中级难度,源码中做了简单的字符替换
// Converts only "" to HTLM entities
$input = str_replace("
$input = str_replace(">", ">", $input);
可以通过URL编码绕过
First name: %3Ch1%3Ehello%3C/h1%3E
Last name: %3Ch1%3Eworld%3C/h1%3E
Level: High
在高级难度,使用了htmlspecialchars()函数过滤
return htmlspecialchars($data, ENT_QUOTES, $encoding);
无法直接绕过
HTML Injection - Reflected (POST)
html代码注入到页面中--通过POST方法
各个界别的绕过方法,与GET方法一致,仅仅是提交方式不同
不再列举
HTML Injection - Reflected (URL)
Level: Low
代码中没有过滤
$url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
可以通过 Burp Suite 修改主机头,在路径中加入html代码
GET: /bWAPP/htmli_current_url.php#
hello
Host: hello.world
HTML Injection - Reflected (URL)(Burp Suite)
显示结果:
Level: Medium/High 无法绕过
HTML Injection - Stored (Blog)
Level: Low
直接输入html语句即可:
hello
HTML Injection - Stored (Blog)(Low)
Level: Medium/High
代码已经加过滤:
}
while($row = $recordset->fetch_object())
{
if($_COOKIE["security_level"] == "1" or $_COOKIE["security_level"] == "2")
{
?>
<?php echo $row->id; ?><?php echo $row->owner; ?><?php echo $row->date; ?><?php echo xss_check_3($row->entry); ?>iFrame Injection
Level: Low
查看页面源码,只需闭合iframe标签即可
iFrame Injection
提交URL,ParamUrl,ParamWidth,ParamHeight3个参数适当闭合即可:
比如:
ParamUrl=robots.txt">
hello
iFrame Injectio(Low)
Level: Medium
源码中加入了addslashes,过滤掉单引号‘、双引号“和反斜杠\,但大部分html特殊字符代码依然可以使用
在ParamWidth后面闭合依然有效:
URL路径中,将ParamWith参数改为:
ParamWidth=250">