初始化项目
This commit is contained in:
parent
503a8f1eca
commit
d2fc7a83a8
10
README.md
10
README.md
@ -0,0 +1,10 @@
|
||||
## SecHub 网安工具集
|
||||
|
||||
### 技术栈
|
||||
|
||||
PHP: 网页实现
|
||||
Json: 存储工具集
|
||||
|
||||
### 部署
|
||||
|
||||
直接复制本项目放置于服务器上即可
|
||||
427
assets/css/style.css
Normal file
427
assets/css/style.css
Normal file
@ -0,0 +1,427 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode {
|
||||
background: #1a1a1a;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
margin-bottom: 30px;
|
||||
padding: 20px 0;
|
||||
position: relative;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode header {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 8px;
|
||||
color: #2c3e50;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode header h1 {
|
||||
color: #ecf0f1;
|
||||
}
|
||||
|
||||
header p {
|
||||
font-size: 1rem;
|
||||
color: #666;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode header p {
|
||||
color: #b0b0b0;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: #fff;
|
||||
border: 2px solid #e0e0e0;
|
||||
border-radius: 50%;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1.3rem;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.theme-toggle:hover {
|
||||
transform: translateY(-50%) scale(1.1);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
border-color: #3498db;
|
||||
}
|
||||
|
||||
body.dark-mode .theme-toggle {
|
||||
background: #2c2c2c;
|
||||
border-color: #444;
|
||||
}
|
||||
|
||||
body.dark-mode .theme-toggle:hover {
|
||||
border-color: #f39c12;
|
||||
}
|
||||
|
||||
.theme-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;
|
||||
}
|
||||
|
||||
.theme-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);
|
||||
}
|
||||
|
||||
.theme-tooltip.show {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.theme-toggle:hover .theme-tooltip {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
color: #2c3e50;
|
||||
font-size: 1.4rem;
|
||||
margin-bottom: 15px;
|
||||
padding: 10px 15px;
|
||||
border-left: 4px solid #3498db;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .section-title {
|
||||
color: #ecf0f1;
|
||||
background: #2c2c2c;
|
||||
border-left-color: #f39c12;
|
||||
}
|
||||
|
||||
.cards-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 18px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
|
||||
transition: all 0.3s ease;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
body.dark-mode .card {
|
||||
background: #2c2c2c;
|
||||
border-color: #444;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 3px;
|
||||
background: linear-gradient(90deg, #3498db, #2980b9);
|
||||
transform: scaleX(0);
|
||||
transform-origin: left;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .card::before {
|
||||
background: linear-gradient(90deg, #f39c12, #e67e22);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
||||
border-color: #3498db;
|
||||
}
|
||||
|
||||
body.dark-mode .card:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
|
||||
border-color: #f39c12;
|
||||
}
|
||||
|
||||
.card:hover::before {
|
||||
transform: scaleX(1);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 1.1rem;
|
||||
color: #2c3e50;
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .card-title {
|
||||
color: #ecf0f1;
|
||||
}
|
||||
|
||||
.card-link {
|
||||
display: inline-block;
|
||||
color: #3498db;
|
||||
text-decoration: none;
|
||||
font-size: 0.85rem;
|
||||
word-break: break-all;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .card-link {
|
||||
color: #f39c12;
|
||||
}
|
||||
|
||||
.card-link:hover {
|
||||
color: #2980b9;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
body.dark-mode .card-link:hover {
|
||||
color: #e67e22;
|
||||
}
|
||||
|
||||
.card-description {
|
||||
color: #666;
|
||||
line-height: 1.5;
|
||||
font-size: 0.9rem;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .card-description {
|
||||
color: #b0b0b0;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
padding: 30px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border: 1px dashed #ddd;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .empty-state {
|
||||
background: #2c2c2c;
|
||||
border-color: #444;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
color: #999;
|
||||
margin-top: 40px;
|
||||
padding: 25px 20px;
|
||||
font-size: 0.9rem;
|
||||
background: #fff;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode footer {
|
||||
background: #2c2c2c;
|
||||
border-top-color: #444;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin-bottom: 10px;
|
||||
color: #666;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .copyright {
|
||||
color: #b0b0b0;
|
||||
}
|
||||
|
||||
.beian-info {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.beian-link {
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
body.dark-mode .beian-link {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.beian-link:hover {
|
||||
color: #3498db;
|
||||
}
|
||||
|
||||
body.dark-mode .beian-link:hover {
|
||||
color: #f39c12;
|
||||
}
|
||||
|
||||
.beian-divider {
|
||||
color: #ddd;
|
||||
user-select: none;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
body.dark-mode .beian-divider {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.beian-icon {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
header h1 {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.cards-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.theme-toggle {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
font-size: 1.1rem;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.theme-tooltip {
|
||||
font-size: 0.75rem;
|
||||
padding: 5px 10px;
|
||||
bottom: -32px;
|
||||
}
|
||||
|
||||
footer {
|
||||
padding: 20px 15px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.beian-info {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.beian-divider {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
header p {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 1.1rem;
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
footer {
|
||||
padding: 15px 10px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
}
|
||||
BIN
assets/imgs/beian.png
Normal file
BIN
assets/imgs/beian.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
20
assets/json/plugin.json
Normal file
20
assets/json/plugin.json
Normal file
@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"section": "插件/非独立小工具"
|
||||
},
|
||||
{
|
||||
"name": "Nuclei Templates",
|
||||
"url": "https://github.com/projectdiscovery/nuclei-templates",
|
||||
"description": "社区驱动的漏洞扫描模板集合,支持多种协议和技术栈"
|
||||
},
|
||||
{
|
||||
"name": "CVE-Exploit",
|
||||
"url": "https://github.com/trickest/cve",
|
||||
"description": "最新CVE漏洞的POC和EXP收集仓库"
|
||||
},
|
||||
{
|
||||
"name": "Web POC",
|
||||
"url": "https://github.com/dorkerdevil/Web-Pentest",
|
||||
"description": "Web应用渗透测试POC脚本合集"
|
||||
}
|
||||
]
|
||||
20
assets/json/poc.json
Normal file
20
assets/json/poc.json
Normal file
@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"section": "POC/EXP"
|
||||
},
|
||||
{
|
||||
"name": "Nuclei Templates",
|
||||
"url": "https://github.com/projectdiscovery/nuclei-templates",
|
||||
"description": "社区驱动的漏洞扫描模板集合,支持多种协议和技术栈"
|
||||
},
|
||||
{
|
||||
"name": "CVE-Exploit",
|
||||
"url": "https://github.com/trickest/cve",
|
||||
"description": "最新CVE漏洞的POC和EXP收集仓库"
|
||||
},
|
||||
{
|
||||
"name": "Web POC",
|
||||
"url": "https://github.com/dorkerdevil/Web-Pentest",
|
||||
"description": "Web应用渗透测试POC脚本合集"
|
||||
}
|
||||
]
|
||||
25
assets/json/tool.json
Normal file
25
assets/json/tool.json
Normal file
@ -0,0 +1,25 @@
|
||||
[
|
||||
{
|
||||
"section": "安全工具"
|
||||
},
|
||||
{
|
||||
"name": "Burp Suite",
|
||||
"url": "https://portswigger.net/burp",
|
||||
"description": "专业的Web安全测试工具集,包含代理、扫描器等多种功能模块"
|
||||
},
|
||||
{
|
||||
"name": "SQLMap",
|
||||
"url": "https://github.com/sqlmapproject/sqlmap",
|
||||
"description": "自动化SQL注入检测和利用工具,支持多种数据库类型"
|
||||
},
|
||||
{
|
||||
"name": "Dirsearch",
|
||||
"url": "https://github.com/maurosoria/dirsearch",
|
||||
"description": "高性能Web目录和文件枚举工具,支持多线程和多种输出格式"
|
||||
},
|
||||
{
|
||||
"name": "Nmap",
|
||||
"url": "https://nmap.org/",
|
||||
"description": "网络发现和安全审计工具,支持端口扫描、服务检测等功能"
|
||||
}
|
||||
]
|
||||
197
index.php
Normal file
197
index.php
Normal file
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
/**
|
||||
* SecHub - 网络安全工具导航页
|
||||
*/
|
||||
|
||||
// 定义JSON文件路径
|
||||
$jsonDir = __DIR__ . '/assets/json/';
|
||||
|
||||
/**
|
||||
* 读取JSON文件并返回数据
|
||||
* @param string $filePath JSON文件路径
|
||||
* @return array 解析后的数据数组
|
||||
*/
|
||||
function loadJsonData($filePath) {
|
||||
if (!file_exists($filePath)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$content = file_get_contents($filePath);
|
||||
if ($content === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$data = json_decode($content, true);
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
error_log("JSON解析错误: " . json_last_error_msg());
|
||||
return [];
|
||||
}
|
||||
|
||||
return is_array($data) ? $data : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有JSON文件并自动识别栏目配置
|
||||
* @param string $jsonDir JSON目录路径
|
||||
* @return array 栏目配置数组
|
||||
*/
|
||||
function getSectionsConfig($jsonDir) {
|
||||
$sections = [];
|
||||
$jsonFiles = glob($jsonDir . '*.json');
|
||||
|
||||
foreach ($jsonFiles as $file) {
|
||||
$filename = basename($file);
|
||||
$data = loadJsonData($file);
|
||||
|
||||
if (!empty($data) && isset($data[0]['section'])) {
|
||||
$sections[$filename] = [
|
||||
'title' => $data[0]['section'],
|
||||
'file' => $filename,
|
||||
'items' => array_slice($data, 1)
|
||||
];
|
||||
} else {
|
||||
$sections[$filename] = [
|
||||
'title' => pathinfo($filename, PATHINFO_FILENAME),
|
||||
'file' => $filename,
|
||||
'items' => $data
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $sections;
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染卡片HTML
|
||||
* @param array $item 项目数据
|
||||
* @return string HTML字符串
|
||||
*/
|
||||
function renderCard($item) {
|
||||
$name = htmlspecialchars($item['name'] ?? '未命名');
|
||||
$url = htmlspecialchars($item['url'] ?? '#');
|
||||
$description = htmlspecialchars($item['description'] ?? '暂无简介');
|
||||
|
||||
return "
|
||||
<div class=\"card\" onclick=\"window.open('{$url}', '_blank')\">
|
||||
<div class=\"card-header\">
|
||||
<h3 class=\"card-title\">{$name}</h3>
|
||||
<a href=\"{$url}\" target=\"_blank\" class=\"card-link\" onclick=\"event.stopPropagation()\">{$url}</a>
|
||||
</div>
|
||||
<p class=\"card-description\">{$description}</p>
|
||||
</div>";
|
||||
}
|
||||
|
||||
// 自动获取栏目配置
|
||||
$sections = getSectionsConfig($jsonDir);
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>SecHub - 网络安全工具集</title>
|
||||
<link rel="stylesheet" href="assets/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>SecHub 网安工具集</h1>
|
||||
<p>一站式网络安全工具与资源导航平台</p>
|
||||
<button id="theme-toggle" class="theme-toggle" title="点击切换白天/黑夜模式">
|
||||
<span class="theme-icon">🌙</span>
|
||||
<span class="theme-tooltip">切换主题</span>
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<?php foreach ($sections as $key => $config): ?>
|
||||
<?php
|
||||
$items = $config['items'] ?? [];
|
||||
?>
|
||||
|
||||
<section class="section">
|
||||
<h2 class="section-title">
|
||||
<?= htmlspecialchars($config['title']) ?>
|
||||
</h2>
|
||||
|
||||
<?php if (empty($items)): ?>
|
||||
<div class="empty-state">
|
||||
<p>暂无数据,请在 <?= htmlspecialchars($config['file']) ?> 中添加项目</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="cards-grid">
|
||||
<?php foreach ($items as $item): ?>
|
||||
<?= renderCard($item) ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<footer class="panel-footer">
|
||||
<div class="footer-content">
|
||||
<p class="copyright">© <?= date('Y') ?> <a href="https://git.masonliu.com/MasonLiu/SecHub" target="_blank" rel="noopener noreferrer">SecHub - 网络安全工具集</a></p>
|
||||
<p class="copyright">Gaming Master Cybersecurity | MasonLiu</p>
|
||||
<div class="beian-info">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer" class="beian-link">蜀ICP备2026025173号</a>
|
||||
<span class="beian-divider">|</span>
|
||||
<a href="https://beian.mps.gov.cn/#/query/webSearch?code=51162302000285" target="_blank" rel="noopener noreferrer" class="beian-link">
|
||||
<img src="/assets/imgs/beian.png" alt="公安备案" width="16" height="16" class="beian-icon"/>
|
||||
<span>川公网安备51162302000285号</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 黑夜模式切换功能
|
||||
(function() {
|
||||
const themeToggle = document.getElementById('theme-toggle');
|
||||
const themeIcon = themeToggle.querySelector('.theme-icon');
|
||||
const body = document.body;
|
||||
|
||||
// 从localStorage读取主题设置
|
||||
const currentTheme = localStorage.getItem('theme') || 'light';
|
||||
|
||||
// 应用保存的主题
|
||||
if (currentTheme === 'dark') {
|
||||
body.classList.add('dark-mode');
|
||||
themeIcon.textContent = '☀️';
|
||||
}
|
||||
|
||||
// 首次访问显示提示
|
||||
if (!localStorage.getItem('themeHintShown')) {
|
||||
setTimeout(() => {
|
||||
showThemeHint();
|
||||
localStorage.setItem('themeHintShown', 'true');
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
// 切换主题
|
||||
themeToggle.addEventListener('click', function() {
|
||||
body.classList.toggle('dark-mode');
|
||||
|
||||
if (body.classList.contains('dark-mode')) {
|
||||
themeIcon.textContent = '☀️';
|
||||
localStorage.setItem('theme', 'dark');
|
||||
} else {
|
||||
themeIcon.textContent = '🌙';
|
||||
localStorage.setItem('theme', 'light');
|
||||
}
|
||||
});
|
||||
|
||||
// 显示提示函数
|
||||
function showThemeHint() {
|
||||
const tooltip = themeToggle.querySelector('.theme-tooltip');
|
||||
tooltip.classList.add('show');
|
||||
|
||||
// 3秒后隐藏提示
|
||||
setTimeout(() => {
|
||||
tooltip.classList.remove('show');
|
||||
}, 3000);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
0
nginx.htaccess
Normal file
0
nginx.htaccess
Normal file
Loading…
Reference in New Issue
Block a user