Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiroakis/go-sql-sniffer
The go-sql-sniffer extracts the SQL packet from tcpdump packet.
https://github.com/hiroakis/go-sql-sniffer
Last synced: 14 days ago
JSON representation
The go-sql-sniffer extracts the SQL packet from tcpdump packet.
- Host: GitHub
- URL: https://github.com/hiroakis/go-sql-sniffer
- Owner: hiroakis
- Created: 2017-06-17T09:46:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-17T10:27:46.000Z (over 7 years ago)
- Last Synced: 2024-06-20T12:40:05.361Z (5 months ago)
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-sql-sniffer
The go-sql-sniffer extracts the SQL packet from tcpdump packet. The tool wraps tcpdump.
# Installation
Run git clone and go build.
# Usage
* run
```
sudo go-sql-sniffer
```It is same as `tcpdump tcp -i any -A -t -n -q -s 0 dst port 3306`. The output will be humanreadable json string.
```
{"unixtime":1497694222,"datetime":"2017-06-17 10:10:22","from":"10.0.4.218.61904","to":"10.0.0.159.3306","sql":"SELECT `t`.* FROM `t` WHERE `t`.`id` IN (25298241, 25505237, 25563426, 25564627, 25053459, 25505323, 25506064, 25566828, 24280930, 25568604, 25569780)"}
```* options
```
Usage of /tmp/go-sql-sniffer:
-dst
The dst flag. See man tcpdump. (default true)
-src
The src flag. See man tcpdump.
-port string
The SQL traffic port. (default "3306")
-file string
If you run with -file, the packet data will be saved to specified file.
-format string
The output format. You can set json, csv and tsv. (default "json")
```# License
MIT