
AIEngine هو نظام كشف التسلل عبر الشبكة (NIDS) من الجيل التالي، تفاعلي/قابل للبرمجة بلغات Python/Ruby/Java/Lua وGo.
AIEngine هو محرك من الجيل التالي لأنظمة كشف التسلل الشبكي، تفاعلي/قابل للبرمجة بلغات Python/Ruby/Java/Lua وGo، ويمتلك قدرات تعلم دون أي تدخل بشري، وتصنيف نطاقات DNS، وكشف البريد العشوائي، وجمع بيانات الشبكة، والتحليل الجنائي للشبكة، وغيرها الكثير.
يساعد AIEngine أيضاً المتخصصين في الشبكات/الأمن على تحديد حركة المرور وتطوير توقيعات لاستخدامها في أنظمة NIDS وجدران الحماية ومصنفات حركة المرور وما إلى ذلك.
الوظائف الرئيسية لـ AIEngine هي:
راجع مجلد docs لمزيد من المعلومات
لاستخدام AIEngine (النسخة المصغرة) فقط قم بتشغيل الملف الثنائي aiengine أو استخدم ربط 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 ستة أنواع من حزم الشبكة (Network stacks) اعتماداً على طوبولوجيا الشبكة.
StackLan (lan) شبكة محلية (LAN) قائمة على IPv4.
StackLanIPv6 (lan6) شبكة محلية مع دعم IPv6.
StackMobile (mobile) شبكة الجوال (واجهة Gn) لـ IPv4.
StackVirtual (virtual) حزمة للبيئات الافتراضية/السحابية مع VxLan وGRE الشفاف.
StackOpenFlow (oflow) حزمة لبيئات openflow.
StackMobileIPv6 (mobile6) شبكة الجوال (واجهة Gn) لـ IPv6.
AIEngine هو أيضاً وحدة python/ruby/java/lua تسمح بمرونة أكبر من حيث التكامل مع الأنظمة والوظائف الأخرى. الكائنات الرئيسية التي يوفرها تصدير وحدة python هي التالية:
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
للحصول على وصف كامل لأساليب الفئات (Class methods) في بايثون
import pyaiengine
help(pyaiengine)
راجع دليل examples للاطلاع على حالات استخدام مفيدة، وراجع /docs للتوثيق
يجب أن يكون لديك حزم pcre-devel وlibpcap-devel وboost-devel مثبتة على نظامك كحد أدنى.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ make
يوفر النظام وظائف التفعيل/التعطيل التالية حسب متطلباتك:
لا يمكن تفعيل/تعطيل هذه الخيارات إلا في وقت التجميع عبر سكربت configure.
لتجميع مكتبة بايثون يُنصح أيضاً بتثبيت boost-python3-devel أو boost-python-devel وpython-devel.
الخيار الأول لتجميع المكتبة هو استخدام تحسين الترجمة O3، وهذا سينتج مكتبة صغيرة الحجم
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make python
$ python pyai_test.py
الخيار الثاني سيجمّع المكتبة بالطريقة البايثونية القياسية باستخدام setup.py، وهذا سينتج حجماً أكبر للمكتبة مقارنةً بالخيار السابق.
$ 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
تحتوي مكتبة python على جميع الوظائف التي يوفرها المحرك.
للتجميع على Ruby يلزم swig وruby-devel.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make ruby
$ ruby ruai_tests.rb
لا توفر مكتبة ruby جميع وظائف المحرك.
للتجميع على Java يلزم حزمة java devel.
$ 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
توفر مكتبة java بعض وظائف المحرك، مع بعض الاستثناءات.
للتجميع على Lua يلزم swig وحزمة lua-devel.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make lua
$ lua luai_tests.lua
توفر مكتبة lua معظم وظائف المحرك.
للتجميع على Go يلزم swig.
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ cd src
$ make go
$ ./goai_test
لدى مكتبة Go بعض القيود الوظيفية بسبب طبيعة اللغة.
يمكنك العثور على وصف كامل لحالات الاستخدام المختلفة مع أنظمة NIDS الأكثر شيوعاً على http://aiengine.readthedocs.io/en/latest/aiengine.html#performance-with-other-engines
تم تطوير AIEngine باستخدام معيار c++11/14/17 وهو بموجب شروط GPLv2.
اطلع على مصدر AIEngine باستخدام
$ git clone https://bitbucket.com/camp0/aiengine
إذا كنت مهتماً بوظيفة محددة، أو تريد الترويج للمشروع، أو تحتاج فقط إلى بعض المساعدة، فقط أرسل لي بريداً إلكترونياً. المساهمات مفيدة دائماً.
تم تطوير AIEngine باستخدام منهجية التطوير الموجّه بالاختبارات (TDD). وللحفاظ على نفس دورة الحياة، يجب أن تحتوي الوظيفة الجديدة على اختبارات وحدة في الدليل الذي أُنشئ للوظيفة الجديدة، وللتكامل مع النظام بأكمله، يتم دمجها لاحقاً مع ملف الاختبارات الرئيسي tests.cc في دليل /src.
إذا كانت لديك حالة استخدام غير مغطاة بالأمثلة المقدمة، فلا تتردد في التواصل معي.
إذا أعجبك المشروع، يمكنك أن تشتري لي بعض الجعات بالبيتكوين :)
3DG7FhkFUuKq7VhfXdP9QpsUzfWPXu49ng