diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..64a3c4b --- /dev/null +++ b/admin.php @@ -0,0 +1,562 @@ + + + + + + + SecHub - 管理登录 + + +
+

🔐 SecHub 管理后台

+ +
+ +
+
+ + +
+ +
+
+ + + syncJsonToDatabase(); + + } catch (Exception $e) { + $message = '保存失败: ' . $e->getMessage(); + } +} + +// 处理删除数据库 +if (isset($_POST['delete_db'])) { + if (file_exists($dbPath)) { + unlink($dbPath); + $success = true; + $message = '数据库已删除!刷新页面后将重新创建。'; + } else { + $message = '数据库文件不存在。'; + } +} + +// 获取所有JSON文件信息 +$jsonFiles = glob($jsonDir . '*.json'); +$fileInfos = []; + +foreach ($jsonFiles as $filePath) { + $filename = basename($filePath); + $content = file_get_contents($filePath); + $data = json_decode($content, true); + + if (json_last_error() === JSON_ERROR_NONE && is_array($data) && !empty($data)) { + $firstItem = $data[0]; + $fileInfos[] = [ + 'filename' => $filename, + 'section' => $firstItem['section'] ?? pathinfo($filename, PATHINFO_FILENAME), + 'no' => $firstItem['no'] ?? 0, + 'item_count' => count($data) - 1 // 减去第一个配置项 + ]; + } +} + +// 按当前 no 排序 +usort($fileInfos, function($a, $b) { + return $a['no'] - $b['no']; +}); +?> + + + + + + + + SecHub - 排序管理 + + + +
+
+
+

📊 SecHub 排序管理

+

调整栏目显示顺序

+
+ +
+ + +
+ ✅ +
+ +
+ ⚠️ +
+ + +
+ 💡 提示:拖动行左侧的 ⋮⋮ 图标来调整顺序,序号会自动更新。修改后点击“保存排序”按钮即可生效。 +
+ +
+
+ + + + + + + + + + + + $info): ?> + + + + + + + + + +
序列文件名称项目名称内容条数
+ ⋮⋮ + + + + + + + + 个工具 +
+ + + + +
+ + +
+
+
+
+ + + + diff --git a/assets/db/sechub.db b/assets/db/sechub.db deleted file mode 100644 index 8c6ee02..0000000 Binary files a/assets/db/sechub.db and /dev/null differ diff --git a/assets/json/blue.json b/assets/json/blue.json index 6e72a90..92887af 100644 --- a/assets/json/blue.json +++ b/assets/json/blue.json @@ -1,5 +1,6 @@ [ { + "no": 2, "section": "甲方/蓝队工具" }, { @@ -21,5 +22,10 @@ "name": "AppScan", "url": "https://github.com/TongchengOpenSource/AppScan", "description": "企业级自动化App隐私合规检测工具" + }, + { + "name": "蓝队工具箱", + "url": "http://github.com/abc123info/BlueTeamTools", + "description": "蓝队分析研判工具箱(小工具集)" } -] \ No newline at end of file +] diff --git a/assets/json/collection.json b/assets/json/collection.json index e892292..c94d75d 100644 --- a/assets/json/collection.json +++ b/assets/json/collection.json @@ -1,5 +1,6 @@ [ { + "no": 1, "section": "合集/导航" }, { @@ -17,4 +18,4 @@ "url": "https://git.masonliu.com/MasonLiu/SecHub", "description": "由本人开发的网安工具集网站" } -] \ No newline at end of file +] diff --git a/assets/json/info.json b/assets/json/info.json new file mode 100644 index 0000000..2608556 --- /dev/null +++ b/assets/json/info.json @@ -0,0 +1,46 @@ +[ + { + "no": 5, + "section": "信息收集" + }, + { + "name": "ENScan Go", + "url": "https://github.com/wgpsec/ENScan_GO", + "description": "一键收集控股公司ICP备案、APP、小程序、微信公众号等信息聚合导出" + }, + { + "name": "EHole(棱洞)", + "url": "https://github.com/EdgeSecurityTeam/EHole", + "description": "快速/高效的网站指纹识别组件,搭配子域名挖掘程序更好用" + }, + { + "name": "Subfinder", + "url": "https://github.com/projectdiscovery/subfinder", + "description": "子域名资产收集发现程序,可以发现更多的隐藏资产" + }, + { + "name": "Masscan", + "url": "https://github.com/robertdavidgraham/masscan", + "description": "快速的网络端口扫描工具" + }, + { + "name": "nmap", + "url": "https://nmap.org/", + "description": "经典网络端口扫描工具" + }, + { + "name": "RustScan", + "url": "https://github.com/bee-san/RustScan", + "description": "Rust编写的高速网络端口扫描工具" + }, + { + "name": "JSFinder", + "url": "https://github.com/Threezh1/JSFinder", + "description": "提取网站文件中的域名信息" + }, + { + "name": "LinkFinder", + "url": "https://github.com/GerbenJavado/LinkFinder", + "description": "提取网站文件中的路径信息" + } +] diff --git a/assets/json/intranet.json b/assets/json/intranet.json index 7149d2f..9e345b2 100644 --- a/assets/json/intranet.json +++ b/assets/json/intranet.json @@ -1,5 +1,6 @@ [ { + "no": 8, "section": "内网渗透工具" }, { @@ -46,5 +47,10 @@ "name": "Pillager", "url": "https://github.com/qwqdanchun/Pillager", "description": "适用于后渗透期间的信息收集工具" + }, + { + "name": "Mimikatz", + "url": "https://github.com/gentilkiwi/mimikatz", + "description": "获取目标机器权限后提取密码哈希值" } -] \ No newline at end of file +] diff --git a/assets/json/mobile.json b/assets/json/mobile.json index 71054e0..c687979 100644 --- a/assets/json/mobile.json +++ b/assets/json/mobile.json @@ -1,5 +1,6 @@ [ { + "no": 11, "section": "移动端渗透工具" }, { @@ -12,4 +13,4 @@ "url": "https://github.com/frida/frida", "description": "移动端内核Hook工具" } -] \ No newline at end of file +] diff --git a/assets/json/other.json b/assets/json/other.json new file mode 100644 index 0000000..9513dff --- /dev/null +++ b/assets/json/other.json @@ -0,0 +1,16 @@ +[ + { + "no": 13, + "section": "其他" + }, + { + "name": "红队安防守则", + "url": "https://github.com/qingluoyu/Pentest_baseline", + "description": "红队反溯源基线核查手册" + }, + { + "name": "f8x", + "url": "https://github.com/ffffffff0x/f8x", + "description": "红/蓝队环境自动化部署工具,支持多种场景" + } +] diff --git a/assets/json/plugin.json b/assets/json/plugin.json index 68e7473..e8767fe 100644 --- a/assets/json/plugin.json +++ b/assets/json/plugin.json @@ -1,6 +1,7 @@ [ { - "section": "插件/非工具" + "no": 12, + "section": "插件/非独立工具" }, { "name": "HaE", @@ -11,5 +12,10 @@ "name": "BurpCrypto", "url": "https://github.com/whwlsfb/BurpCrypto", "description": "支持多种加密算法或直接执行JS代码的用于爆破前端加密的BurpSuite插件" + }, + { + "name": "FindSomething", + "url": "https://github.com/momosecurity/FindSomething", + "description": "浏览器用JS信息搜寻插件" } -] \ No newline at end of file +] diff --git a/assets/json/poc.json b/assets/json/poc.json index 0d6c1c9..08fe323 100644 --- a/assets/json/poc.json +++ b/assets/json/poc.json @@ -1,12 +1,8 @@ [ { + "no": 7, "section": "POC/EXP" }, - { - "name": "CVE-2026-31431", - "url": "https://copy.fail/", - "description": "基于复制功能的Linux系统提权漏洞" - }, { "name": "MS17-010检测工具", "url": "https://github.com/TeskeVirtualSystem/MS17010Test", @@ -22,4 +18,4 @@ "url": "https://github.com/Dliv3/redis-rogue-server", "description": "Redis未授权访问漏洞利用工具(Redis 4.x/5.x RCE)" } -] \ No newline at end of file +] diff --git a/assets/json/proxy.json b/assets/json/proxy.json index f945598..3730b05 100644 --- a/assets/json/proxy.json +++ b/assets/json/proxy.json @@ -1,5 +1,6 @@ [ { + "no": 10, "section": "代理工具/集成平台" }, { @@ -27,4 +28,4 @@ "url": "https://www.proxifier.com/", "description": "功能强大的网络代理工具,支持HTTP/HTTPS/SOCKS代理" } -] \ No newline at end of file +] diff --git a/assets/json/right.json b/assets/json/right.json new file mode 100644 index 0000000..efe4ee5 --- /dev/null +++ b/assets/json/right.json @@ -0,0 +1,21 @@ +[ + { + "no": 9, + "section": "提权" + }, + { + "name": "Windows", + "url": "https://github.com/SecWiki/windows-kernel-exploits", + "description": "Windows提权工具集" + }, + { + "name": "Linux", + "url": "https://github.com/SecWiki/linux-kernel-exploits", + "description": "Linux提权工具集" + }, + { + "name": "CVE-2026-31431", + "url": "https://copy.fail/", + "description": "基于复制功能的Linux系统提权漏洞" + } +] diff --git a/assets/json/scanner.json b/assets/json/scanner.json index cb67e87..4e03dde 100644 --- a/assets/json/scanner.json +++ b/assets/json/scanner.json @@ -1,5 +1,6 @@ [ { + "no": 4, "section": "多功能扫描器" }, { @@ -37,4 +38,4 @@ "url": "https://gobies.org/", "description": "自动化漏洞扫描工具,建议自行上网搜索红队破解版" } -] \ No newline at end of file +] diff --git a/assets/json/shell.json b/assets/json/shell.json index 4d5f70d..55934b4 100644 --- a/assets/json/shell.json +++ b/assets/json/shell.json @@ -1,14 +1,15 @@ [ { + "no": 3, "section": "Shell管理工具" }, { - "name": "AntSword蚁剑", + "name": "AntSword(蚁剑)", "url": "https://github.com/AntSwordProject/antSword", "description": "AntSword蚁剑是一个功能强大的Shell管理工具,尤其是在PHP场景下" }, { - "name": "Godzilla哥斯拉", + "name": "Godzilla(哥斯拉)", "url": "https://github.com/BeichenDream/Godzilla", "description": "多语言支持的强大Shell管理工具" }, @@ -21,5 +22,10 @@ "name": "ShellcodeLoader", "url": "https://github.com/knownsec/shellcodeloader", "description": "shell免杀加密程序" + }, + { + "name": "Metasploit", + "url": "https://github.com/rapid7/metasploit-framework", + "description": "超级漏洞利用框架" } -] \ No newline at end of file +] diff --git a/assets/json/tools.json b/assets/json/tools.json index f77189e..359c5a7 100644 --- a/assets/json/tools.json +++ b/assets/json/tools.json @@ -1,5 +1,6 @@ [ { + "no": 6, "section": "外网/打点工具" }, { @@ -17,29 +18,14 @@ "url": "https://github.com/sqlmapproject/sqlmap", "description": "主流的强大SQL注入神器" }, - { - "name": "ENScan Go", - "url": "https://github.com/wgpsec/ENScan_GO", - "description": "一键收集控股公司ICP备案、APP、小程序、微信公众号等信息聚合导出" - }, { "name": "dddd", "url": "https://github.com/SleepingBag945/dddd", "description": "用法简单的批量信息收集,供应链漏洞探测工具" }, - { - "name": "EHole(棱洞)", - "url": "https://github.com/EdgeSecurityTeam/EHole", - "description": "快速/高效的网站指纹识别组件,搭配子域名挖掘程序更好用" - }, - { - "name": "Subfinder", - "url": "https://github.com/projectdiscovery/subfinder", - "description": "子域名资产收集发现程序,可以发现更多的隐藏资产" - }, { "name": "MDUT", "url": "https://github.com/SafeGroceryStore/MDUT", "description": "支持大量类型的数据库管理工具" } -] \ No newline at end of file +] diff --git a/assets/template.json b/assets/template.json index 64adc9b..0357bc7 100644 --- a/assets/template.json +++ b/assets/template.json @@ -1,5 +1,6 @@ [ { + "no": "0", "section": "栏目名称" }, { @@ -8,13 +9,8 @@ "description": "工具描述" }, { - "name": "工具名称", - "url": "工具链接", - "description": "工具描述" - }, - { - "name": "工具名称", - "url": "工具链接", - "description": "工具描述" + "name": "", + "url": "", + "description": "" } ] \ No newline at end of file diff --git a/db.php b/db.php index 8e984c7..6d037a9 100644 --- a/db.php +++ b/db.php @@ -66,6 +66,7 @@ class SecHubDatabase { id INTEGER PRIMARY KEY AUTOINCREMENT, json_filename TEXT UNIQUE NOT NULL, table_name TEXT NOT NULL, + section_no INTEGER DEFAULT 0, last_sync_time DATETIME NOT NULL, json_file_mtime INTEGER NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP @@ -115,6 +116,9 @@ class SecHubDatabase { return; } + // 获取排序号(从第一个数据项的 no 字段) + $sectionNo = $data[0]['no'] ?? 0; + // 创建或更新表 $this->createTable($tableName, $data[0]); @@ -127,14 +131,14 @@ class SecHubDatabase { $this->insertItem($tableName, $item, $data[0]['section'] ?? $tableName); } - // 更新同步日志 - $this->updateSyncLog($filename, $tableName); + // 更新同步日志(包含排序号) + $this->updateSyncLog($filename, $tableName, $sectionNo); } /** * 更新同步日志 */ - private function updateSyncLog($filename, $tableName) { + private function updateSyncLog($filename, $tableName, $sectionNo = 0) { $jsonFile = $this->jsonDir . $filename; $jsonModified = filemtime($jsonFile); $syncTime = date('Y-m-d H:i:s'); @@ -148,20 +152,22 @@ class SecHubDatabase { if ($exists) { // 更新现有记录 $sql = "UPDATE json_sync_log - SET table_name = :table_name, + SET table_name = :table_name, + section_no = :section_no, last_sync_time = :sync_time, json_file_mtime = :mtime WHERE json_filename = :filename"; } else { // 插入新记录 - $sql = "INSERT INTO json_sync_log (json_filename, table_name, last_sync_time, json_file_mtime) - VALUES (:filename, :table_name, :sync_time, :mtime)"; + $sql = "INSERT INTO json_sync_log (json_filename, table_name, section_no, last_sync_time, json_file_mtime) + VALUES (:filename, :table_name, :section_no, :sync_time, :mtime)"; } $stmt = $this->db->prepare($sql); $stmt->execute([ ':filename' => $filename, ':table_name' => $tableName, + ':section_no' => $sectionNo, ':sync_time' => $syncTime, ':mtime' => $jsonModified ]); @@ -344,6 +350,15 @@ class SecHubDatabase { foreach ($tables as $table) { $tableName = $table['name']; + + // 从同步日志中获取排序号 + $sql = "SELECT section_no FROM json_sync_log WHERE table_name = :table_name LIMIT 1"; + $stmt = $this->db->prepare($sql); + $stmt->execute([':table_name' => $tableName]); + $log = $stmt->fetch(); + $sectionNo = $log ? $log['section_no'] : 0; + + // 获取栏目名称 $sql = "SELECT DISTINCT section FROM {$tableName} LIMIT 1"; $stmt = $this->db->query($sql); $row = $stmt->fetch(); @@ -351,11 +366,17 @@ class SecHubDatabase { if ($row) { $sections[$tableName] = [ 'title' => $row['section'], - 'table' => $tableName + 'table' => $tableName, + 'no' => $sectionNo ]; } } + // 按 no 字段排序 + uasort($sections, function($a, $b) { + return ($a['no'] ?? 0) - ($b['no'] ?? 0); + }); + return $sections; }