当前位置:网站首页>Wuzhicms code audit
Wuzhicms code audit
2022-07-04 17:31:00 【zkzq】
Zero basic hacker , Search official account : White hat left
author : Control security — grapefruit
Environment building
Source download official website :https://www.wuzhicms.com/
Put it here phpstudy The root directory , visit install Path to install .
Access background :
Access the front desk :
Leakage of sensitive information
Hang a link directly in the background :
The code analysis
The front desk sql Inject
Vulnerability analysis
Search for select When Found in mysql.class There is a function in the file select And there is no filtering in the back splicing
Search where this function is called , First of all api In the catalog sms_check It is found in the file that get_one function And the parameters are through the previous $code Splicing .
We can see code First through $GLOBALS To get the parameters param Value As you can see from the previous Introduction $GLOBALS Is available post get Value There is no definition in front of this file param Variable that This param It should be post perhaps get It's what we can control This is also the point that leads to injection
code And through strip_tags function And the function is to strip html label , Filter xss.
After that, the function is directly passed in Continue to further function Because this file also introduced db class .
You can see this get-one In the function It also calls a array2sql Function to handle $where
Let's first look at the function .
You can see that this function is used for filtering . If it's an array This entry if Put the brackets Single quotation marks are filtered out .
If not, go else Filter %20 %27. Then return the parameter , But that's where the filter is There is no protection in place . The parameter we passed is not an array So I didn't go if, and else What is filtered inside is %20 %27.
Although we passed through url Coded however web The server will automatically decode once therefore When we send it to the back-end code, there is no url code .
But the secondary coding is different because web The server decodes only once , If it is secondary coding, here else Filtering works ,return Called get_one Is the first thing I saw mysql.class It's in the document .
Now you can start to construct directly payload 了 From the code analysis, we can see that the quotation marks are closed .
Loophole recurrence
payload:
sms_check.php?param=1%27+or%20extractvalue(1,concat(0x7e,(select%20database)))%23](http://192.168.1.7/wuzhicms/api/sms_check.php?param=1'+or extractvalue(1,concat(0x7e,(select database)))%23)
backstage sql Inject a
Vulnerability analysis
stay www\api\sms_check.php in :
The ginseng param to $code, Then splice directly to sql In the sentence , Lead to sqli:
Loophole recurrence
backstage sql Injection 2
stay eframe\app\promote\admin\index.php in :
obtain $keywords Splice directly to sql In the sentence , Lead to sqli:
Background arbitrary file read 、 Delete
coreframe\app\attachment\admin\index.php in dir Method :
Analyze logic and find , take …/,./,.\,…\ Replace with empty and add / ending , You can bypass by writing more here :
At the same time, it is found that the read file can be deleted , There are deleted links after each .
find del Method :
adopt url After getting the path , Tested ATTACHMENT_URL Parameters , Replace empty ,
define(‘ATTACHMENT_URL’,‘http://www.wuzhicmstest.com/uploadfile/’);// Attachment path
Then there is no other filter , Pass in my_unlink:
To achieve the purpose of deletion .
Logical loopholes
stay \api\uc.php in :
You can call... By passing parameters uc_note Class :
You can change the user name, password, etc .
backstage RCE
Vulnerability analysis
stay coreframe\app\core\libs\function\common.func.php in set_cache Method :
Write content is not filtered , Then search where to call set_cache:
member There are calls in the model .
Find direct access to setting Write cache .
utilize , write in phpinfo:
Loophole recurrence
Backstage access
expand
Global search found , There are many other uses of the same :
边栏推荐
- 智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
- PyTorch深度学习快速入门教程
- Which domestic cloud management platform manufacturer is good in 2022? Why?
- What grade does Anxin securities belong to? Is it safe to open an account
- [template] [Luogu p4630] duathlon Triathlon (round square tree)
- 公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
- [Huawei HCIA continuous update] SDN and FVC
- Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness
- R language plot visualization: plot visualizes overlapping histograms and uses geom at the top edge of the histogram_ The rug function adds marginal rug plots
- [acwing] 58 weeks 4489 Longest subsequence
猜你喜欢
聊聊异步编程的 7 种实现方式
NFT liquidity market security issues occur frequently - Analysis of the black incident of NFT trading platform quixotic
Congratulations to Mr. Zhang Pengfei, chief data scientist of artefact, for winning the campaign Asia tech MVP 2022
解读数据安全治理能力评估框架2.0,第四批DSG评估征集中
[HCIA continuous update] overview of WLAN workflow
Electronic pet dog - what is the internal structure?
一文掌握数仓中auto analyze的使用
公司要上监控,Zabbix 和 Prometheus 怎么选?这么选准没错!
电子元器件B2B商城系统开发:赋能企业构建进销存标准化流程实例
ble HCI 流控机制
随机推荐
C# 服务器日志模块
The company needs to be monitored. How do ZABBIX and Prometheus choose? That's the right choice!
7 RSA密码体制
容器环境minor gc异常频繁分析
[HCIA continuous update] WLAN overview and basic concepts
[acwing] 58 weeks 4490 dyeing
TP configuring multiple databases
祝贺Artefact首席数据科学家张鹏飞先生荣获 Campaign Asia Tech MVP 2022
S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
动态规划股票问题对比
Master the use of auto analyze in data warehouse
[unity ugui] scrollrect dynamically scales the grid size and automatically locates the middle grid
智慧物流园区供应链管理系统解决方案:数智化供应链赋能物流运输行业供应链新模式
智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
VSCode修改缩进不成功,一保存就缩进四个空格
雨量预警广播自动化数据平台BWII 型广播预警监测仪
Firewall basic transparent mode deployment and dual machine hot standby
就在今天丨汇丰4位专家齐聚,共讨银行核心系统改造、迁移、重构难题
Zhijieyun - meta universe comprehensive solution service provider