WO2015165375A1 - 在移动终端中抓取网络数据包的方法及装置 - Google Patents

在移动终端中抓取网络数据包的方法及装置 Download PDF

Info

Publication number
WO2015165375A1
WO2015165375A1 PCT/CN2015/077656 CN2015077656W WO2015165375A1 WO 2015165375 A1 WO2015165375 A1 WO 2015165375A1 CN 2015077656 W CN2015077656 W CN 2015077656W WO 2015165375 A1 WO2015165375 A1 WO 2015165375A1
Authority
WO
WIPO (PCT)
Prior art keywords
network data
mobile terminal
function
event
data
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2015/077656
Other languages
English (en)
French (fr)
Inventor
陈杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Publication of WO2015165375A1 publication Critical patent/WO2015165375A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/725Cordless telephones

Definitions

  • the present invention relates to the field of mobile terminal technologies, and in particular, to a method and apparatus for capturing network data packets in a mobile terminal.
  • the operating system is responsible for managing the software and hardware resources of the mobile terminal devices, controlling the operation of other programs, and providing services and support for the operation of other programs.
  • users can install a variety of feature-rich software applications that involve people's work and entertainment.
  • feature-rich software applications that involve people's work and entertainment.
  • applications that require high requirements for the operating environment, such as online banking.
  • the data packet transmitted and received by the application itself can be directly monitored by directly monitoring the data transmission and reception events of the application itself.
  • a transmission protocol such as https
  • the data packet is encrypted during the process of transmitting the data packet, when the application receives and receives events in a conventional manner, the captured data packet is often incapable of being directly Perform analytical operations.
  • some network data monitoring tools have appeared in the prior art. These tools generally need to be simulated as an application client when crawling https data packets. If the application or website needs to encrypt data, it needs to be acquired and installed in advance. The application or the certificate of the website, and then use the obtained certificate to communicate with the server, and capture the data package uploaded or received by the application.
  • this method can capture https data packets, it can only be used for specific applications.
  • a monitoring tool can only monitor and receive data for a browser software. For the endless stream of mobile terminal applications, this data is sent and received. Monitoring tools or methods lack general applicability and cannot meet the number According to security needs.
  • the method of capturing the data packet also needs to install the corresponding security certificate on the terminal device, so that effective security monitoring can be realized, and if the security certificate cannot be obtained, This technical means still cannot effectively capture the data packets sent and received by the mobile terminal.
  • the present invention has been made in order to provide a method for capturing network data packets in a mobile terminal and corresponding apparatus for capturing network data packets in a mobile terminal that overcomes the above problems or at least partially solves the above problems.
  • a method for capturing a network data packet in a mobile terminal including:
  • the event of transmitting the network data When the event of transmitting the network data is monitored, the event of transmitting the network data is intercepted, and the data packet to be sent is extracted from the event.
  • an apparatus for capturing a network data packet in a mobile terminal including:
  • a monitoring unit configured to monitor an event of sending network data of an application in the mobile terminal device by hooking a function for transmitting network data in the mobile terminal device; wherein the function for transmitting the network data is a mobile terminal
  • the unified interface function provided by the operating system of the device, and each application installed in the mobile terminal device needs to call the function when the network data needs to be sent;
  • a data extracting unit configured to intercept an event that sends the network data when the event of sending the network data is monitored, and extract a data packet to be sent from the event.
  • a computer program comprising computer readable code, when said computer readable code is run on a mobile terminal, causing said mobile terminal to perform said crawling of a network in a mobile terminal The method of the packet.
  • a computer readable medium storing a computer program as described above is provided.
  • an event of transmitting network data of an application in the mobile terminal device can be monitored by hooking a function for transmitting network data in the mobile terminal device;
  • the event of sending the network data is monitored, the event of sending the network data is intercepted, and the data packet to be sent is extracted from the event, and the application program can be effectively extracted from the event that the application sends the network data.
  • the data is sent, and since the application often needs to call the unified interface function monitored when sending network data, the method has wide applicability to various programs as compared with the prior art.
  • FIG. 1 shows a flow chart of a method of grabbing a network data packet in a mobile terminal according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an apparatus for capturing network data packets in a mobile terminal according to an embodiment of the present invention
  • Figure 3 schematically shows a block diagram of a mobile terminal for performing the method according to the invention
  • Fig. 4 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • FIG. 1 is a flowchart of a method for capturing a network data packet in a mobile terminal according to an embodiment of the present invention. As shown in FIG. 1, the method for capturing a network data packet in a mobile terminal includes the following steps:
  • S110 Monitor an event of sending network data of an application in the mobile terminal device by hooking a function for sending network data in the mobile terminal device, where the function for sending the network data is an operation of the mobile terminal device
  • a relatively complex operating system is usually installed to support upper-layer applications. If an application in a mobile terminal device needs to connect to a network and send and receive data through the network, it is usually necessary to call an interface provided by the operating system.
  • the event of transmitting and receiving network data by the application in the mobile terminal device can be monitored by hooking a function in the mobile terminal device for transmitting and receiving network data.
  • an application local to the mobile terminal device needs to call a function for transmitting network data in the mobile terminal device to send data to a specific network address.
  • the mobile device also needs to call the mobile terminal.
  • a function in the terminal device for transmitting network data which transmits local data.
  • an event for sending network data in an application of the mobile terminal device may be monitored by hooking a function for transmitting network data in the mobile terminal device, so as to know that the application sends the event. Events for network data.
  • the function for transmitting network data includes a unified interface function provided by an operating system of the mobile terminal device, and each application installed in the mobile terminal device needs a function to be called when the network data needs to be sent.
  • the installed operating system is iOS.
  • the iOS operating system if the application needs to initiate an encrypted connection and send data to the outside, it needs to call the sslread provided in the iOS operating system. function. At this time, it is possible to monitor the event of transmitting the network data of the application running therein by hooking the function in the mobile terminal device carrying the iOS operating system.
  • the malicious application can receive malicious information such as receiving hacking instructions and downloading malicious programs by receiving network data. Therefore, in addition to monitoring and transmitting local sensitive data to the malicious application, in addition to monitoring, the method provided by the embodiment of the present invention may The calling event of the function of uploading the network data of the local data may also monitor the event that the local application receives the network data.
  • the function of the mobile terminal device for receiving the network data may be hooked up to the mobile terminal. The event of the application receiving network data in the device is monitored; wherein the letter for receiving the network data
  • the number includes a unified interface function provided by the operating system of the mobile terminal device, and each application installed in the mobile terminal device needs to call the function when it needs to receive network data. For example, in a mobile terminal equipped with an iOS operating system, if the local application needs to accept network data, it needs to call the sslwrite function, and the function of receiving the network data of the application in the mobile terminal device can be monitored by hooking the function.
  • the network data sent by the application may be intercepted. Further, the data packet to be sent to the data packet may be extracted from the event, and the data sent by the application program may be analyzed and determined. Its security, or whether it is sensitive to the user's data. As described above, when an application on a mobile terminal device transmits data, it may be an encrypted transmission based on an encrypted connection, and data capture in such data transmission is implemented, if there is no corresponding decryption means, such as a decryption key. Or the certificate, it is difficult to achieve further data analysis.
  • the hooking mechanism can be used to hook the sending interface function of the operating system called by the application, so that the application can send the application to the operating system when the application calls the sending interface function of the operating system.
  • the parameters transmitted by the interface function in the parameter, have function parameters representing the data to be sent or received by the application, and the function parameters can be extracted to implement the acquisition of the data packet to be sent by the application.
  • the acquired function parameters representing the transmitted/received data are unencrypted data, which facilitates subsequent data security analysis.
  • the malicious behavior of the application in addition to sending the user's sensitive data, can also receive malicious actions such as receiving hacking instructions and downloading malicious programs. Therefore, it is also possible to monitor events that the application receives network data, as well as events.
  • the packets received by the application are acquired.
  • the specific implementation manner may also be that the hooking mechanism is used to hook the receiving interface function of the operating system invoked by the application.
  • the data packet is encrypted, when the data is extracted, the data may be extracted after performing the decryption operation, and correspondingly, the data packet extracted from the event of receiving the network data is the data packet after the decryption operation is performed by the application.
  • the interface functions, sslread and sslwrite which are called when the application sends and receives data, can be hooked respectively.
  • the function prototype of the hook can be as follows:
  • the data to be sent and received by the application can be obtained in the code of the hook function.
  • the legality analysis may be further performed on the extracted data packet to be sent or the data packet to be received; If it is determined that the transmitted data packet includes user sensitive data, or the malicious data received by the remote control, or the malicious program is downloaded, the user intercepts or sends a prompt message to the user to remind the user to take further security measures.
  • the method for capturing a network data packet in a mobile terminal is described in detail above.
  • the method can be applied to a mobile terminal device by hooking a function for sending network data in the mobile terminal device.
  • the event of sending the network data of the program is monitored; further, when the event of sending the network data is monitored, the event of sending the network data is intercepted, and the data packet to be sent is extracted from the event, and sent from the application.
  • the data sent by the application can be effectively extracted, and since the application often needs to call the unified interface function monitored when the network data is sent, the method has a wider range of functions than the prior art. applicability.
  • FIG. 2 is in accordance with an embodiment of the present invention.
  • the monitoring unit 210 is configured to monitor an event of sending network data of an application in the mobile terminal device by hooking a function for sending network data in the mobile terminal device, where the function for transmitting the network data is a mobile terminal device
  • the data extracting unit 220 is configured to intercept an event of sending network data when the event of sending the network data is monitored, and extract a data packet to be sent from the event.
  • the data packet to be sent extracted from the event of sending network data may be an application execution The packet before the encryption operation.
  • the hooked function may be an sslread function for transmitting network data.
  • the device for capturing network data packets in the mobile terminal may further include:
  • a data analysis unit configured to perform legality analysis on the extracted data packet to be sent
  • the data intercepting unit is configured to intercept or send the prompt information to the user if it is determined that the data packet includes user sensitive data.
  • the monitoring unit 210 may be further configured to: receive an event of the network data of the application in the mobile terminal device by hooking a function in the mobile terminal device for receiving network data. Performing monitoring; wherein the function for receiving network data is a unified interface function provided by the operating system of the mobile terminal device, and each application installed in the mobile terminal device needs to call the function when receiving network data;
  • the data extracting unit 220 is further configured to intercept an event of receiving the network data when the event of receiving the network data is monitored, and extract the received data packet from the event.
  • the hooked data receiving function may be an sslwrite function for receiving network data.
  • the device for capturing a network data packet in a mobile terminal provided by the embodiment of the present invention is introduced.
  • the device can be used to hook the mobile terminal device to send an application of the network data to the application in the mobile terminal device.
  • Events that send network data are monitored. Further, when the event of transmitting the network data is monitored, the event of sending the network data is intercepted, and the data packet to be sent is extracted from the event, and the application can be effectively extracted from the event that the application sends the network data.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the components of the device for capturing network data packets in a mobile terminal in accordance with an embodiment of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • FIG. 3 illustrates a mobile terminal, such as a cell phone, PAD, etc., that may implement a method of capturing network data packets in a mobile terminal in accordance with the present invention.
  • the mobile terminal conventionally includes a processor 310 and a computer program product or computer readable medium in the form of a memory 320.
  • the memory 320 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • the memory 320 has a storage space 330 for program code 331 for performing any of the method steps of the above-described method of capturing network data packets in the mobile terminal.
  • storage space 330 for program code may include various program code 331 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 320 in the mobile terminal of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 331', ie, code readable by a processor, such as 310, that when executed by the mobile terminal causes the mobile terminal to perform each of the methods described above step.
  • the application can be applied to a computer system/server that can operate with numerous other general purpose or special purpose computing system environments or configurations.
  • Examples of well-known computing systems, environments, and/or configurations suitable for use with computer systems/servers include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, based on Microprocessor systems, set-top boxes, programmable consumer electronics, networked personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above, and the like.
  • the computer system/server can be described in the general context of computer system executable instructions (such as program modules) being executed by a computer system.
  • program modules may include routines, programs, target programs, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the computer system/server can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communication network.
  • program modules may be located on a local or remote computing system storage medium including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种在移动终端中抓取网络数据包的方法及装置,其中所述方法包括:通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;其中,所述用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。通过该方法可以有效的提取应用程序所发送的网络数据,对于多种程序都具有广泛的适用性。

Description

在移动终端中抓取网络数据包的方法及装置 技术领域
本发明涉及移动终端技术领域,具体涉及在移动终端中抓取网络数据包的方法及装置。
背景技术
为了便于应用,大多移动终端设备中会搭载相对大型的操作系统,操作系统负责管理移动终端设备的软硬件资源,控制其他程序的运行,并为其他程序的运行提供服务和支持。在操作系统之上用户可以安装各种功能丰富的软件应用,这些软件应用涉及到人们工作娱乐等等方面。在用户安装的软件应用中,不乏对运行环境要求较高的应用,诸如网络银行,一旦敏感的用户信息被恶意程序盗取,就可能会给用户带来损失;另外还有一些应用,可能会处于某种原因,在用户不知情的情况下,将终端设备中的一些用户数据上传到自己的服务器,等等。因此在移动终端设备上,还常常需要采取一定的安全措施,其中,在移动终端上对应用程序收发的数据包进行监控,并对收发的数据包进行安全性分析判断,在发现其中包含用户的敏感数据时,进行拦截或者向用户进行提示,便是其中的一种措施。在此过程中,如何抓取到应用收发的数据包是一个关键的问题。
对于一些使用http等传统的传输协议进行数据传输的情况而言,一般直接监控应用自身的收发数据事件,即可抓取到其收发的数据包。但是,对于https等传输协议而言,由于在传输数据包的过程中对数据包进行加密处理,因此,采用传统的方式对应用的收发事件进行监控时,抓取到的数据包往往是无法直接进行分析操作的。为此,现有技术中出现了一些网络数据监控工具,这些工具在抓取https数据包时,一般需要模拟成应用的客户端,如果应用或网站需要对数据进行加密,还需要提前获取和安装应用或者网站的证书,然后利用获取到的证书与服务器端进行通信,从中抓取到应用上传或者接收到的数据包。
这种方式虽然能够抓取到https数据包,但是往往只能针对特定的应用,例如某监控工具只能够对一款浏览器软件实现数据收发监控,对于层出不穷的移动终端应用,这种数据收发的监控工具或方式缺乏普遍的适用性,无法满足数 据安全的需求。此外,对于建立在加密的安全连接上的收据收发,这种抓取数据包的方式还需要在终端设备上安装对应的安全证书,才能够实现有效的安全监控,在无法获取安全证书的情况下,这种技术手段则仍然无法实现对移动终端所收发的数据包进行有效的抓取。
因此,如何更方便有效地抓取移动终端设备上收发的数据包,是迫切需要本领域技术人员解决的技术问题。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的在移动终端中抓取网络数据包的方法和相应的在移动终端中抓取网络数据包的装置。
依据本发明的一个方面,提供了在移动终端中抓取网络数据包的方法,包括:
通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;其中,所述用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;
当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。
根据本发明的另一方面,提供了在移动终端中抓取网络数据包的装置,包括:
监控单元,用于通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;其中,所述用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;
数据提取单元,用于当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。
根据本发明的另一个方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在移动终端上运行时,导致所述移动终端执行上述的在移动终端中抓取网络数据包的方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了如上所述的计算机程序。
根据本发明的在移动终端中抓取网络数据包的方法,可以通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;进而,当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包,从应用程序发送网络数据的事件中可以有效的提取应用程序所发送的数据,并且,由于应用程序在发送网络数据时,常常需要调用所监控的统一的接口函数,从而本方法相对于现有技术,对于多种程序都具有广泛的适用性。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了根据本发明一个实施例的在移动终端中抓取网络数据包的方法的流程图;
图2示出了根据本发明一个实施例的在移动终端中抓取网络数据包的装置的示意图;
图3示意性地示出了用于执行根据本发明的方法的移动终端的框图;以及
图4示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
附图实施例
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本 公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
图1示出了根据发明一个实施例的在移动终端中抓取网络数据包的方法的流程图,如图1所示,该在移动终端中抓取网络数据包的方法包括以下步骤:
S110:通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;其中,所述用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;
在移动终端设备中,通常安装了相对复杂的操作系统,为上层的应用程序提供支持。移动终端设备中的应用程序如果需要连接网络并通过网络收发数据,通常需要调用操作系统提供的接口。首先可以通过钩挂移动终端设备中用于收发网络数据的函数,对移动终端设备中应用程序收发网络数据的事件进行监控。通常,移动终端设备本地的应用程序要发送数据到特定的网络地址,需要调用移动终端设备中用于发送网络数据的函数,同样,在一些恶意程序需要发送用户的敏感数据时,也需要调用移动终端设备中的用于发送网络数据的函数,将本地的数据发送出去。因此,在本发明实施例提供的方法中,主要可以通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控,来获知应用程序发送网络数据的事件。
其中,用于发送网络数据的函数包括移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用的函数。例如,在苹果公司生产的移动终端设备中,所安装的操作系统为iOS,在iOS操作系统中,应用程序如果需要发起加密连接,并向外发送数据时,需要调用iOS操作系统中提供的sslread函数。此时,可以通过钩挂搭载iOS操作系统的移动终端设备中的该函数,实现对其中运行的应用程序的发送网络数据的事件的监控。
此外,恶意应用程序还可以通过接收网络数据,实现接收黑客指令,下载恶意程序等恶意行为,因此除了监控对恶意应用程序发送本地敏感数据外,在本发明实施例提供的方法中,除了监控可能上传本地数据的发送网络数据的函数的调用事件,还可以对本地应用程序接收网络数据的事件进行监控,具体实现时,可以通过钩挂移动终端设备中用于接收网络数据的函数,对移动终端设备中应用程序的接收网络数据的事件进行监控;其中,用于接收网络数据的函 数包括移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要接收网络数据时,均需调用该函数。例如搭载iOS操作系统的移动终端中,本地应用程序如果需要接受网络数据,需要调用sslwrite函数,可以通过钩挂该函数,实现对移动终端设备中应用程序的接收网络数据的事件的监控。
S120:当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。
当监控到本地应用程序触发的发送网络数据的事件后,可以拦截应用程序发送的网络数据,进一步的,可以从该事件中提取出待发送到数据包,对应用程序发送的数据进行分析,确定其安全性,或者确定其是否为用户的敏感数据。如前所述,在移动终端设备上的应用程序发送数据时,可以是基于加密连接的加密传输,要实现对这种数据传输中的数据捕获,如果不具备相应的解密手段,比如解密密钥或者证书,就很难实现进一步的数据分析,此时就需要在监控到移动终端设备中应用程序的发送网络数据的事件时,在应用程序对其所要发送的数据进行加密前,从函数调用事件中提取到待发送的未加密的数据包。具体实现时,可以利用钩挂机制,对应用程序所调用的操作系统的发送接口函数进行钩挂,这样,就可以在应用程序调用操作系统的发送接口函数时,获取应用程序向操作系统的发送接口函数传送的参数,在参数中有代表应用程序所要发送或接收的数据的函数参数,可以将此函数参数提取出来,从而实现对应用程序所要发送的数据包的获取。并且在这个过程中,所获取到的代表发送/接收数据的函数参数,是未经过加密的数据,便于实现后续的数据安全性分析。
如前所述,应用程序的恶意行为,除了发送用户的敏感数据,还可以有接收黑客指令,下载恶意程序等恶意行为,因此,还可以对应用程序接收网络数据的事件进行监控,以及对事件中应用程序所接收的数据包进行获取。具体的实现方式也可以是利用钩挂机制,对应用程序所调用的操作系统的接收接口函数进行钩挂。在数据包被加密的情况下,在提取数据时,可以在执行解密操作后再提取其中的数据,对应的,从接收网络数据的事件中提取的数据包为应用执行解密操作后的数据包。
例如在iOS操作系统中可以分别对应用程序收发数据时调用的接口函数,sslread以及sslwrite进行钩挂,实现钩挂的函数原型可以如下:
MSHookFunction((void*)SSLWrite,(void*)_hook_SSLWrite,(void**)&_real_SSLWrite);
MSHookFunction((void*)SSLRead,(void*)_hook_SSLRead,(void**)&_real_SSLRead);
通过实现上述钩挂函数,可以在钩挂函数的代码中获取应用程序所要收发的数据。
在实现了对应用程序发送以及接收网络数据的事件的监控,以及对所有收发的数据包的获取后,可以进一步的对提取到的待发送数据包,或者待接收的数据包进行合法性分析;如果判定发送数据包中包括用户敏感数据,或者接收到数据为远程操控的恶意指令,或者下载恶意程序等行为等等,则进行拦截或者向用户发送提示信息,以提醒用户采取进一步的安全措施。
以上对本发明实施例提供的在移动终端中抓取网络数据包的方法进行了详细的介绍,通过该方法,可以通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;进而,当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包,从应用程序发送网络数据的事件中可以有效的提取应用程序所发送的数据,并且,由于应用程序在发送网络数据时,常常需要调用所监控的统一的接口函数,从而本方法相对于现有技术具有更加广泛的适用性。
与本发明实施例提供的在移动终端中抓取网络数据包的方法相对应,还提供了在移动终端中抓取网络数据包的装置,请参看图2,为根据本发明一个实施例的在移动终端中抓取网络数据包的装置的示意图,如图所示,该装置可以包括:
监控单元210,用于通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;其中,用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;
数据提取单元220,用于当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。
其中,从发送网络数据的事件中提取的待发送的数据包可以是应用程序执 行加密操作前的数据包。当移动终端设备所搭载的操作系统为iOS系统时,所钩挂的函数可以是用于发送网络数据的sslread函数。
在另一种实现方式下,该在移动终端中抓取网络数据包的装置还可以包括:
数据分析单元,用于对提取到的待发送数据包进行合法性分析;
数据拦截单元,用于如果判定出所述数据包中包括用户敏感数据,则进行拦截或者向用户发送提示信息。
当用于获取移动终端中应用程序接收的数据时,监控单元210还可以用于,通过钩挂移动终端设备中用于接收网络数据的函数,对移动终端设备中应用程序的接收网络数据的事件进行监控;其中,用于接收网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要接收网络数据时,均需调用该函数;
数据提取单元220还用于,当监控到接收网络数据的事件时,对该接收网络数据的事件进行拦截,并从该事件中提取接收到的数据包。
其中,如果是基于加密连接的数据传输,对应的从接收数据的事件中提取的接收到的数据包为应用执行解密操作后的数据包。当移动终端设备所搭载的操作系统为iOS系统时,所钩挂的数据接收函数可以是用于接收网络数据的sslwrite函数。
以上对本发明实施例提供的在移动终端中抓取网络数据包的装置进行了介绍,通过该装置,可以利用钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控。进而,当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包,从应用程序发送网络数据的事件中可以有效的提取应用程序所发送的数据,并且,由于应用程序在发送网络数据时,常常需要调用所监控的统一的接口函数,相对于现有技术具有更加广泛的适用性。
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发 明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的在移动终端中抓取网络数据包的装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。 这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图3示出了可以实现根据本发明的在移动终端中抓取网络数据包的方法的移动终端,例如手机、PAD等。该移动终端传统上包括处理器310和以存储器320形式的计算机程序产品或者计算机可读介质。存储器320可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器320具有用于执行上述在移动终端中抓取网络数据包的方法中的任何方法步骤的程序代码331的存储空间330。例如,用于程序代码的存储空间330可以包括分别用于实现上面的方法中的各种步骤的各个程序代码331。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图4所述的便携式或者固定存储单元。该存储单元可以具有与图3的移动终端中的存储器320类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码331’,即可以由例如诸如310之类的处理器读取的代码,这些代码当由移动终端运行时,导致该移动终端执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包 括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。
本申请可以应用于计算机系统/服务器,其可与众多其它通用或专用计算系统环境或配置一起操作。适于与计算机系统/服务器一起使用的众所周知的计算系统、环境和/或配置的例子包括但不限于:个人计算机系统、服务器计算机系统、瘦客户机、厚客户机、手持或膝上设备、基于微处理器的系统、机顶盒、可编程消费电子产品、网络个人电脑、小型计算机系统、大型计算机系统和包括上述任何系统的分布式云计算技术环境,等等。
计算机系统/服务器可以在由计算机系统执行的计算机系统可执行指令(诸如程序模块)的一般语境下描述。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务器可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。

Claims (16)

  1. 一种在移动终端中抓取网络数据包的方法,包括:
    通过钩挂移动终端设备中用于发送网络数据的函数,对移动终端设备中应用程序的发送网络数据的事件进行监控;其中,所述用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;
    当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。
  2. 如权利要求1所述的方法,所述从该事件中提取的待发送的数据包为应用程序执行加密操作前的数据包。
  3. 如权利要求1所述的方法,当所述操作系统为iOS系统时,所述用于发送网络数据的函数包括sslread函数。
  4. 如权利要求1至3任一项所述的方法,还包括:
    对提取到的待发送数据包进行合法性分析;
    如果判定出所述数据包中包括用户敏感数据,则进行拦截或者向用户发送提示信息。
  5. 如权利要求1至3任一项所述的方法,还包括:
    通过钩挂移动终端设备中用于接收网络数据的函数,对移动终端设备中应用程序的接收网络数据的事件进行监控;其中,所述用于接收网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要接收网络数据时,均需调用该函数;
    当监控到所述接收网络数据的事件时,对该接收网络数据的事件进行拦截,并从该事件中提取接收到的数据包。
  6. 如权利要求5所述的方法,所述从该事件中提取的接收到的数据包为应用执行解密操作后的数据包。
  7. 如权利要求5所述的方法,当所述操作系统为iOS系统时,所述用于接收网络数据的函数包括sslwrite函数。
  8. 一种在移动终端中抓取网络数据包的装置,包括:
    监控单元,用于通过钩挂移动终端设备中用于发送网络数据的函数,对移 动终端设备中应用程序的发送网络数据的事件进行监控;其中,所述用于发送网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要发送网络数据时,均需调用该函数;
    数据提取单元,用于当监控到所述发送网络数据的事件时,对该发送网络数据的事件进行拦截,并从该事件中提取待发送的数据包。
  9. 如权利要求8所述的装置,所述从该事件中提取的待发送的数据包为应用程序执行加密操作前的数据包。
  10. 如权利要求8所述的装置,当所述操作系统为iOS系统时,所述用于发送网络数据的函数包括sslread函数。
  11. 如权利要求8至10任一项所述的装置,还包括
    数据分析单元,用于对提取到的待发送数据包进行合法性分析;
    数据拦截单元,用于如果判定出所述数据包中包括用户敏感数据,则进行拦截或者向用户发送提示信息。
  12. 如权利要求8至10任一项所述的装置,所述监控单元还用于:
    通过钩挂移动终端设备中用于接收网络数据的函数,对移动终端设备中应用程序的接收网络数据的事件进行监控;其中,所述用于接收网络数据的函数为移动终端设备的操作系统提供的统一的接口函数,移动终端设备中安装的各个应用在需要接收网络数据时,均需调用该函数;
    所述数据提取单元还用于:当监控到所述接收网络数据的事件时,对该接收网络数据的事件进行拦截,并从该事件中提取接收到的数据包。
  13. 如权利要求12所述的装置,所述从该事件中提取的接收到的数据包为应用执行解密操作后的数据包。
  14. 如权利要求12所述的装置,当所述操作系统为iOS系统时,所述用于接收网络数据的函数包括sslwrite函数。
  15. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在移动终端上运行时,导致所述移动终端执行根据权利要求1-7中的任一个所述的在移动终端中抓取网络数据包的方法。
  16. 一种计算机可读介质,其中存储了如权利要求15所述的计算机程序。
PCT/CN2015/077656 2014-04-28 2015-04-28 在移动终端中抓取网络数据包的方法及装置 Ceased WO2015165375A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410175709.5A CN105099991B (zh) 2014-04-28 2014-04-28 在移动终端中抓取网络数据包的方法及装置
CN201410175709.5 2014-04-28

Publications (1)

Publication Number Publication Date
WO2015165375A1 true WO2015165375A1 (zh) 2015-11-05

Family

ID=54358174

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/077656 Ceased WO2015165375A1 (zh) 2014-04-28 2015-04-28 在移动终端中抓取网络数据包的方法及装置

Country Status (2)

Country Link
CN (1) CN105099991B (zh)
WO (1) WO2015165375A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961432A (zh) * 2021-09-28 2022-01-21 阿波罗智联(北京)科技有限公司 生成数据报告的方法、装置、电子设备及存储介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220258A (zh) * 2016-03-22 2017-09-29 阿里巴巴集团控股有限公司 用于抓取应用页面的数据的方法、装置及终端
CN106101105A (zh) * 2016-06-14 2016-11-09 北京小米移动软件有限公司 数据处理方法、装置及系统
CN107528820A (zh) * 2017-06-07 2017-12-29 中国银联股份有限公司 针对应用程序的加解密方法、装置及安全审计方法和平台
CN113225354B (zh) * 2021-06-02 2022-03-22 郑州信大捷安信息技术股份有限公司 用于分析安全通道加密数据的方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286850A (zh) * 2007-04-10 2008-10-15 深圳职业技术学院 路由器安全防御装置及防御系统和方法
CN103051617A (zh) * 2012-12-18 2013-04-17 北京奇虎科技有限公司 识别程序的网络行为的方法、装置及系统
US8561176B1 (en) * 2007-01-24 2013-10-15 Mcafee, Inc. System, method and computer program product for monitoring and/or analyzing at least one aspect of an invocation of an interface
CN103368978A (zh) * 2013-08-02 2013-10-23 公安部第三研究所 实现智能移动终端应用漏洞和通信安全检测的系统及方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8103763B2 (en) * 2007-08-24 2012-01-24 Tibbo Technology System for remote configuration, control, and monitoring of devices over computer network using central server
CN102932375B (zh) * 2012-11-22 2015-10-07 北京奇虎科技有限公司 网络访问行为的防护方法和装置
CN103198255B (zh) * 2013-04-03 2015-06-24 武汉大学 一种Android软件敏感行为监控与拦截方法及系统
CN103428582B (zh) * 2013-09-02 2016-09-28 贝壳网际(北京)安全技术有限公司 播放视频的方法、装置和客户端
CN103442360A (zh) * 2013-09-09 2013-12-11 北京网秦天下科技有限公司 移动应用的安全性检测方法及移动终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8561176B1 (en) * 2007-01-24 2013-10-15 Mcafee, Inc. System, method and computer program product for monitoring and/or analyzing at least one aspect of an invocation of an interface
CN101286850A (zh) * 2007-04-10 2008-10-15 深圳职业技术学院 路由器安全防御装置及防御系统和方法
CN103051617A (zh) * 2012-12-18 2013-04-17 北京奇虎科技有限公司 识别程序的网络行为的方法、装置及系统
CN103368978A (zh) * 2013-08-02 2013-10-23 公安部第三研究所 实现智能移动终端应用漏洞和通信安全检测的系统及方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961432A (zh) * 2021-09-28 2022-01-21 阿波罗智联(北京)科技有限公司 生成数据报告的方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN105099991A (zh) 2015-11-25
CN105099991B (zh) 2019-05-31

Similar Documents

Publication Publication Date Title
US11991158B2 (en) System and method for implementing secure communications for internet of things (IoT) devices
US12267352B2 (en) Rest API scanning for security testing
KR102739986B1 (ko) 패턴 매칭 기반 데이터세트 추출
US8949935B2 (en) Secure account creation
CN107135073A (zh) 接口调用方法和装置
CN104641377A (zh) 用于移动计算设备的数据丢失防护
US20190149410A1 (en) Secure configuration of cloud computing nodes
EP3590061B1 (en) Managing data encrypting application
WO2014048250A1 (en) Termininal interaction methods and related devices and systems
CN111163095B (zh) 网络攻击分析方法、网络攻击分析装置、计算设备和介质
CN105554001B (zh) 一种基于加密的通信方法和系统
CN109075966B (zh) 通信安全系统和方法
CN105099991A (zh) 在移动终端中抓取网络数据包的方法及装置
US10826901B2 (en) Systems and method for cross-channel device binding
CN107528820A (zh) 针对应用程序的加解密方法、装置及安全审计方法和平台
WO2014106391A1 (zh) 一种应用安装的方法、设备及系统
TW201633205A (zh) 用於惡意程式碼檢測之系統及方法
Zhang et al. An empirical study of insecure communication in Android apps
CN111970281B (zh) 基于验证服务器的路由设备远程控制方法、系统及电子设备
CN119440547A (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: 15785471

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

Country of ref document: EP

Kind code of ref document: A1