WO2018023705A1 - 一种应用程序编程接口异常使用的检测方法和装置 - Google Patents

一种应用程序编程接口异常使用的检测方法和装置 Download PDF

Info

Publication number
WO2018023705A1
WO2018023705A1 PCT/CN2016/093544 CN2016093544W WO2018023705A1 WO 2018023705 A1 WO2018023705 A1 WO 2018023705A1 CN 2016093544 W CN2016093544 W CN 2016093544W WO 2018023705 A1 WO2018023705 A1 WO 2018023705A1
Authority
WO
WIPO (PCT)
Prior art keywords
application programming
programming interface
sequence
module
sequence data
Prior art date
Application number
PCT/CN2016/093544
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 深圳中兴力维技术有限公司
Priority to PCT/CN2016/093544 priority Critical patent/WO2018023705A1/zh
Publication of WO2018023705A1 publication Critical patent/WO2018023705A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and apparatus for detecting an abnormal use of an application programming interface.
  • HOOK technology is a relatively mature technology, HOOK means hook, contact. You can use HOOK technology to hook up keyboard actions and mouse actions, or you can hook up the API (Application Programming Interface), register the calling process of the application programming interface, and monitor the incoming parameters. Process IAT (Import Address
  • FIG. 1 is a schematic block diagram showing the software execution flow after the HOOK process is not added and the HOOK process is increased.
  • Existing virus intrusion detection methods basically hook an important application programming interface or system call, and then record its calling process and associate with the next calling process. The comparison is performed by the rule base or the virus database of the detection software, and if it conforms to the description of the rule base or the virus database, it is considered to be a virus intrusion program.
  • the existing detection method the accuracy of detection is not high, and the application programming interface of the hook is limited.
  • the main purpose of the present invention is to provide a detection method and device for abnormal use of an application programming interface, which aims to solve the problem of detecting abnormal use of an application programming interface and improving the accuracy of detection.
  • a first aspect of the embodiments of the present invention provides a method for detecting an abnormal use of an application programming interface, where the method includes the following steps:
  • S2 receiving the acquired application programming interface information and performing serialization processing to generate sequence data
  • S3 performing statistics on the generated sequence data, and generating a statistical sequence
  • S4 confirm whether the number of generations of the statistical sequence reaches a preset generation quantity, and if the preset generation quantity is reached, generate a sequence data sequence table of the sequence mode, and go to the next step S5; Step S2;
  • S5 analyzing the sequence data statistical table of the sequence mode, and determining whether the behavior of the application programming interface is abnormal.
  • the method further includes:
  • Step S6 If the behavior of the application programming interface is abnormal, the user is sent an alarm message to the user of the application programming interface.
  • the hooking the application programming interface is implemented by replacing an input address table of an application programming interface process.
  • the step S2 includes:
  • S21 receiving the acquired application programming interface information and performing denoising processing to obtain application programming interface information after denoising processing;
  • S22 Serialize the application programming interface information after the denoising process and generate sequence data.
  • the step S3 further includes the steps of:
  • S3.0 Cascading the generated sequence data to generate cascaded sequence data.
  • the application programming interface information includes one or more of calling information, calling parameters, and calling time of the application programming interface.
  • a second aspect of the embodiments of the present invention further provides a detection device for abnormal use of an application programming interface, where the device includes: a hook module, a sequence capture module, a sequence pattern generation module, and a determination.
  • the device includes: a hook module, a sequence capture module, a sequence pattern generation module, and a determination.
  • the hook module is configured to hook the application programming interface, and obtain the application programming interface information
  • sequence capture module is configured to receive application programming interface information acquired by the hook module and perform serialization processing to generate sequence data
  • the sequence pattern generating module is configured to perform statistics on sequence data of the sequence grabbing module, and generate a statistical sequence; and used to confirm whether the number of generated statistics sequences reaches a preset number of generations, And generating a sequence data statistical table of the sequence pattern by using a predetermined number of generated statistical sequences;
  • the determining module is configured to analyze, and determine, a sequence data statistical table of the sequence mode of the sequence pattern generating module Whether the behavior of the application programming interface is abnormal.
  • the device further includes an alarm module
  • the alarm module is configured to send an alarm message to a user of the application programming interface according to an abnormal use of the application programming interface determined by the determining module.
  • the hook module implements hooking the application programming interface by replacing an input address table of an application programming interface process.
  • the sequence capture module includes a denoising module and a sequence data generating module
  • the denoising module is configured to receive application programming interface information acquired by the hook module, perform denoising processing, and obtain application programming interface information after denoising processing;
  • the sequence data generating module is configured to serialize the application programming interface information after the denoising process and generate sequence data.
  • the sequence pattern generation module includes a statistical sequence generation module, a confirmation module, and a sequence data statistics table generation module;
  • the statistical sequence generating module is configured to perform statistics on sequence data of the sequence capture module, and generate a statistical sequence
  • the confirmation module is configured to confirm whether the number of generations of the statistical sequence of the statistical sequence generation module reaches a preset generation quantity, and if the preset generation quantity is reached, the preset generation quantity information is reached. Sending to the sequence data statistics table generation module; otherwise, sending the information that does not reach the preset generation quantity to the sequence capture module;
  • the sequence data statistics table generating module is configured to generate a sequence data statistics table of the sequence mode for the statistical sequence that reaches the preset generated quantity.
  • the sequence pattern generating module further includes a sequence data cascading module
  • the sequence data cascading module is configured to cascade sequence data of the sequence capture module to generate cascaded sequence data.
  • the application programming interface information includes a calling information of an application programming interface, a calling parameter, and a call.
  • a calling information of an application programming interface includes a calling information of an application programming interface, a calling parameter, and a call.
  • the detection method and device for abnormal use of the application programming interface provided by the embodiment of the present invention can perform statistics and analysis according to the application programming interface information that the user is interested in, and improve the accuracy of the abnormal use detection of the application programming interface.
  • FIG. 1 is a schematic structural diagram of a software execution flow after a HOOK process and a booster HOOK process
  • FIG. 2 is a schematic flowchart of a method for detecting an abnormality of an application programming interface according to a first embodiment of the present invention
  • 3 is a schematic diagram showing the operation of a hook application programming interface in a method for detecting an abnormality of an application programming interface according to a first embodiment of the present invention
  • FIG. 4 is a schematic flowchart of generating sequence data in a method for detecting an abnormality of an application programming interface according to a first embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of an apparatus for detecting an abnormality of an application programming interface according to a second embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a sequence capture module of an apparatus for detecting an abnormality of an application programming interface according to a second embodiment of the present invention
  • FIG. 7 is a schematic structural diagram of a sequence pattern generation module of a detection apparatus for abnormally using an application programming interface according to a second embodiment of the present invention.
  • a first embodiment of the present invention provides a detection method for abnormal use of an application programming interface, and the method includes the steps of:
  • S1 hooking the application programming interface, and acquiring the application programming interface information
  • the application programming interface is hooked by replacing the input address table of the application programming interface process. Specifically, it replaces the specific address in the IAT (im port address table input address table) of the application programming interface process, but the parameters should be consistent.
  • the alternate address is an address unit of a new application programming interface.
  • This address unit represents an instruction module.
  • the instruction module is divided into two parts, one part is the processing logic module, and the processing logic module is mainly responsible for obtaining the application programming interface information, and the application programming interface information includes but is not limited to: the calling information of the application programming interface, the calling parameter, and the calling time.
  • Another The branch is the jump module. Specifically, it jumps back to the address of the replaced application programming interface, so that the original calling process is not affected.
  • S2 receiving the acquired application programming interface information and performing serialization processing to generate sequence data; [0055] Referring to FIG. 4, in this embodiment, the step specifically includes:
  • S21 receiving the acquired application programming interface information, performing denoising processing, and obtaining application programming interface information after denoising processing;
  • the application programming interface information includes, but is not limited to, call information of the application programming interface, calling parameters, and calling time. Denoising is the removal of scattered, marginalized data.
  • S22 Serialize the application programming interface information after the denoising process and generate sequence data.
  • step S2 the information that is called each time the application programming interface is called can be acquired and processed through step S2.
  • step S2 the following is specifically explained:
  • Step S2 Receive application programming interface information has application programming interface Name / application programming interface Address, ParamA ⁇ Param B, SystemTime or application programming interface information of interest to the user. After receiving the application programming interface information, the application programming interface information is denoised. The application programming interface information after denoising is serialized to generate a sequence of data ⁇ Application Programming Interface Name/Application Programming Interface Address-PammA-ParamB-SystemTime-others>.
  • sequence data includes the following items: ⁇ function address/function name, value of parameter A, value of parameter B... value of parameter N, call daytime, etc.>.
  • S3 performing statistics on the generated sequence data, and generating a statistical sequence
  • the sequence data generated in step S2 is counted, and the statistical data may be an application programming interface name or address, an application programming interface parameter set, etc.; the number of calls is generated each time the call statistics are completed. And generate a statistical sequence.
  • the statistical sequence is similar to the following: ⁇ application programming interface name or address, parameter value Al, parameter value B 1.... parameter value Nl, call time, number of calls, etc.>. Since the number of parameters for each application programming interface is fixed, n can be determined. For example, ⁇ XX Application Programming Interface 1, Al, B l, timel, 8>, ⁇ XX Application Programming Interface 2, A2, B2, time2, 9>.
  • the sequence data may be cascaded to generate cascaded sequence data.
  • the sequence data 1 is ⁇ ?11 ⁇ 131>
  • the sequence data 2 is ⁇ eight? I2, A2, B2, C2>
  • the sequence data after cascading is ⁇ API1, A1, B1, API2, A2, B2, C2>.
  • a stronger rule is generated, so that the call process can be found between law.
  • S4 confirm whether the generated number of the statistical sequence reaches a preset generated quantity, and if the preset generated quantity is reached, generate a sequence data sequence table of the sequence mode, and go to the next step S5; Step S2;
  • a certain number of statistical sequences are required to be generated.
  • the number of generations can be determined by the system default value or by the user.
  • a certain number of statistical sequences must be generated and converted into a sequence data sequence data table, as shown in the following example:
  • S5 analyzing the sequence data statistical table of the sequence mode, and determining whether the behavior of the application programming interface is abnormal.
  • sequence data statistics table of the sequence mode we can analyze and judge whether the behavior of the application programming interface is abnormal.
  • the maximum and minimum values of each column parameter can be statistically analyzed, and the calling frequency of different parameters for the application programming interface can also be statistically analyzed to form two horizontal and vertical directions.
  • Statistical Dimensions Parameter Upper Threshold, Lower Parameter Threshold, and the frequency of calls for the first call parameter set (first record) and the frequency of calls for the second call parameter set (second record).
  • the method further includes the step S6: if the behavior of the application programming interface For abnormal behavior, an alert message is sent to the user of the application programming interface. For example: When there is an abnormal sequence call, the value of the application programming interface parameter n exceeds the threshold range of the parameter, and the user can be notified. If the number of times a sequence is called in a session is abnormally increased, an alert can be sent to the user. After the user processes it, it can be set to be called normally.
  • the detection method for abnormal use of the application programming interface provided by the embodiment of the present invention can perform statistics and analysis according to the application programming interface information that the user is interested in, and improves the accuracy of the abnormal use detection of the application programming interface.
  • the invention further provides a system.
  • FIG. 2 is a device for detecting abnormal use of an application programming interface according to a second embodiment of the present invention.
  • the device 10 includes: a hook module 101, a sequence capture module 102, a sequence pattern generation module 103, and a determination. Module 104;
  • a hooking module 101 configured to hook the application programming interface, and obtain the application programming interface information
  • the sequence capture module 102 is configured to receive application programming interface information acquired by the hook module 101 and perform serialization processing to generate sequence data.
  • the sequence pattern generating module 103 is configured to perform statistics on the sequence data of the sequence grabbing module 102, and generate a statistical sequence; and use it to confirm whether the number of generated statistical sequences reaches a preset number of generations, and Setting a statistical sequence of the generated number to generate a sequence data statistical table of the sequence mode;
  • the determining module 104 is configured to analyze the sequence data statistics table of the sequence mode of the sequence mode generating module 103, and determine whether the behavior of the application programming interface is abnormal.
  • the sequence capture module 102 includes a denoising module 1021 and a sequence data generating module 1022.
  • the denoising module 1021 is configured to receive the application programming interface information acquired by the hook module 101 and perform denoising processing to obtain the application programming interface information after the denoising process;
  • the sequence data generating module 1022 is configured to perform sequence processing on the application programming interface information after the denoising process and generate sequence data.
  • the sequence pattern generation module 103 includes a statistical sequence generation module 10
  • the statistical sequence generating module 1031 is configured to perform statistics on the sequence data of the sequence grabbing module 102, and generate a statistical sequence
  • the confirmation module 1032 is configured to confirm whether the number of generations of the statistical sequence of the statistical sequence generation module 1031 reaches a preset generation quantity, and if the preset generation quantity is reached, send the information that reaches the preset generation quantity to the The sequence data statistic table generation module 1033; otherwise, the information that has not reached the preset generation quantity is sent to the sequence capture module 102, and the sequence capture module 102 and the sequence pattern generation module 103 continue to generate the statistical sequence;
  • the sequence data statistics table generating module 1033 is configured to generate a sequence data statistics table of the sequence mode for the statistical sequence that reaches the preset generation quantity.
  • sequence pattern generation module 103 further includes a sequence data cascading module 1030;
  • the sequence data cascading module 1030 is configured to cascade the sequence data of the sequence fetching module 102 to generate concatenated sequence data.
  • the hook module 101 implements hooking of the application programming interface by replacing the input address table of the application programming interface process.
  • the application programming interface information includes one or more of call information, call parameters, and call times of the application programming interface.
  • the device 10 further includes an alarm module 105.
  • the alarm module 105 is configured to issue an alarm to the user of the application programming interface according to the abnormal use of the application programming interface determined by the determination module 104.
  • the detecting device for abnormally using the application programming interface provided by the embodiment can perform statistics and analysis according to the application programming interface information that the user is interested in, and improves the accuracy of the abnormal use detection of the application programming interface.
  • the detection method and device for abnormal use of the application programming interface provided by the embodiment of the present invention can perform statistics and analysis according to the application programming interface information that the user is interested in, thereby improving the accuracy of the abnormal use detection of the application programming interface. Therefore, it has industrial applicability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种应用程序编程接口异常使用的检测方法和装置,所述方法包括步骤:S1:挂钩应用程序编程接口,并获取应用程序编程接口信息;S2:接收获取的应用程序编程接口信息并进行序列化处理,生成序列数据;S3:对生成的序列数据进行统计,并生成统计序列;S4:确认统计序列的生成数量是否达到预设的生成数量,若达到预设的生成数量,则生成序列模式的序列数据统计表,并转到下一个步骤S5;否则转到步骤S2;S5:对序列模式的序列数据统计表进行分析,并判断应用程序编程接口的行为是否异常。该方法可以依照用户感兴趣的应用程序编程接口信息进行统计和分析,提高了应用程序编程接口异常使用检测的准确度。

Description

一种应用程序编程接口异常使用的检测方法和装置 技术领域
[0001] 本发明涉及通信领域, 尤其涉及一种应用程序编程接口异常使用的检测方法和 装置。
背景技术
[0002] 随着互联网的发展, 软件安全和病毒入侵的问题越来越引起所有人的重视。 入 侵的病毒可以使进程崩溃, 进而引起操作系统的崩溃; 也可以监听和盗窃用户 的私密信息, 危害很大。
[0003] HOOK技术是一项比较成熟的技术, HOOK的意思就是挂钩、 联系。 可以使用 HOOK技术挂钩键盘动作、 鼠标动作, 也可以挂钩 API (Application Programming Interface, 应用程序编程接口) , 登记应用程序编程接口的调用过程, 监控传入 的参数。 进程的 IAT (Import Address
Table, 输入地址表) 、 系统的 SSDT (System Services Descriptor Table, 系统服 务描述符表) 、 IDT (Interrupt Descriptor Table , 中断描述符表) 等都是挂钩的 对象。 挂钩后, 就相当于在原有的过程增加了一个迂回分支, 迂回完成后继续 转回原有流程的处理步骤。 图 1为未增加 HOOK过程和增加 HOOK过程后的软件 执行流程的对比示意结构图。
[0004] 现有的病毒入侵检测方法基本是挂钩重要的应用程序编程接口或者系统调用, 然后记录其调用过程, 并与下一个调用过程相关联。 通过检测软件的规则库或 病毒库进行比对, 如果符合规则库或病毒库的描述, 则认为是病毒入侵程序。 现有的这种检测方法, 检测的准确度不高, 挂钩的应用程序编程接口有所限制 技术问题
[0005] 本发明的主要目的在于提出一种应用程序编程接口异常使用的检测方法和装置 , 旨在解决如何检测应用程序编程接口异常使用, 提高检测的准确度。
问题的解决方案 技术解决方案
[0006] 为实现上述目的, 本发明实施例第一方面提供一种应用程序编程接口异常使用 的检测方法, 所述方法包括步骤:
[0007] S1:挂钩所述应用程序编程接口, 并获取所述应用程序编程接口信息;
[0008] S2:接收获取的应用程序编程接口信息并进行序列化处理, 生成序列数据; [0009] S3:对生成的序列数据进行统计, 并生成统计序列;
[0010] S4:确认所述统计序列的生成数量是否达到预设的生成数量, 若达到预设的生 成数量, 则生成序列模式的序列数据统计表, 并转到下一个步骤 S5; 否则转到 步骤 S2;
[0011] S5:对所述序列模式的序列数据统计表进行分析, 并判断所述应用程序编程接 口的行为是否异常。
[0012] 结合本发明实施例的第一方面, 本发明实施例的第一方面的第一种实现方式中 , 所述方法还包括:
[0013] 步骤 S6:若所述应用程序编程接口的行为为异常行为, 向所述应用程序编程接 口的用户发出告警信息。
[0014] 结合本发明实施例的第一方面, 本发明实施例的第一方面的第二种实现方式中
, 所述挂钩所述应用程序编程接口, 是通过替换应用程序编程接口进程的输入 地址表的方式实现。
[0015] 结合本发明实施例的第一方面, 本发明实施例的第一方面的第三种实现方式中 , 所述步骤 S2包括:
[0016] S21:接收获取的应用程序编程接口信息并进行去噪处理, 获得去噪处理后的应 用程序编程接口信息;
[0017] S22:对所述去噪处理后的应用程序编程接口信息, 进行序列化处理并生成序列 数据。
[0018] 结合本发明实施例的第一方面, 本发明实施例的第一方面的第四种实现方式中
, 所述步骤 S3还包括步骤:
[0019] S3.0: 对所述生成的序列数据进行级联, 生成级联后的序列数据。
[0020] 结合本发明实施例的第一方面, 本发明实施例的第一方面的第五种实现方式中 , 所述应用程序编程接口信息包括应用程序编程接口的调用信息、 调用参数、 调用吋间中的一种或多种。
[0021] 此外, 为实现上述目的, 本发明实施例第二方面还提出一种应用程序编程接口 异常使用的检测装置, 所述装置包括: 挂钩模块、 序列抓取模块、 序列模式生 成模块及判断模块;
[0022] 所述挂钩模块, 用于挂钩所述应用程序编程接口, 并获取所述应用程序编程接 口信息;
[0023] 所述序列抓取模块, 用于接收所述挂钩模块获取的应用程序编程接口信息并进 行序列化处理, 生成序列数据;
[0024] 所述序列模式生成模块, 用于对所述序列抓取模块的序列数据进行统计, 并生 成统计序列; 用于对所述统计序列的生成数量进行确认是否达到预设的生成数 量, 并将达到预设的生成数量的统计序列生成序列模式的序列数据统计表; [0025] 所述判断模块, 用于对所述序列模式生成模块的序列模式的序列数据统计表进 行分析, 并判断所述应用程序编程接口的行为是否异常。
[0026] 结合本发明实施例的第二方面, 本发明实施例的第二方面的第一种实现方式中
, 所述装置还包括告警模块;
[0027] 所述告警模块, 用于根据所述判断模块判断出的应用程序编程接口异常使用, 向所述应用程序编程接口的用户发出告警信息。
[0028] 结合本发明实施例的第二方面, 本发明实施例的第二方面的第二种实现方式中
, 所述挂钩模块通过替换应用程序编程接口进程的输入地址表的方式实现挂钩 所述应用程序编程接口。
[0029] 结合本发明实施例的第二方面, 本发明实施例的第二方面的第三种实现方式中
, 所述序列抓取模块包括去噪模块、 序列数据生成模块;
[0030] 所述去噪模块, 用于接收所述挂钩模块获取的应用程序编程接口信息并进行去 噪处理, 获得去噪处理后的应用程序编程接口信息;
[0031] 所述序列数据生成模块, 用于对所述去噪处理后的应用程序编程接口信息, 进 行序列化处理并生成序列数据。
[0032] 结合本发明实施例的第二方面, 本发明实施例的第二方面的第四种实现方式中 , 所述序列模式生成模块包括统计序列生成模块、 确认模块、 序列数据统计表 生成模块;
[0033] 所述统计序列生成模块, 用于对所述序列抓取模块的序列数据进行统计, 并生 成统计序列;
[0034] 所述确认模块, 用于对所述统计序列生成模块的统计序列的生成数量进行确认 是否达到预设的生成数量, 若达到预设的生成数量, 则将达到预设生成数量的 信息发送给所述序列数据统计表生成模块; 否则将没有达到预设生成数量的信 息发送给所述序列抓取模块;
[0035] 所述序列数据统计表生成模块, 用于对达到预设生成数量的统计序列, 生成序 列模式的序列数据统计表。
[0036] 本发明实施例的第二方面的第五种可能实现方式, 结合本发明实施例的第二方 面的第四种实现方式, 所述序列模式生成模块还包括序列数据级联模块;
[0037] 所述序列数据级联模块, 用于对所述序列抓取模块的序列数据进行级联, 生成 级联后的序列数据。
[0038] 结合本发明实施例的第二方面, 本发明实施例的第二方面的第六种实现方式中 , 所述应用程序编程接口信息包括应用程序编程接口的调用信息、 调用参数、 调用吋间中的一种或多种。
发明的有益效果
有益效果
[0039] 本发明实施例提供的应用程序编程接口异常使用的检测方法和装置, 可以依照 用户感兴趣的应用程序编程接口信息进行统计和分析, 提高了应用程序编程接 口异常使用检测的准确度。
对附图的简要说明
附图说明
[0040] 图 1为未增力口 HOOK过程和增力口 HOOK过程后的软件执行流程的对比示意结构 图;
[0041] 图 2为本发明第一实施例的应用程序编程接口异常使用的检测方法的流程示意 图; [0042] 图 3为本发明第一实施例的应用程序编程接口异常使用的检测方法中的挂钩应 用程序编程接口的工作示意图;
[0043] 图 4为本发明第一实施例的应用程序编程接口异常使用的检测方法中的生成序 列数据的流程示意图;
[0044] 图 5为本发明第二实施例的应用程序编程接口异常使用的检测装置结构示意图
[0045] 图 6为本发明第二实施例的应用程序编程接口异常使用的检测装置的序列抓取 模块的结构示意图;
[0046] 图 7为本发明第二实施例的应用程序编程接口异常使用的检测装置的序列模式 生成模块的结构示意图。
[0047] 本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一步说明。
本发明的实施方式
[0048] 应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于限定本发 明。
[0049] 现在将参考附图描述实现本发明各个实施例的。 在后续的描述中, 使用用于表 示元件的诸如 "模块"、 "部件 "或"单元"的后缀仅为了有利于本发明的说明, 其本 身并没有特定的意义。
[0050] 如图 2所示, 本发明第一实施例提出一种应用程序编程接口异常使用的检测方 法, 该方法包括步骤:
[0051] S1:挂钩所述应用程序编程接口, 并获取所述应用程序编程接口信息;
[0052] 在本实施例中, 是通过替换应用程序编程接口进程的输入地址表的方式实现挂 钩所述应用程序编程接口。 具体地说就是替换应用程序编程接口进程的 IAT (im port address table输入地址表) 中具体的地址, 但是参数要保持一致。
[0053] 参考图 3所示, 替换的地址是一个新应用程序编程接口的地址单元。 这个地址 单元所代表的是一个指令模块。 指令模块分为两部分, 一部分是处理逻辑模块 , 处理逻辑模块主要负责获取应用程序编程接口信息, 应用程序编程接口信息 包括但不限于: 应用程序编程接口的调用信息、 调用参数、 调用吋间。 另一部 分是跳转模块, 具体地说, 就是跳转回被替换的应用程序编程接口的地址, 使 得原有的调用过程不受影响。
[0054] S2:接收获取的应用程序编程接口信息并进行序列化处理, 生成序列数据; [0055] 参考图 4所示, 在本实施例中, 该步骤具体包括:
[0056] S21:接收获取的应用程序编程接口信息并进行去噪处理, 并获得去噪处理后的 应用程序编程接口信息;
[0057] 在本实施例中, 应用程序编程接口信息包括但不限于: 应用程序编程接口的调 用信息、 调用参数、 调用吋间。 去噪处理就是去掉零散的边缘化的数据。
[0058] S22:对所述去噪处理后的应用程序编程接口信息, 进行序列化处理并生成序列 数据。
[0059] 在本实施例中, 应用程序编程接口每次被调用的信息都可通过步骤 S2获取并处 理。 作为一个示例, 下面具体来说明下:
[0060] 假设应用程序编程接口 (int A, char*
B), 其调用的具体参数值为 (ParamA, ParamB) 。 步骤 S2接收的应用程序编程 接口信息有应用程序编程接口 Name/应用程序编程接口 Address、 ParamA ^ Param B、 SystemTime或者用户感兴趣的应用程序编程接口信息。 接收应用程序编程接 口信息后, 对应用程序编程接口信息进行去噪处理。 去噪处理后的应用程序编 程接口信息会被进行序列化处理, 生成一条序列数据 <应用程序编程接口 Name/ 应用程序编程接口 Address-PammA-ParamB-SystemTime-others>。
[0061] 一般地, 序列数据包含如下几项<函数地址 /函数名, 参数 A的值, 参数 B的值… 参数 N的值, 调用吋间等 >。
[0062] S3:对生成的序列数据进行统计, 并生成统计序列;
[0063] 在本实施例中, 对步骤 S2生成的序列数据进行统计, 统计的数据可以是应用程 序编程接口名称或地址、 应用程序编程接口参数集等; 每次调用统计完成后会 生成调用次数, 并生成统计序列。 统计序列类似以下方式<应用程序编程接口名 称或地址, 参数值 Al, 参数值 B 1....参数值 Nl, 调用吋间、 调用次数等 >。 由于 每个应用程序编程接口的参数数目是固定的, 所以 n可以确定。 例如 <XX应用程 序编程接口 1, Al, B l,timel,8>、 <XX应用程序编程接口 2, A2, B2,time2,9>。 [0064] 进一步的, 在对生成的序列数据进行统计之前, 可对序列数据进行级联, 生成 级联后的序列数据。 作为示例的, 序列数据 1为< ?11^131>, 序列数据 2为<八? I2,A2,B2,C2>, 级联后的序列数据为 < API1,A1,B1,API2,A2,B2,C2>, 级联后产生 强度更高的规则, 这样可以发现调用过程之间的规律。
[0065] S4:确认所述统计序列的生成数量是否达到预设的生成数量, 若达到预设的生 成数量, 则生成序列模式的序列数据统计表, 并转到下一个步骤 S5; 否则转到 步骤 S2;
[0066] 在本实施例中, 需要一定生成数量的统计序列。 生成数量可由系统默认值决定 , 也可以由用户自己设定。 一定生成数量的统计序列, 会转换为序列模式的序 列数据统计表, 如下所示的示例:
[]
Figure imgf000009_0001
[0067] S5:对所述序列模式的序列数据统计表进行分析, 并判断所述应用程序编程接 口的行为是否异常。
[0068] 针对序列模式的序列数据统计表, 我们可以进行分析, 并判断所述应用程序编 程接口的行为是否异常。 以以上的序列模式的序列数据统计表为例, 可以统计 分析出每一列参数的最大最小值, 也能够统计分析出针对这个应用程序编程接 口的不同的参数的调用频率, 以形成横向和纵向两个统计维度: 参数上限阈值 、 参数下限阈值以及针对第一种调用参数集 (第一条记录) 的调用频率和针对 第二种调用参数集 (第二条记录) 的调用频率。 有了这几个参数, 也就能够统 计分析出什么样的序列是频繁的, 什么样的序列是不频繁的, 什么样的序列是 罕见的。 当然, 频繁、 不频繁、 罕见是可以由用户来设定的。
[0069] 进一步的, 在其他实施例中, 还包括步骤 S6:若所述应用程序编程接口的行为 为异常行为, 向所述应用程序编程接口的用户发出告警信息。 例如: 当有不正 常序列调用吋, 应用程序编程接口参数 n的值超出该参数的阈值范围, 可以向用 户进行通知。 若某一序列在一个吋间段内被调用的次数呈现异常增多吋, 可以 向用户发出告警。 用户处理之后, 可以再设置为正常调用的。
[0070] 本发明实施例提供的应用程序编程接口异常使用的检测方法, 可以依照用户感 兴趣的应用程序编程接口信息进行统计和分析, 提高了应用程序编程接口异常 使用检测的准确度。
[0071] 本发明进一步提供一种系统。
[0072] 参照图 5, 图 2为本发明第二实施例的一种应用程序编程接口异常使用的检测装 置, 装置 10包括: 挂钩模块 101、 序列抓取模块 102、 序列模式生成模块 103及判 断模块 104;
[0073] 挂钩模块 101, 用于挂钩所述应用程序编程接口, 并获取所述应用程序编程接 口信息;
[0074] 序列抓取模块 102, 用于接收所述挂钩模块 101获取的应用程序编程接口信息并 进行序列化处理, 生成序列数据;
[0075] 序列模式生成模块 103, 用于对序列抓取模块 102的序列数据进行统计, 并生成 统计序列; 用于对统计序列的生成数量进行确认是否达到预设的生成数量, 并 将达到预设生成数量的统计序列生成序列模式的序列数据统计表;
[0076] 判断模块 104, 用于对序列模式生成模块 103的序列模式的序列数据统计表进行 分析, 并判断所述应用程序编程接口的行为是否异常。
[0077] 参考图 6所示, 在本实施例中, 序列抓取模块 102包括去噪模块 1021、 序列数据 生成模块 1022;
[0078] 去噪模块 1021, 用于接收挂钩模块 101获取的应用程序编程接口信息并进行去 噪处理, 获得去噪处理后的应用程序编程接口信息;
[0079] 序列数据生成模块 1022, 用于对去噪处理后的应用程序编程接口信息, 进行序 列化处理并生成序列数据。
[0080] 参考图 7所示, 在本实施例中, 序列模式生成模块 103包括统计序列生成模块 10
31、 确认模块 1032及序列数据统计表生成模块 1033; [0081] 统计序列生成模块 1031, 用于对序列抓取模块 102的序列数据进行统计, 并生 成统计序列;
[0082] 确认模块 1032, 用于对统计序列生成模块 1031的统计序列的生成数量进行确认 是否达到预设的生成数量, 若达到预设的生成数量, 则将达到预设生成数量的 信息发送给序列数据统计表生成模块 1033; 否则将没有达到预设生成数量的信 息发送给序列抓取模块 102, 由序列抓取模块 102、 序列模式生成模块 103继续生 成统计序列;
[0083] 序列数据统计表生成模块 1033, 用于对达到预设生成数量的统计序列, 生成序 列模式的序列数据统计表。
[0084] 进一步的, 序列模式生成模块 103还包括序列数据级联模块 1030;
[0085] 序列数据级联模块 1030, 用于对序列抓取模块 102的序列数据进行级联, 生成 级联后的序列数据。
[0086] 在本实施例中, 挂钩模块 101通过替换应用程序编程接口进程的输入地址表的 方式实现挂钩所述应用程序编程接口。
[0087] 在本实施例中, 应用程序编程接口信息包括应用程序编程接口的调用信息、 调 用参数、 调用吋间中的一种或多种。
[0088] 在其他实施例中, 装置 10还包括告警模块 105; 告警模块 105, 用于根据判断模 块 104判断出的应用程序编程接口异常使用, 向应用程序编程接口的用户发出告 警 息。
[0089] 本实施例提供的应用程序编程接口异常使用的检测装置, 可以依照用户感兴趣 的应用程序编程接口信息进行统计和分析, 提高了应用程序编程接口异常使用 检测的准确度。
[0090] 需要说明的是, 在本文中, 术语"包括"、 "包含 "或者其任何其他变体意在涵盖 非排他性的包含, 从而使得包括一系列要素的过程、 方法、 物品或者装置不仅 包括那些要素, 而且还包括没有明确列出的其他要素, 或者是还包括为这种过 程、 方法、 物品或者装置所固有的要素。 在没有更多限制的情况下, 由语句 "包 括一个 ...... "限定的要素, 并不排除在包括该要素的过程、 方法、 物品或者装置 中还存在另外的相同要素。 [0091] 以上仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本 发明说明书及附图内容所作的等效结构或等效流程变换, 或直接或间接运用在 其他相关的技术领域, 均同理包括在本发明的专利保护范围内。
工业实用性
[0092] 本发明实施例提供的应用程序编程接口异常使用的检测方法和装置, 可以依照 用户感兴趣的应用程序编程接口信息进行统计和分析, 提高了应用程序编程接 口异常使用检测的准确度。 因此, 具有工业实用性。

Claims

权利要求书
[权利要求 1] 一种应用程序编程接口异常使用的检测方法, 所述方法包括步骤:
S1:挂钩所述应用程序编程接口, 并获取所述应用程序编程接口信息
S2:接收获取的应用程序编程接口信息并进行序列化处理, 生成序列 数据;
S3:对生成的序列数据进行统计, 并生成统计序列; S4:确认所述统计序列的生成数量是否达到预设的生成数量, 若达到 预设的生成数量, 则生成序列模式的序列数据统计表, 并转到下一个 步骤 S5 ; 否则转到步骤 S2;
S5:对所述序列模式的序列数据统计表进行分析, 并判断所述应用程 序编程接口的行为是否异常。
[权利要求 2] 如权利要求 1所述的一种应用程序编程接口异常使用的检测方法, 其 中, 所述方法还包括:
步骤 S6:若所述应用程序编程接口的行为为异常行为, 向所述应用程 序编程接口的用户发出告警信息。
[权利要求 3] 如权利要求 1所述的一种应用程序编程接口异常使用的检测方法, 其 中, 所述挂钩所述应用程序编程接口, 是通过替换应用程序编程接口 进程的输入地址表的方式实现。
[权利要求 4] 如权利要求 1所述的一种应用程序编程接口异常使用的检测方法, 其 中, 所述步骤 S2包括:
S21:接收获取的应用程序编程接口信息并进行去噪处理, 获得去噪处 理后的应用程序编程接口信息;
S22:对所述去噪处理后的应用程序编程接口信息, 进行序列化处理并 生成序列数据。
[权利要求 5] 如权利要求 1所述的一种应用程序编程接口异常使用的检测方法, 其 中, 所述步骤 S3还包括步骤:
S3.0: 对所述生成的序列数据进行级联, 生成级联后的序列数据。 如权利要求 1-5任一所述的一种应用程序编程接口异常使用的检测方 法, 其中, 所述应用程序编程接口信息包括应用程序编程接口的调用 信息、 调用参数、 调用吋间中的一种或多种。
一种应用程序编程接口异常使用的检测装置, 所述装置包括: 挂钩模 块、 序列抓取模块、 序列模式生成模块及判断模块;
所述挂钩模块, 用于挂钩所述应用程序编程接口, 并获取所述应用程 序编程接口信息;
所述序列抓取模块, 用于接收所述挂钩模块获取的应用程序编程接口 信息并进行序列化处理, 生成序列数据;
所述序列模式生成模块, 用于对所述序列抓取模块的序列数据进行统 计, 并生成统计序列; 用于对所述统计序列的生成数量进行确认是否 达到预设的生成数量, 并将达到预设生成数量的统计序列生成序列模 式的序列数据统计表;
所述判断模块, 用于对所述序列模式生成模块的序列模式的序列数据 统计表进行分析, 并判断所述应用程序编程接口的行为是否异常。 如权利要求 7所述的一种应用程序编程接口异常使用的检测装置, 其 中, 所述装置还包括告警模块;
所述告警模块, 用于根据所述判断模块判断出的应用程序编程接口异 常使用, 向所述应用程序编程接口的用户发出告警信息。
如权利要求 7所述的一种应用程序编程接口异常使用的检测装置, 其 中, 所述挂钩模块通过替换应用程序编程接口进程的输入地址表的方 式实现挂钩所述应用程序编程接口。
如权利要求 7所述的一种应用程序编程接口异常使用的检测装置, 其 中, 所述序列抓取模块包括去噪模块、 序列数据生成模块; 所述去噪模块, 用于接收所述挂钩模块获取的应用程序编程接口信息 并进行去噪处理, 获得去噪处理后的应用程序编程接口信息; 所述序列数据生成模块, 用于对所述去噪处理后的应用程序编程接口 信息, 进行序列化处理并生成序列数据。 [权利要求 11] 如权利要求 7所述的一种应用程序编程接口异常使用的检测装置, 其 中, 所述序列模式生成模块包括统计序列生成模块、 确认模块、 序列 数据统计表生成模块;
所述统计序列生成模块, 用于对所述序列抓取模块的序列数据进行统 计, 并生成统计序列;
所述确认模块, 用于对所述统计序列的生成数量进行确认是否达到预 设的生成数量, 若达到预设的生成数量, 则将达到预设生成数量的信 息发送给所述序列数据统计表生成模块; 否则将没有达到预设生成数 量的信息发送给所述序列抓取模块;
所述序列数据统计表生成模块, 用于对达到预设生成数量的统计序列 , 生成序列模式的序列数据统计表。
[权利要求 12] 如权利要求 7所述的一种应用程序编程接口异常使用的检测装置, 其 中, 所述序列模式生成模块还包括序列数据级联模块;
所述序列数据级联模块, 用于对所述序列抓取模块的序列数据进行级 联, 生成级联后的序列数据。
[权利要求 13] 如权利要求 7-12任一所述的一种应用程序编程接口异常使用的检测装 置, 其中, 所述应用程序编程接口信息包括应用程序编程接口的调用 信息、 调用参数、 调用吋间中的一种或多种。
PCT/CN2016/093544 2016-08-05 2016-08-05 一种应用程序编程接口异常使用的检测方法和装置 WO2018023705A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/093544 WO2018023705A1 (zh) 2016-08-05 2016-08-05 一种应用程序编程接口异常使用的检测方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/093544 WO2018023705A1 (zh) 2016-08-05 2016-08-05 一种应用程序编程接口异常使用的检测方法和装置

Publications (1)

Publication Number Publication Date
WO2018023705A1 true WO2018023705A1 (zh) 2018-02-08

Family

ID=61073326

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/093544 WO2018023705A1 (zh) 2016-08-05 2016-08-05 一种应用程序编程接口异常使用的检测方法和装置

Country Status (1)

Country Link
WO (1) WO2018023705A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080066179A1 (en) * 2006-09-11 2008-03-13 Fujian Eastern Micropoint Info-Tech Co., Ltd. Antivirus protection system and method for computers
CN102314561A (zh) * 2010-07-01 2012-01-11 电子科技大学 基于api hook的恶意代码自动分析方法和系统
CN104751052A (zh) * 2013-12-30 2015-07-01 南京理工大学常熟研究院有限公司 基于svm算法的移动智能终端软件的动态行为分析方法
CN104794399A (zh) * 2015-04-23 2015-07-22 北京北信源软件股份有限公司 一种基于海量程序行为数据的终端防护系统及方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080066179A1 (en) * 2006-09-11 2008-03-13 Fujian Eastern Micropoint Info-Tech Co., Ltd. Antivirus protection system and method for computers
CN102314561A (zh) * 2010-07-01 2012-01-11 电子科技大学 基于api hook的恶意代码自动分析方法和系统
CN104751052A (zh) * 2013-12-30 2015-07-01 南京理工大学常熟研究院有限公司 基于svm算法的移动智能终端软件的动态行为分析方法
CN104794399A (zh) * 2015-04-23 2015-07-22 北京北信源软件股份有限公司 一种基于海量程序行为数据的终端防护系统及方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU, QI ET AL.: "Malicious Code Dynamic Analysis Base on the Windows API Sequences", 1 September 2009 (2009-09-01) *

Similar Documents

Publication Publication Date Title
CN108881294B (zh) 基于网络攻击行为的攻击源ip画像生成方法以及装置
US11509685B2 (en) Cyberattack prevention system
TW201629832A (zh) 一種識別病毒變種的方法及裝置
US9372776B2 (en) Monitoring user activity and performance of computerized devices
WO2015135305A1 (zh) 终端真伪验证方法及装置
JP2017539039A5 (zh)
JP2015523663A (ja) メッセージを処理するための方法およびデバイス
CN110717183B (zh) 病毒查杀方法、装置、设备及存储介质
TW201220116A (en) Information security protection host
CN110059007B (zh) 系统漏洞扫描方法、装置、计算机设备及存储介质
CN107395650B (zh) 基于沙箱检测文件识别木马回连方法及装置
JP5739034B1 (ja) 攻撃検知システム、攻撃検知装置、攻撃検知方法および攻撃検知プログラム
CN109766694A (zh) 一种工控主机的程序协议白名单联动方法及装置
CN109684878B (zh) 一种基于区块链技术隐私信息防篡改方法及系统
CN103595731A (zh) 用于保护账户安全的系统和方法
CN113709147B (zh) 网络安全事件的响应方法、装置及设备
CN103795684A (zh) 一种防止透明窗体类病毒盗取即时通讯工具账号密码的方法及系统
CN108509228B (zh) 加载页面的方法、终端设备及计算机可读存储介质
Wang et al. Droidchain: A novel malware detection method for android based on behavior chain
CN104219219B (zh) 一种数据处理的方法、服务器及系统
WO2018023705A1 (zh) 一种应用程序编程接口异常使用的检测方法和装置
CN104462953B (zh) 一种信息处理方法及电子设备
CN112685745A (zh) 一种固件检测方法、装置、设备及存储介质
CN106790442A (zh) 一种防止表单重复提交的处理方法
CN113986986B (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: 16911300

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: 16911300

Country of ref document: EP

Kind code of ref document: A1