
Programmierbare Paketinspektions-Engine mit NIDS, DNS-Klassifizierung, Frequenzanalyse und automatischer Regex-Generierung. Unterstützt Python/Ruby/Java/Lua-Bindungen für die Integration mit Datenbanken und anderen Sicherheitstools.
AIEngine ist eine interaktive/programmierbare Paketinspektionsengine der nächsten Generation in Python/Ruby/Java/Lua mit Fähigkeiten zum Lernen ohne menschliches Eingreifen, NIDS-Funktionalität (Network Intrusion Detection System), DNS-Domain-Klassifizierung, Netzwerksammler, Netzwerkforensik und vielen weiteren.
Das eigentliche Projekt befindet sich auf https://bitbucket.org/camp0/aiengine
AIEngine hilft Netzwerk-/Sicherheitsexperten auch dabei, Datenverkehr zu identifizieren und Signaturen für den Einsatz in NIDS, Firewalls, Verkehrsklassifikatoren usw. zu entwickeln.
Die Hauptfunktionen von AIEngine sind:
Um AIEngine (reduzierte Version) zu verwenden, führen Sie einfach die Binärdatei aiengine aus oder verwenden Sie die Python/Ruby/Java/Lua-Bindung.
luis@luis-xps:~/c++/aiengine/src$ ./aiengine -h
aiengine 1.5
Mandatory arguments:
-I [ --input ] arg Sets the network interface ,pcap file or
directory with pcap files.
Link Layer optional arguments:
-q [ --tag ] arg Selects the tag type of the ethernet layer (vlan,mpls).
TCP optional arguments:
-t [ --tcp-flows ] arg (=32768) Sets the number of TCP flows on the pool.
UDP optional arguments:
-u [ --udp-flows ] arg (=16384) Sets the number of UDP flows on the pool.
Regex optional arguments:
-R [ --enable-signatures ] Enables the Signature engine.
-r [ --regex ] arg (=.*) Sets the regex for evaluate agains the flows.
-c [ --flow-class ] arg (=all) Uses tcp, udp or all for matches the signature
on the flows.
-m [ --matched-flows ] Shows the flows that matchs with the regex.
-j [ --reject-flows ] Rejects the flows that matchs with the
regex.
-w [ --evidence ] Generates a pcap file with the matching
regex for forensic analysis.
Frequencies optional arguments:
-F [ --enable-frequencies ] Enables the Frequency engine.
-g [ --group-by ] arg (=dst-port) Groups frequencies by src-ip,dst-ip,src-por
t and dst-port.
-f [ --flow-type ] arg (=tcp) Uses tcp or udp flows.
-L [ --enable-learner ] Enables the Learner engine.
-k [ --key-learner ] arg (=80) Sets the key for the Learner engine.
-b [ --buffer-size ] arg (=64) Sets the size of the internal buffer for
generate the regex.
-y [ --enable-yara ] Generates a yara signature.
Optional arguments:
-n [ --stack ] arg (=lan) Sets the network stack (lan,mobile,lan6,virtual,
oflow).
-d [ --dumpflows ] Dump the flows to stdout.
-s [ --statistics ] arg (=0) Show statistics of the network stack (5 levels).
-T [ --timeout ] arg (=180) Sets the flows timeout.
-P [ --protocol ] arg Show statistics of a specific protocol of the
network stack.
-e [ --release ] Release the caches.
-l [ --release-cache ] arg Release a specific cache.
-p [ --pstatistics ] Show statistics of the process.
-h [ --help ] Show help.
-v [ --version ] Show version string.
AIEngine unterstützt fünf Arten von Netzwerkstacks, abhängig von der Netzwerktopologie.
StackLan (lan) Local Area Network basierend auf IPv4.
StackLanIPv6 (lan6) Local Area Network mit IPv6-Unterstützung.
StackMobile (mobile) Netzwerk-Mobil (Gn-Schnittstelle) für IPv4.
StackVirtual (virtual) Stack für virtuelle/Cloud-Umgebungen mit VxLan und GRE Transparent.
StackOpenFlow (oflow) Stack für OpenFlow-Umgebungen.
AIEngine ist auch ein Python/Ruby/Java/Lua-Modul, das eine flexiblere Integration mit anderen Systemen und Funktionalitäten ermöglicht. Die Hauptobjekte, die das Python-Modul exportiert, sind die folgenden:
DNSInfo
BitcoinInfo
DatabaseAdaptor (Abstract class)
DomainName
DomainNameManager
Flow
FlowManager
Frequencies
FrequencyGroup
HTTPInfo
HTTPUriSet
IMAPInfo
IPAbstractSet (Abstract class)
IPSet
IPSetManager
LearnerEngine
NetworkStack (Abstract class)
StackLan
StackLanIPv6
StackMobile
StackOpenFlow
StackVirtual
POPInfo
PacketDispatcher
PacketFrequencies
Regex
RegexManager
SIPInfo
SMTPInfo
SSLInfo
MQTTInfo
CoAPInfo
Für eine vollständige Beschreibung der Klassenmethoden
import pyaiengine
help(pyaiengine)
Überprüfen Sie die Konfigurationswiki-Seiten oder das Beispiele-Verzeichnis für weitere interessante Beispiele. [https://bitbucket.org/camp0/aiengine/wiki/Configurations]
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ make
Die erste Option zum Kompilieren der Bibliothek verwendet die O3-Kompilierungsoptimierung, dies erzeugt eine kleine Bibliothek.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make python
$ python pyai_test.py
Die zweite Option kompiliert die Bibliothek auf die standardmäßige pythonische Weise mit setup.py, dies erzeugt im Vergleich zur vorherigen eine größere Bibliotheksgröße.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ python setup.py build_ext -i
$ python pyai_test.py
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make ruby
$ ruby ruai_tests.rb
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make java
$ java -cp ".:/usr/share/java/junit.jar:/usr/share/java/hamcrest/core.jar:./buildjava" org.junit.runner.JUnitCore JunitTestSuite
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make lua
$ lua luai_tests.lua
AIEngine wird mit dem C++11/14 Standard entwickelt und steht unter den Bedingungen der GPLv2.
Holen Sie sich den AIEngine-Quellcode mit
$ git clone https://bitbucket.com/camp0/aiengine
Wenn Sie an einer Funktion oder Hilfe interessiert sind, senden Sie mir einfach eine E-Mail. Beiträge sind immer willkommen.
AIEngine wurde mit testgetriebener Entwicklung entwickelt. Um den gleichen Lebenszyklus beizubehalten, sollte die neue Funktionalität Unit-Tests im erstellten Verzeichnis der neuen Funktionalität haben und um mit dem gesamten System zu integrieren, später in die Hauptdatei tests.cc im Verzeichnis /src integrieren.