PHPOK结合CSRF(GET型) - GETSHELL

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

### 简要描述: PHPOK 输入过滤做的还是不错的,输入参数都做了 addslashes 转义; addslashes 在某些场景起不到安全防护作用,这里借PHPOK举个栗子。 ### 详细说明: getshell利用的是include方法过滤不严的缺陷,代码如下: 文件 framework/www/payment_control.php :submit方法 ``` function submit_f() { $rs = $this->auth_check(); ... $payment = $this->get('payment','int'); ... // 取数据库表 qinggan_payment 的数据 $payment_rs = $this->model('payment')->get_one($payment); // $payment_rs['code']即上述表 qinggan_payment 的code字段数据 $file = $this->dir_root.'payment/'.$payment_rs['code'].'/submit.php'; if(!is_file($file)) { error(P_Lang('支付接口异常,请检查'),$error_url,'error'); } // 包含$file文件 include_once($file); ``` include参数$file参数是可控的,来自于数据库表qinggan_payment的code字段,我们继续跟这个字段是否可控。 文件 framework/admin/payment_control.php : save方法 ``` function save_f() { $gid = $this->get('gid','int'); // ($_GET或$_POST)外部传code值,会对敏感字符做addslashes $code = $this->get('code'); $id = $this->get('id','int'); ... $data = array('title'=>$title,'code'=>$code,'gid'=>$gid); ... // 数据存入db,上面的get方法传入的code值存入数据库表...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息