
AIEngine est un NIDS (système de détection d'intrusion réseau) interactif/programmable de nouvelle génération en Python/Ruby/Java/Lua et Go.
AIEngine est un moteur de système de détection d'intrusion réseau de nouvelle génération, interactif/programmable en Python/Ruby/Java/Lua et Go, doté de capacités d'apprentissage sans intervention humaine, de classification de domaines DNS, de détection de spam, de collecte réseau, de criminalistique réseau et bien d'autres.
AIEngine aide également les professionnels du réseau et de la sécurité à identifier le trafic et à développer des signatures pour les utiliser sur les NIDS, les pare-feu, les classificateurs de trafic, etc.
Les principales fonctionnalités d'AIEngine sont :
Consultez le dossier docs pour plus d'informations
Pour utiliser AIEngine (version réduite), exécutez simplement le binaire aiengine ou utilisez la liaison python/ruby/java/lua.
luis@luis-xps:~/c++/aiengine/src$ ./aiengine -h
aiengine 2.1.0
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.
Domain optional arguments:
-D [ --domain-file ] arg Reads domain names from file.
-B [ --domain-protocol ] arg (=dns) Protocol to plug the domain-file (dns,
ssl, http).
-S [ --matched-domain ] Shows only the domains that matches.
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.
-M [ --matched-packet ] Shows the packet payload that matchs with
the regex.
-C [ --continue ] Continue evaluating the regex with the
next packets of the Flow.
-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.
-Q [ --byte-quality ] arg (=80) Sets the minimum quality for the bytes of
the generated 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.
-a [ --port ] arg (=0) Sets the HTTP listenting port.
-e [ --release ] Release the caches.
-l [ --release-cache ] arg Release a specific cache.
-p [ --pstatistics ] Show statistics of the process.
-o [ --summary ] Show protocol summmary statistics
(bytes,packets,% bytes,cache miss,memory).
-h [ --help ] Show help.
-v [ --version ] Show version string.
AIEngine prend en charge six types de piles réseau (Network stacks) selon la topologie du réseau.
StackLan (lan) réseau local basé sur IPv4.
StackLanIPv6 (lan6) réseau local avec prise en charge IPv6.
StackMobile (mobile) réseau mobile (interface Gn) pour IPv4.
StackVirtual (virtual) pile pour environnements virtuels/cloud avec VxLan et GRE transparent.
StackOpenFlow (oflow) pile pour environnements OpenFlow.
StackMobileIPv6 (mobile6) réseau mobile (interface Gn) pour IPv6.
AIEngine est également un module python/ruby/java/lua qui permet d'être plus flexible en termes d'intégration avec d'autres systèmes et fonctionnalités. Les principaux objets que le module python exporte sont les suivants.
BitcoinInfo
Cache
CoAPInfo
DCERCPInfo
DHCPInfo
DHCPv6Info
DNSInfo
DTLSInfo
DatabaseAdaptor
DomainName
DomainNameManager
Flow
FlowManager
Frequencies
FrequencyGroup
HTTPInfo
HTTPUriSet
IMAPInfo
IPAbstractSet
IPRadixTree
IPSet
IPSetManager
LearnerEngine
MQTTInfo
NetbiosInfo
NetworkStack
StackLan
StackLanIPv6
StackMobile
StackMobileIPv6
StackOpenFlow
StackVirtual
POPInfo
PacketDispatcher
PacketFrequencies
QuicInfo
Regex
RegexManager
SIPInfo
SMBInfo
SMTPInfo
SSDPInfo
SSHInfo
SSLInfo
TCPInfo
Pour une description complète des méthodes de classe en Python
import pyaiengine
help(pyaiengine)
Consultez le répertoire examples pour des cas d'utilisation utiles et /docs pour la documentation.
Vous devez avoir installé pcre-devel, libpcap-devel et boost-devel sur votre système, au minimum.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ make
Le système fournit les fonctionnalités d'activation/désactivation suivantes selon vos besoins.
Ces options ne peuvent être activées/désactivées qu'au moment de la compilation, dans le script configure.
Pour compiler la bibliothèque Python, il est également recommandé d'installer boost-python3-devel ou boost-python-devel et python-devel.
La première option pour compiler la bibliothèque consiste à utiliser l'optimisation de compilation O3 ; cela générera une bibliothèque de petite taille.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make python
$ python pyai_test.py
La deuxième option compile la bibliothèque en utilisant la méthode pythonique standard via setup.py ; cela générera une bibliothèque de plus grande taille par rapport à la précédente.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ python setup.py build_ext -i
$ python pyai_test.py
$ python3.6 setup.py build_ext -i
$ python3.6 pyai_test.py
La bibliothèque python contient toutes les fonctionnalités que le moteur fournit.
Pour compiler sous Ruby, swig et ruby-devel sont nécessaires.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make ruby
$ ruby ruai_tests.rb
La bibliothèque Ruby ne fournit pas toutes les fonctionnalités du moteur.
Pour compiler sous Java, le paquet de développement java est nécessaire.
$ 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
La bibliothèque Java fournit une partie des fonctionnalités du moteur, avec quelques exceptions.
Pour compiler sous Lua, swig et le paquet lua-devel sont nécessaires.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make lua
$ lua luai_tests.lua
La bibliothèque Lua fournit la majorité des fonctionnalités du moteur.
Pour compiler sous Go, swig est nécessaire.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make go
$ ./goai_test
La bibliothèque Go présente certaines restrictions fonctionnelles en raison de la nature du langage.
Vous trouverez une description complète de différents cas d'utilisation avec les NIDS les plus courants sur http://aiengine.readthedocs.io/en/latest/aiengine.html#performance-with-other-engines
AIEngine est développé avec le standard c++11/14/17 et est soumis aux termes de la GPLv2.
Consultez le code source d'AIEngine avec
$ git clone https://bitbucket.com/camp0/aiengine
Si vous êtes intéressé par une fonctionnalité spécifique, si vous voulez promouvoir le projet ou si vous avez simplement besoin d'aide, envoyez-moi un e-mail. Les contributions sont toujours utiles.
AIEngine a été développé en utilisant le développement piloté par les tests (TDD). Afin de maintenir le même cycle de vie, la nouvelle fonctionnalité doit avoir des tests unitaires dans le répertoire créé pour celle-ci et, pour s'intégrer à l'ensemble du système, être ensuite intégrée au fichier principal tests.cc du répertoire /src.
Si vous avez un cas d'utilisation qui n'est pas couvert par les exemples fournis, n'hésitez pas à me contacter.
Si vous aimez le projet, vous pouvez m'offrir des bières en bitcoin :)
3DG7FhkFUuKq7VhfXdP9QpsUzfWPXu49ng