没有合适的资源?快使用搜索试试~ 我知道了~
PHPOK 5.3 最新版前台注入 - 先知社区1
需积分: 0 0 下载量 64 浏览量
2022-08-03
12:40:46
上传
评论
收藏 6.69MB PDF 举报
温馨提示
试读
15页
注入点:// 176行// sqlext变量转义取消// 拼接sqlext的值的函数只有_userlist、_arc_condition_single、_arc
资源详情
资源评论
资源推荐
/
PHPOK 5.3 最新版前台注入 - 先知社区
最近继续跟了一下新版的 phpok,结果撞洞了,这里分享一下思路
最新版下载地址: https://www.phpok.com/phpok.html (https://www.phpok.com/phpok.html)
底层获取参数: $this->get() 方法
framework/init.php#get
final public function get($id,$type="safe",$ext="")
{
// PGC全局获取
$val = isset($_POST[$id]) ? $_POST[$id] : (isset($_GET[$id]) ? $_GET[$id] : (isset($_COOKIE[$id]) ?
$_COOKIE[$id] : ''));
if($val == ''){
if($type == 'int' || $type == 'intval' || $type == 'float' || $type == 'floatval'){
return 0;
}else{
return '';
}
}
//判断内容是否有转义,所有未转义的数据都直接转义
$addslashes = false;
if(f ti i t (" t i t ") && t i t ()){
先知社区,先知安全技术社区
“
注入点分析
/
if(function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()){
$addslashes = true;
}
if(!$addslashes){
$val = $this->_addslashes($val);
}
return $this->format($val,$type,$ext);
}
跟进 format 函数:framework/init.php#format
final public function format($msg,$type="safe",$ext="")
{
if($msg == ""){
return '';
}
if(is_array($msg)){
foreach($msg as $key=>$value){
if(!is_numeric($key)){
$key2 = $this->format($key);
if($key2 == '' || in_array($key2,array('#','&','%'))){
unset($msg[$key]);
continue;
}
}
$msg[$key] = $this->format($value,$type,$ext);
}
if($msg && count($msg)>0){
return $msg;
}
return false;
}
if($type == 'html_js' || ($type == 'html' && $ext)){
$msg = stripslashes($msg);
if($this->app_id != 'admin'){
$msg = $this->lib('string')->xss_clean($msg);
}
$msg = $this->lib('string')->clear_url($msg,$this->url);
return addslashes($msg);
/
return addslashes($msg);
}
// 转义去除
$msg = stripslashes($msg);
//格式化处理内容
switch ($type){
case 'safe_text':
$msg = strip_tags($msg);
$msg = str_replace(array("\\","'",'"',"<",">"),'',$msg);
break;
case 'system':
$msg = !preg_match("/^[a-zA-Z][a-z0-9A-Z\_\-]+$/u",$msg) ? false : $msg;
break;
case 'id':
$msg = !preg_match("/^[a-zA-Z][a-z0-9A-Z\_\-]+$/u",$msg) ? false : $msg;
break;
case 'checkbox':
$msg = strtolower($msg) == 'on' ? 1 : $this->format($msg,'safe');
break;
case 'int':
$msg = intval($msg);
break;
case 'intval':
$msg = intval($msg);
break;
case 'float':
$msg = floatval($msg);
break;
case 'floatval':
$msg = floatval($msg);
break;
case 'time':
$msg = strtotime($msg);
break;
case 'html':
$msg = $this->lib('string')->safe_html($msg,$this->url);
break;
case 'func':
$msg = function_exists($ext) ? $ext($msg) : false;
break;
case 'text':
$ t i t ($ )
剩余14页未读,继续阅读
df595420469
- 粉丝: 24
- 资源: 310
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0