All Projects → mushorg → Go Dpi

mushorg / Go Dpi

Licence: mit
Application layer protocol identification of traffic flows

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Go Dpi

Wagtail
A Django content management system focused on flexibility and user experience
Stars: ✭ 11,387 (+8866.14%)
Mutual labels:  hacktoberfest
Radixengine
A free and open game engine.
Stars: ✭ 126 (-0.79%)
Mutual labels:  hacktoberfest
Dnspy.extension.holly
A dnSpy extension to aid reversing of obfuscated assemblies
Stars: ✭ 127 (+0%)
Mutual labels:  hacktoberfest
Http Server
a simple zero-configuration command-line http server
Stars: ✭ 11,280 (+8781.89%)
Mutual labels:  hacktoberfest
Neo Cowsay
🐮 cowsay is reborn. Neo Cowsay written in Go. This cowsay extended the original and added fun more options. And it can be used as a library.
Stars: ✭ 126 (-0.79%)
Mutual labels:  hacktoberfest
Confs.tech
List of tech conferences: JavaScript / Design - CSS - UX / Ruby - iOS - Android - PHP - Data - Devops and more.
Stars: ✭ 1,649 (+1198.43%)
Mutual labels:  hacktoberfest
Voyager
Voyager - The Missing Laravel Admin
Stars: ✭ 10,801 (+8404.72%)
Mutual labels:  hacktoberfest
Codezilla
⚡️ codezilla ⚡️ One giant 🦖 collection of algorithms & design patterns.
Stars: ✭ 127 (+0%)
Mutual labels:  hacktoberfest
Xknx
XKNX - A KNX library written in Python
Stars: ✭ 125 (-1.57%)
Mutual labels:  hacktoberfest
Cape Python
Collaborate on privacy-preserving policy for data science projects in Pandas and Apache Spark
Stars: ✭ 125 (-1.57%)
Mutual labels:  hacktoberfest
Hydra
OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Compatible with MITREid.
Stars: ✭ 11,884 (+9257.48%)
Mutual labels:  hacktoberfest
Django Phone Verify
A Django app to support phone number verification using security code / One-Time-Password (OTP) sent via SMS.
Stars: ✭ 121 (-4.72%)
Mutual labels:  hacktoberfest
3mux
Terminal multiplexer inspired by i3
Stars: ✭ 1,687 (+1228.35%)
Mutual labels:  hacktoberfest
Cphalcon
High performance, full-stack PHP framework delivered as a C extension.
Stars: ✭ 10,534 (+8194.49%)
Mutual labels:  hacktoberfest
Aid
One-Stop System for Machine Learning.
Stars: ✭ 127 (+0%)
Mutual labels:  hacktoberfest
Discord.js
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.
Stars: ✭ 16,432 (+12838.58%)
Mutual labels:  hacktoberfest
Find Sec Bugs
The SpotBugs plugin for security audits of Java web applications and Android applications. (Also work with Kotlin, Groovy and Scala projects)
Stars: ✭ 1,748 (+1276.38%)
Mutual labels:  hacktoberfest
Doxdocgen
Generate doxygen documentation from source code in VS Code
Stars: ✭ 127 (+0%)
Mutual labels:  hacktoberfest
Mastering Python For Finance Second Edition
Sources codes for: Mastering Python for Finance, Second Edition
Stars: ✭ 127 (+0%)
Mutual labels:  hacktoberfest
Django Init
Project template used at Fueled for scaffolding new Django based projects. 💫
Stars: ✭ 126 (-0.79%)
Mutual labels:  hacktoberfest

Build Status Coverage Status Go Report Card

go-dpi

go-dpi is an open source Go library for application layer protocol identification of traffic flows. In addition to its own heuristic methods, it contains wrappers for other popular and well-established libraries that also perform protocol identification, such as nDPI and libprotoident. It aims to provide a simple, easy-to-use interface and the capability to be extended by a developer with new detection methods and protocols.

It attempts to classify flows to different protocols regardless of the ports used. This makes it possible to detect protocols on non-standard ports, which is ideal for honeypots, as malware might often try and throw off detection methods by using non-standard and unregistered ports. Also, with its layered architecture, it aims to be fast in its detection, only using heavier classification methods when the faster ones fail.

It is being developed in the context of the Google Summer of Code 2017 program, under the mentorship of The Honeynet Project.

Please read the project's Wiki page for more information.

For documentation, please check out the godoc reference.

Example usage

The library and the modules APIs aim to be very simple and straightforward to use. The library relies on the gopacket library and its Packet structure. Once you have a Packet in your hands, it's very easy to classify it with the library. First of all you need to initialize the library. You can do that by calling:

godpi.Initialize()

The Initialize method initializes all the selected modules in the library, by calling the Initialize method that they provide. It also creates the cache that is used to track the flows, which outdates unused flows after some minutes.

Then, you need a flow that contains the packet. You can get the flow a packet belongs to with the following call:

flow, isNew := godpi.GetPacketFlow(packet)

That call returns the flow, as well as whether that flow is a new one (this packet is the first in the flow) or an existing one.

Afterwards, classifying the flow can be done by calling:

result := godpi.ClassifyFlow(flow)

This returns the protocol guessed by the classifiers as well as the source, e.g. go-dpi or one of the wrappers.

Finally, once you are done with the library, you should free the used resources by calling:

godpi.Destroy()

Destroy frees all the resources that the library is using, and calls the Destroy method of all the activated modules. It is essentially the opposite of the Initialize method.

A minimal example application is included below. It uses the library to classify a packet capture file, located at /tmp/http.cap. Note the helpful godpi.ReadDumpFile function that returns a channel with all the packets in the file.

package main

import (
	"fmt"
	"github.com/mushorg/go-dpi"
	"github.com/mushorg/go-dpi/types"
	"github.com/mushorg/go-dpi/utils"
)

func main() {
	godpi.Initialize()
	defer godpi.Destroy()
	packets, err := utils.ReadDumpFile("/tmp/http.cap")
	if err != nil {
		fmt.Println(err)
	} else {
		for packet := range packets {
			flow, _ := godpi.GetPacketFlow(packet)
			result := godpi.ClassifyFlow(flow)
			if result.Protocol != types.Unknown {
				fmt.Println(result.Source, "detected protocol", result.Protocol)
			} else {
				fmt.Println("No detection was made")
			}
		}
	}
}

License

go-dpi is available under the MIT license and distributed in source code format.

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].