当前位置:网站首页>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 :





边栏推荐
- 金额计算用 BigDecimal 就万无一失了?看看这五个坑吧~~
- VSCode修改缩进不成功,一保存就缩进四个空格
- Is it safe to open an account online
- 被PMP考试“折磨”出来的考试心得,值得你一览
- MD5加密的两种方式
- Hidden corners of coder Edition: five things that developers hate most
- Using win10 scheduling task program to automatically run jar package at fixed time
- 矿产行业商业供应链协同系统解决方案:构建数智化供应链平台,保障矿产资源安全供应
- VB cannot access database stocks
- 一文掌握数仓中auto analyze的使用
猜你喜欢

电子宠物小狗-内部结构是什么?

【云原生】服务网格是什么“格”?

Understand ThreadLocal in one picture

【Unity UGUI】ScrollRect 动态缩放格子大小,自动定位到中间的格子

什么是低代码开发?

VB cannot access database stocks

"Cannot initialize Photoshop because the temporary storage disk is full" graphic solution

Capvision Rongying's prospectus in Hong Kong was "invalid": it was strictly questioned by the CSRC and required supplementary disclosure

解读数据安全治理能力评估框架2.0,第四批DSG评估征集中

斑马识别成狗,AI犯错的原因被斯坦福找到了丨开源
随机推荐
tx.origin安全问题总结
Understand ThreadLocal in one picture
安信证券属于什么档次 开户安全吗
容器环境minor gc异常频繁分析
kaili不能输入中文怎么办???
缓存穿透、缓存击穿、缓存雪崩分别是什么
CocosCreator事件派發使用
Developers, MySQL column finish, help you easily from installation to entry
中银证券网上开户安全吗?
La 18e Conférence internationale de l'IET sur le transport d'électricité en courant alternatif et en courant continu (acdc2022) s'est tenue avec succès en ligne.
NFT流动性市场安全问题频发—NFT交易平台Quixotic被黑事件分析
PingCode 性能测试之负载测试实践
wuzhicms代码审计
[HCIA continuous update] overview of WLAN workflow
S2b2b solution for lighting industry: efficiently enable the industrial supply chain and improve the economic benefits of enterprises
整理混乱的头文件,我用include what you use
C# 更加优质的操作MongoDB数据库
开发者,MySQL专栏完更,助你轻松从安装到入门进阶
R language plot visualization: plot visualization of multiple variable violin plot in R with plot
Embedded software architecture design - function call