All Projects → slgobinath → pcap-processor

slgobinath / pcap-processor

Licence: GPL-3.0 License
Read and process pcap files using this nifty tool

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to pcap-processor

Ttrpc
GRPC for low-memory environments
Stars: ✭ 236 (+555.56%)
Mutual labels:  stream, grpc
Csv
CSV Decoding and Encoding for Elixir
Stars: ✭ 398 (+1005.56%)
Mutual labels:  csv, stream
Grpc By Example Java
A collection of useful/essential gRPC Java Examples
Stars: ✭ 709 (+1869.44%)
Mutual labels:  stream, grpc
Fast Csv
CSV parser and formatter for node
Stars: ✭ 1,054 (+2827.78%)
Mutual labels:  csv, stream
React Papaparse
react-papaparse is the fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
Stars: ✭ 116 (+222.22%)
Mutual labels:  csv, stream
eec
A fast and lower memory excel write/read tool.一个非POI底层,支持流式处理的高效且超低内存的Excel读写工具
Stars: ✭ 93 (+158.33%)
Mutual labels:  csv, stream
text2json
Performant parser for textual data (CSV parser)
Stars: ✭ 33 (-8.33%)
Mutual labels:  csv, stream
Iostreams
IOStreams is an incredibly powerful streaming library that makes changes to file formats, compression, encryption, or storage mechanism transparent to the application.
Stars: ✭ 84 (+133.33%)
Mutual labels:  csv, stream
Csv Stream
📃 Streaming CSV Parser for Node. Small and made entirely out of streams.
Stars: ✭ 98 (+172.22%)
Mutual labels:  csv, stream
Csvbuilder
Easily encode complex JSON objects to CSV with CsvBuilder's schema-like API
Stars: ✭ 128 (+255.56%)
Mutual labels:  csv, stream
tabular-stream
Detects tabular data (spreadsheets, dsv or json, 20+ different formats) and emits normalized objects.
Stars: ✭ 34 (-5.56%)
Mutual labels:  csv, stream
pci
Packet communication investigator
Stars: ✭ 82 (+127.78%)
Mutual labels:  pcap
simplifai
Free automated deep learning for spreadsheets
Stars: ✭ 17 (-52.78%)
Mutual labels:  csv
meshRPC
Automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio.
Stars: ✭ 69 (+91.67%)
Mutual labels:  grpc
httpbook
Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
Stars: ✭ 18 (-50%)
Mutual labels:  grpc
grpcoin
API-driven cryptocurrency paper trading game. Write a bot and play!
Stars: ✭ 53 (+47.22%)
Mutual labels:  grpc
lolita
基于gin 微服务opentrace集成
Stars: ✭ 13 (-63.89%)
Mutual labels:  grpc
pulseha
PulseHA is a active-passive high availability cluster daemon that uses GRPC and is written in GO.
Stars: ✭ 15 (-58.33%)
Mutual labels:  grpc
vue-virtual-stream
Simple vue-virtualized package for Vue.js
Stars: ✭ 16 (-55.56%)
Mutual labels:  stream
sms
rtmp server and super media server whith golang.
Stars: ✭ 65 (+80.56%)
Mutual labels:  stream

Pcap Processor

Read and process pcap files using this nifty tool.

This tool can read pcap files, process them internally and write them to one or more sinks. Currently there are mappers written for pcap length conversion and protocol normalization. I also have written sinks to write the pcap file to console, csv file or http endpoint.

usage: pcap-processor [-h] [--map {length,protocol}]
                      [--sink {console,kafka,http,csv,grpc}] [--version]
                      file [file ...]

Read and process pcap files using this nifty tool.

positional arguments:
  file                  pcap file to read

optional arguments:
  -h, --help            show this help message and exit
  --map {length,protocol}
                        enable a mapper with the given name. You can use this
                        option multiple times to enable more than one mappers
  --sink {console,kafka,http,csv,grpc}
                        enable a sink with the given name. You can use this
                        option multiple times to enable more than one sinks
  --version             show program's version number and exit

Note

Currently the pcap-processor reads only packets with IP or IPV6 layers. Feel free to modify the code based on your requirement. If you find any enhancement, please send a Pull Request.

Requirements

pcap-reader relies on external command line tool: tshark and some Python modules.

Install tshark using the following command in Ubuntu and its derivatives:

sudo apt install tshark

Install Python dependencies using the following command:

pip3 install -r requirements.txt

Research Work

This tool is developed as part of my research project. If you are using this tool in your research, please cite the following paper:

Citation:

Loganathan, G., Samarabandu, J., & Wang, X. (2018). Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly Detection in Network Traffic. In 2018 IEEE Canadian Conference on Electrical & Computer Engineering (CCECE) (CCECE 2018). Quebec City, Canada.

BibTex

@INPROCEEDINGS{Loga1805:Sequence,
AUTHOR="Gobinath Loganathan and Jagath Samarabandu and Xianbin Wang",
TITLE="Sequence to Sequence Pattern Learning Algorithm for Real-time Anomaly
Detection in Network Traffic",
BOOKTITLE="2018 IEEE Canadian Conference on Electrical \& Computer Engineering (CCECE)
(CCECE 2018)",
ADDRESS="Quebec City, Canada",
DAYS=13,
MONTH=may,
YEAR=2018,
KEYWORDS="Seq2Seq; Anomaly Detection",
ABSTRACT="Network intrusions can be modeled as anomalies in network traffic in which
the expected order of packets and their attributes deviate from regular
traffic. Algorithms that predict the next sequence of events based on
previous sequences are a promising avenue for detecting such anomalies. In
this paper, we present a novel multi-attribute model for predicting a
network packet sequence based on previous packets using a
sequence-to-sequence (Seq2Seq) encoder-decoder model. This model is trained
on an attack-free dataset to learn the normal sequence of packets in TCP
connections and then it is used to detect anomalous packets in TCP traffic.
We show that in DARPA 1999 dataset, the proposed multi-attribute Seq2Seq
model detects anomalous raw TCP packets which are part of intrusions with
97\% accuracy. Also, it can detect selected intrusions in real-time with
100\% accuracy and outperforms existing algorithms based on recurrent
neural network models such as LSTM."
}

Use Cases

Read a pcap file and send all packets to Apache Kafka:

python3 -m pcap_processor --sink kafka samples/cicids_2017.pcap

Read a pcap file, map protocols and write them to a CSV file:

python3 -m pcap_processor --map protocol --sink csv samples/cicids_2017.pcap

Mappers and sinks have their own properties. Please modify them in the relevant plugins/<file>.py.

For example, to change the output CSV file location, modify the self.path = "packets.csv" in pcap_processor/plugins/csv_sink.py.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].