home / skills / aidotnet / moyucode / port-scanner

port-scanner skill

/skills/tools/port-scanner

This skill helps you quickly assess network ports, identify open services, and verify availability across hosts.

npx playbooks add skill aidotnet/moyucode --skill port-scanner

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
868 B
---
name: port-scanner
description: 扫描网络端口以检查可用性和检测运行的服务。
metadata:
  short-description: 扫描网络端口
source:
  repository: https://github.com/python/cpython
  license: PSF
---

# Port Scanner Tool

## Description
Scan network ports to check availability, detect running services, and find open ports.

## Trigger
- `/port` command
- User needs to check ports
- User wants to scan network

## Usage

```bash
# Check single port
python scripts/port_scanner.py localhost 8080

# Scan port range
python scripts/port_scanner.py 192.168.1.1 --range 80-443

# Scan common ports
python scripts/port_scanner.py example.com --common

# Check if port is available
python scripts/port_scanner.py localhost 3000 --available
```

## Tags
`port`, `network`, `scan`, `tcp`, `security`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill scans network ports to check availability, detect running services, and identify open TCP endpoints. It provides single-port checks, ranged scans, common-port presets, and availability queries to help troubleshoot connectivity and surface potential security issues.

How this skill works

The scanner attempts TCP connections to target hosts and ports, reporting success, timeout, or refusal for each attempt. It supports scanning a single port, a numeric range, or a curated set of common ports, and can flag ports that appear available for binding. Results include basic service detection by observing banner responses when available.

When to use it

  • Verify a single service is reachable on a host and port before deploying or testing.
  • Audit a host for unexpectedly open ports that may expose services.
  • Troubleshoot connectivity issues during development or CI checks.
  • Quickly check a port range when configuring firewalls or network rules.
  • Confirm whether a port is free on a machine before starting a server process.

Best practices

  • Run scans from a network location that reflects the client perspective (local, VPN, or public) to get meaningful results.
  • Respect scanning policies and obtain permission before probing hosts you do not own.
  • Combine results with firewall rules and service logs to pinpoint root causes of failures.
  • Use conservative timeouts and rate limits to avoid triggering intrusion detection systems.
  • When possible, corroborate banner-based detection with authenticated checks or service-specific probes.

Example use cases

  • Check whether a web server is listening on port 8080 before starting a CI smoke test.
  • Scan 192.168.1.1 for ports 80–443 after a network change to validate firewall rules.
  • Run a common-port scan against an instance to quickly identify active services like SSH or HTTP.
  • Confirm that port 3000 is available on a development machine before launching a local app.
  • Perform a quick security check on a newly provisioned VM to list exposed TCP services.

FAQ

Is this a TCP-only scanner?

Yes, it focuses on TCP connection attempts and banner observation; UDP probing is not included.

Will scanning a host without permission cause problems?

Scanning can trigger security alerts or violate policies—always get authorization before scanning hosts you do not control.