WO2009115034A1 - 一种协议报文的检测方法、系统及设备 - Google Patents

一种协议报文的检测方法、系统及设备 Download PDF

Info

Publication number
WO2009115034A1
WO2009115034A1 PCT/CN2009/070837 CN2009070837W WO2009115034A1 WO 2009115034 A1 WO2009115034 A1 WO 2009115034A1 CN 2009070837 W CN2009070837 W CN 2009070837W WO 2009115034 A1 WO2009115034 A1 WO 2009115034A1
Authority
WO
WIPO (PCT)
Prior art keywords
header
protocol packet
protocol
fingerprint feature
detected
Prior art date
Application number
PCT/CN2009/070837
Other languages
English (en)
French (fr)
Inventor
吴平
张喆
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2009115034A1 publication Critical patent/WO2009115034A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, system, and device for detecting protocol packets. Background technique
  • the voice over IP (VOIP) technology carried on the IP provides a low-cost voice service, and provides signaling customization functions to the terminal, facilitating the development of new services.
  • VOIP voice over IP
  • malicious users can easily use the open mechanism to customize malicious signaling, which can pose a threat to the communication system.
  • malicious signaling include the following, such as adding unauthorized headers, attempting to cause the system to handle exceptions or entraining information that is not allowed by the system or causing the system to misidentify the user's signaling as system signaling; or delete necessary Header header; or repeat some header headers multiple times; or add header headers that are not required for this message.
  • the method for dealing with such malformed insulation attacks is generally to add judgment logic to the protocol stack, by setting the maximum length of the header to no more than a certain value, and storing all the collections of legal headers.
  • the message header includes a header that does not appear in the legal header set. If yes, the message is determined to be a malformed message, which is not a legal message; If the VIA header field is more than N times, the message is a malformed message, not a legal message.
  • the embodiment of the invention provides a method, a system and a device for detecting a protocol message.
  • a fingerprint signature database is created in the protocol packet, and protocol packets are collected on the network for fingerprint feature comparison, thereby improving the efficiency of determining whether the protocol packet is an illegal packet.
  • the embodiment of the invention provides a method for detecting a protocol packet, and the method includes:
  • the embodiment of the present invention further provides a communication device, where the communication device includes: a storage module, configured to store a fingerprint feature library established by a header fingerprint feature of a legal or illegal protocol message;
  • An collection module configured to collect protocol packets to be detected
  • a processing module configured to acquire a header fingerprint feature of the protocol packet to be detected collected by the collection module
  • a detection module configured to: capture, by the processing module, a header fingerprint feature of the protocol packet to be detected and a header fingerprint feature in the storage module
  • the library performs a comparison test.
  • the embodiment of the present invention further provides a network system, including at least one or more network transmission ports and a network device connected to the network transmission port, where the network transmission port is used to transmit data packets;
  • the network device is configured to perform packet detection on the data packet on the network transmission port, collect the protocol packet to be detected on the network transmission port, and obtain the header fingerprint feature of the to-be-detected protocol packet.
  • the header fingerprint feature of the protocol packet to be detected is compared with the header fingerprint feature of the protocol packet in the stored fingerprint signature database.
  • the embodiment of the present invention implements a fingerprint feature database for the header fingerprint feature of the protocol packet, and after collecting the protocol packet to be detected, obtains the header fingerprint feature in the protocol packet for comparison detection, thereby improving the judgment. Whether the protocol packet is invalid for illegal packets.
  • FIG. 2 is a flow chart of establishing a fingerprint feature database in an embodiment of the present invention
  • FIG. 3 is a flowchart of a packet protocol detecting method in an embodiment of the present invention. detailed description
  • the embodiment of the invention provides a method, a system and a device for detecting a protocol message.
  • a fingerprint signature database is created for the protocol packets, and protocol packets are collected on the network for fingerprint feature comparison. This improves the efficiency of determining whether the protocol packets are illegal.
  • the header fingerprint feature may refer to the relatively stable information in the header of the terminal during the signaling interaction with the system, such as the content of the header, the order relationship, the number of repetitions, the carrying parameters, the parameter characteristics, etc., and the information may be used to imply
  • the legitimacy of the terminal is used as the basis for judging the legitimacy of the terminal.
  • part of the feature may be selected as the heading fingerprint feature according to the balance between the accuracy and complexity of the implementation.
  • the fingerprint feature database may refer to a system that collects and analyzes the fingerprint feature of the header of the legal terminal, and saves the fingerprint feature of the header in a compressed form, and is used as a supporting database for judging the legitimacy of the terminal during system operation.
  • the fingerprint feature database includes a feature library index, a fingerprint feature, and a fingerprint feature value.
  • the feature database index refers to different terminal manufacturers. In different methods, the fingerprint characteristics are different. The corresponding fingerprint information is determined by analyzing the information of the terminal manufacturer, method, and the like.
  • the fingerprint feature refers to the content of the header, the order relationship, the number of repetitions, the carrying parameters, the parameter characteristics, and the like, which can be used to suggest the relevant information characteristics of the terminal legality.
  • the fingerprint feature value refers to the information after the fingerprint feature is extracted and compressed.
  • the library of feature features such as not distinguishing between terminal manufacturers
  • partial fingerprint features such as content containing only headers, order
  • Relationships, number of repetitions and other fingerprint features Full match (100% requires the same fingerprint feature value) or partial match (if the match degree is above 80%, the definition of match may depend on the needs of the specific implementation).
  • FIG. 1 shows a message detecting communication device in the implementation of the present invention.
  • the collection module 11 the detection module 14 , the processing module 13 , and the storage module 12 , wherein: the collection module 11 is configured to collect protocol packets to be detected; and the processing module 13 is configured to acquire the protocol packets to be detected collected by the collection module 11 .
  • a header fingerprint feature the storage module 12 is configured to store a fingerprint feature database established for a header fingerprint feature of the protocol packet, where the fingerprint signature database is a fingerprint signature database established by an illegal protocol header header fingerprint feature, or a legal protocol.
  • the fingerprint feature library is established by the fingerprint of the header of the message header.
  • the detection module 14 is configured to compare and detect the header fingerprint feature of the protocol packet to be detected obtained by the processing module and the header fingerprint feature of the protocol packet in the storage module.
  • the protocol may perform corresponding filtering processing on the protocol, and the communication device further includes a filtering module 15 configured to be used when the detecting unit 14 compares the detection.
  • the header fingerprint feature of the legal protocol packet matching the header fingerprint feature of the protocol packet to be detected is not found in the storage module 12 or the header of the protocol packet to be detected is found in the fingerprint signature database.
  • the header fingerprint feature of the illegal protocol packet matching the fingerprint feature is filtered to process the protocol packet.
  • the processing module 13 further includes a normalization processing unit 131, a first acquisition unit 132, a second acquisition unit 133, an equivalent processing unit 134, and a hash processing unit 135, where: the regular processing unit 131 is configured to collect the collection module 11
  • the code stream of the to-be-detected protocol packet is in the form of a byte
  • the first obtaining unit 132 is configured to obtain the content of the protocol packet to be detected in the protocol packet that is normalized by the normalizing unit 131;
  • the equivalent processing unit 134 is configured to perform equivalent processing on the protocol packet header obtained by the first obtaining unit 133
  • the hash processing unit 135 is configured to The equivalent processing unit 134 performs the hash processing on the header of the protocol message after the equivalent processing.
  • the storage module 12 herein may also be implemented by a device independent of the communication device, and is specifically used for collecting and managing the fingerprint feature of the protocol message header, and
  • the communication device of the protocol packet detection method may be located in a VOIP network system, and connected to multiple terminal devices or communication gateways in the network system through multiple transmission ports of the network system, where the communication device is on the network transmission port.
  • the data packet is detected, for example, the text protocol such as the SIP protocol or the media gateway control protocol H.248 is detected.
  • the implementation process of the protocol packet detection method in the embodiment of the present invention is described in detail below with reference to FIG.
  • a flow chart of establishing a fingerprint feature database for a header of a legal protocol packet in the embodiment of the present invention is described by using the SIP protocol as an example. The specific steps are as follows:
  • Step S201 Collect legal protocol packets. Receive a legal binary SIP packet stream.
  • Step S202 The code stream of the collected legal protocol packet is regularized in a byte form
  • the binary SIP message stream to be analyzed is organized in the form of bytes (associated with 8 bits).
  • Step S203 Obtain the content of the legal protocol packet in the protocol packet after the adjustment
  • the string "0D 0A 0D OA” is the end tag of the SIP message, followed by the drawing description protocol (Session Description Protocol, SDP) and other protocol messages.
  • the SDP protocol is partially discarded, and the obtained packets are as follows:
  • Step S204 Obtain a protocol message header in the content of the legal protocol packet
  • the SIP protocol specifies that the content from the message header to the character “20” is used to describe the SIP message.
  • the character "20” is actually a space in the SIP message.
  • the string of the message header to the character “20” is taken out from the content of the legal protocol message.
  • A1 In the extracted string, mark the first string "0D 0A" as Header[pointer] , where pointer is a variable, and the variable pointer ⁇ 1;
  • A2 Find the next string " 0D 0A " in the extracted string, mark it as Header [pointer+ 1 ], find the first character “3A” between Header [pointer] and Header [pointer+ 1 ], remove the Header a string between [pointer] and the character "3A", where "3A" is the colon after the header;
  • the headers are obtained in order: t, From, Max-Forwards, Call-ID, CSeq, Via, Content-Type, Content-Length.
  • A4 The character string extracted as described above is subjected to step S205.
  • Step S205 Perform equivalent processing on the header of the obtained protocol message;
  • the obtained header is equivalent in the following cases, such as case-insensitive or abbreviated, "VIA", "V", “via” are equivalent.
  • these equivalent header header fields need to be mapped to one of the cases for processing, such as mapping the different headers of "VIA", “V", “via” to "VIA”.
  • Step S206 Perform hash processing on the header of the protocol packet after the equivalent processing
  • Hash processing is performed to reduce the size of the feature library and improve the efficiency of feature comparison.
  • the above string can be mapped to an L-bit stream (assumed to be 32 bits) using a specific hash algorithm. It can be seen that after the hash operation, the amount of feature data obtained is probably only 6% without hash processing.
  • Step S207 Establish a fingerprint feature database according to the hashed protocol header message.
  • fingerprint signature database In the process of establishing a fingerprint signature database, all the legal SIP packets are collected, and the fingerprint features in the SIP packets are obtained, and the fingerprint features are stored in the fingerprint signature database.
  • the fingerprint signature database is configured to statically configure legal packets. Fingerprint features can also dynamically generate fingerprint features according to certain methods.
  • the fingerprint feature database of the legal protocol packet can be set up and stored in the communication device that needs to detect the protocol packet.
  • the fingerprint feature database of the legal protocol packet can also be stored in the corresponding service device.
  • remote storage there is no communication device for packet detection, so that the fingerprint feature of the legal protocol packet is collected, and the process of comparing detection is provided for the communication device that performs protocol packet detection, which is described in detail below with reference to FIG.
  • Flowchart of the protocol packet detection method The SIP protocol is taken as an example. The specific steps are as follows:
  • Step S301 Collect a protocol packet to be detected.
  • Step S302 The code stream of the collected protocol packet to be detected is regularized in a byte form
  • Step S303 Obtain the content of the protocol packet to be detected in the protocol packet after the adjustment;
  • the string "OD OA OD OA” is the end tag of the SIP packet, and can be followed by other protocol packets such as SDP.
  • Step S304 Obtain a protocol message header in the content of the protocol packet to be detected.
  • the SIP protocol specifies that the content from the message header to the character “20” is used to describe the SIP message.
  • the character "20” is actually a space in the SIP message.
  • the string of the message header to the character “20” is taken out from the content of the legal protocol message.
  • Step S305 Perform equivalent processing on the header of the obtained protocol message
  • the obtained header is equivalent in the following cases, such as case-insensitive or abbreviated, "VIA”, “V”, “via” are equivalent.
  • these equivalent header header fields need to be mapped to one of the cases for processing, such as mapping the different headers of "VIA", “V”, “via” to "VIA”.
  • Step S306 Perform hash processing on the header of the protocol packet after the equivalent processing
  • Hash processing is performed to reduce the size of the feature library and improve the efficiency of feature comparison.
  • Step S307 Compare and detect the header fingerprint feature of the to-be-detected protocol packet with the header fingerprint feature of the legal agreement in the fingerprint feature database.
  • Step S308 detecting whether the protocol packet to be detected is an illegal protocol packet, if yes, proceeding to step S309, otherwise proceeding to step S310, performing a normal program processing process;
  • Step S309 When it is detected that the protocol packet to be detected is an illegal protocol packet, filter the protocol packet.
  • Step S310 End.
  • the protocol packet to be detected is a legal protocol packet, and the normal procedure is processed; If the header fingerprint feature of the matching legal protocol is not found, the protocol to be detected is an illegal protocol packet, and the system needs to perform corresponding filtering processing.
  • the fingerprint feature of the protocol packet to be detected obtained by the hash algorithm is compared with the fingerprint feature of the legal protocol packet in the fingerprint feature database by using the flow chart 3, and if the same fingerprint feature exists, the protocol can pass. Otherwise, the system considers that the protocol packet to be detected is an illegal protocol packet, and then filters the packet to discard the protocol packet, and performs related alarms, log records, or dynamic protection measures.
  • the header fingerprint feature of the illegal protocol packet can be collected, and the fingerprint signature database of the contrast detection is established, and when the header fingerprint feature of the matched protocol packet is found in the comparison detection process,
  • the protocol packet to be detected is an illegal protocol packet, and the related processing operation is required.
  • the implementation process here is substantially the same as the foregoing process, and is not described here.
  • the process of detecting the header of the protocol packet is not limited to the header of the SIP protocol packet.
  • the protocol packet with the header format of the SIP protocol packet can be used to implement the protocol packet detection process. Again - for a description.
  • the embodiment of the present invention may firstly establish a corresponding fingerprint feature database for a legal or illegal protocol message, and after collecting the protocol message to be detected, obtain a header fingerprint feature in the protocol message.
  • the fingerprint feature in the fingerprint feature database can be quickly compared and detected, so that the illegal protocol packet tampering with the header is prevented from being attacked and spoofed by the VOIP system, and the illegal protocol packet is filtered.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Description

一种协议报文的检测方法、 系统及设备 本申请要求于 2008年 3月 21日提交中国专利局、申请号为 200810026934.7、 发明名称为 "一种协议报文的检测方法、 系统及设备" 的中国专利申请的优先 权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及通信领域, 尤其涉及一种协议报文的检测方法、 系统及设备。 背景技术
承载在 IP上的语音业务( Voice Over IP, VOIP )技术提供了一种低成本语 音业务, 将信令定制功能提供给终端, 为新业务的开展提供了便利。 但是恶意 用户^艮容易利用该开放机制, 定制恶意的信令, 这些恶意的信令会对通信系统 造成威胁。
这些恶意的信令包括以下几种, 如增加未经授权的标题头, 企图引起系统 处理异常或夹带未经系统允许的信息或使系统将用户的信令误判为系统信令; 或删除必要的标题头; 或将某些标题头多次重复; 或将非本消息所需要的标题 头增加进来。
目前对付这类畸形保温攻击的方法一般是在协议栈中加入判断逻辑, 通过 设置标题头最大长度不得大于某个数值, 并存储了所有的合法标题头的集合。 在收到报文之后, 判断报文中是否包含了未在合法标题头集合中出现的标题头, 如果存在则判断该报文是畸形报文, 不是合法报文; 不同类别的标题头设置最 大的重复次数, 如 VIA头域最多最允许出现 Ν次, 如果判断 VIA头域超过 N 次时, 则判断该报文是畸形报文, 不是合法报文。
在实施本发明的过程中, 发明人发现现有技术中至少存在以下缺点: 需要 对终端发来数据的不同标题头进行逐一逻辑分析, 导致非法数据处理过滤效率 低。 发明内容
本发明实施例提供了一种协议报文的检测方法、 系统及设备。 通过对合法 协议报文建立指纹特征库, 在网络中收集协议报文进行指纹特征对比, 从而提 高了判断该协议报文是否为非法报文的效率。
本发明实施例提出了一种协议报文的检测方法, 该方法包括:
收集待检测的协议报文;
获取所述待检测协议报文的标题头指纹特征;
将所述待检测协议报文的标题头指纹特征与存储的指纹特征库中的协议报 文的标题头指纹特征进行对比检测。
相应的, 本发明实施例还提出了一种通信设备, 所述通信设备包括: 存储模块, 用于存储为合法或非法的协议报文的标题头指纹特征建立的指 纹特征库;
采集模块, 用于收集待检测的协议报文;
处理模块, 用于获取采集模块收集的待检测协议报文的标题头指纹特征; 检测模块, 用于将处理模块获取的待检测协议报文的标题头指纹特征与存 储模块中的标题头指纹特征库进行对比检测。
相应的, 本发明实施例还提出了一种网络系统, 包括至少一个或以上的网 络传输端口以及与所述网络传输端口相连的网络设备, 所述网络传输端口用于 传输数据报文;
网络设备用于对所述网络传输端口上的数据报文进行报文检测, 收集所述 网络传输端口上待检测的协议报文, 获取所述待检测协议报文的标题头指纹特 征, 将所述待检测协议报文的标题头指纹特征与存储的指纹特征库中的协议报 文的标题头指纹特征进行对比检测。
实施本发明实施例, 对协议报文的标题头指纹特征建立指纹特征库, 在收 集到待检测的协议报文之后, 获取协议报文中的标题头指纹特征进行对比检测, 从而提高了判断该协议报文是否为非法报文的效率。 附图说明 例或现有技术描述中所需要使用的附图作筒单地介绍, 显而易见地, 下面描述 中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付 出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。 图 1是本发明实施例中的通信设备;
图 2是本发明实施例中的建立指纹特征数据库流程图;
图 3是本发明实施例中的报文协议检测方法的流程图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部 的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做出创造性劳 动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明实施例提供了一种协议报文的检测方法、 系统及设备。 通过对协议 报文建立指纹特征库, 在网络中收集协议报文进行指纹特征对比, 从而提高了 判断该协议报文是否为非法报文的效率。
下面结合附图详细说明本发明的优选实施例。
标题头指纹特征可以是指终端在和系统进行信令交互过程中, 标题头中相 对稳定信息, 比如标题头的内容, 次序关系, 重复次数, 携带参数, 参数特征 等, 这些信息可以用来暗示终端的合法性, 作为终端合法性的部分判断依据。 实际应用中, 可以根据实施方案的准确度和复杂度之间的均衡需要, 选取部分 特征作为标题头指纹特征。
指纹特征库可以是指系统通过收集分析合法终端的标题头指纹特征, 将标 题头指纹特征以压缩的形式进行保存, 用于系统运行中, 对终端合法性进行判 断的支撑数据库。 指纹特征库包含特征库索引, 指纹特征, 指纹特征取值等部 分。 特征库索引是指不同终端厂家, 不同方法中, 指纹特征是不同的。 通过分 析终端厂家, 方法等信息, 确定对应的指纹信息。 指纹特征是指标题头的内容, 次序关系, 重复次数, 携带参数, 参数特征等可以用来暗示终端合法性的相关 信息特征。 指纹特征取值是指指纹特征经提取和压缩后的信息。 实际应用中, 可以根据实施方案的准确度和复杂度之间的均衡需要, 采用筒化的特征库(如 不进行终端厂家区分), 和选取部分指纹特征(如只包含标题头的内容, 次序关 系, 重复次数等指纹特征)进行全匹配(100 %要求指纹特征取值相同 )或部分 匹配(如匹配度在 80 % 以上即可, 匹配度定义可以取决于具体实现的需要)。
首先请参阅图 1 , 图 1示出了本发明实施中的报文检测通信设备, 该通信设 备包括采集模块 11、 检测模块 14、 处理模块 13和存储模块 12, 其中: 采集模 块 11用于收集待检测的协议报文; 处理模块 13用于获取采集模块 11收集的待 检测协议报文的标题头指纹特征; 存储模块 12用于存储为协议报文的标题头指 纹特征建立的指纹特征库, 该指纹特征库为非法的协议报文标题头指纹特征建 立的指纹特征库, 或合法的协议报文标题头指纹特征建立的指纹特征库; 检测 模块 14用于将处理模块获取的待检测协议报文的标题头指纹特征与存储模块中 的协议报文的标题头指纹特征进行对比检测。 相应的, 在检测模块 14检测出非 法协议报文之后, 可以对协议进行相应的过滤处理, 该通信设备中还包括有过 滤模块 15, 所述过滤模块 15用于在检测单元 14对比检测时, 在所述存储模块 12 中找不到与待检测协议报文的标题头指纹特征相匹配的合法协议报文的标题 头指纹特征或在所述指纹特征库中找到与待检测协议报文标题头指纹特征相匹 配的非法协议报文的标题头指纹特征, 对所述协议报文进行过滤处理。 所述处 理模块 13还包括规整处理单元 131、 第一获取单元 132、 第二获取单元 133、 等 价处理单元 134和哈希处理单元 135, 其中: 规整处理单元 131用于对采集模块 11收集的待检测协议报文的码流按字节形式规整; 第一获取单元 132用于在规 整单元 131 规整后的协议报文中获取待检测协议报文内容; 第二获取单元 133 用于在第一获取单元 132获取的协议报文内容中获取协议报文标题头; 等价处 理单元 134用于对第一获取单元 133获得的协议报文标题头进行等价处理; 哈 希处理单元 135用于对等价处理单元 134等价处理后的协议报文标题头进行哈 希处理。 需要说明的是, 这里的存储模块 12也可以通过独立于通信设备之外的 设备来实现, 专门用于收集和管理协议报文标题头指纹特征, 为通信设备的协 议4艮文检测过程实现对比检测。
所述协议报文检测方法的通信设备可以位于 VOIP网络系统中,通过网络系 统的多个传输端口连接网络系统中的多个终端设备或通信网关等, 所述通信设 备对所述网络传输端口上的数据报文进行检测, 如对 SIP协议或媒体网关控制 协议 H.248等文本协议进行检测, 下面结合图 1详细说明本发明实施例中协议 报文检测方法的实现过程, 图 2示出了本发明实施例中对合法协议报文的标题 头建立指纹特征数据库的流程图, 这里以 SIP协议为例进行说明, 具体步骤如 下:
步骤 S201: 收集合法协议报文; 接收合法的二进制 SIP报文码流,在 SIP报文发生分片的情况下,可以采用 两种策略进行收集, 一种是宽松策略, 只收集第一个分片的 SIP报文, 只获取 第一个分片的标题头指纹特征, 另外一种是严格策略, 需要对分片报文先緩存 起来, 等到报文收集齐了在获取标题头指纹特征。
步骤 S202: 对收集的合法协议报文的码流按字节形式规整;
在收集完合法协议报文后, 将需要分析的二进字 SIP报文码流按字节 (联 系 8比特)形式规整。
如下,以 RFC4475 提供的合法 SIP报文为例来说明整个处理过程。经过 S201 和 S202之后, 可以得到以下报文:
INVITE sip :j oe@example.com SIP/2.0
t: sip:joe@example.com
From: sip:caller@example.net;tag=141334
Max-Forwards: 8
Call-ID: dblreq.0ha0isnda977644900765@ 192.0.2.15
CSeq: 8 INVITE
Via: SIP/2.0/UDP 192.0.2.15; branch=z9hG4bKkdjuw380234
Content-Type: application/sdp
Content-Length: 150 v=0
o=mhandley 29739 7272939 IN IP4 192.0.2.15
s=- c=IN IP4 192.0.2.15
t=0 0
m=audio 49217 RTP/AVP 0 12
m =video 3227 RTP/AVP 31
a=rtpmap:31 LPC
步骤 S203: 在规整后的协议报文中获取合法协议报文内容;
寻找字符串 "0D 0A 0D 0A" ,后续的字符串直接丢弃不处理。字符串 "0D 0A 0D OA" 是 SIP报文的结束标记, 后面接有绘画描述协议(Session Description Protocol , SDP )等其他协议报文。
经过 S203 , SDP协议部分被丢弃, 得到的报文如下:
INVITE sip:joe@example.com SIP/2.0
t: sip:joe@example.com
From: sip:caller@example.net;tag=141334
Max-Forwards: 8
Call-ID: dblreq.0ha0isnda977644900765@ 192.0.2.15
CSeq: 8 INVITE
Via: SIP/2.0/UDP 192.0.2.15; branch=z9hG4bKkdjuw380234 Content-Type: application/sdp
Content-Length: 150 步骤 S204: 在合法协议报文内容中获取协议报文标题头;
寻找第一个字符 "20" , SIP协议规定从报文头到字符 "20"之间的内容是 用于描述该 SIP报文的方法, 字符 "20" 实际是 SIP报文中的空格, 在合法协议 报文内容中将报文头到字符 "20" 之间的字符串取出来。
经过该步骤, 可以得到 INVITE字符串。
A1 : 在取出的字符串中, 将第一个字符串 "0D 0A"标记为 Header[pointer] , 其中 pointer为变量, 记变量 pointer^ 1;
A2 : 在取出的字符串中寻找下一个字符串 " 0D 0A " , 标记为 Header [pointer+ 1 ] , 寻找 Header [pointer]和 Header [pointer+ 1 ]之间的第一个字符 "3A" , 取出 Header[pointer]和字符 "3A"之间的字符串, 其中 "3A"是标题头 后的冒号;
A3: 在获取 Header[pointer]和字符 "3A" 之间的字符串后, 查找下个字符 串 "0D 0A" , 标记为 Header[pointer+l+l]进行 A2和 A3的内容, 直到查找不到 字符串 "0D 0A" 为止;
经过 A2, A3的循环处理,依次得到标题头: t, From, Max-Forwards, Call-ID, CSeq, Via, Content-Type, Content- Length。
A4: 将上述取出的字符串进行步骤 S205。
步骤 S205: 对获取的协议报文标题头进行等价处理; 在上述获取标题头的过程中, 得到的标题头在以下情况都是等价的, 如大 小写不同或采用缩写方式, "VIA" , "V" , "via" 这几种情况都是等价的, 实际 应用过程中需要将这些等价的标题头头域映射为其中一种情况进行处理, 如将 "VIA" , "V" , "via" 这些不同的标题头都映射为 "VIA"。
经过 S205后, 得到以下字符串
"INVITETOFROMMAX-FORWARDSCALL-IDCSEQVIACONTENT-TYPECON
TENTLENGTH"。
步骤 S206: 对等价处理后的协议报文标题头进行哈希处理;
进行哈希处理是为了减少特征库规模, 提高特征比对的效率。
采用特定的哈希算法, 可以将以上字符串映射为一个 L比特流(假定为 32 比特 )。 可以看出, 进行哈希运算后, 得到的特征数据量大概只有不进行哈希 处理的 6%。
步骤 S207: 根据哈希处理后的协议标题报文建立指纹特征库。
在建立指纹特征库的过程中,需要收集所有的合法 SIP报文,获取 SIP报文 中的指纹特征, 并将这些指纹特征保存在指纹特征库中, 指纹特征库为系统静 态配置合法报文的指纹特征, 也可以根据一定的方法动态生成指纹特征。
通过上述方法的实现即可建立合法协议报文的指纹特征库, 并存储在需要 进行协议报文检测的通信设备中, 这些合法协议报文的指纹特征库也可以存储 在相应的服务设备中, 通过远端存储, 不存在报文检测的通信设备中, 以便于 专门收集合法协议报文的指纹特征, 并为进行协议报文检测的通信设备提供对 比检测的过程, 下面结合图 3 来详细说明协议报文检测方法的流程图, 这里以 SIP协议为例进行说明, 具体步骤如下:
步骤 S301: 收集待检测的协议报文;
接收待检测的二进制 SIP报文码流,在 SIP报文发生分片的情况下,可以采 用两种策略进行收集, 一种是宽松策略, 只收集第一个分片的 SIP报文, 只获 取第一个分片的标题头指纹特征, 另外一种是严格策略, 需要对分片报文先緩 存起来, 等到报文收集齐了在获取标题头指纹特征。
步骤 S302: 对收集的待检测协议报文的码流按字节形式规整;
在收集完待检测协议报文后,将需要分析的二进字 SIP报文码流按字节(联 步骤 S303: 在规整后的协议报文中获取待检测协议报文内容;
寻找字符串 "OD OA OD OA" ,后续的字符串直接丢弃不处理。字符串 "OD OA OD OA" 是 SIP报文的结束标记, 后面可以协议 SDP等其他协议报文。
步骤 S304: 在待检测协议报文内容中获取协议报文标题头;
寻找第一个字符 "20" , SIP协议规定从报文头到字符 "20"之间的内容是 用于描述该 SIP报文的方法, 字符 "20" 实际是 SIP报文中的空格, 在合法协议 报文内容中将报文头到字符 "20" 之间的字符串取出来。
B1: 在取出的字符串中, 将第一个字符串 "0D 0A"标记为 Header[pointer] , 其中 pointer为变量, 记变量 pointer^ 1;
B2 : 在取出的字符串中寻找下一个字符串 " 0D 0A " , 标记为 Header [pointer+ 1 ] , 寻找 Header [pointer]和 Header [pointer+ 1 ]之间的第一个字符 "3A" , 取出 Header[pointer]和字符 "3A" 之间的字符串;
B3: 在获取 Header[pointer]和字符 "3A" 之间的字符串后, 查找下个字符 串 "0D 0A" , 标记为 Header[pointer+l+l]进行 B2和 B3的内容, 直到查找不到 字符串 "0D 0A" 为止;
B4: 将上述取出的字符串进行步骤 S205。
步骤 S305: 对获取的协议报文标题头进行等价处理;
在上述获取标题头的过程中, 得到的标题头在以下情况都是等价的, 如大 小写不同或采用缩写方式, "VIA" , "V" , "via" 这几种情况都是等价的, 实际 应用过程中需要将这些等价的标题头头域映射为其中一种情况进行处理, 如将 "VIA" , "V" , "via" 这些不同的标题头都映射为 "VIA"。
步骤 S306: 对等价处理后的协议报文标题头进行哈希处理;
进行哈希处理是为了减少特征库规模, 提高特征比对的效率。
步骤 S307: 将所述待检测协议报文的标题头指纹特征与指纹特征库中的合 法协议的标题头指纹特征进行对比检测;
步骤 S308: 检测所述待检测的协议报文是否是非法协议报文, 如果是则进 行步骤 S309, 否则转步骤 S310, 进行正常程序的处理过程;
步骤 S309: 当检测到所述待检测的协议报文为非法协议报文时, 对所述协 议报文进行过滤处理;
步骤 S310: 结束。 在步骤 S307和步骤 S308的对比检测过程, 如果能查找到相匹配的合法协 议的标题头指纹特征时, 则所述待检测协议报文为合法的协议报文, 进行正常 程序的处理过程; 如果查找不到相匹配的合法协议的标题头指纹特征, 则所述 待检测协议报文为非法的协议报文, 则需要系统进行相应的过滤处理。
通过流程图 3 可以通过哈希算法得到的待检测协议报文的指纹特征与指纹 特征库中的合法协议报文中的指纹特征进行对比, 如果存在相同的指纹特征, 则所述协议可以通过, 否则, 系统会认为该待检测的协议报文为非法协议报文, 则会进行过滤处理丢弃该协议报文, 并进行相关的告警、 日志记录或启动动态 防护措施等。
需要说明的是, 这里也可以通过收集非法的协议报文的标题头指纹特征, 并建立对比检测的指纹特征库, 当在对比检测过程中找到相匹配的协议报文的 标题头指纹特征时, 说明所述待检测的协议报文为非法的协议报文, 需要进行 相关处理操作, 这里的实现过程与上述流程大致相同, 这里不再——赘述。 这 里对协议报文标题头的检测过程也不限于 SIP协议报文的标题头, 具有跟 SIP 协议报文标题头格式的协议报文都可以采用所述方法实现协议报文的检测过 程, 这里不再——进行描述。
综上所述, 实施本发明实施例, 可以先对合法或非法的协议报文建立相应 的指纹特征库, 在收集到待检测的协议报文之后, 获取协议报文中的标题头指 纹特征即可实现与指纹特征库中的指纹特征进行快速的对比检测, 从而防止针 对标题头进行篡改的非法协议报文对 VOIP系统攻击和欺骗,实现对非法协议报 文的过滤。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于一计算 机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施例的流程。 其中, 所述的存储介质可为磁碟、 光盘、 只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体(Random Access Memory, RAM )等。
以上揭露的仅为本发明的较佳实施例而已, 当然不能以此来限定本发明之 权利范围, 因此依本发明权利要求所作的等同变化, 仍属本发明所涵盖的范围。

Claims

权 利 要 求
1、 一种协议报文的检测方法, 其特征在于, 该方法包括:
收集待检测的协议报文;
获取所述待检测协议报文的标题头指纹特征;
将所述待检测协议报文的标题头指纹特征与存储的指纹特征库中的协议报 文的标题头指纹特征进行对比检测。
2、如权利要求 1所述的协议报文的检测方法,其特征在于, 该方法还包括: 为合法或非法的协议报文的标题头指纹特征建立指纹特征库, 存储所述建 立的指纹特征库。
3、 如权利要求 2所述的协议报文的检测方法, 其特征在于, 所述为合法或 非法的协议报文的标题头指纹特征建立指纹特征库包括:
收集合法或非法的协议报文;
获取所述合法或非法的协议报文的标题头指纹特征;
将所述获取的标题头指纹特征存储在指纹特征库。
4、 如权利要求 3所述的协议报文的检测方法, 其特征在于, 所述收集合法 或非法的协议报文或收集待检测的协议报文包括:
在协议报文发生分片情况时, 通过宽松策略或严格策略收集协议报文。
5、 如权利要求 3所述的协议报文的检测方法, 其特征在于, 所述获取所述 合法或非法的协议报文的标题头指纹特征包括:
对所述获取的合法或非法的协议报文的码流按字节形式规整;
在规整后的协议报文中获取合法或非法的协议报文内容;
获取合法或非法的协议报文内容中的协议报文标题头;
对获取的协议报文标题头进行等价处理;
对等价处理后的协议报文标题头进行哈希处理。
6、 如权利要求 1所述的获取所述待检测协议报文的标题头指纹特征包括: 对所述待检测协议报文码流按字节形式规整;
在规整后的协议报文中获取待检测协议报文内容;
获取待检测协议报文内容中的协议报文标题头;
对获取的协议报文标题头进行等价处理;
对等价处理后的协议报文标题头进行哈希处理。
7、 如权利要求 5或者 6所述的协议报文的检测方法, 其特征在于, 所述对 获取的协议报文标题头进行等价处理包括:
对协议报文标题头的大小写字符或缩写字符视为同一协议报文标题头。
8、 如权利要求 1至 6任一项所述的协议报文的检测方法, 其特征在于, 所 述方法还包括:
若对比检测时, 在所述指纹特征库中找不到与待检测协议报文的标题头指 纹特征相匹配的合法协议报文的标题头指纹特征或在所述指纹特征库中找到与 待检测协议报文标题头指纹特征相匹配的非法协议报文的标题头指纹特征, 则 对所述待检测的协议报文进行过滤处理。
9、 一种通信设备, 其特征在于, 所述通信设备包括:
存储模块, 用于存储为合法或非法的协议报文的标题头指纹特征建立的指 纹特征库;
采集模块, 用于收集待检测的协议报文;
处理模块, 用于获取采集模块收集的待检测协议报文的标题头指纹特征; 检测模块, 用于将处理模块获取的待检测协议报文的标题头指纹特征与存 储模块中的标题头指纹特征库进行对比检测。
10、 如权利要求 9所述的通信设备, 其特征在于, 所述处理模块包括: 规整处理单元, 用于对采集模块收集的待检测协议报文的码流按字节形式 规整;
第一获取单元, 用于在规整单元规整后的协议报文中获取待检测协议报文 内容;
第二获取单元, 用于在第一获取单元获取的协议报文内容中获取协议报文 标题头;
等价处理单元, 用于对第一获取单元获得的协议报文标题头进行等价处理; 哈希处理单元, 用于对等价处理单元等价处理后的协议报文标题头进行哈 希处理生成标题头指纹特征。
11、 如权利要求 10或 11所述的通信设备, 其特征在于, 所述通信设备还 包括过滤模块, 用于在检测单元对比检测时, 在所述存储模块中找不到与待检 测协议报文的标题头指纹特征相匹配的合法协议报文的标题头指纹特征或在所 述指纹特征库中找到与待检测协议报文标题头指纹特征相匹配的非法协议报文 的标题头指纹特征, 则对所述待检测的协议报文进行过滤处理。
12、 一种网络系统, 其特征在于, 包括至少一个网络传输端口以及与所述 网络传输端口相连的网络设备, 其中:
所述网络传输端口用于传输数据报文;
网络设备用于对所述网络传输端口上的数据报文进行报文检测, 收集所述 网络传输端口上待检测的协议报文, 获取所述待检测协议报文的标题头指纹特 征, 将所述待检测协议报文的标题头指纹特征与存储的指纹特征库中的协议报 文的标题头指纹特征进行对比检测。
13、 如权利要求 12所述的网络系统, 其特征在于, 所述网络传输端口与通 信终端或通信网关进行连接, 对通信终端或通信网关上的数据报文进行传输。
PCT/CN2009/070837 2008-03-21 2009-03-17 一种协议报文的检测方法、系统及设备 WO2009115034A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN 200810026934 CN101247281A (zh) 2008-03-21 2008-03-21 一种协议报文的检测方法、系统及设备
CN200810026934.7 2008-03-21

Publications (1)

Publication Number Publication Date
WO2009115034A1 true WO2009115034A1 (zh) 2009-09-24

Family

ID=39947507

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/070837 WO2009115034A1 (zh) 2008-03-21 2009-03-17 一种协议报文的检测方法、系统及设备

Country Status (2)

Country Link
CN (1) CN101247281A (zh)
WO (1) WO2009115034A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112989315A (zh) * 2021-02-03 2021-06-18 杭州安恒信息安全技术有限公司 物联网终端的指纹生成方法、装置、设备和可读存储介质
CN113114663A (zh) * 2021-04-08 2021-07-13 北京威努特技术有限公司 一种基于扫描报文行为的判定方法及装置
CN113676466A (zh) * 2021-08-11 2021-11-19 中国人民银行数字货币研究所 一种网络安全检测的方法和装置

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247281A (zh) * 2008-03-21 2008-08-20 华为技术有限公司 一种协议报文的检测方法、系统及设备
CN102413007B (zh) * 2011-10-12 2014-03-26 上海奇微通讯技术有限公司 一种深度报文检测方法及设备
CN106407350A (zh) * 2016-09-05 2017-02-15 广州视睿电子科技有限公司 错误日志信息过滤方法及装置
CN106792712B (zh) * 2017-02-26 2020-04-03 上海交通大学 针对VoLTE设备的SIP协议的自动监测框架系统
CN107276995A (zh) * 2017-06-05 2017-10-20 广西荣中科技有限责任公司 一种通讯系统
CN110198290B (zh) * 2018-03-14 2021-11-19 腾讯科技(深圳)有限公司 一种信息处理方法、设备、装置及存储介质
CN110875918B (zh) * 2018-12-06 2022-02-11 北京安天网络安全技术有限公司 一种木马通信行为的检测方法、装置及电子设备
CN114401147B (zh) * 2022-01-20 2024-02-20 山西晟视汇智科技有限公司 一种基于摘要算法的新能源电站通讯报文比对方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845509A (zh) * 2005-04-06 2006-10-11 阿拉克斯拉网络株式会社 网络控制装置和控制系统及控制方法
CN1913528A (zh) * 2006-08-25 2007-02-14 清华大学 基于特征码的p2p数据报文检测方法
WO2007110951A1 (ja) * 2006-03-29 2007-10-04 The Bank Of Tokyo-Mitsubishi Ufj, Ltd. ユーザ確認装置、方法及びプログラム
CN101247281A (zh) * 2008-03-21 2008-08-20 华为技术有限公司 一种协议报文的检测方法、系统及设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1845509A (zh) * 2005-04-06 2006-10-11 阿拉克斯拉网络株式会社 网络控制装置和控制系统及控制方法
WO2007110951A1 (ja) * 2006-03-29 2007-10-04 The Bank Of Tokyo-Mitsubishi Ufj, Ltd. ユーザ確認装置、方法及びプログラム
CN1913528A (zh) * 2006-08-25 2007-02-14 清华大学 基于特征码的p2p数据报文检测方法
CN101247281A (zh) * 2008-03-21 2008-08-20 华为技术有限公司 一种协议报文的检测方法、系统及设备

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112989315A (zh) * 2021-02-03 2021-06-18 杭州安恒信息安全技术有限公司 物联网终端的指纹生成方法、装置、设备和可读存储介质
CN112989315B (zh) * 2021-02-03 2023-03-24 杭州安恒信息安全技术有限公司 物联网终端的指纹生成方法、装置、设备和可读存储介质
CN113114663A (zh) * 2021-04-08 2021-07-13 北京威努特技术有限公司 一种基于扫描报文行为的判定方法及装置
CN113676466A (zh) * 2021-08-11 2021-11-19 中国人民银行数字货币研究所 一种网络安全检测的方法和装置

Also Published As

Publication number Publication date
CN101247281A (zh) 2008-08-20

Similar Documents

Publication Publication Date Title
WO2009115034A1 (zh) 一种协议报文的检测方法、系统及设备
CA2445751C (en) Dynamic packet filter utilizing session tracking
EP1966977B1 (en) Method and system for secure communication between a public network and a local network
US9001661B2 (en) Packet classification in a network security device
US10547523B2 (en) Systems and methods for extracting media from network traffic having unknown protocols
US7835390B2 (en) Network traffic identification by waveform analysis
US8060633B2 (en) Method and apparatus for identifying data content
US7646728B2 (en) Network monitoring and intellectual property protection device, system and method
US20060212942A1 (en) Semantically-aware network intrusion signature generator
CN101686239B (zh) 一种木马发现系统
CN109818970B (zh) 一种数据处理方法及装置
CN110958233B (zh) 一种基于深度学习的加密型恶意流量检测系统和方法
CN104994016B (zh) 用于分组分类的方法和装置
CN109474485A (zh) 基于网络流量信息检测僵尸网络的方法、系统及存储介质
US8769665B2 (en) IP communication device as firewall between network and computer system
US8510840B2 (en) Method and apparatus for detecting scans in real-time
WO2010139237A1 (zh) 一种深度报文检测方法和装置
Li et al. An efficient intrusion detection and prevention system against SIP malformed messages attacks
Li et al. A rules-based intrusion detection and prevention framework against SIP malformed messages attacks
JP5885224B2 (ja) テキストベースのプロトコルによる受信データメッセージのハンドリング
Islam et al. A novel signature based traffic classification engine reduce false alarms in intrusion detection systems
KR102607050B1 (ko) 압축 패킷의 보안 처리 방법 및 이를 이용하는 보안 지원 장치
CN114070602A (zh) Http隧道检测方法、装置、电子设备和存储介质
CN114915442A (zh) 高级持续性威胁攻击检测方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09721704

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09721704

Country of ref document: EP

Kind code of ref document: A1