PortGuard:讓您的服務在 在掃描器面前「徹底隱身」
PortGuard combines a modified fwknop-based server with a cross-platform client that supports the fwknop SPA protocol. Ports stay closed by default and open temporarily only after a valid AES/GPG-signed packet is verified.
Quick Server Install
Installs the latest open-source package built by GitHub Actions from the PortGuard server repository.
curl -fsSL https://portguard.net/install.sh | sudo bash
傳統暴露模式(Risk)
- ✕連接埠全天候開放,持續遭受全球掃描器探測。
- ✕暴露服務將直接面對暴力破解與漏洞利用攻擊。
- ✕防火牆白名單維護複雜,且缺乏動態靈活性。
PortGuard 模式(Solution)
- ✓預設拒絕: 未授權前連接埠完全不可見(Stealth)。
- ✓SPA 認證: 僅特定格式的加密單包可觸發放行。
- ✓動態放行: 僅暫時放行來源 IP,隨後自動關閉。
核心特性
核心安全特性
Strong defaults for teams that want SSH, admin panels, and private services to disappear until authorization is intentional.
SPA 高效通訊
Send fwknop-compatible single-packet authorization without TCP handshake overhead, with strong stealth.
AES/GPG + HMAC
整合 SHA256 完整性校驗,確保指令真實且未被竄改。
連接埠全隱身
預設 DROP 策略使服務對掃描器呈現為不可達。
防重放攻擊
時間窗校驗結合完整性驗證,可快速使舊封包失效。
PortGuard 教程
A cleaner fwknop-compatible client for every device.
PortGuard Client supports the fwknop SPA protocol. Profiles, one-tap SPA, QR import, encrypted export, and activation stay compatible with fwknopd and PortGuard Server workflows.
技術原理
安全運行機制
PortGuard 運行在受保護伺服器的防火牆前沿,持續檢測網路中的鑑權封包,同時不對外暴露服務握手行為。
生成鑑權封包
客戶端使用金鑰與時間戳生成加密單包。
無握手投遞
封包透過 UDP 等方式發送,使基於握手的探測失效。
動態開門
驗證通過後,服務端會暫時放行來源 IP,並在逾時後自動移除規則。
應用場景
SSH 遠端運維
保護 22 連接埠,僅在管理員發送 SPA 後短時可見。
多雲環境安全
跨 AWS/Azure 等環境統一存取控制,降低暴露面。
IoT 裝置管理
保護 IoT 控制介面,避免直接暴露公網。
ACL 自動化
結合腳本與規則週期,實現臨時授權自動化。
下載與安裝
支援多平台客戶端與伺服端安裝包
Server Packages
Install PortGuard Server on Debian, Ubuntu, Rocky, CentOS, and OpenWrt
Use the quick installer for supported Linux servers, or download the latest package generated from the open-source GitHub Actions release pipeline.
Quick Install
One command server setup
curl -fsSL https://portguard.net/install.sh | sudo bash
The script detects the operating system, selects the matching package from the GitHub release manifest, verifies SHA256, installs dependencies, and leaves fwknopd ready for configuration export to PortGuard Client.
Open Source Release
Packages synced from GitHub
These packages are built automatically by GitHub Actions from the public PortGuard server source code.
| System | Version | Architecture | Package | 下載 |
|---|---|---|---|---|
| Loading packages from GitHub release... | ||||
相關產品
Product
OpenAT
Secure, time-locked data storage powered by drand's mathematical certainty. Encrypt your future today without a central authority.
Visit website
Product
Lockmem
End-to-end encrypted personal media vault for your NAS. Privacy-first management for your self-hosted infrastructure.
Visit website常見問題與使用情境
最後更新:
What is the relationship between PortGuard and fwknop?
PortGuard is built around the fwknop SPA protocol. PortGuard Client is a cross-platform client that sends fwknop-compatible SPA packets, while PortGuard Server is a modified server based on the upstream fwknop project. Compared with traditional sequence-based port knocking, this single encrypted packet model is faster, stealthier, and resistant to replay attacks.
是否可以只產生一次設定,然後敲門一次,讓某個 IP 存取伺服器上的所有服務連接埠?
可以。將伺服器存取段設定為 OPEN_PORTS ANY,並在用戶端設定中使用 ACCESS ANY。設定只需產生並匯入一次,之後可以重複使用。每次有效敲門都會建立一條暫時來源 IP 規則,讓 ALLOW_IP 指定的 IP 在 FW_TIMEOUT 到期前可以存取伺服器上的所有 TCP 與 UDP 服務連接埠。規則到期後需要重新敲門。這是高權限模式:請設定較短的逾時時間並妥善保護設定與金鑰;上游雲端防火牆、路由器規則以及服務本身的驗證仍然有效。
fwknop 與 tnock 相比如何?
兩者都以隱藏網路埠為目標,但 fwknop 是更進階的 Single Packet Authorization(SPA)方案。tnock 與類似的序列式敲門守護程式,需在多個關閉埠上偵測特定連線模式,執行較慢且易受重放攻擊。fwknop 透過傳送單一個帶加密簽章與時間戳的負載來解決。其優勢是更高的安全性、可抵禦重放攻擊,並可與現代防火牆無縫整合。
如何讓我的網站或私有服務只開放給特定人員?
By default, PortGuard Server, modified from fwknop, configures your server's firewall to block all inbound traffic to your service port. The service appears completely offline to the public. When an authorized user needs access, they use PortGuard Client with their unique cryptographic key to send a fwknop-compatible Single Packet Authorization (SPA) packet. Once verified, the server dynamically whitelists their current IP address for a brief period.
NAS 對外暴露時,如何兼顧安全與隱私並避免資料外洩?
由於殭屍網路與掃描器會持續探測,將 NAS 直接暴露在網際網路風險極高。一般有兩種較安全的做法:
- 方案 1:Cloudflare Zero Trust(Tunnels) 此方案將 NAS 流量經由 Cloudflare 網路轉送,無需開放任何入站埠。優點:設定容易、不需公網 IP,並可多一層 WAF 防護。缺點:流量必須經過第三方伺服器,代表你需依賴 Cloudflare 的隱私政策;傳輸速度也常受免費方案路由限制,不利於大型媒體串流。
- 方案 2:自建公網 IP + fwknop Port Knocking 你在路由器上開一個埠,但使用 fwknop(SPA)保護。該埠對公網保持不可見,只有送出有效且帶加密簽章的存取封包時才會開啟。優點:流量不經第三方伺服器,可獲得更高資料隱私;由於是直連,傳輸可達硬體極限(適合影音串流)。缺點:需要真實公網 IP,且初期設定稍有技術門檻。
埠開啟後,fwknop PortGuard 會讓連線變慢嗎?
No. The fwknop-compatible PortGuard Server only handles the initial authorization packet. Once the firewall rule is dynamically created and your IP is authorized, your connection via SSH, WireGuard, or directly to your NAS operates directly between your client and the server at full line speed.
受到全球 DevOps 與安全專家信賴
Official Contact
Need help with PortGuard?
For purchase recovery, activation issues, deployment questions, or security reports, contact the official PortGuard support mailbox.
[email protected]