KADIN-cpu/NetKit

GitHub: KADIN-cpu/NetKit

一个跨平台的网络与系统诊断 CLI 工具,将 sysinfo、ping/CIDR 扫描和 TCP 端口扫描整合到单一二进制文件中,替代散落的诊断命令和脚本。

Stars: 0 | Forks: 0

# netkit [![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?logo=go&logoColor=white)](https://go.dev) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Build](https://github.com/KADIN-cpu/netkit/actions/workflows/build.yml/badge.svg)](https://github.com/KADIN-cpu/netkit/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/KADIN-cpu/netkit)](https://goreportcard.com/report/github.com/KADIN-cpu/netkit) `netkit` 将最常见的网络和系统诊断任务集成在一个二进制文件中,无需依赖散落在机器各处的零散脚本。它可以在 **Windows、Linux 和 macOS** 上运行。 ## 功能 - **`sysinfo`** — 完整的系统信息:CPU、内存、磁盘和 uptime - **`ping`** — ping 单个主机或通过 CIDR 扫描整个网络范围(并发) - **`portscan`** — TCP 端口扫描器,可识别常见服务 ## 动机 我开始这个项目是为了在实践中学习 Go,构建一个我自己真正会用到的东西。在日常工作中,为了检查一台机器或网络的基本情况,我总是在几个不同的实用程序(`ping`、`nmap`、`systeminfo`、`df -h`)和一些自己编写的脚本之间来回切换。 `netkit` 的理念是将基本功能整合到一个命令中,提供清晰且彩色的输出,它是一个在 Windows 和 Linux 上运行方式相同的单一二进制文件——无需安装任何 runtime。 ## 安装 ### 预编译二进制文件 在 [发布页面](https://github.com/KADIN-cpu/netkit/releases) 下载适合您系统的二进制文件,并将其放入您的 `PATH` 中。 ### 通过 `go install` ``` go install github.com/KADIN-cpu/netkit@latest ``` ### 从源码编译 ``` git clone https://github.com/KADIN-cpu/netkit.git cd netkit make build # ou: go build -o netkit . ``` ## 使用 ### 系统信息 ``` netkit sysinfo ``` ``` » Sistema Hostname meu-pc SO linux Plataforma ubuntu 22.04 Arquitetura x86_64 Uptime 12d 4h 33m » CPU Modelo Intel(R) Core(TM) i7-10700 Núcleos 8 Uso 14.2% » Memória Total 16.0 GiB Em uso 9.4 GiB Uso 58.7% ``` ### Ping / 网络扫描 ``` # 单一 host netkit ping 192.168.0.10 # 整个范围 (CIDR) netkit ping 192.168.0.0/24 # /24 网络,仅显示在线的 netkit ping 192.168.0.0/24 --only-up ``` Flags:`--timeout/-t`(每个主机的毫秒数)、`--workers/-w`(并发数)、`--only-up`。 ### 端口扫描器 ``` # 常见 portas netkit portscan 192.168.0.10 # 特定 portas netkit portscan 192.168.0.10 --ports 22,80,443 # faixa de portas netkit portscan 192.168.0.10 --ports 1-1024 # 全部 (1-65535) netkit portscan 192.168.0.10 --all ``` ## 跨平台构建 ``` make build-all # gera binários para windows, linux e macos em ./dist ``` 或者手动操作: ``` GOOS=windows GOARCH=amd64 go build -o dist/netkit.exe . GOOS=linux GOARCH=amd64 go build -o dist/netkit-linux . GOOS=darwin GOARCH=arm64 go build -o dist/netkit-macos . ``` ## 技术栈 - [Go 1.22](https://go.dev) - [Cobra](https://github.com/spf13/cobra) — CLI 命令结构 - [gopsutil](https://github.com/shirou/gopsutil) — 跨平台系统指标 - [tablewriter](https://github.com/olekukonko/tablewriter) — 终端表格 - [color](https://github.com/fatih/color) — 彩色输出 ## Roadmap - [ ] 以 JSON / CSV 格式导出结果 - [ ] `traceroute` 命令 - [ ] 扫描时的反向 DNS 解析 - [ ] 持续监控模式(`watch`) ## 许可证 MIT — 详情请见 [LICENSE](LICENSE)。
标签:EVTX分析, Go语言, 情报分析, 数据统计, 日志审计, 程序破解, 端口扫描, 系统信息, 网络诊断