简介
在电视家挂掉后,思来想去还是决定自建一套IPTV管理系统,经过一顿查找,终于确定把群晖IPTV
作为替代。但是这玩意只能在群晖里用,于是把这玩意提取出来,整个docker;在调试时发现不少位置存在SQL注入。
环境安装
群晖
- 添加矿神的三方源: https://spk7.imnks.com/
- 找到
群晖iptv管理系统
安装,按照提示安装前置源。
其他设备
docker volume create iptv
docker pull v1st233/iptv:0.9
docker run -d --name iptv_server \
-p <port>:80 \
-v iptv:/var/lib/mysql \
-e PROTOCOL=http<or https> \
-e IPTV_SER_ADDR=<your_host> \
-e IPTV_SER_PORT=<port> \
v1st233/iptv:0.9
# username: admin
# password: password
测试
C:\Users\xx>sqlmap -u http://10.10.220.161/iptv/login.php?id=device123
问题原因
查看iptv/login.php
:
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR);
require_once "aes.php";
require_once "config.php";
$db = Config::GetIntance();
if (isset($_GET['id'])) {
$androidid = $_GET['id'];
$mealid = $db->mGet("iptv_users", "meal", "where deviceid='$androidid'");
$mealname = $db->mGet("iptv_meals", "name", "where id='$mealid'");
echo $mealname;
}
定位mGet
在iptv/config.php:76
:
// 获取单条数据
public function mGet($table, $value, $func = "where 1") {
if ($result = $this->mQuery("SELECT $value FROM $table $func")) {
$row = mysqli_fetch_array($result);
return $row[0];
} else {
return false;
exit("<script>$.alert('mGet数据库有错误!$value,$table,$func');</script>");
}
}
定位$this->mQuery
在iptv/config.php:50
:
// 执行SQL语句
public function mQuery($func) {
if ($result = mysqli_query($this->link, $func)) {
return $result;
} else {
return false;
}
}
没有任何过滤,直接把参数拼接到SQL中了,data.php
等多个文件存在相同问题
用户量
fofa: body="群晖IPTV管理系统"
用户数量: 1,256
修复
docker pull v1st233/iptv:latest
暂无评论 IP地址位置数据由 纯真CZ88 提供支持