通过pcap数据来向镜像端口eth0发送一些垃圾信息,我使用的是一些提前准备好的数据:
pi@foxhound:~ $ sudo tcpreplay -t -K -q--loop=10 --intf1=eth0 /opt/foxhound-1476541443.pcap Actual: 1048570 packets (1050923190 bytes)sent in 87.62 seconds. Rated:11994102.0 bps, 91.51 Mbps, 11967.25 pps下面是发送前和发送后的broctl netstats数据:
root@foxhound:/etc/network# broctl netstats bro: 1476547903.768150 recvd=1951368 dropped=5408 link=1956776 root@foxhound:/etc/network# broctl netstats bro: 1476548144.248161 recvd=3012168 dropped=14608 link=3026776对于家庭或实验室环境来说,它的性能相对还算很好了(1000000个数据包只会丢弃10000个)。我的带宽速度为40Mbps,对于IDS系统来说已经足够了。如果你还需要提升性能,建议考虑换掉树莓派。
如果你想进行更多的NIC perf测试,你可以在服务器上运行下列命令:
mark@Ubuntu:~$ sudo apt install iperf3 mark@ubuntu:~$ iperf3 -s ----------------------------------------------------------- Serverlistening on 5201然后在树莓派上运行:
root@foxhound:~# apt install iperf3 root@foxhound:~# iperf3 -c 10.0.0.7 -i 1 -t20 Connecting to host 10.0.0.7, port 5201 [ 4]local 10.0.0.180 port 38562 connected to 10.0.0.7 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 8.86 MBytes 74.3 Mbits/sec 0 89.1 KBytes ... ... ... [ 4] 19.00-20.00 sec 9.26 MBytes 77.7 Mbits/sec 0 1.23 MBytes - - - - - - - - - - - - - - - - - - - - - -- - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-20.00 sec 185 MBytes 77.5 Mbits/sec 139 sender [ 4] 0.00-20.00 sec 184 MBytes 77.1 Mbits/sec receiver iperf Done.我假设这里的瓶颈是microSD卡,它的速度大约是80MB/s。
Bro基础-所有Bro日志的默认存储路径为/nsm/bro/logs/
-默认的脚本路径为/usr/local/bro/share/bro/site/bro-scripts/
日志目录结构大致如下所示:
pi@foxhound:/nsm/bro/logs/current $ ls-lash total 6.9M 4.0K drwxr-xr-x 3 root root 4.0K Oct 15 16:11 . 4.0K drwxr-xr-x 5 root staff 4.0K Oct 1516:50 .. 4.0K -rw-r--r-- 1 root root 349 Oct 15 16:51 app_stats.log 4.0K -rw-r--r-- 1 root root 121 Oct 15 15:51 .cmdline 16K-rw-r--r-- 1 root root 14K Oct 15 16:30communication.log 2.9M -rw-r--r-- 1 root root 2.9M Oct 15 16:52 conn.log 16K-rw-r--r-- 1 root root 14K Oct 15 16:52dhcp.log 384K -rw-r--r-- 1 root root 379K Oct 15 16:52 dns.log 4.0K -rw-r--r-- 1 root root 345 Oct 15 15:51 .env_vars 1.2M -rw-r--r-- 1 root root 1.2M Oct 15 16:52 files.log 1.6M -rw-r--r-- 1 root root 1.6M Oct 15 16:52 http.log 4.0K -rw-r--r-- 1 root root 291 Oct 15 16:44 known_hosts.log 4.0K -rw-r--r-- 1 root root 327 Oct 15 16:34 known_services.log 12K-rw-r--r-- 1 root root 11K Oct 15 16:50notice.log 4.0K -rw-r--r-- 1 root root 5 Oct 15 15:51 .pid 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.communication 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.conn 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:01 .rotated.conn-summary 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.dhcp 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.dns 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.files 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.http 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.known_hosts 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.known_services 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.loaded_scripts 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.notice 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.packet_filter 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.software 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.ssl 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.weird 4.0K -rw-r--r-- 1 root root 18 Oct 15 16:00 .rotated.x509 4.0K -rw-r--r-- 1 root root 3.0K Oct 15 16:51 software.log 320K -rw-r--r-- 1 root root 314K Oct 15 16:52 ssl.log 4.0K -rw-r--r-- 1 root root 58 Oct 15 15:51 .startup 4.0K drwx------ 3 root root 4.0K Oct 15 15:51 .state 4.0K -rwx------ 1 root root 18 Oct 15 15:51 .status 4.0K -rw-r--r-- 1 root root 46Oct 15 15:51 stderr.log 4.0K -rw-r--r-- 1 root root 188 Oct 15 15:51 stdout.log 24K-rw-r--r-- 1 root root 17K Oct 15 16:52weird.log 416K -rw-r--r-- 1 root root 412K Oct 15 16:52 x509.log