360 Secure SkillHub
360 安全技能中心

Port Scanner

该 Skill 提供纯 Python 标准库实现的 TCP 端口扫描脚本,可对主机、IP 或域名扫描指定端口、范围或 top-N 端口,识别 HTTP、SSH、MySQL 等常见服务并支持 banner 抓取,输出文本或 JSON,用于网络侦察和防火墙审计。

johnnywang2001
johnnywang2001
热度 84.24
最近更新 2026-05-17 14:32:46
分类:安全依赖:代码执行应用场景:DevOps / 自动化脚本

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add jrv-port-scanner
Metadata
name
port-scanner
description
Fast TCP port scanner for network reconnaissance and security auditing. Scan hosts for open ports, detect common services, and identify potential attack surface. Use when checking what ports are open on a server, scanning a network range, auditing firewall rules, or performing pre-deployment security checks. Triggers on "scan ports", "check open ports", "port scan", "network recon", "what ports are open", "firewall audit".

Port Scanner

Lightweight, zero-dependency TCP port scanner for network recon and security auditing.

Quick Start

# Scan common ports on a host
python3 scripts/port_scan.py example.com

# Scan specific port range
python3 scripts/port_scan.py 192.168.1.1 --ports 1-1024

# Scan specific ports
python3 scripts/port_scan.py 10.0.0.1 --ports 22,80,443,3306,5432,8080

# Fast scan with short timeout
python3 scripts/port_scan.py example.com --timeout 0.5 --workers 200

# JSON output
python3 scripts/port_scan.py example.com --format json

# Scan top N most common ports
python3 scripts/port_scan.py example.com --top 100

Features

  • Concurrent scanning with configurable thread count
  • Common service identification (HTTP, SSH, MySQL, PostgreSQL, Redis, etc.)
  • Banner grabbing for open ports
  • Supports single ports, ranges, comma-separated lists, and top-N common ports
  • JSON and text output formats
  • No external dependencies — pure Python stdlib