使用cgo调用libnids实现网络数据的过滤与还原
发表于:2025-04-15 |
字数统计: 192 | 阅读时长: 1分钟 | 阅读量:

使用cgo调用libnids实现网络数据的过滤与还原

项目地址https://github.com/EnderCHX/websafe-go

1. 介绍

本系统使用cgo调用C语言的libnids库实现网络空间安全审计功能。

2. 编译运行

在项目根目录执行

1
go run .

编译为二进制文件

1
go build .

3. 系统用法

1
2
3
4
5
6
7
Usage of websafe
-d string
设备名称 (default "eth0")
-f string
BPF过滤规则
-m int
运行模式:1. http 2. ethernet 3. 扫描攻击检测 (default 1)

4.功能展示

http捕获和过滤

访问 http://hw.bj.hrbeu.top:1315/posts,捕获到http数据
https://img.020928.xyz/f3e7e5ca6ad519d89e9c850d191c8c98.png

以太网捕获和过滤

ping chxc.cc 捕获到以太网数据
https://img.020928.xyz/img/893e59023c6a548c5b0fbf09cfa985b0.png

扫描攻击检测

使用nmap -p 1-65535 al.bj.hrbeu.top ,捕获到扫描攻击攻击
https://img.020928.xyz/img/9da49fdac6eab9e4194033561cb34ecb.png

下一篇:
QQ机机人接入deepseek并实现联网搜索