安装
这里使用的是phpstudy进行搭建的
先下载bWAPP
打开解压之后bWAPP目录下的admin中的settings.php
将数据库连接名和密码改为与phpmyadmin相同的,保存
浏览器访问
点击here
点击
Login
,默认密码bee/bug
A1 - Injection
- HTML Injection - Reflected (GET)
- HTML Injection - Reflected (POST)
- HTML Injection - Reflected (Current URL )
- HTML Injection - Stored (Blog)
- iFrame Injection
- LDAP Injection (Search)
- Mail Header Injection (SMTP)
- OS Command Injection
- OS Command lnjection - Blind
- PHP Code Injection
- Server-Side Includes (SSI) Injection
- SQL Injection (GET/Search)
- SQL Injection (GE' T/Select)
- SQL Injection (POST/Search)
- SQL Injection (POST/Select)
- SQL Injection (AJAX/JSON/jQuery)
- SQL Injection (CAPTCHA)
- SQL Injection (Login Form/Hero)
- SQL Injection (Login Form/User)
- SQL Injection (SQLite)
- SQL Injection (Drupal)
- SQL Injection - Stored (Blog)
- SQL Injection - Stored (SQLite)
- SQL Injection - Stored (User-Agent)
- SQL Injection - Stored (XML)
- SQL Injection - Blind - Boolean-Based
- SQL Injection - Blind - Time _Based
- SQL Injection - Blind (SQLite)
- SQL Injection - Blind (Web Services/SOAP)
- XML/XPath Injection (Login Form)
- XML/XPath Injection (Search)
HTML Injection - Reflected (GET)
HTML注入是指将HTML代码注入到Web服务器响应中,以更改最终用户的内容,也称为跨站点脚本
可以尝试HTML语句或xss注入
low
直接在
First name:
和Last name:
输入框
尝试<script>alert('xss')</script>
medium
同low进行尝试
会发现被全部显示
抓包看一下
会发现符号<>均被编码
0,1,2分别对应三个等级
找见对应的/bWAPP/bwapp/htmli_get.php
文件
三个等级分别要进行不同的检测
还会发现要调用functions_external.php
文件
$input = urldecode($input);
这里使用了urldecode
函数,对字符串进行URL解码,
返回的是已解码的字符串
所以可以在输入框输入编码后的代码
high
同medium一样被全部显示
抓包看看
会发现和medium一样<>均被编码
但是如果尝试在输入框输入编码后的代码并不能成功
htmlspecialchars()
函数把预定义的字符&," ,’ ,<,> 转换为 HTML 实体,是安全的
HTML Injection - Reflected (POST)
操作同HTML Injection - Reflected (GET)一样,只不过是成了post方式
HTML Injection - Reflected (Current URL )
low
要在url中构造语句
发现通过hackbar直接构造的内容会被编码
尝试抓包
将被编码的部分改成正常的
弹窗成功
medium&high
发现同low级别的一样,但当尝试抓包修改为正常的并不能成功
看波源码
找见这个htmli_ current_ url.php
文件后,发现这样的一段代码
还会发现在case"2"
时要进行xss_check_3
的检测
(xss_check_3
见HTML Injection - Reflected (GET)
的high级别)
HTML Injection - Stored (Blog)
low
发现有输入框,尝试一下xss注入
medium
这次虽然显示已经添加,但是并没有弹窗
看源码
functions_external.php
文件
可以看到case"1"
或case"2"
都要进行sqli_check_3
检测
function sqli_check_3($link, $data)
{