360 Secure SkillHub
360 安全技能中心

Port Check

该 Skill 提供 port-check 脚本,对给定的 host:port 目标做 TCP 连通性检查;加 --http 时通过 curl 获取 HTTP 状态码,可用 --timeout 调整超时(默认 3 秒)。输出各目标 open/closed/timeout 状态与退出码,用于服务监控和网络排查。

rogue-agent1
rogue-agent1
热度 68.82
最近更新 2026-05-17 12:05:23
分类:自动化依赖:代码执行 / 第三方 API应用场景:DevOps / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add port-check
Metadata
name
port-check
version
1.0.0
description
Check if services are responding on given host:port pairs. Supports TCP and HTTP checks with configurable timeout. Use for service monitoring, health checks, and network debugging.
metadata
{"clawdbot":{"emoji":"🔌","requires":{"bins":["nc","curl"]}}}

Port Check Skill

Quickly verify if services are up and responding on specific ports.

Usage

# Basic TCP check
bash scripts/port-check.sh localhost:8080 localhost:5432

# Multiple targets with HTTP status check
bash scripts/port-check.sh localhost:80 api.example.com:443 --http

# Custom timeout (default 3s)
bash scripts/port-check.sh 192.168.1.1:22 --timeout 5

Output

  • ✅ host:port — open (TCP connected)
  • ✅ host:port — open (HTTP 200) (with --http flag)
  • ⚠️ host:port — open but HTTP 500 (port open, bad HTTP status)
  • ❌ host:port — closed/timeout (no response)

Exit Codes

  • 0 — all targets up
  • 1 — one or more targets down

Common Checks

# OpenClaw gateway
bash scripts/port-check.sh localhost:18789 --http

# Database + web stack
bash scripts/port-check.sh localhost:5432 localhost:6379 localhost:3000

# Home network devices
bash scripts/port-check.sh 192.168.1.1:80 192.168.1.50:22 --timeout 2