diff --git a/assets/css/style.css b/assets/css/style.css index 0c32de1..09973ef 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -157,25 +157,25 @@ body.dark-mode .search-result-title { .theme-toggle { position: absolute; - right: 20px; + right: 65px; top: 20px; background: white; - border: 2px solid #e2e8f0; + border: 1px solid #e2e8f0; border-radius: 50%; - width: 45px; - height: 45px; + width: 40px; + height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; - font-size: 1.3rem; + font-size: 1.2rem; transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); } .theme-toggle:hover { transform: scale(1.1); - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); border-color: #4299e1; } @@ -188,6 +188,75 @@ body.dark-mode .theme-toggle:hover { border-color: #63b3ed; } +/* 视图切换按钮 */ +.view-toggle { + position: absolute; + right: 15px; + top: 20px; + background: white; + border: 1px solid #e2e8f0; + border-radius: 50%; + width: 40px; + height: 40px; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + font-size: 1.2rem; + transition: all 0.3s ease; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); +} + +.view-toggle:hover { + transform: scale(1.1); + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); + border-color: #4299e1; +} + +body.dark-mode .view-toggle { + background: #2d3748; + border-color: #4a5568; +} + +body.dark-mode .view-toggle:hover { + border-color: #63b3ed; +} + +.view-tooltip { + position: absolute; + bottom: -35px; + left: 50%; + transform: translateX(-50%) translateY(-10px); + background: rgba(0, 0, 0, 0.85); + color: #fff; + padding: 6px 12px; + border-radius: 6px; + font-size: 0.8rem; + white-space: nowrap; + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; + pointer-events: none; + z-index: 1000; +} + +.view-tooltip::before { + content: ''; + position: absolute; + top: -6px; + left: 50%; + transform: translateX(-50%); + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid rgba(0, 0, 0, 0.85); +} + +.view-toggle:hover .view-tooltip { + opacity: 1; + visibility: visible; + transform: translateX(-50%) translateY(0); +} + .theme-tooltip { position: absolute; bottom: -35px; @@ -560,7 +629,7 @@ body.dark-mode .beian-divider { width: 40px; height: 40px; font-size: 1.1rem; - right: 10px; + right: 65px; top: 10px; } @@ -570,6 +639,20 @@ body.dark-mode .beian-divider { bottom: -32px; } + .view-toggle { + width: 40px; + height: 40px; + font-size: 1.1rem; + right: 10px; + top: 10px; + } + + .view-tooltip { + font-size: 0.75rem; + padding: 5px 10px; + bottom: -32px; + } + .section-header { flex-direction: column; align-items: flex-start; diff --git a/assets/db/sechub.db b/assets/db/sechub.db deleted file mode 100644 index 54ff8ba..0000000 Binary files a/assets/db/sechub.db and /dev/null differ diff --git a/assets/json/collection.json b/assets/json/collection.json new file mode 100644 index 0000000..e892292 --- /dev/null +++ b/assets/json/collection.json @@ -0,0 +1,20 @@ +[ + { + "section": "合集/导航" + }, + { + "name": "404星链计划", + "url": "https://github.com/knownsec/404StarLink", + "description": "知道创宇404实验室网安工具收集册" + }, + { + "name": "Vulhub", + "url": "https://github.com/vulhub/vulhub", + "description": "基于Docker的漏洞复现工程,也可以在其中搜寻漏洞利用脚本" + }, + { + "name": "Sechub", + "url": "https://git.masonliu.com/MasonLiu/SecHub", + "description": "由本人开发的网安工具集网站" + } +] \ No newline at end of file diff --git a/assets/json/intranet.json b/assets/json/intranet.json new file mode 100644 index 0000000..0ae340b --- /dev/null +++ b/assets/json/intranet.json @@ -0,0 +1,25 @@ +[ + { + "section": "内网渗透工具" + }, + { + "name": "Suo5", + "url": "https://github.com/zema1/suo5", + "description": "高性能网站代理脚本" + }, + { + "name": "FRP", + "url": "https://github.com/fatedier/frp", + "description": "一个快速反向代理工具" + }, + { + "name": "fscan", + "url": "https://github.com/shadow1ng/fscan", + "description": "内网高速扫描工具(易被发现)" + }, + { + "name": "fscan结果美化工具", + "url": "https://github.com/ZororoZ/fscanOutput", + "description": "fscan结果美化工具" + } +] \ No newline at end of file diff --git a/assets/json/mobile.json b/assets/json/mobile.json new file mode 100644 index 0000000..71054e0 --- /dev/null +++ b/assets/json/mobile.json @@ -0,0 +1,15 @@ +[ + { + "section": "移动端渗透工具" + }, + { + "name": "Magisk", + "url": "https://github.com/topjohnwu/Magisk", + "description": "安卓root工具,一代神器" + }, + { + "name": "Frida", + "url": "https://github.com/frida/frida", + "description": "移动端内核Hook工具" + } +] \ No newline at end of file diff --git a/assets/json/plugin.json b/assets/json/plugin.json new file mode 100644 index 0000000..e8a0e04 --- /dev/null +++ b/assets/json/plugin.json @@ -0,0 +1,10 @@ +[ + { + "section": "插件/非工具" + }, + { + "name": "HaE", + "url": "https://github.com/gh0stkey/HaE", + "description": "HaE是一款可以快速挖掘目标指纹和关键信息的Burp插件" + } +] \ No newline at end of file diff --git a/assets/json/poc.json b/assets/json/poc.json new file mode 100644 index 0000000..32a87e0 --- /dev/null +++ b/assets/json/poc.json @@ -0,0 +1,20 @@ +[ + { + "section": "POC/EXP" + }, + { + "name": "CVE-2026-31431", + "url": "https://copy.fail/", + "description": "基于复制功能的Linux系统提权漏洞" + }, + { + "name": "MS17-010检测工具", + "url": "https://github.com/TeskeVirtualSystem/MS17010Test", + "description": "Windows可用,快速检测永恒之蓝漏洞" + }, + { + "name": "CVE-2023-32315", + "url": "https://github.com/vulhub/vulhub/tree/master/openfire/CVE-2023-32315", + "description": "Openfire任意用户添加漏洞" + } +] \ No newline at end of file diff --git a/assets/json/proxy.json b/assets/json/proxy.json new file mode 100644 index 0000000..f945598 --- /dev/null +++ b/assets/json/proxy.json @@ -0,0 +1,30 @@ +[ + { + "section": "代理工具/集成平台" + }, + { + "name": "Burp Suite", + "url": "https://portswigger.net/burp", + "description": "经典,功能强大的Web应用安全测试工具,建议自行搜索破解版" + }, + { + "name": "Yakit", + "url": "https://github.com/yaklang/yakit", + "description": "交互式应用安全测试平台" + }, + { + "name": "Reqable", + "url": "https://reqable.com/zh-CN/", + "description": "多平台协同抓包分析以及API调试平台,支持Python脚本" + }, + { + "name": "Fiddler", + "url": "https://www.telerik.com/fiddler", + "description": "HTTP调试代理工具,一般用于PC抓取移动端报文" + }, + { + "name": "Proxifier", + "url": "https://www.proxifier.com/", + "description": "功能强大的网络代理工具,支持HTTP/HTTPS/SOCKS代理" + } +] \ No newline at end of file diff --git a/assets/json/scanner.json b/assets/json/scanner.json new file mode 100644 index 0000000..cb67e87 --- /dev/null +++ b/assets/json/scanner.json @@ -0,0 +1,40 @@ +[ + { + "section": "多功能扫描器" + }, + { + "name": "Nuclei", + "url": "https://github.com/projectdiscovery/nuclei", + "description": "(POC/EXP扫描工具)Nuclei 是一个快速、灵活且可扩展的漏洞扫描工具" + }, + { + "name": "arog", + "url": "https://github.com/zan8in/afrog", + "description": "(POC/EXP扫描工具)基于Go语言开发的开源漏扫系统" + }, + { + "name": "Pocsuite3", + "url": "https://github.com/knownsec/pocsuite3", + "description": "(POC/EXP扫描工具)基于Python开发的开源漏扫系统" + }, + { + "name": "xray", + "url": "https://github.com/chaitin/xray", + "description": "(POC/EXP扫描工具)长亭开发的漏洞扫描工具,支持被动扫描" + }, + { + "name": "Nikto", + "url": "https://github.com/sullo/nikto", + "description": "Web服务器扫描工具" + }, + { + "name": "OpenVAS", + "url": "https://github.com/greenbone/openvas", + "description": "自动化开源漏洞扫描工具" + }, + { + "name": "Goby", + "url": "https://gobies.org/", + "description": "自动化漏洞扫描工具,建议自行上网搜索红队破解版" + } +] \ No newline at end of file diff --git a/assets/json/shell.json b/assets/json/shell.json new file mode 100644 index 0000000..9c3a14c --- /dev/null +++ b/assets/json/shell.json @@ -0,0 +1,15 @@ +[ + { + "section": "Shell管理工具" + }, + { + "name": "AntSword蚁剑", + "url": "https://github.com/AntSwordProject/antSword", + "description": "AntSword蚁剑是一个功能强大的Shell管理工具,尤其是在PHP场景下" + }, + { + "name": "Godzilla哥斯拉", + "url": "https://github.com/BeichenDream/Godzilla", + "description": "多语言支持的强大Shell管理工具" + } +] \ No newline at end of file diff --git a/assets/json/template.json b/assets/json/template.json index a7ad07e..64adc9b 100644 --- a/assets/json/template.json +++ b/assets/json/template.json @@ -2,6 +2,16 @@ { "section": "栏目名称" }, + { + "name": "工具名称", + "url": "工具链接", + "description": "工具描述" + }, + { + "name": "工具名称", + "url": "工具链接", + "description": "工具描述" + }, { "name": "工具名称", "url": "工具链接", diff --git a/assets/json/tools.json b/assets/json/tools.json new file mode 100644 index 0000000..00ff2a8 --- /dev/null +++ b/assets/json/tools.json @@ -0,0 +1,20 @@ +[ + { + "section": "工具" + }, + { + "name": "Dirsearch", + "url": "https://github.com/maurosoria/dirsearch", + "description": "经典网站路径扫描爆破工具" + }, + { + "name": "Dirmap", + "url": "https://github.com/H4ckForJob/dirmap", + "description": "网站路径扫描爆破工具" + }, + { + "name": "Sqlmap", + "url": "https://github.com/sqlmapproject/sqlmap", + "description": "主流的强大SQL注入神器" + } +] \ No newline at end of file diff --git a/db.php b/db.php index 369da77..8e984c7 100644 --- a/db.php +++ b/db.php @@ -8,6 +8,7 @@ class SecHubDatabase { private $dbPath; private $jsonDir; private $db; + private $needsInitialSync = false; public function __construct($dbPath, $jsonDir) { $this->dbPath = $dbPath; @@ -20,18 +21,43 @@ class SecHubDatabase { */ private function initDatabase() { try { + // 检查数据库文件是否存在 + $dbExists = file_exists($this->dbPath); + $this->db = new PDO('sqlite:' . $this->dbPath); $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); // 创建同步日志表 $this->createSyncLogTable(); + + // 如果数据库文件是新创建的,或者没有任何业务数据表,标记需要同步 + if (!$dbExists || $this->isEmptyDatabase()) { + $this->needsInitialSync = true; + } } catch (PDOException $e) { error_log("数据库连接失败: " . $e->getMessage()); throw $e; } } + /** + * 检查数据库是否为空(没有业务数据表) + */ + private function isEmptyDatabase() { + try { + $sql = "SELECT count(*) as table_count FROM sqlite_master + WHERE type='table' + AND name NOT LIKE 'sqlite_%' + AND name != 'json_sync_log'"; + $stmt = $this->db->query($sql); + $result = $stmt->fetch(); + return $result['table_count'] == 0; + } catch (Exception $e) { + return true; + } + } + /** * 创建同步日志表 */ @@ -52,6 +78,18 @@ class SecHubDatabase { * 检查并同步JSON数据到数据库 */ public function syncJsonToDatabase() { + // 如果是初始同步,强制同步所有文件 + if ($this->needsInitialSync) { + $jsonFiles = glob($this->jsonDir . '*.json'); + + foreach ($jsonFiles as $file) { + $this->syncSingleFile($file); + } + $this->needsInitialSync = false; + return; + } + + // 正常增量同步 $jsonFiles = glob($this->jsonDir . '*.json'); foreach ($jsonFiles as $file) { diff --git a/index.php b/index.php index c132862..8dfd623 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ -
{$description}
- "; -} - // 初始化数据库并同步数据 try { $database = new SecHubDatabase($dbPath, $jsonDir); + + if (!file_exists($dbPath)) { + error_log("数据库文件不存在,将在同步时创建"); + } + $database->syncJsonToDatabase(); // 获取栏目配置 @@ -55,14 +40,475 @@ try { -一站式网络安全工具与资源导航平台
+高密度浏览模式 | 一屏查看更多工具
= htmlspecialchars($item['description'] ?? '暂无简介') ?>
+${escapeHtml(description)}
+${escapeHtml(description)}