通用代码审计思路


通用代码审计思路

一、敏感函数回溯参数过程

 

二、通读全文代码

骑士CMS   宽子节注入,深入了解/php双引号,配置文件,代码执行?

1.查看应用文件结构

api,admin,manage,include

2.查看关键文件代码

common.func.php, 过滤函数,addslashes() , XSS过滤函数mystrip_tags() ,new_html_special_chars(), remove_xss() , getip() , SQL查询统一操作函数 inserttable() updatetable() ,wheresql() , 令牌生成函数 asyn_userkey()

3.查看配置文件

config.php , cache_config.php , 双引号解析代码执行问题,DBCHARSE宽子节注入问题,senamegbk

4.跟读首页文件

5.跟进其它功能入口文件

 

三、根据功能点定向审计

文件上传功能

任意文件上传,文件名SQL注入

文件管理功能

任意文件读取,XSS

登录认证功能

任意用户登录,越权

找回密码功能

验证码爆破,验证凭证算法是否可信


public function isOpenMethod($module, $method)
{
if($module == ‘user’ and strpos(‘login|logout|deny|reset’, $method) !== false) return true;
if($module == ‘api’ and $method == ‘getsessionid’) return true;
if($module == ‘misc’ and $method == ‘ping’) return true;
if($module == ‘misc’ and $method == ‘checktable’) return true;
if($module == ‘misc’ and $method == ‘qrcode’) return true;
if($module == ‘misc’ and $method == ‘about’) return true;
if($module == ‘misc’ and $method == ‘checkupdate’) return true;
if($module == ‘misc’ and $method == ‘changelog’) return true;
if($module == ‘sso’ and $method == ‘login’) return true;
if($module == ‘sso’ and $method == ‘logout’) return true;
if($module == ‘sso’ and $method == ‘bind’) return true;
if($module == ‘sso’ and $method == ‘gettodolist’) return true;
if($module == ‘block’ and $method == ‘main’) return true;
if($this->loadModel(‘user’)->isLogon() or ($this->app->company->guest and $this->app->user->account == ‘guest’))
{
if(stripos($method, ‘ajax’) !== false) return true;
if(stripos($method, ‘downnotify’) !== false) return true;
if($module == ‘tutorial’) return true;
if($module == ‘block’) return true;
if($module == ‘product’ and $method == ‘showerrornone’) return true;
}
return false;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值