go-sniffer

command module
v0.0.0-...-bb56650 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 1 Imported by: 0

README

go-sniffer

Capture mysql,redis,http,mongodb etc protocol... 抓包截取项目中的数据库请求并解析成相应的语句,如mysql协议会解析为sql语句,便于调试。 不要修改代码,直接嗅探项目中的数据请求。

GitHub license

中文使用说明

Support List:

Demo:

$ go-sniffer en0 mysql

image

Setup:

  • support : MacOS Linux Unix
  • not support : windows
  • If you encounter problems in the go get process, try upgrading the go version (如果go get 过程中遇到问题,请尝试升级go版本)
Centos
$ yum -y install libpcap-devel
Ubuntu
$ apt-get install libpcap-dev
MacOs

RUN
$ go get -v -u github.com/40t/go-sniffer
$ cp -rf $(go env GOPATH)/bin/go-sniffer /usr/local/bin
$ go-sniffer

Usage:

==================================================================================
[Usage]

    go-sniffer [device] [plug] [plug's params(optional)]

    [Example]
          go-sniffer en0 redis          Capture redis packet
          go-sniffer en0 mysql -p 3306  Capture mysql packet

    go-sniffer --[commend]
               --help "this page"
               --env  "environment variable"
               --list "Plug-in list"
               --ver  "version"
               --dev  "device"
    [Example]
          go-sniffer --list "show all plug-in"

==================================================================================
[device] : lo0 :   127.0.0.1
[device] : en0 : xx:xx:xx:xx:xx:xx  192.168.199.221
==================================================================================
中文使用说明
=======================================================================
[使用说明]

    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
=======================================================================
Example:
$ go-sniffer lo0 mysql 
$ go-sniffer en0 redis 
$ go-sniffer eth0 http -p 8080
$ go-sniffer eth1 mongodb

License:

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
plugSrc
mongodb/build/FerretDB-internal/backends
Package backends provides common interfaces ([Backend], [Database], and [Collection]) and code for all backend implementations.
Package backends provides common interfaces ([Backend], [Database], and [Collection]) and code for all backend implementations.
mongodb/build/FerretDB-internal/backends/decorators/dummy
Package dummy provides decorators that delegate all methods to wrapped objects.
Package dummy provides decorators that delegate all methods to wrapped objects.
mongodb/build/FerretDB-internal/backends/decorators/oplog
Package oplog provides decorators that add OpLog functionality to the backend.
Package oplog provides decorators that add OpLog functionality to the backend.
mongodb/build/FerretDB-internal/backends/hana
Package hana provides backend for SAP HANA.
Package hana provides backend for SAP HANA.
mongodb/build/FerretDB-internal/backends/mysql
Package mysql provides backend for MySQL and compatible databases.
Package mysql provides backend for MySQL and compatible databases.
mongodb/build/FerretDB-internal/backends/mysql/metadata
Package metadata provides access to databases and collections information.
Package metadata provides access to databases and collections information.
mongodb/build/FerretDB-internal/backends/mysql/metadata/pool
Package pool provides access to MySQL connections.
Package pool provides access to MySQL connections.
mongodb/build/FerretDB-internal/backends/postgresql
Package postgresql provides backend for PostgreSQL and compatible databases.
Package postgresql provides backend for PostgreSQL and compatible databases.
mongodb/build/FerretDB-internal/backends/postgresql/metadata
Package metadata provides access to databases and collections information.
Package metadata provides access to databases and collections information.
mongodb/build/FerretDB-internal/backends/postgresql/metadata/pool
Package pool provides access to PostgreSQL connections.
Package pool provides access to PostgreSQL connections.
mongodb/build/FerretDB-internal/backends/sqlite
Package sqlite provides SQLite backend.
Package sqlite provides SQLite backend.
mongodb/build/FerretDB-internal/backends/sqlite/metadata
Package metadata provides access to databases and collections information.
Package metadata provides access to databases and collections information.
mongodb/build/FerretDB-internal/backends/sqlite/metadata/pool
Package pool provides access to SQLite databases and their connections.
Package pool provides access to SQLite databases and their connections.
mongodb/build/FerretDB-internal/bson
Package bson provides converters from/to BSON for built-in and `types` types.
Package bson provides converters from/to BSON for built-in and `types` types.
mongodb/build/FerretDB-internal/clientconn
Package clientconn provides client connection implementation.
Package clientconn provides client connection implementation.
mongodb/build/FerretDB-internal/clientconn/conninfo
Package conninfo provides access to connection-specific information.
Package conninfo provides access to connection-specific information.
mongodb/build/FerretDB-internal/clientconn/connmetrics
Package connmetrics provides listener and connection metrics.
Package connmetrics provides listener and connection metrics.
mongodb/build/FerretDB-internal/clientconn/cursor
Package cursor provides access to cursor registry.
Package cursor provides access to cursor registry.
mongodb/build/FerretDB-internal/handler
Package handler provides a universal handler implementation for all backends.
Package handler provides a universal handler implementation for all backends.
mongodb/build/FerretDB-internal/handler/common
Package common contains code used to be shared by different handlers.
Package common contains code used to be shared by different handlers.
mongodb/build/FerretDB-internal/handler/common/aggregations
Package aggregations provides aggregation pipelines.
Package aggregations provides aggregation pipelines.
mongodb/build/FerretDB-internal/handler/common/aggregations/operators
Package operators provides aggregation operators.
Package operators provides aggregation operators.
mongodb/build/FerretDB-internal/handler/common/aggregations/operators/accumulators
Package accumulators provides aggregation accumulator operators.
Package accumulators provides aggregation accumulator operators.
mongodb/build/FerretDB-internal/handler/common/aggregations/stages
Package stages provides aggregation stages.
Package stages provides aggregation stages.
mongodb/build/FerretDB-internal/handler/common/aggregations/stages/projection
Package projection provides projection for aggregations.
Package projection provides projection for aggregations.
mongodb/build/FerretDB-internal/handler/commonpath
Package commonpath contains functions used for path.
Package commonpath contains functions used for path.
mongodb/build/FerretDB-internal/handler/handlererrors
Package handlererrors provides handlers errors.
Package handlererrors provides handlers errors.
mongodb/build/FerretDB-internal/handler/handlerparams
Package handlerparams provides functions for parsing handlers parameters.
Package handlerparams provides functions for parsing handlers parameters.
mongodb/build/FerretDB-internal/handler/proxy
Package proxy sends requests to another wire protocol compatible service.
Package proxy sends requests to another wire protocol compatible service.
mongodb/build/FerretDB-internal/handler/registry
Package registry provides a registry of handlers.
Package registry provides a registry of handlers.
mongodb/build/FerretDB-internal/handler/sjson
Package sjson provides converters from/to jsonb with some extensions for built-in and `types` types.
Package sjson provides converters from/to jsonb with some extensions for built-in and `types` types.
mongodb/build/FerretDB-internal/types
Package types provides Go types matching BSON types that don't have built-in Go equivalents.
Package types provides Go types matching BSON types that don't have built-in Go equivalents.
mongodb/build/FerretDB-internal/types/fjson
Package fjson provides converters to FJSON (JSON with some extensions) for built-in and `types` types.
Package fjson provides converters to FJSON (JSON with some extensions) for built-in and `types` types.
mongodb/build/FerretDB-internal/util/ctxutil
Package ctxutil provides context helpers.
Package ctxutil provides context helpers.
mongodb/build/FerretDB-internal/util/debug
Package debug provides debug facilities.
Package debug provides debug facilities.
mongodb/build/FerretDB-internal/util/debugbuild
Package debugbuild provides information about whatever this is a debug build or not.
Package debugbuild provides information about whatever this is a debug build or not.
mongodb/build/FerretDB-internal/util/fsql
Package fsql provides database/sql utilities.
Package fsql provides database/sql utilities.
mongodb/build/FerretDB-internal/util/hex
Package hex provides helpers for working with hex dumps.
Package hex provides helpers for working with hex dumps.
mongodb/build/FerretDB-internal/util/iterator
Package iterator describes a generic Iterator interface and related utilities.
Package iterator describes a generic Iterator interface and related utilities.
mongodb/build/FerretDB-internal/util/iterator/testiterator
Package testiterator provides a helper for checking iterator implementations.
Package testiterator provides a helper for checking iterator implementations.
mongodb/build/FerretDB-internal/util/lazyerrors
Package lazyerrors provides error wrapping with file location.
Package lazyerrors provides error wrapping with file location.
mongodb/build/FerretDB-internal/util/logging
Package logging provides logging helpers.
Package logging provides logging helpers.
mongodb/build/FerretDB-internal/util/must
Package must provides helper functions that panic on error.
Package must provides helper functions that panic on error.
mongodb/build/FerretDB-internal/util/observability
Package observability provides abstractions for tracing, metrics, etc.
Package observability provides abstractions for tracing, metrics, etc.
mongodb/build/FerretDB-internal/util/password
Package password provides utilities for password hashing and verification.
Package password provides utilities for password hashing and verification.
mongodb/build/FerretDB-internal/util/resource
Package resource provides utilities for tracking resource lifetimes.
Package resource provides utilities for tracking resource lifetimes.
mongodb/build/FerretDB-internal/util/state
Package state stores FerretDB process state.
Package state stores FerretDB process state.
mongodb/build/FerretDB-internal/util/telemetry
Package telemetry provides basic telemetry facilities.
Package telemetry provides basic telemetry facilities.
mongodb/build/FerretDB-internal/util/testutil
Package testutil provides testing helpers.
Package testutil provides testing helpers.
mongodb/build/FerretDB-internal/util/testutil/testfail
Package testfail provides testing helpers for expected tests failures.
Package testfail provides testing helpers for expected tests failures.
mongodb/build/FerretDB-internal/util/testutil/teststress
Package teststress provides a helper for stress testing.
Package teststress provides a helper for stress testing.
mongodb/build/FerretDB-internal/util/testutil/testtb
Package testtb provides a common testing interface.
Package testtb provides a common testing interface.
mongodb/build/FerretDB-internal/util/tlsutil
Package tlsutil provides TLS utilities.
Package tlsutil provides TLS utilities.
mongodb/build/FerretDB-internal/wire
Package wire provides wire protocol implementation.
Package wire provides wire protocol implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL