Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译成功后,运行软件获取不到数据,流量进出一直显示是零 #5

Open
fejich opened this issue May 16, 2020 · 3 comments

Comments

@fejich
Copy link

fejich commented May 16, 2020

编译安装时候的命令记录

cd ~
sudo apt install libpcap-dev gcc
wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.14.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go get github.com/gotoolkits/libnetgo 
cd ~/go/src/github.com/gotoolkits/libnetgo
go build libnet.go

运行

chmod +x libnet
./libnet -c -ip 192.168.168.165
⇨ http server started on [::]:18081
=======================================================================================================================
| PID | USER |                    IPLINK              |IN|OUT(k)|SENT|RECEIVED(kB/s)|            PROGRAM               |
=======================================================================================================================
 26700  root     192.168.168.165:22-192.168.168.2:50010   0     0     0     0      /usr/sbin/sshd
 26736  root     192.168.168.165:22-192.168.168.2:50012   0     0     0     0      /usr/sbin/sshd
 12212  root     127.0.0.1:36462-127.0.0.1:8024           0     0     0     0      /root/nps/npc
 12212  root     127.0.0.1:36464-127.0.0.1:8024           0     0     0     0      /root/nps/npc
@fejich
Copy link
Author

fejich commented May 16, 2020

系统环境:

CPU model            : Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
Number of cores      : 4
CPU frequency        : 3500.176 MHz
Total size of Disk   : 28.5 GB (6.7 GB Used)
Total amount of Mem  : 3859 MB (2783 MB Used)
Total amount of Swap : 4095 MB (303 MB Used)
System uptime        : 12 days, 21 hour 42 min
Load average         : 0.33, 0.29, 0.27
OS                   : Debian GNU/Linux 10
Arch                 : x86_64 (64 Bit)
Kernel               : 5.3.18-2-pve

@shangwen
Copy link

shangwen commented Feb 4, 2021

我也遇到同样的问题

@gotoolkits
Copy link
Owner

Console命令这块没有封装参数开启sniffer on模式,可以试试-s参数启动API服务访问 "/api/sniffon" 打开。
代码实现在 packet.StartNetSniff(ipaddr string)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants