
프로그래밍 가능한 패킷 검사 엔진으로 NIDS, DNS 분류, 주파수 분석, 자동 정규식 생성을 지원합니다. Python/Ruby/Java/Lua 바인딩을 통해 데이터베이스 및 기타 보안 도구와 통합할 수 있습니다.
AIEngine는 차세대 대화형/프로그래밍 가능한 Python/Ruby/Java/Lua 패킷 검사 엔진으로, 사람의 개입 없이 학습할 수 있는 기능, NIDS(네트워크 침입 탐지 시스템) 기능, DNS 도메인 분류, 네트워크 수집기, 네트워크 포렌식 등을 갖추고 있습니다.
현재 프로젝트는 https://bitbucket.org/camp0/aiengine 에 있습니다.
AIEngine은 네트워크/보안 전문가가 트래픽을 식별하고 NIDS, 방화벽, 트래픽 분류기 등에 사용할 시그니처를 개발하는 데도 도움을 줍니다.
AIEngine의 주요 기능은 다음과 같습니다.
AIEngine(축소 버전)을 사용하려면 바이너리 aiengine을 실행하거나 python/ruby/java/lua 바인딩을 사용하십시오.
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은 네트워크 토폴로지에 따라 다섯 가지 유형의 네트워크 스택을 지원합니다.
StackLan (lan) IPv4 기반 로컬 영역 네트워크.
StackLanIPv6 (lan6) IPv6을 지원하는 로컬 영역 네트워크.
StackMobile (mobile) IPv4용 모바일 네트워크(Gn 인터페이스).
StackVirtual (virtual) VxLan 및 GRE Transparent를 사용하는 가상/클라우드 환경용 스택.
StackOpenFlow (oflow) 오픈플로우 환경용 스택.
AIEngine은 python/ruby/java/lua 모듈이기도 하여 다른 시스템 및 기능과의 통합 측면에서 더 유연합니다. python 모듈이 내보내는 주요 객체는 다음과 같습니다.
DNSInfo
BitcoinInfo
DatabaseAdaptor (추상 클래스)
DomainName
DomainNameManager
Flow
FlowManager
Frequencies
FrequencyGroup
HTTPInfo
HTTPUriSet
IMAPInfo
IPAbstractSet (추상 클래스)
IPSet
IPSetManager
LearnerEngine
NetworkStack (추상 클래스)
StackLan
StackLanIPv6
StackMobile
StackOpenFlow
StackVirtual
POPInfo
PacketDispatcher
PacketFrequencies
Regex
RegexManager
SIPInfo
SMTPInfo
SSLInfo
MQTTInfo
CoAPInfo
클래스 메서드에 대한 전체 설명을 보려면
import pyaiengine
help(pyaiengine)
보다 흥미로운 예제를 보려면 구성 위키 페이지 또는 examples 디렉토리를 확인하십시오. [https://bitbucket.org/camp0/aiengine/wiki/Configurations]
$ git clone https://bitbucket.com/camp0/aiengine
$ ./autogen.sh
$ ./configure
$ make
라이브러리 컴파일의 첫 번째 옵션은 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
$ 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은 c++11/14 표준으로 개발되었으며 GPLv2 조건에 따라 배포됩니다.
AIEngine 소스 코드를 확인하려면
$ git clone https://bitbucket.com/camp0/aiengine
특정 기능에 관심이 있거나 도움이 필요하면 이메일을 보내주십시오. 기여는 언제나 환영합니다.
AIEngine은 테스트 주도 개발(TDD)을 사용하여 개발되었습니다. 따라서 동일한 라이프 사이클을 유지하려면 새 기능의 디렉토리에 단위 테스트를 작성하고, 이후 시스템 전체와 통합한 다음 /src 디렉토리의 main tests.cc 파일과 통합해야 합니다.