Skip to content
forked from 40t/go-sniffer

Capture mysql,redis,http,mongodb etc protocol

License

Notifications You must be signed in to change notification settings

xjxyxgq/go-sniffer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-sniffer

捕获mysql,redis,http,mongodb等协议...完善中

  • 抓取项目中的数据库请求,如:执行的mysql查询语句
  • 不需要修改项目代码,通过指定端口抓包解析协议
  • 快速预览项目中所有的数据请求,便于程序调试

GitHub license

Support List:

Demo:

$ go-sniffer en0 mysql

image

Setup:

  • 支持 : MacOS Linux Unix
  • 不支持 : windows
  • 依赖:google/gopacket

依赖库安装:Centos

$ yum install libcap-devel

依赖库安装: Ubuntu

$ apt-get install libcap-dev

RUN

$ go get -v github.com/40t/go-sniffer
$ cd $(go env GOPATH)/src/github.com/40t/go-sniffer
$ go run main.go

Usage:

=======================================================================
[使用说明]

    go-sniffer [设备名] [插件名] [插件参数(可选)]

    [例子]
          go-sniffer en0 redis          抓取redis数据包
          go-sniffer en0 mysql -p 3306  抓取mysql数据包,端口3306

    go-sniffer --[命令]
               --help 帮助信息
               --env  环境变量
               --list 插件列表
               --ver  版本信息
               --dev  设备列表
    [例子]
          go-sniffer --list 查看可抓取的协议

=======================================================================
[设备名] : lo0 :   127.0.0.1
[设备名] : en0 : x:x:x:x:x5:x  192.168.1.3
[设备名] : utun2 :   1.1.11.1
=======================================================================

mysql

支持预处理语句等常大部分语句

$ go-sniffer [设备名] mysql [参数]
-p 置顶端口,默认3306

image

redis

$ go-sniffer [设备名] redis [参数]
-p 置顶端口,默认6379

image

http

$ go-sniffer [设备名] http [参数]
-p 置顶端口,默认80

image

mongodb

$ go-sniffer [设备名] mongodb [参数]
-p 端口,默认27017
  • 支持大部分语句,只有个别少数语句没有实现

License:

MIT

About

Capture mysql,redis,http,mongodb etc protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%