当前位置:网站首页>复现assert和eval成功连接或失败连接蚁剑的原因
复现assert和eval成功连接或失败连接蚁剑的原因
2022-08-01 10:13:00 【miracle-boy】
准备工作
1.首先编写一个php文件,写入一句话木马,然后通过Phptudy启动这个网站

2.下载蚁剑工具和burpsuite工具
Burpsuite2021.10安装详细教程_青果@的博客-CSDN博客_burpsuite安装百度网盘链接:链接:https://pan.baidu.com/s/1AKS54jtyN6Ohkt1VDZ0Jiw提取码:v73p下载之后解压,解压之后会有两个文件点击jdk-18_windows-x64_bin.exe进行安装然后对应的安装目录查看是否有jdk的文件打开该文件夹,看是否有jre文件夹,我这里就没有没有jre文件参考大佬的方案:https://blog.csdn.net/qq_41219157/article/details/109667631可以看到jre文件https://blog.csdn.net/weixin_45632448/article/details/125071440GitHub - AntSwordProject/antSword: 中国蚁剑是一款跨平台的开源网站管理工具。AntSword is a cross-platform website management toolkit.中国蚁剑是一款跨平台的开源网站管理工具。AntSword is a cross-platform website management toolkit. - GitHub - AntSwordProject/antSword: 中国蚁剑是一款跨平台的开源网站管理工具。AntSword is a cross-platform website management toolkit.
https://github.com/AntSwordProject/antSword
通过eval进行测试连接
- eval是PHP自身的语言结构,不能被可变函数调用
- PHP 支持可变函数的概念。意味着如果一个变量名后有圆括号,PHP 将寻找与变量的值同名的函数,并且尝试执行它
- eval除非通过自己再去构造一个函数来进行木马传递
1.首先将1中传值为eval,密码为2,尝试构成eval()函数


此时返回数据为空,连接失败,原因是因为eval()是一个语言构造器,他不能使用PHP提供的可变函数来调用
利用assert进行连接
- 与eval不同,因为assert在php中被认为是一个函数
- eval函数中参数是字符,assert函数中参数为表达式 (或者为函数)
- 下面将通过assert()来实现一句话木马,原理和前面类似。
直接使用1=assert&2来作为密码

使用burp suite工具抓包,发现2的值是直接输入的一系列PHP获取文件的函数的字符串
assert()函数的参数不能使字符串,必须是函数才能够执行语句

改变编码方式

抓包,发现此时因为编码方式是base64,所以2处自动调用了eval(base64_decode())进行对PHP的文件相关函数的解码,满足了assert()函数参数必须是函数的条件

尝试使用1=assert 2=eval($_POST[‘3’])的方式传值

此时可变函数为assert(eval($_POST[‘3’]))也满足了assert()参数必须是函数,且eval语句中有可以传递的参数值,所以连接成功
边栏推荐
- EasyRecovery热门免费数据检测修复软件
- Push the local project to the remote repository
- Enterprise WeChat group: robot timing reminder function database configuration
- .NET性能优化-使用SourceGenerator-Logger记录日志
- PDMan-domestic free general database modeling tool (minimalist, beautiful)
- notes....
- 可视化——Superset安装与部署
- Android Security and Protection Policy
- Comprehensive experiment BGP
- Generate certificates using KeyStore
猜你喜欢

企业微信群:机器人定时提醒功能数据库配置化

小程序毕设作品之微信美食菜谱小程序毕业设计成品(2)小程序功能

Google Earth Engine APP——15行代码搞定一个inspector高程监测APP

Enterprise WeChat group: robot timing reminder function database configuration

50.【Application of dynamic two-dimensional array】

rpm and yum

AC与瘦AP的WLAN组网实验

Golang内存分析工具gctrace和pprof实战

Yang Hui Triangle (C language implementation)

Android 安全与防护策略
随机推荐
Basic configuration commands of cisco switches (what is the save command of Huawei switches)
Three chess (C language implementation)
MySQL 必现之死锁
node 格式化时间的传统做法与高级做法(moment)
[Cloud Residency Co-Creation] Huawei Cloud Global Scheduling Technology and Practice of Distributed Technology
高级驾驶辅助系统ADAS简介
How to find out hidden computer software (how to clean up the computer software hidden)
CTFshow,命令执行:web31
Meeting OA (Upcoming Meetings & All Meetings)
Explain / Desc 执行计划分析
Endorsed in 2022 years inventory | product base, science and technology, guangzhou automobile group striding forward
shell脚本------条件测试 if语句和case分支语句
Introduction and application of heap memory (including examples)
SAP ABAP OData 服务如何支持 $orderby (排序)操作试读版
Drawing arrows of WPF screenshot control (5) "Imitation WeChat"
How I secured 70,000 ETH and won a 6 million bug bounty
基于ModelArts的物体检测YOLOv3实践【玩转华为云】
The first experience of Shengsi large model experience platform——Take the small model LeNet as an example
Dataset之mpg:mpg数据集的简介、下载、使用方法之详细攻略
招聘随想2022