Skip to main content

xl-network

一个功能强大的网络工具包,提供端口扫描等网络安全功能。

功能特性

  • 快速端口扫描:多线程并发扫描,提高扫描效率
  • 灵活配置:支持自定义端口范围、线程数、超时时间
  • 命令行界面:简单易用的CLI工具
  • 跨平台:支持Windows、Linux、macOS

安装

# 从源码安装
cd D:\git\libs\py-network
pip install -e .

使用方法

命令行使用

# 基本用法:扫描本地主机的前1024个端口
xl-network scan 127.0.0.1 1 1024

# 扫描指定主机的特定端口范围
xl-network scan localhost 80 443

# 使用自定义线程数和详细输出
xl-network scan example.com 1 65535 --threads 200 --verbose

# 设置连接超时时间
xl-network scan 192.168.1.1 1 1000 --timeout 2.0

# 查看帮助信息
xl-network scan --help

编程接口

from xl_network import scan_ports, port_scan

# 扫描单个端口
open_port = port_scan("127.0.0.1", 80)
if open_port:
    print(f"端口 {open_port} 开放")

# 扫描端口范围
open_ports = scan_ports("127.0.0.1", 1, 1024, num_threads=50)
print(f"开放端口: {open_ports}")

命令行参数

  • host: 目标主机(IP地址或域名)
  • start_port: 起始端口号(1-65535)
  • end_port: 结束端口号(1-65535)
  • --threads, -t: 线程数量(默认:100)
  • --timeout: 连接超时时间,秒(默认:1.0)
  • --verbose, -v: 显示详细信息

示例

# 扫描常见的Web端口
xl-network scan example.com 80 443 --verbose

# 快速扫描本地主机
xl-network scan 127.0.0.1 1 1000 --threads 50

# 扫描整个端口范围(较慢)
xl-network scan 192.168.1.1 1 65535 --threads 300 --timeout 0.5

注意事项

  • 请确保你有权限扫描目标主机
  • 扫描大量端口可能会触发目标主机的安全防护措施
  • 建议在授权的网络环境中使用此工具

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request!

Metadata

Release files for xl-network 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xl-network 2.0.0
File Size Uploaded Provenance Actions
xl_network-2.0.0.tar.gz 6.5 kB Without provenance Details for xl_network-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xl-network 2.0.0
File Interpreter ABI Platform Actions
xl_network-2.0.0-py3-none-any.whl Python 3 none any Details for xl_network-2.0.0-py3-none-any.whl

Total release size: 12.9 kB

Release files / xl_network-2.0.0.tar.gz

Download URL xl_network-2.0.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2db4283c5b4efd95e55f79f985f2b3f4a6491f3bbb06859da6ffff3abbef1064
BLAKE2b-256 checksum
How to use checksums
215edf5c2419d515286827f3aaacbf20b14d477cfd7cf92ffdc413fe7d313331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Release files / xl_network-2.0.0-py3-none-any.whl

Download URL xl_network-2.0.0-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9210db53191e462eeb7efe0d284923863e24e746e554fe63a40261dc5660b4f8
BLAKE2b-256 checksum
How to use checksums
6a7dd45aafbf01a3b5cea81b4d86e0ec000aa19223a993e1e26de9f012d24cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.3

Security for xl-network 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page