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

mac下面执行没有任何输出 #5

Open
michealzh opened this issue Oct 25, 2018 · 11 comments
Open

mac下面执行没有任何输出 #5

michealzh opened this issue Oct 25, 2018 · 11 comments

Comments

@michealzh
Copy link

mac系统 0.14 (18A391)
go 版本: go version go1.11.1 darwin/amd64

执行命令:
go-sniffer lo0 redis

@xulei131401
Copy link

我也是一样的问题

@40t
Copy link
Owner

40t commented Oct 25, 2018

和wireshark等抓包原理相似,指定端口,设备(lo0,en0,en1等),这2点只要正确即可。

  1. 如果是本地端口(lo0),那么redis配置中的 localhost 要换成 127.0.0.1 。
  2. 比如命令 go-sniffer lo0 redis 这里默认监听的是6379,查看你的redis配置中的端口是否为这个,如果不是可以命令后面加参数-p 新的端口,例如go-sniffer lo0 redis -p 新的端口

@ixqbar
Copy link

ixqbar commented Oct 25, 2018

本地服务都是以0.0.0.0:port运行

无法启动监控

@40t
Copy link
Owner

40t commented Oct 25, 2018

$ go-sniffer --dev 首先看一下设备对应的ip

@ixqbar
Copy link

ixqbar commented Oct 25, 2018

确认过参数无误,--dev 结果正常, ip显示内网ip go-sniffer 启动监控就退出

@40t
Copy link
Owner

40t commented Oct 25, 2018

  1. --dev 显示的信息发一下
    2 .执行的命令发一下

@ixqbar
Copy link

ixqbar commented Oct 25, 2018

  • sudo 解决

应该输出提示信息

sudo ./go-sniffer lo0 mysql
tcp and port 3306
# Start new stream: 127.0.0.1->127.0.0.1 53442->3306
# Start new stream: 127.0.0.1->127.0.0.1 3306->53442
2018-10-25 18:18:45| cli -> ser |【Query】 ���

使用mysql -h127.0.0.1 -uroot -p 测试Query乱码后再没有输出

@40t
Copy link
Owner

40t commented Oct 25, 2018

之后加一下 权限判断 ,thx 辛苦

@vicnoah
Copy link

vicnoah commented Oct 25, 2018

ubuntu18.04安装前需要安装libpcap-dev才能安装成功,说明文档没有写,不安装时会缺少pcap.h。还有就是执行时需要root权限才能执行,否则直接闪退

@40t
Copy link
Owner

40t commented Oct 25, 2018

thx 反馈 我更新一下文档

@chyroc
Copy link
Contributor

chyroc commented Oct 26, 2018

image

1、环境

➜  ~ go-sniffer --ver
0.1
➜  ~ go-sniffer --dev
[device] : lo0 :   127.0.0.1
[device] : en0 : 18:65:90:d5:d8:0b  10.115.3.151
[device] : utun2 :   10.25.0.166

2、打开:

  • wireshark
  • go-sniffer lo0 mysql
  • sudo go-sniffer lo0 mysql

3、结果:

  • wireshark lo0有数据
  • 后两者没有数据

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

6 participants