当前位置:网站首页>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 :
边栏推荐
- 第十八届IET交直流输电国际会议(ACDC2022)于线上成功举办
- Display opencv drawn pictures on MFC picture control control
- go-micro教程 — 第二章 go-micro v3 使用Gin、Etcd
- Is it safe for CITIC Securities to open an account online? Is the account opening fee charged
- Master the use of auto analyze in data warehouse
- C# 服务器日志模块
- 整理混乱的头文件,我用include what you use
- 中信证券网上开户安全吗 开户收费吗
- 动态规划股票问题对比
- The 18th IET AC / DC transmission International Conference (acdc2022) was successfully held online
猜你喜欢
CocosCreator事件派发使用
Solution du système de gestion de la chaîne d'approvisionnement du parc logistique intelligent
wuzhicms代码审计
leetcode:421. 数组中两个数的最大异或值
【HCIA持续更新】WLAN工作流程概述
The Ministry of human resources and Social Security announced the new construction occupation
Hidden corners of coder Edition: five things that developers hate most
World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
世界环境日 | 周大福用心服务推动减碳环保
Years of training, towards Kata 3.0! Enter the safe container experience out of the box | dragon lizard Technology
随机推荐
昆明三环闭合工程将经过这些地方,有在你家附近的吗?
斑马识别成狗,AI犯错的原因被斯坦福找到了丨开源
[acwing] 58 weeks 4490 dyeing
解决el-input输入框.number数字输入问题,去掉type=“number“后面箭头问题也可以用这种方法代替
Solution du système de gestion de la chaîne d'approvisionnement du parc logistique intelligent
第十八届IET交直流输电国际会议(ACDC2022)于线上成功举办
[Huawei HCIA continuous update] SDN and FVC
如何实现一个延时队列 ?
Yanwen logistics plans to be listed on Shenzhen Stock Exchange: it is mainly engaged in international express business, and its gross profit margin is far lower than the industry level
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.
Solution of dealer collaboration system in building materials industry: empowering enterprises to build core competitiveness
wuzhicms代码审计
超大规模数仓集群在大型商业银行的落地实践
Is it safe for Bank of China Securities to open an account online?
智慧物流園區供應鏈管理系統解决方案:數智化供應鏈賦能物流運輸行業供應鏈新模式
Great Wall Securities security does not open a securities account
解读数据安全治理能力评估框架2.0,第四批DSG评估征集中
Ble HCI flow control mechanism
整理混乱的头文件,我用include what you use
就在今天丨汇丰4位专家齐聚,共讨银行核心系统改造、迁移、重构难题