Bd-Mutant7/Port-Scanner
GitHub: Bd-Mutant7/Port-Scanner
基于 Next.js 前端与本地 Python 后端的混合式端口扫描工具,通过 Vercel 托管 Web 界面并联动本地扫描服务,实现轻量便捷的端口探测。
Stars: 2 | Forks: 0
# 端口扫描器应用 – Vercel 部署




**在线演示:** [https://port-scanner-app.vercel.app](https://port-scanner-app.vercel.app)
## 📖 概述
这是一个专为 **Verc# 端口扫描器应用 – Vercel 部署




**在线演示:** [https://port-scanner-app.vercel.app](https://port-scanner-app.vercel.app)
## 📖 概述
这是一个专为 **Verc# 端口扫描器应用 – Vercel 部署




**在线演示:** [https://port-scanner-app.vercel.app](https://port-scanner-app.vercel.app)
## 📖 概述
这是一个专为 **Vercel 部署**设计的**混合式端口扫描器应用**。前端托管在 Vercel 上,而实际的端口扫描则运行在**本地 Python 服务器**上。这种架构符合 Vercel 的无服务器限制,同时仍能实现真实的网络扫描。
## 🌐 在线部署
### 访问应用
```
https://port-scanner-app.vercel.app
```
### 在 Vercel 上可用的功能
```
✓ Demo interface (simulated scans)
✓ Setup & usage instructions
✓ Common ports database
✓ Responsive UI (desktop & mobile)
✓ No installation required
```
### 需要本地设置的功能
```
⚠ Actual port scanning
⚠ Real TCP socket connections
⚠ CLI-based scanning features
```
## 🏗️ 架构
```
┌─────────────────────────────────────────────────────────┐
│ Vercel (Cloud) │
│ ┌─────────────────────────────────────────────────┐ │
│ │ React Frontend (Static) │ │
│ │ • Demo Mode Interface │ │
│ │ • Setup Instructions │ │
│ │ • Local Server Controller │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ User's Computer │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Local Python Server │ │
│ │ • Real Port Scanning │ │
│ │ • Socket Connections │ │
│ │ • Full Network Access │ │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ PowerShell CLI │ │
│ │ • Command-line Scanning │ │
│ │ • Advanced Features │ │
│ │ • Batch Processing │ │
│ └─────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
```
## 🚀 用户快速入门
### 步骤 1:访问 Web 应用
打开浏览器并导航至:
```
https://port-scanner-app.vercel.app
```
可用模式:
```
• Demo Mode (instant, simulated)
• Local Server Mode (real scanning)
```
### 步骤 2:尝试演示模式
```
Select "Demo Mode" in the web interface
Enter any target (e.g., scanme.nmap.org)
Click "Start Scan"
View simulated results immediately
```
### 步骤 3:设置本地服务器(真实扫描)
#### 选项 A:一键设置(Windows)
```
# 从 Vercel 站点下载 setup 包
# 解压并运行:
.\\setup.bat
```
#### 选项 B:手动设置
```
# 以管理员身份打开 PowerShell
.\\Setup-Environment.ps1
```
## 🎯 使用方法
### 阶段 1:Web 界面(Vercel)
```
URL: https://port-scanner-app.vercel.app
```
选择一种模式:
```
• Demo Mode – simulated results
• Local Server – real scanning
```
演示示例:
```
Target: scanme.nmap.org
Port Range: 20-80
Action: Start Scan
```
### 阶段 2:本地服务器设置
下载文件:
```
curl -L https://port-scanner-app.vercel.app/download/setup.zip -o setup.zip
```
安装依赖:
```
python -m pip install flask flask-cors
```
启动服务器:
```
# PowerShell 启动器
.\\Start-Scanner.ps1
# 或直接
python app.py
```
从 Web UI 连接:
```
1. Switch to "Local Server" mode
2. Auto-detects http://localhost:5000
3. Start real scans
```
### 阶段 3:执行真实扫描
Web UI:
```
Target: scanme.nmap.org
Port Range: 20-100
Threads: 100
```
CLI 替代方案:
```
.\\cli\\scanner.ps1 scanme.nmap.org -Ports 20-80
```
## 🔧 技术实现
### Vercel 特定文件
```
vercel.json
next.config.js
pages/
├── index.js
├── demo.js
└── api/demo.js
public/
├── setup.zip
└── instructions/
```
### 演示 API(Vercel)
```
export default function handler(req, res) {
if (req.method === 'POST') {
res.status(200).json({
status: 'demo',
open_ports: [22, 80, 443],
note: 'Demo mode only'
});
}
}
```
### 本地服务器 API
```
@app.route('/api/scan', methods=['POST'])
def start_scan():
pass # real socket scanning
```
## 🔌 本地服务器要求
```
OS: Windows / macOS / Linux
Python: 3.8+
RAM: 2GB minimum
Storage: 100MB
```
## 🚨 安全模型
```
• No raw sockets on Vercel
• No persistent processes
• Local execution only
```
```
✓ Scans run locally
✓ No cloud logging
✓ Full user control
```
## 📊 性能
前端(Vercel):
```
Load time < 2s
Unlimited users
```
本地扫描:
```
~100 ports/sec
<100MB RAM
```
## 🛠️ 开发与部署
克隆与部署:
```
git clone https://github.com/yourusername/port-scanner.git
cd port-scanner
vercel
```
环境变量:
```
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_DEMO_MODE=true
```
## 📄 许可证
```
MIT License
Use responsibly and legally
```
标签:AI合规, DNS枚举, DNS查询工具, GUI, MIT开源协议, React, Serverless, Syscalls, TCP Socket连接, Vercel部署, 云存储安全, 云部署, 全栈项目, 前端静态托管, 响应式UI, 图形用户界面, 插件系统, 数据统计, 本地Python服务器, 混合架构应用, 端口扫描, 端口扫描器, 网络安全工具, 网络扫描, 逆向工具