Clustering method in protocol reverse engineering for industrial protocols

一、摘要

在本文中,我们提出了一种分析私有协议结构的方法,可以用于工业协议。该方法由六个模块组成:流量收集、消息提取、消息大小聚类、消息相似度聚类、字段提取和会话分析。我们使用Schneider Modicon M580收集流量,并通过将收集的流量与现有的协议逆向工程方法(Netzob、AutoreeEngine和FieldHunter)进行比较,证明了所提出方法的有效性。

二、介绍

在本文中,我们提出了一个使用施耐德Modicon设备(包括具有代表性的PLC设备)推导Modbus/TCP协议结构的系统。系统根据大小对协议消息进行分类,并使用mean-shift算法对协议消息进行聚类,这些分组消息被定义为一种类型。对于每种类型,该系统使用连续序列模式(CSP)算法提取定义字段的公共子字符串。在字段定义之后分析消息的结构。最后,消息类型的顺序和结构可用于识别工业现场使用的消息类型、字段的含义以及网络通信传输的命令。

我们提出的自动工业协议逆向工程方法包括六个阶段,该系统的结构包括以下步骤:流量收集、消息提取、基于大小的消息聚类、基于相似性的消息聚类、字段提取和会话分析。
工业协议的协议逆向工程概述

(一)流量收集

此步骤收集EWS和PLC设备之间的流量。收集流量时,EWS指定函数并执行该函数以收集流量,必须通过多次执行此过程来收集至少两个流量集。

(二)信息提取

收集的流量集存储在pcap类型中。此步骤提取pcap类型文件作为此方法中使用的消息格式。消息形式提取时,按方向分割为请求和响应消息。这是因为请求中的消息类型与响应中的消息类型不同。信息中包含的信息如下:
消息信息

(三)基于大小的消息聚类

此步骤通过根据大小分隔从消息提取步骤提取的消息来指定类型。提取的消息分为请求和响应,因此,该步骤执行两次。首先,此步骤接收请求消息;然后,输入的邮件根据大小进行排序;最后,排序后的邮件从最小大小的邮件开始按顺序格式化。详细步骤如下图所示:
基于大小的消息类型聚类

(四)基于相似性的消息聚类

此步骤测量按大小分隔的消息之间的相似性,执行更详细的聚类,相同大小的消息之间的相似性被测量和分类。我们使用了几种算法来获得对消息进行最佳分类的聚类算法,这些算法包括K-means、UPGMA和mean-shift算法。比较之后,我们最终确定使用mean-shift算法,下图显示了通过均值漂移算法按相似性对消息进行分类的过程:
基于相似性的消息类型聚类
通过此步骤确定所输入消息的消息类型数。

(五)字段提取

字段提取步骤为消息派生静态字段和动态字段。静态字段是指同一类型消息中的一系列公共字符串。动态字段是指除同一类型消息中的公共字符串外的其余消息。

在此步骤中,使用CSP算法提取静态字段。CSP算法基于Apriori算法提取公共字符串,使用CSP算法的静态字段提取过程将相同类型的消息提取到一组序列中。CSP算法从一组序列生成长度为1的内容。长度为1的内容分为通过最低支持度检查不满足最低支持度的内容和满足最低支持度要求的内容。将删除不满足最低支持要求的内容,并创建内容长度为2的满足要求的内容。重复此过程,直到无法再增加长度。下图显示了静态字段提取的过程:
CSP静态字段提取
CSP算法需要最小的支持。最小支持度是指候选内容可以扩展到下一个长度的条件。在本研究中,最小支撑始终设置为100%,100%表示从相同类型的所有消息中提取的公共字符串。

(六)会话分析

会话分析步骤通过对齐推导的消息序列,显示执行函数时定义的消息类型的顺序。消息信息包括流位置和分组位置信息。因此,此信息可用于在会话中实现消息类型序列。实现结果可以分析流中协议消息的结构。

三、实验评估

本文所提出的方法基于Modbus/TCP协议的分析结果来评估性能。最后,通过对比分析以及Netzob和AutoreeEngine的结果,验证了该方法的有效性。

(一)流量收集

项目传输PLC至EWS的功能包括将现有PLC执行的项目信息发送至EWS。我们收集流量并分析以下三个典型功能的协议结构。收集信息如下:
流量评估信息

(二)消息聚类

我们通过分析实验数据的消息类型来手动分类消息类型,分类结果如下:
真实信息分类
我们应用消息聚类算法,分类结果如下,我们确定mean-shift算法与手动分类消息类型的结果最为相似。
基于算法的消息分类结果

(三)性能评估

从简洁性和覆盖面两个方面对绩效评估指标进行了评估。简洁性将输入数据的消息类型评估为手动生成的全局真相类型和从每个方法中提取的消息类型。Coverage评估在提取消息类型时覆盖所有消息的能力。

计算公式
下图显示了本文所使用方法与Netzob与AutoreeEngine简洁性比较:
简洁性比较
下图显示了Netzob、AutoreeEngine和建议方法的覆盖率值比较:覆盖率

四、结论

本文提出了一种分析工业用私有协议结构的方法,此方法可用于有效监控工业协议的网络流量。实验表明,现有的协议逆向工程方法在分析工业协议时存在一些局限性。

作为未来的工作,我们打算应用更多不同的工业协议来开发可用于工业现场的系统。此外,我们的目标是开发一个适用于商业、私有和工业协议的系统。

1. Zetter K. Attack code for SCADA vulnerabilities released online. http://www.wired.com/threatlevel/2011/03/scada-vulnerabilities/,
2011.
2. Spenneberg R, Brüggemann M, Schwartke H. PLC-blaster: a worm living solely in the PLC.Black Hat Asia. 2016;16:116.
3. Langner R. Stuxnet: dissecting a cyberwarfare weapon.IEEE Security & Privacy. 2011;9(3):49-51.
4. Tridgell A. (2003). How Samba was written. [Online]. Available: http://samba.org/ftp/tridge/misc/french_cafe.txt
5. Pidgin. (2018). About Pidgin. [Online]. Available: http://www.pidgin.im/about
6. Caballero J, Song D. Automatic protocol reverse-engineering: message format extraction and field semantics inference.Int J Comput
Telecommun Netw. 2013;57(2):451-474.
7. Liu M, Jia C, Liu L, Wang Z. Extracting sent message formats from executables using backward slicing. Proc. 4th Int. Conf. Emerg.
Intell. Data Web Technol., X'ian, China, Sep. 2013, pp. 377384.
8. Wang Y, Yun X, Shafiq MZ et al A semantics aware approach to automated reverse engineering unknown protocols. In: Proc. 20th IEEE
Int. Conf. Netw. Protocols (ICNP), Oct. 2012, pp. 110.
9. Krueger T, Gascon H, Kramer N, Rieck K Learning stateful models for network honeypots. In: Proc. 5th ACM Workshop Secur. Artif.
Intell., Raleigh, NC, USA, Oct. 2012, pp. 3748.
10. Li H, Shuai B, Wang J, Tang C Protocol reverse engineering using LDA and association analysis. In: Proc. 11th Int. Conf. Comput.
Intell.Secur. (CIS), Dec. 2015, pp. 312316.
11. Beddoe MA. Network protocol analysis using bioinforomatics algorithms; 2004. [Online]. Available: http://www.4tphi.net/?awalters/
PI/pi.pdf
12. Leita C, Mermoud K, Dacier M. ScriptGen: an automated script generation tool for Honeyd. In: Proc. 21st Annu. Comput. Secur. Appl.
Conf., Tucson, AZ, USA, Dec. 2005, p. 2.
13. Cui W, Kannan J, Wang HJ. Discoverer: automatic protocol reverse engineering from network traces. In: Proc. 16th USENIX Secur.
Symp., Boston, MA, USA, Aug. 2007, pp. 199212.
14. Bossert G Exploiting semantic for the automatic reverse engineering of communication protocols. Ph.D. dissertation, Univ. Gif-sur-
Yvette, Rennes, France, Dec. 2014.
15. Wang L, Jiang T. On the complexity of multiple sequence alignment.J Comput Biol. 1994;1(4):337-348.
16. Luo J-Z, Yu S-Z. Position-based automatic reverse engineering of network protocols.J Netw Comput Appl. May 2013;36(3):1070-1077.
17. Wang Y, Zhang N, Wu Y-M., Su B-B, Liao Y-J. Protocol formats reverse engineering based on association rules in wireless environment.
In: Proc. 12th IEEE Int. Conf. Trust, Secur. Privacy Comput. Commun. Melbourne, VIC, Australia, Jul. 2013, pp. 134141.
18. Ji R, Li H, Tang C Extracting keywords of UAVs wireless communication protocols based on association rules learning. In: Proc. 12th
IEEE Int. Conf. Comput. Intell. Secur., Wuxi, China, Dec. 2016, pp. 310313.
19. Bermudez I, Tongaonkar A, Iliofotou M, Mellia M, Munafo MM. Automatic protocol field inference for deeper protocol understanding.
In: Proc. 14th IFIP Netw. Conf., Toulouse, France, May 2015, pp. 19.
20. Ladi G, Buttyan L, Holczer T Message format and field semantics inference for binary protocols using recorded network traffic. In: Proc.
26th Int. Conf. Softw., Telecommun. Comput. Netw., Split, Croatia, Sep. 2018
21. Stouffer K, Falco J, Scarfone K. Guide to industrial control systems (ICS) security.NIST Special Publication. 2011;800(82):16-16.
22. Shim K-S, Goo Y-H, Lee M-S, Hasanova H, Kim M-S Inference of network unknown protocol structure using CSP (contiguous sequence
pattern) algorithm based on tree structure. Proc. of the NOMS 2018IEEE/IFIP DISSECT workshop, Taipei, Taiwan, April. 23, 2018,
pp. 14.
23. Davidson CC, Andel T, Yampolskiy M, McDonald JT, Glisson B, Thomas T (2018). On SCADA PLC and Fieldbus Cyber-Security. In:
13th International Conference on Cyber Warfare and Security pp. 140149.
24. Van Herrewege A, Singelee D, Verbauwhede I. CANAuth—a simple, backward compatible broadcast authentication protocol for CAN
bus. ECRYPT Workshop on Lightweight Cryptography. Vol. 2011. 2011.
25. Thompson S. Application of controller area network bus and CANopen protocol in Industrial Automation. Diss. Murdoch University,
2018.
26. Murvay P-S, Groza B. A brief look at the security of DeviceNet communication in industrial control systems. Proceedings of the Central
European Cybersecurity Conference 2018. 2018.
27. Fovino IN, Carcano A, Masera M, Trombetta A. Design and implementation of a secure modbus protocol. In:International Conference
on Critical Infrastructure Protection. Berlin, Heidelberg: Springer; 2009.
28. Suzuki K, Chino S, Sakurada H, Tarui I, Ban N, Charles P FDT technology for CC-link network. SICE Annual Conference 2011. IEEE,
2011.
29. Höfken H, Paffen B, Schuba M. ICS/SCADA security analysis of a Beckhoff CX5020 PLC. 2015 International Conference on Information
Systems Security and Privacy (ICISSP). IEEE, 2015.
30. Langlois K, van der Hoeven T, Rodriguez Cianca D, et al. Ethercat tutorial: an introduction for real-time hardware communication on
windows [tutorial].IEEE Robot Autom Mag. 2018;25(1):22-122.
31. Faisal MA, Cardenas AA, Wool A. Profiling communications in industrial IP networks: Model complexity and anomaly detection. In:
Security and Privacy Trends in the Industrial Internet of Things. Cham, Switzerland: Springer; 2019:139-160.
32. Feld J. PROFINET—scalable factory communication for all applications. IEEE International Workshop on Factory Communication Sys-
tems, 2004. Proceedings IEEE, 2004.
33. Goldenberg N, Wool A. Accurate modeling of Modbus/TCP for intrusion detection in SCADA systems.Int J Crit Infr Prot. 2013;6(2):
63-75.
34. Jain AK. Data clustering: 50 years beyond K-means.Pattern Recognit Lett. 2010;31(8):651-666.
35. Cumani S, Laface P. Exact memory–constrained UPGMA for large scale speaker clustering.Pattern Recognit. 2019;95:235-246.
36. Reddym CK, Bhanukiran B. A survey of partitional and hierarchical clustering algorithm. In:Data Clustering. Boca Raton, Florida,
United States: Chapman and Hall/CRC; 2018:87-110.
37. Shim KS, Yoon SH, Lee SK, Kim SM, Jung WS, Kim MS. Automatic generation of snort content rule for network traffic analysis.KICS.
2015;40(04):666-677.
posted @ 2022-07-03 21:44  哆啦哆啦呦  阅读(50)  评论(0编辑  收藏  举报