Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/giannisalinetti/gopcap
https://github.com/giannisalinetti/gopcap
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/giannisalinetti/gopcap
- Owner: giannisalinetti
- Created: 2019-11-01T20:03:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-01T20:04:30.000Z (about 5 years ago)
- Last Synced: 2023-02-28T12:37:23.426Z (almost 2 years ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gopcap - a packet capture tool
This is a training oriented project to discover the features of the package
[github.com/google/gopacket](https://github.com/google/gopacket), developed to
handle packet at different layers.### Prerequisites
To use it libpcap devel headers must be installed on the system. On Fedora run
the following command:```
$ sudo dnf install libpcap libpcap-devel
```### Build
To build and install:
```
$ make
$ sudo make install
```### Usage
gopcap must be used with root privileges in order to access the interface.
```
$ sudo gopcap
```To display the help
```
$ gopcap -h
Usage of gopcap:
-i string
Default interface (default "wlp4s0")
-o string
Output mode (dump, short, tcpstat, udpstat) (default "short")
-p Set promiscuous mode
-s int
Snapshot length to read for each packet (default 65536)
```To run the capture on a different interface
```
$ sudo gopcap -i ens1
```To print an hex dump of the packets:
```
$ sudo gopcap -o dump
```To print live tcp stats:
```
$ sudo gopcap -o tcpstat
```To print live udp stats:
```
$ sudo gopcap -o udpstat
```### TODO
The program still needs a lot of development. Some possible features are:
* Implement tests
* Define different capture behaviors (ie: dump only HTTP/HTTPS traffic)
* If needed refactor with a CLI like cobra
* Refine the output layout of dumps###
Authors:
- Gianni Salinetti