WO2013182006A1 - 一种用于拦截应用程序对服务的调用的方法和装置 - Google Patents

一种用于拦截应用程序对服务的调用的方法和装置 Download PDF

Info

Publication number
WO2013182006A1
WO2013182006A1 PCT/CN2013/076453 CN2013076453W WO2013182006A1 WO 2013182006 A1 WO2013182006 A1 WO 2013182006A1 CN 2013076453 W CN2013076453 W CN 2013076453W WO 2013182006 A1 WO2013182006 A1 WO 2013182006A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
service
information
address
call
Prior art date
Application number
PCT/CN2013/076453
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 US14/405,846 priority Critical patent/US9697353B2/en
Publication of WO2013182006A1 publication Critical patent/WO2013182006A1/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/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs
    • 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/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/033Test or assess software

Definitions

  • the present invention relates to system security of an electronic device operating system, and more particularly to a method and apparatus for intercepting an application's call to an application in an operating system of an electronic device. Background technique
  • a service interface such as reading a contact information through a data source service (ie, a process of the system, the process loads the data source service object, and provides an interface)
  • a data source service ie, a process of the system, the process loads the data source service object, and provides an interface
  • any program that needs to read the contact information needs to request the contact information from the service through the interface.
  • the interface of this service is based on the Binder communication mechanism.
  • the process of calling the interface is as follows: The application issues an interface request for a service, sends the service name and interface serial number -> the service's total route query service, and registers the caller, letting it wait ->
  • the service's total route allocates the client's request to the specific service -> the specific service performs the call to its own interface -> the specific service returns the result of the interface call -> the service's total route gets the result and returns it to the registered application ->
  • the client program gets the result of the interface request.
  • the Andro id system itself does not have a blocking mechanism. It only tells the system user that the program may access certain services before the malicious program is installed, but does not judge whether the application is a malicious program.
  • the present invention has been made in order to provide an overcoming of the above problems or to A method and apparatus for intercepting an application's call to a service in an operating system of an electronic device that partially solves or mitigates the above problems.
  • a method for intercepting an application's call to a service in an operating system of an electronic device including: loading an intercepted dynamic library into a process in which the service is located; inputting and outputting the process The address of the control function is replaced with the first address of the intercepting dynamic library; when the application invokes the service, executing the intercepting dynamic library based on the first address to obtain the name and information of the application And the invoked information, and replacing an address of the service to be called included in the invoked information with a second address of the intercepting dynamic library; and based on the second address, according to the application Name and / or information to perform processing.
  • an apparatus for intercepting an application's call to a service in an operating system of an electronic device including a load module, configured to load the intercept dynamic library to a process in which the service is located; a module, configured to replace an address of the input/output control function in the process with a first address of the intercepting dynamic library; a second replacement module, configured to: when the application invokes the service, based on the Executing the intercepting dynamic library with an address to obtain the name and information of the application and the called information, and replacing the address of the service to be called included in the called information with the intercepting dynamic library And a processing module, configured to perform processing according to the name and/or information of the application based on the second address.
  • a computer program comprising computer readable code causing the server to perform any of claims 1-10 when run on a server
  • a computer readable medium wherein the computer program according to claim 21 is stored.
  • the present invention is capable of intercepting calls when the application makes a call to the service, and uses the whitelist, blacklist, and feature data in the predefined database to determine whether the application is a trusted application or a malicious application.
  • the application and the called information do not match the information in the above database, the name and information of the application and the called information can also be displayed, so that the application can be selected according to the information.
  • Call In the case of, for example, a malicious application calling a service, the call can be directly rejected or rejected, and the virtual service result of the call can be returned to the malicious application, so that the malicious application cannot be found, thereby improving the system. Security.
  • FIG. 1 is a flow chart schematically showing a method for intercepting an application's call to a service in an operating system of an electronic device; an exemplary view of the system making a selection for the call, in accordance with an embodiment of the present invention
  • FIG. 3 is a block diagram schematically showing an apparatus for intercepting an application's call to a service in an operating system of an electronic device, in accordance with an embodiment of the present invention
  • Figure 4 shows schematically a block diagram of a server for carrying out the method according to the invention
  • Fig. 5 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
  • the electronic device includes, but is not limited to, the following electronic devices with an operating system installed: mobile phone, tablet, notebook computer, navigator, audio and/or video player, radio, mobile TV, multi-function remote control Portable computing devices; desktop computers, mainframe computers, printers, fax machines, photocopiers, Stationary computing devices such as MFPs, set-top boxes, public information query devices, multimedia information interaction devices; and other electronic devices with operating systems installed.
  • the principle of the present invention is exemplarily described by taking a mobile phone equipped with an Andro id system as an example, but the description is merely exemplary, and the scope of the present invention is not limited thereto, and the principle of the present invention can also be applied to Any electronic device installed with other operating systems (such as Linux, iOS, Window Phone, Symbi an, etc.), such as those mentioned above.
  • operating systems such as Linux, iOS, Window Phone, Symbi an, etc.
  • the process in which each service is located is found in the Andro id system in advance, and in step S101, the interception dynamic library is loaded to the process in which the service is located.
  • the pull dynamic library can be loaded into the The process in which the service is located.
  • the process may be suspended before execution of step S101, for example, by the application programming interface pt race provided by the Linux system.
  • step S102 is performed, in which the address of the input/output control function in the process is replaced with the first address of the intercepting dynamic library.
  • the input and output control function is an I0CTL function in the Binder mechanism.
  • the first address of the intercepting dynamic library is used to execute the intercepting dynamic library. After the execution of step S102, the process can be resumed.
  • step S103 when the application invokes the service, executing the intercepting dynamic library based on the first address to obtain the name and information of the application and the invoked information, and The address of the service to be called included in the called information is replaced with the second address of the intercepting dynamic library.
  • the intercepting dynamic library when the application calls the service through the Binder mechanism, the I0CTL function will be reached, since the address of the IOCT function has been replaced with the first address of the intercepting dynamic library, Therefore, the intercepting dynamic library will be executed based on the first address. At this time, the intercepting dynamic library can obtain the name and information of the application before the Andro id system by using the IOCT function. And the information called.
  • the called information includes the interface number of the call and the address of the service to be called.
  • the address of the service to be called is replaced with the second address of the interception dynamic library, and processing may be performed based on the name and/or information of the application based on the second address.
  • step S104 Since the address of the service to be called has been replaced with the second address of the intercepting dynamic library, in step S104, based on the second address, based on the name of the application and/or Information to perform processing.
  • based on the second address by comparing the name and/or information of the application with information in a predefined database, (a) performing the Calling and returning the actual service result to the application, or (b) returning a predefined service result to the application.
  • the predefined service result may for example be a service result indicating that the call has been successful in order for the application to consider that its call to the service has succeeded, and for the invention according to the invention The interception performed by the embodiment is unaware.
  • the predefined database may contain an application whitelist, a blacklist, and feature data.
  • the whitelist may contain the name of a known trusted application (including the UID (unique identifier) of the program and the package name of the program), and the blacklist may contain the name of the known malicious application (including the program) UID (Unique Identifier) and the package name of the program), the feature data may contain data of known malicious features, such as advertising features.
  • the identity of the application may be determined by using the name and information of the application, or both, respectively, and corresponding processing may be taken.
  • Break time when the name of the application is included in the white list in the predefined database, the call is performed according to the address of the service, and the actual service result is returned to the application; or, When the name of the application is included in a blacklist in a predefined database, the predefined service result is returned to the application; or, the name of the application is not included in the predefined database.
  • the list and the blacklist the name and information of the application and the called information are displayed, and processing is performed according to the selection of the call by the operating system on the electronic device.
  • the name of the application when the name of the application is included in the whitelist, it is determined that the application is a trusted application, allowing its call to the service, thereby executing the call according to the address of the service, and returning to the application. Actual service result; when the name of the application is included in the blacklist, it is determined that the application is a malicious application, rejecting its call to the service, and directly returning the false service result to the call, so that the call has succeeded; When the name of the application is neither included in the whitelist nor included in the blacklist, the name and information of the application and the called information are displayed, and the call is made according to the operating system on the electronic device. The choice to perform the processing.
  • the call is performed according to the address of the service, and the actual service result is returned to the application; or In the event that the application makes a call to the service, a predefined service result is returned to the application.
  • the above selection for the call may be, for example, the user selects the operating system of the electronic device after seeing the name and information of the application displayed on the display screen of the electronic device and the called information.
  • FIG. 2 is an exemplary view of a selection of an invocation by an operating system on an electronic device in accordance with an embodiment of the present invention.
  • the name and information of the application and the invoked information are displayed on the display of the mobile phone and the user is asked if the application is allowed to make calls to the service.
  • the call is performed according to the address of the service, and the actual service result is returned to the application; or when the user selects not to allow the
  • a predefined service result is returned to the application.
  • the information of the application when the information of the application is used to judge the identity of the application: when the information of the application includes the feature data in the predefined database, the predefined service result is returned to the application. Or displaying, when the information of the application does not include the feature data in the predefined database, displaying the name and information of the application and the called information, and according to the operating system on the electronic device The selection of the call to perform processing.
  • the information of the application for example, the package configuration information
  • the feature data for example, the data of the advertisement feature
  • the list control and display service is started, and the process in which each service is located in the Andro id system (including the process in which the notification bar service is located, assuming that the name is the process S) is loaded in advance, and the interception dynamic library is loaded to The process in which each service is located (including process S).
  • the malicious application A needs to invoke the notification bar service in order to send an advertisement message to the notification bar, which first initiates access to the notification bar interface.
  • the address of the I0CTL function in the Binder mechanism is replaced with the first address of the intercepting dynamic library. Since the malicious application A implements the call to the notification bar service through the Binder mechanism, it executes the I0CTL function in the Binder mechanism. The IOCCTL has been replaced with the first address, and thus the intercept dynamic library will be executed based on the first address. At this time, the intercepting dynamic library may obtain the name and information of the application (the malicious application A and its description) and the called information before the Android system by using the IOCT function (calling the notification bar service, The title and content of the ad message to be displayed). Then, the address of the notification bar service is replaced with the second address of the interception dynamic library.
  • the Binder mechanism is used to communicate with the list control and display service based on the second address to determine whether the name of the malicious application A is included in advance.
  • the predefined service result ie, the service result indicating that the call has been successful, so that the malicious application A considers that its call to the notification bar service has succeeded, and for the embodiment according to the present invention None is known about the interception.
  • the name of the malicious application A is not included in the whitelist and blacklist in the predefined database, and the information of the malicious application A does not include the feature data in the predefined database.
  • the name and information of the malicious application A and the called information may be displayed on the display screen of the electronic device through the list control and display service (for example, displayed in the manner of FIG. 2 or displayed in the notification bar).
  • the call is performed according to the address of the notification bar service, and the actual service result is returned to the malicious application A; or the user is not allowed to select
  • the predefined false service result is directly returned to the malicious application A.
  • the malicious display may be directly displayed in the notification bar.
  • An advertisement message to be sent by the application A the user can set after seeing the advertisement message, thereby adding the malicious application A to the blacklist in the predefined database, and adding an advertisement message to the In the feature data in the predefined database, the malicious application A is directly intercepted in subsequent system operations.
  • the present invention provides a method for intercepting an application's call to a service in an operating system of an electronic device.
  • the present invention is capable of intercepting calls when the application makes a call to the service, and uses a whitelist, blacklist, and feature data in a predefined database to determine whether the application is a trusted application or a malicious application.
  • the name and information of the application and the called information can also be displayed, so that it can be selected according to the information to allow the application to call the service. .
  • the call can be directly rejected or selected, and the false service result of the successful call can be returned to the malicious application, so that the malicious application cannot be found, thereby improving the system. safety.
  • the information obtained by the user from the actual operation can be added to the predefined database to improve the data in the database, so as to obtain better results in the subsequent interception.
  • the malicious application can intercept the privacy information of the electronic device user (including contact information, call history, short message, multimedia message, various accounts and passwords, etc.), and prevent the malicious application from dialing the charge call and sending the buckle.
  • SMS access to network that consumes network traffic Station, to prevent malicious applications from installing Trojans and virus programs, to prevent malicious applications from recording users' GPS or network location, to block malicious applications from popping up harassment advertisements, etc., to intercept any malicious applications for service calls, thereby improving The security of the system.
  • the present invention also provides an apparatus 200 for intercepting an application's call to a service in an operating system of an electronic device.
  • the apparatus 200 includes:
  • the loading module 210 is configured to load the intercepting dynamic library into the process where the service is located, and the loading module 210 can be used to perform step S101 in the foregoing method 100;
  • a first replacement module 220 configured to replace the address of the input and output control function in the process with the first address of the intercepting dynamic library, the first replacement module 220 may be used to perform step S102 in the method 100 above;
  • a second replacement module 230 configured to: when the application invokes the service, execute the intercepting dynamic library based on the first address, to obtain a name and information of the application, and the invoked information, and Replacing the address of the service to be called included in the invoked information with the second address of the intercepting dynamic library, the second replacement module 230 may be configured to perform step S103 in the method 100 above;
  • the processing module 240 is configured to perform processing according to the name and/or information of the application based on the second address, and the processing module 240 can be configured to perform step S104 in the foregoing method 100.
  • the processing module 240 compares the name and/or information of the application with information in a predefined database, and (a) performs the method according to the address of the service. Calling and returning the actual service result to the application, or (b) returning a predefined service result to the application.
  • the processing module 240 when the name of the application is included in a whitelist in a predefined database, the processing module 240 performs the call according to the address of the service, and to the application The program returns an actual service result; or, when the name of the application is included in a blacklist in a predefined database, the processing module 240 returns a predefined service result to the application; or, in the When the name of the application is not included in the whitelist and blacklist in the predefined database, the processing module 240 displays the name and information of the application and the called information, and according to the operation on the electronic device The system performs processing for the selection of the call.
  • the processing module 240 when the information of the application includes feature data in a predefined database, the processing module 240 returns a predefined service result to the application; or, in the application When the information of the program does not include the feature data in the predefined database, the processing module 240 displays the name and information of the application and the invoked information, and according to the call on the electronic device through the operating system. Select to perform processing.
  • the processing module 240 performs the call according to the address of the service, and to the application Returning the actual service result; or in the event that the application's call to the service is selected to be disallowed, the processing module 240 returns a predefined service result to the application.
  • the apparatus 200 further includes a suspending module 250 for suspending the process before the loading module 210 loads the intercepting dynamic library to a process in which the service is located, and for the A replacement module 220 replaces the address of the input-output control function in the process with the recovery module 260 that resumes the process after intercepting the first address of the dynamic library.
  • the invoked information includes the interface number of the call and the address of the service to be invoked.
  • the operating system is an Andro id system
  • the application invokes the service through a Binder mechanism of the Andro id system.
  • the input and output control function is an I0CTL function in the Binder mechanism.
  • the second replacement module 230 executes the intercepting dynamic library based on the first address to precede the Andro by the IOCT function.
  • the id system obtains the name and information of the application and the information of the call.
  • Various component embodiments of the present invention may be implemented in hardware, or in one or more A software module implementation running on a processor, or a combination of them.
  • a microprocessor or digital signal processor can be used in practice.
  • DSP implements some or all of the functionality of some or all of the means for intercepting an application's call to a service in an operating system of an electronic device in accordance with an embodiment of the present invention.
  • the invention may 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.
  • Figure 4 illustrates a server, such as an application server, that can implement a method for intercepting an application's call to a service in an operating system of an electronic device in accordance with the present invention.
  • the server conventionally includes a processor 410 and a computer program product or computer readable medium in the form of a memory 420.
  • Memory 420 can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk or ROM.
  • the memory 420 has a storage space 430 of program code 431 for performing any of the method steps described above.
  • storage space 430 for program code may include various program code 431 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 computer program products are typically portable or fixed storage units as described with reference to Figure 5.
  • the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 420 in the server of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 431, i.e., code that can be read by a processor, such as 410, which, when executed by a server, causes the server to perform various steps in the methods described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种用于拦截电子设备的操作系统中应用程序对服务的调用的方法和装置。所述方法包括:将拦截动态库加载到服务所在的进程;将所述进程中的输入输出控制函数的地址替换为所述拦截动态库的第一地址;在应用程序对所述服务进行调用时,基于所述第一地址执行所述拦截动态库,以获得所述应用程序的名称和信息和所述调用的信息,并且将所述调用的信息中包括的要被调用的服务的地址替换为所述拦截动态库的第二地址;以及基于所述第二地址,根据所述应用程序的名称和/或信息来执行处理。本发明提高了电子设备操作系统的安全性。

Description

一种用于拦截应用程序对服务的调用的方法和装置 技术领域
本发明涉及电子设备操作系统的系统安全, 特别涉及一种用于拦截 电子设备的操作系统中应用程序对服务的调用的方法和装置。 背景技术
近年来,安装有操作系统的电子设备、特别是便携式电子设备(例如, 移动电话、 平板电脑等)变得越来越普及。 与之相应地, 运行在这些电子 设备的操作系统上的应用程序的数量也有了呈几何级数的爆炸式增长。以 iOS系统和 Andro id系统为例, 目前这两个系统上的应用程序分别超过了 60 万个和 40万个。
尽管海量的应用程序给用户带来了更多的选择,但随之而来的安全性 问题也值得关注。 以 Andro i d系统为例, 系统的部分重要功能通过服务接 口的形式提供, 譬如读取联系人信息是通过数据源服务(即系统的一个进 程, 该进程加载了数据源服务对象, 并且提供接口)来进行的, 任何需要 读取联系人信息的程序都需要通过接口来向该服务申请读取联系人信息。
这种服务的接口基于 Binder通讯机制, 调用接口的流程如下: 应用程 序发出对某个服务的接口请求, 发送服务名称和接口序号 -〉服务的总路 由查询服务, 并登记调用者, 让其等待 -〉服务的总路由分配客户的请求 到具体服务 -〉具体服务执行对自己接口的调用 ->具体服务返回接口调 用的结果 -〉服务的总路由拿到结果, 并返回给登记过的应用程序 -〉客 户程序拿到接口请求的结果。
目前, Andro id系统本身不具备拦截的机制, 只是在恶意程序安装之 前告知系统用户此程序可能会访问某些服务,但是对于应用程序是否是恶 意程序不做判断。 目前, 存在一些针对恶意程序进行拦截的方案。 例如, 通过向系统注册假服务的方式实现拦截,但是这种方式会在进行拦截的系 统中留下明显的假服务名称, 很容易被恶意程序发现, 进而使拦截失效。 发明内容
鉴于上述问题, 提出了本发明以便提供一种克服上述问题或者至 少部分地解决或者减緩上述问题的用于拦截电子设备的操作系统中应用 程序对服务的调用的方法和装置。
根据本发明的一个方面, 提供了一种用于拦截电子设备的操作系统 中应用程序对服务的调用的方法, 包括: 将拦截动态库加载到服务所在的 进程;将所述进程中的输入输出控制函数的地址替换为所述拦截动态库的 第一地址; 在应用程序对所述服务进行调用时, 基于所述第一地址执行所 述拦截动态库, 以获得所述应用程序的名称和信息和所述调用的信息, 并 且将所述调用的信息中包括的要被调用的服务的地址替换为所述拦截动 态库的第二地址; 以及基于所述第二地址, 根据所述应用程序的名称和 / 或信息来执行处理。
根据本发明的另一个方面, 提供了一种用于拦截电子设备的操作系 统中应用程序对服务的调用的装置, 包括加载模块, 用于将拦截动态库加 载到服务所在的进程; 第一替换模块, 用于将所述进程中的输入输出控制 函数的地址替换为所述拦截动态库的第一地址; 第二替换模块, 用于在应 用程序对所述服务进行调用时, 基于所述第一地址执行所述拦截动态库, 以获得所述应用程序的名称和信息和所述调用的信息,并且将所述调用的 信息中包括的要被调用的服务的地址替换为所述拦截动态库的第二地址; 以及处理模块, 用于基于所述第二地址, 根据所述应用程序的名称和 /或 信息来执行处理。
根据本发明的又一个方面, 提供了一种计算机程序, 其包括计算 机可读代码, 当所述计算机可读代码在服务器上运行时, 导致所述服 务器执行根据权利要求 1-10 中的任一个所述的用于拦截电子设备的操 作系统中应用程序对服务的调用的方法。
根据本发明的再一个方面, 提供了一种计算机可读介质, 其中存 储了如权利要求 21所述的计算机程序。
本发明的有益效果为:
本发明能够在应用程序对服务进行调用时, 对于调用进行拦截, 并利 用预先定义的数据库中的白名单、 黑名单、 以及特征数据来判断该应用程 序是受信任的应用程序还是恶意应用程序。在应用程序和调用的信息与上 述数据库中的信息均不吻合的情况下 ,还可以显示应用程序的名称和信息 和调用的信息,这样就可以根据这些信息来选择是否允许应用程序对服务 的调用。 在例如恶意应用程序对服务调用的情况下, 就可以直接拒绝该调 用或者选择拒绝该调用 ,并向恶意应用程序返回该调用成功的虛 支服务结 果, 使恶意应用程序无法发现, 从而提高了系统的安全性。
上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发 明的技术手段, 而可依照说明书的内容予以实施, 并且为了让本发明 的上述和其它目的、 特征和优点能够更明显易懂, 以下特举本发明的 具体实施方式。 附图说明
通过阅读下文优选实施方式的详细描述, 各种其他的优点和益处 对于本领域普通技术人员将变得清楚明了。 附图仅用于示出优选实施 方式的目的, 而并不认为是对本发明的限制。 而且在整个附图中, 用 相同的参考符号表示相同的部件。 在附图中:
图 1示意性地示出了根据本发明的实施例的用于拦截电子设备的操 作系统中应用程序对服务的调用的方法的流程图; 系统对于调用进行选择的示例视图;
图 3 示意性地示出了根据本发明的实施例的用于拦截电子设备的操 作系统中应用程序对服务的调用的装置的框图;
图 4示意性地示出了用于执行根据本发明的方法的服务器的框图; 以及
图 5 示意性地示出了用于保持或者携带实现根据本发明的方法的 程序代码的存储单元。 具体实施例
下面结合附图和具体的实施方式对本发明作进一步的描述。
图 1 是根据本发明的实施例的用于拦截电子设备的操作系统中应用 程序对服务的调用的方法的流程图。根据本发明, 所述电子设备包括但不 限于安装有操作系统的以下电子设备: 移动电话、 平板电脑、 笔记本计算 机、 导航仪、 音频和 /或视频播放器、 收音机、 移动电视、 多功能遥控器 等便携式计算设备; 台式计算机、 大型计算机、 打印机、传真机、 复印机、 多功能一体机、 机顶盒、 公共信息查询设备、 多媒体信息交互设备等固定 式计算设备; 以及其它安装有操作系统的电子设备。
在下文中, 以安装有 Andro id系统的移动电话为例, 对本发明的原理 进行示例性描述,然而此描述仅仅是示例性的,本发明的范围并不限于此, 本发明的原理也可以适用于安装有其它操作系统(例如 Linux、iOS、Window Phone, Symbi an等) 的任何电子设备, 例如前面提及的那些电子设备。
在用于拦截电子设备的操作系统中应用程序对服务的调用的方法 100中, 以下以应用程序通过 Andro i d系统的 Binder机制对服务进行调 用为例进行描述, 但此描述仅仅是示例性的, 本发明也适用于其它通信机 制。
根据本发明, 预先在 Andro id系统中找到各个服务所在的进程, 在步 骤 S101中, 将拦截动态库加载到服务所在的进程。根据本发明的实施例, 例如可以通过 Andro id系统所基于的 L inux系统提供的应用程序编程接口 ( Appl i ca t ion Programming Int erface, API ) d lopen 来将该拉截动态 库加载到所述服务所在的进程。 根据本发明的实施例, 在步骤 S101执行 之前, 可以暂停所述进程, 例如可以通过 Linux系统提供的应用程序编程 接口 pt race来实现此暂停操作。
在上述步骤 S101之后, 执行步骤 S102 , 其中, 将所述进程中的输入 输出控制函数的地址替换为所述拦截动态库的第一地址。根据本发明的实 施例, 所述输入输出控制函数是 Binder机制中的 I0CTL函数。 所述拦截 动态库的第一地址用于执行所述拦截动态库。 在步骤 S102执行之后, 可 以恢复所述进程。
接下来, 在步骤 S103中, 在应用程序对所述服务进行调用时, 基于 所述第一地址执行所述拦截动态库 ,以获得所述应用程序的名称和信息和 所述调用的信息,并且将所述调用的信息中包括的要被调用的服务的地址 替换为所述拦截动态库的第二地址。根据本发明的实施例, 在所述应用程 序通过 Binder机制来对所述服务进行调用时, 将到达所述 I0CTL函数, 由于 I0CTL函数的地址已经被替换为所述拦截动态库的第一地址,因此就 将基于所述第一地址执行所述拦截动态库。 此时, 所述拦截动态库就可以 通过所述 I0CTL函数而先于 Andro i d系统获得所述应用程序的名称和信息 和所述调用的信息。
根据本发明的实施例 ,所述调用的信息包括所述调用的接口序号以及 要被调用的服务的地址。将所述要被调用的服务的地址替换为所述拦截动 态库的第二地址, 可以基于该第二地址来根据所述应用程序的名称和 /或 信息来执行处理。
由于所述要被调用的服务的地址已经被替换为所述拦截动态库的第 二地址, 因此, 在步骤 S104 中, 就将基于所述第二地址, 根据所述应用 程序的名称和 /或信息来执行处理。
根据本发明的实施例,基于所述第二地址, 通过将所述应用程序的名 称和 /或信息与预先定义的数据库中的信息进行比较, 而( a )根据所述服 务的地址执行所述调用, 并向所述应用程序返回实际服务结果, 或者(b ) 向所述应用程序返回预先定义的服务结果。
根据本发明的实施例 ,所述预先定义的服务结果可以例如是表示所述 调用已经成功的服务结果,以便令所述应用程序认为其对于所述服务的调 用已经成功, 而对于根据本发明的实施例所进行的拦截一无所知。
所述预先定义的数据库可以包含应用程序白名单、 黑名单、 以及特征 数据。 所述白名单可以包含已知的受信任的应用程序的名称(包括程序的 UID (唯一标识符) 和程序的包名) , 所述黑名单可以包含已知的恶意应 用程序的名称 (包括程序的 UID (唯一标识符)和程序的包名) , 所述特 征数据可以包含已知的恶意特征(例如广告特征) 的数据。
根据本发明的实施例, 可以分别利用应用程序的名称和信息、或者结 合两者来对于所述应用程序的身份进行判断, 进而采取相应的处理。 断时:在所述应用程序的名称包含在所述预先定义的数据库中的白名单中 时, 根据所述服务的地址执行所述调用, 并向所述应用程序返回实际服务 结果; 或者, 在所述应用程序的名称包含在预先定义的数据库中的黑名单 中时, 向所述应用程序返回预先定义的服务结果; 或者, 在所述应用程序 的名称未包含在预先定义的数据库中的白名单和黑名单中时,显示所述应 用程序的名称和信息和所述调用的信息,并且根据在电子设备上通过操作 系统对于所述调用的选择来执行处理。 也就是说, 当应用程序的名称包含在白名单中时, 判定该应用程序为 受信任的应用程序, 允许其对于服务的调用, 从而根据所述服务的地址执 行调用, 并向该应用程序返回实际服务结果; 当应用程序的名称包含在黑 名单中时, 判定该应用软件为恶意应用程序, 拒绝其对于服务的调用, 直 接向其返回虛假的服务结果, 使其认为调用已经成功; 而当应用程序的名 称既未包含在白名单、 也未包含在黑名单中时, 则显示所述应用程序的名 称和信息和所述调用的信息,并且根据在电子设备上通过操作系统对于所 述调用的选择来执行处理。 具体而言, 在选择了允许所述应用程序对所述 服务的调用的情况下, 根据所述服务的地址执行所述调用, 并向所述应用 程序返回实际服务结果;或者在选择了不允许所述应用程序对所述服务的 调用的情况下, 向所述应用程序返回预先定义的服务结果。 上述对于调用 的选择例如可以是用户在看到显示在电子设备的显示屏上的所述应用程 序的名称和信息和所述调用的信息之后,通过电子设备的操作系统来进行 选择的。
图 2 是根据本发明的实施例的在电子设备上通过操作系统对于调用 进行选择的示例视图。 参见图 2 , 将应用程序的名称和信息和调用的信息 显示在移动电话的显示屏上,并向用户询问是否允许所述应用程序对所述 服务的调用。 在用户选择了允许所述应用程序对所述服务的调用的情况 下, 根据所述服务的地址执行所述调用, 并向所述应用程序返回实际服务 结果; 或者在用户选择了不允许所述应用程序对所述服务的调用的情况 下, 向所述应用程序返回预先定义的服务结果。
而在利用应用程序的信息来对于所述应用程序的身份进行判断时:在 所述应用程序的信息包含所述预先定义的数据库中的特征数据时 ,向所述 应用程序返回预先定义的服务结果; 或者, 在所述应用程序的信息不包含 所述预先定义的数据库中的特征数据时,显示所述应用程序的名称和信息 和所述调用的信息,并且根据在电子设备上通过操作系统对于所述调用的 选择来执行处理。
也就是说, 当应用程序的信息(例如程序包配置信息)包含所述特征 数据(例如广告特征的数据)时, 即判断此应用程序为恶意应用程序, 拒 绝其对于服务的调用, 直接向其返回虛假的服务结果, 使其认为调用已经 成功; 而当应用程序的信息不包含所述特征数据时, 执行上述参考图 2描 述的步骤, 在用户选择了允许所述应用程序对所述服务的调用的情况下, 根据所述服务的地址执行所述调用, 并向所述应用程序返回实际服务结 果; 或者在用户选择了不允许所述应用程序对所述服务的调用的情况下, 直接向所述应用程序返回预先定义的虛假的服务结果。
下面以恶意应用程序 A发起对于向通知栏发送广告消息的请求为例, 对于本发明的原理进行描述, 但此描述仅仅是示例性的, 本发明可应用于 拦截任何恶意应用程序。
根据本发明的实施例, 启动名单控制和显示服务, 并预先在 Andro id 系统中找到各个服务所在的进程(包括通知栏服务所在的进程, 假设其名 称为进程 S ) , 将拦截动态库加载到各个服务所在的进程 (包括进程 S ) 。 恶意应用程序 A为了向通知栏发送广告消息,需要对于通知栏服务进行调 用 , 其会首先发起对于通知栏接口的访问。
根据本发明的实施例 , 将 Binder机制中的 I0CTL函数的地址替换为 所述拦截动态库的第一地址。 由于恶意应用程序 A会通过 Binder机制来 实现对通知栏服务的调用 , 因此其会执行 Binder机制中的 I0CTL函数。 该 I0CTL已被替换为所述第一地址,因而将基于第一地址执行所述拦截动 态库。 此时, 所述拦截动态库就可以通过所述 I0CTL函数而先于 Android 系统获得所述应用程序的名称和信息(恶意应用程序 A及其描述)和所述 调用的信息(调用通知栏服务、 所要显示的广告消息的标题和内容)。 然 后 , 将所述通知栏服务的地址替换为拦截动态库的第二地址。
接下来, 由于通知栏服务的地址已被替换为所述第二地址, 因此将基 于第二地址, 通过 Binder机制与名单控制和显示服务通信, 判断所述恶 意应用程序 A 的名称是否包含在预先定义的数据库中的白名单或黑名单 中, 并且 /或者判断所述恶意应用程序 A的信息是否包含预先定义的数据 库中的特征数据。 由于该恶意应用程序 A的程序包中包含广告特征, 因此 即使该恶意应用程序 A的名称未包含在所述黑名单中,也可以将其判断为 恶意应用程序, 从而拒绝其对于通知栏服务调用, 直接向其返回预先定义 的服务结果, 即表示所述调用已经成功的服务结果, 以便令恶意应用程序 A认为其对于通知栏服务的调用已经成功, 而对于根据本发明的实施例所 进行的拦截一无所知。
在替代实施例中,假设该恶意应用程序 A的名称未包含在预先定义的 数据库中的白名单和黑名单中,该恶意应用程序 A的信息也不包含所述预 先定义的数据库中的特征数据。 此时, 可以通过名单控制和显示服务在电 子设备的显示屏上显示(例如以图 2的方式显示或者在通知栏中显示)恶 意应用程序 A的名称和信息和所述调用的信息,在用户选择了允许所述恶 意应用程序 A对通知栏服务的调用的情况下,根据通知栏服务的地址执行 所述调用, 并向所述恶意应用程序 A返回实际服务结果; 或者在用户选择 了不允许所述恶意应用程序 A对通知栏服务的调用的情况下,直接向所述 恶意应用程序 A返回预先定义的虛假的服务结果。 或者, 在电子设备的显 示屏上显示(例如以图 2的方式显示或者在通知栏中显示)恶意应用程序 A的名称和信息和所述调用的信息的同时, 可以直接在通知栏中显示恶意 应用程序 A要发送的广告消息, 用户在看到该广告消息后可以进行设置, 从而将该恶意应用程序 A添加到所述预先定义的数据库中的黑名单中,并 将广告消息添加到所述预先定义的数据库中的特征数据中,以在之后的系 统操作中直接拦截该恶意应用程序 A。
本发明提供了一种用于拦截电子设备的操作系统中应用程序对服务 的调用的方法。 本发明能够在应用程序对服务进行调用时, 对于调用进行 拦截, 并利用预先定义的数据库中的白名单、 黑名单、 以及特征数据来判 断该应用程序是受信任的应用程序还是恶意应用程序。在应用程序和调用 的信息与上述数据库中的信息均不吻合的情况下,还可以显示应用程序的 名称和信息和调用的信息,这样就可以根据这些信息来选择是否允许应用 程序对服务的调用。 在例如恶意应用程序对服务调用的情况下, 就可以直 接拒绝该调用或者选择拒绝该调用 ,并向恶意应用程序返回该调用成功的 虛假服务结果, 使恶意应用程序无法发现, 从而提高了系统的安全性。 另 外, 还可以将用户从实际操作中获得的信息添加到该预先定义的数据库 中, 以完善数据库中的数据, 从而在之后的拦截中获得更好的效果。
根据本发明, 可以拦截恶意应用程序偷窥电子设备用户的隐私信息 (包括联系人信息、通话记录、短信、 彩信、各种账户及密码等)的行为, 防止恶意应用程序拨打扣费电话、发送扣费短信、访问耗费网络流量的网 站, 防止恶意应用程序安装木马和病毒程序, 防止恶意应用程序记录用户 的 GPS或网络定位, 拦截恶意应用程序弹出骚扰广告信息等等, 可以对于 任何恶意应用程序对于服务的调用进行拦截, 从而提高了系统的安全性。
与上述的方法 100相对应 ,本发明还提供了一种用于拦截电子设备的 操作系统中应用程序对服务的调用的装置 200 , 参见图 3, 该装置 200包 括:
加载模块 210 , 用于将拦截动态库加载到服务所在的进程, 该加载模 块 210可以用于执行上述方法 100中的步骤 S101 ;
第一替换模块 220 , 用于将所述进程中的输入输出控制函数的地址替 换为所述拦截动态库的第一地址,该第一替换模块 220可以用于执行上述 方法 100中的步骤 S102;
第二替换模块 230 , 用于在应用程序对所述服务进行调用时, 基于所 述第一地址执行所述拦截动态库,以获得所述应用程序的名称和信息和所 述调用的信息,并且将所述调用的信息中包括的要被调用的服务的地址替 换为所述拦截动态库的第二地址,该第二替换模块 230可以用于执行上述 方法 100中的步骤 S103; 以及
处理模块 240 , 用于基于所述第二地址, 根据所述应用程序的名称和 /或信息来执行处理, 该处理模块 240可以用于执行上述方法 100中的步 骤 S104。
在本发明的优选实施例中,所述处理模块 240通过将所述应用程序的 名称和 /或信息与预先定义的数据库中的信息进行比较, 而(a )根据所述 服务的地址执行所述调用 ,并向所述应用程序返回实际服务结果,或者( b ) 向所述应用程序返回预先定义的服务结果。
在本发明的优选实施例中 ,在所述应用程序的名称包含在预先定义的 数据库中的白名单中时,所述处理模块 240根据所述服务的地址执行所述 调用, 并向所述应用程序返回实际服务结果; 或者, 在所述应用程序的名 称包含在预先定义的数据库中的黑名单中时,所述处理模块 240向所述应 用程序返回预先定义的服务结果; 或者, 在所述应用程序的名称未包含在 预先定义的数据库中的白名单和黑名单中时,所述处理模块 240显示所述 应用程序的名称和信息和所述调用的信息,并且根据在电子设备上通过操 作系统对于所述调用的选择来执行处理。
在本发明的优选实施例中,在所述应用程序的信息包含预先定义的数 据库中的特征数据时,所述处理模块 240向所述应用程序返回预先定义的 服务结果; 或者, 在所述应用程序的信息不包含预先定义的数据库中的特 征数据时,所述处理模块 240显示所述应用程序的名称和信息和所述调用 的信息,并且根据在电子设备上通过操作系统对于所述调用的选择来执行 处理。
在本发明的优选实施例中,在所述应用程序对所述服务的调用被选择 为允许的情况下, 所述处理模块 240根据所述服务的地址执行所述调用 , 并向所述应用程序返回实际服务结果;或者在所述应用程序对所述服务的 调用被选择为不允许的情况下,所述处理模块 240向所述应用程序返回预 先定义的服务结果。
在本发明的优选实施例中,所述装置 200还包括用于在所述加载模块 210 将拦截动态库加载到服务所在的进程之前暂停所述进程的暂停模块 250、 以及用于在所述第一替换模块 220将所述进程中的输入输出控制函 数的地址替换为所述拦截动态库的第一地址之后恢复所述进程的恢复模 块 260。
在本发明的优选实施例中,所述调用的信息包括所述调用的接口序号 以及要被调用的服务的地址。
在本发明的优选实施例中, 所述操作系统是 Andro id系统, 所述应用 程序通过 Andro id系统的 Binder机制对所述服务进行调用。
在本发明的优选实施例中, 所述输入输出控制函数是 Binder机制中 的 I0CTL函数。
在本发明的优选实施例中, 在应用程序对所述服务进行调用时, 所述 第二替换模块 230 基于所述第一地址执行所述拦截动态库, 以通过所述 I0CTL函数而先于 Andro id系统获得所述应用程序的名称和信息和所述调 用的信息。
由于上述各装置实施例与前述各方法实施例相对应 ,因此不再对各装 置实施例进行详细描述。
本发明的各个部件实施例可以以硬件实现, 或者以在一个或者多 个处理器上运行的软件模块实现, 或者以它们的组合实现。 本领域的 技术人员应当理解, 可以在实践中使用微处理器或者数字信号处理器
( DSP )来实现根据本发明实施例的用于拦截电子设备的操作系统中应用 程序对服务的调用的装置中的一些或者全部部件的一些或者全部功能。 本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的 设备或者装置程序 (例如, 计算机程序和计算机程序产品) 。 这样的 实现本发明的程序可以存储在计算机可读介质上, 或者可以具有一个 或者多个信号的形式。 这样的信号可以从因特网网站上下载得到, 或 者在载体信号上提供, 或者以任何其他形式提供。
例如, 图 4示出了可以实现根据本发明的用于拦截电子设备的操作 系统中应用程序对服务的调用的方法的服务器, 例如应用服务器。 该服 务器传统上包括处理器 410和以存储器 420形式的计算机程序产品或 者计算机可读介质。 存储器 420 可以是诸如闪存、 EEPR0M (电可擦除 可编程只读存储器) 、 EPR0M、 硬盘或者 ROM之类的电子存储器。 存储 器 420具有用于执行上述方法中的任何方法步骤的程序代码 431 的存 储空间 430。 例如, 用于程序代码的存储空间 430可以包括分别用于实 现上面的方法中的各种步骤的各个程序代码 431。这些程序代码可以从 一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算 机程序产品中。 这些计算机程序产品包括诸如硬盘, 紧致盘 (CD ) 、 存储卡或者软盘之类的程序代码载体。 这样的计算机程序产品通常为 如参考图 5 所述的便携式或者固定存储单元。 该存储单元可以具有与 图 4 的服务器中的存储器 420类似布置的存储段、 存储空间等。 程序 代码可以例如以适当形式进行压缩。 通常, 存储单元包括计算机可读 代码 431, , 即可以由例如诸如 410之类的处理器读取的代码, 这些代 码当由服务器运行时, 导致该服务器执行上面所描述的方法中的各个 步骤。
本文中所称的 "一个实施例" 、 "实施例" 或者 "一个或者多个 实施例" 意味着, 结合实施例描述的特定特征、 结构或者特性包括在 本发明的至少一个实施例中。 此外, 请注意, 这里 "在一个实施例中" 的词语例子不一定全指同一个实施例。
在此处所提供的说明书中, 说明了大量具体细节。 然而, 能够理 些实例中, 并未详细示出公知的方法、 结构和技术, 以便不模糊对本 说明书的理解。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行 限制, 并且本领域技术人员在不脱离所附权利要求的范围的情况下可 设计出替换实施例。 在权利要求中, 不应将位于括号之间的任何参考 符号构造成对权利要求的限制。 单词 "包含" 不排除存在未列在权利 要求中的元件或步骤。 位于元件之前的单词 "一" 或 "一个" 不排除 存在多个这样的元件。 本发明可以借助于包括有若干不同元件的硬件 以及借助于适当编程的计算机来实现。 在列举了若干装置的单元权利 要求中, 这些装置中的若干个可以是通过同一个硬件项来具体体现。 单词第一、 第二、 以及第三等的使用不表示任何顺序。 可将这些单词 解释为名称。
此外, 还应当注意, 本说明书中使用的语言主要是为了可读性和 教导的目的而选择的, 而不是为了解释或者限定本发明的主题而选择 的。 因此, 在不偏离所附权利要求书的范围和精神的情况下, 对于本 技术领域的普通技术人员来说许多修改和变更都是显而易见的。 对于 本发明的范围, 对本发明所做的公开是说明性的, 而非限制性的, 本 发明的范围由所附权利要求书限定。

Claims

权 利 要 求
1. 一种用于拦截电子设备的操作系统中应用程序对服务的调用的方 法 (1 00 ) , 包括:
将拦截动态库加载到服务所在的进程 (S1 01 ) ;
将所述进程中的输入输出控制函数的地址替换为所述拦截动态库的 第一地址 (S1 02 ) ;
在应用程序对所述服务进行调用时 ,基于所述第一地址执行所述拦截 动态库, 以获得所述应用程序的名称和信息和所述调用的信息, 并且将所 述调用的信息中包括的要被调用的服务的地址替换为所述拦截动态库的 第二地址 (S1 03 ) ; 以及
基于所述第二地址, 根据所述应用程序的名称和 /或信息来执行处理 ( S1 04 ) 。
2. 如权利要求 1所述的方法, 其中根据所述应用程序的名称和 /或信 息来执行处理的步骤包括: 通过将所述应用程序的名称和 /或信息与预先 定义的数据库中的信息进行比较, 而 (a )根据所述服务的地址执行所述 调用, 并向所述应用程序返回实际服务结果, 或者 (b ) 向所述应用程序 返回预先定义的服务结果。
3. 如权利要求 1所述的方法, 其中根据所述应用程序的名称来执行 处理的步骤包括:在所述应用程序的名称包含在预先定义的数据库中的白 名单中时, 根据所述服务的地址执行所述调用, 并向所述应用程序返回实 际服务结果; 或者, 在所述应用程序的名称包含在预先定义的数据库中的 黑名单中时, 向所述应用程序返回预先定义的服务结果; 或者, 在所述应 用程序的名称未包含在预先定义的数据库中的白名单和黑名单中时,显示 所述应用程序的名称和信息和所述调用的信息,并且根据在电子设备上通 过操作系统对于所述调用的选择来执行处理。
4. 如权利要求 1所述的方法, 其中根据所述应用程序的信息来执行 处理的步骤包括:在所述应用程序的信息包含预先定义的数据库中的特征 数据时, 向所述应用程序返回预先定义的服务结果; 或者, 在所述应用程 序的信息不包含预先定义的数据库中的特征数据时,显示所述应用程序的 名称和信息和所述调用的信息,并且根据在电子设备上通过操作系统对于 所述调用的选择来执行处理。
5. 如权利要求 3或 4所述的方法, 其中根据在电子设备上通过操作 系统的选择来执行处理的步骤包括:在选择了允许所述应用程序对所述服 务的调用的情况下, 根据所述服务的地址执行所述调用, 并向所述应用程 序返回实际服务结果;或者在选择了不允许所述应用程序对所述服务的调 用的情况下, 向所述应用程序返回预先定义的服务结果。
6. 如权利要求 1至 4中的任一项所述的方法, 还包括在将拦截动态 库加载到服务所在的进程 ( S101 )的步骤之前暂停所述进程, 以及在将所 述进程中的输入输出控制函数的地址替换为所述拦截动态库的第一地址
( S102 ) 的步骤之后恢复所述进程。
7. 如权利要求 1至 4中的任一项所述的方法, 其中所述调用的信息 包括所述调用的接口序号以及要被调用的服务的地址。
8. 如权利要求 1至 4中的任一项所述的方法, 其中所述操作系统是 Android系统, 所述应用程序通过 Android系统的 Binder机制对所述月良 务进行调用。
9. 如权利要求 8所述的方法, 其中所述输入输出控制函数是 Binder 机制中的 I0CTL函数。
10. 如权利要求 9所述的方法, 其中在应用程序对所述服务进行调用 时, 基于所述第一地址执行所述拦截动态库, 以通过所述 I0CTL函数而先 于 Android系统获得所述应用程序的名称和信息和所述调用的信息。
11. 一种用于拦截电子设备的操作系统中应用程序对服务的调用的 装置 ( 200 ) , 包括:
加载模块(210 ) , 用于将拦截动态库加载到服务所在的进程; 第一替换模块( 220 ) , 用于将所述进程中的输入输出控制函数的地 址替换为所述拦截动态库的第一地址;
第二替换模块( 230 ) , 用于在应用程序对所述服务进行调用时, 基 于所述第一地址执行所述拦截动态库,以获得所述应用程序的名称和信息 和所述调用的信息,并且将所述调用的信息中包括的要被调用的服务的地 址替换为所述拦截动态库的第二地址; 以及
处理模块 ( 240 ) , 用于基于所述第二地址, 根据所述应用程序的名 称和 /或信息来执行处理。
12. 如权利要求 11所述的装置, 其中所述处理模块( 240 )通过将所 述应用程序的名称和 /或信息与预先定义的数据库中的信息进行比较, 而 ( a )根据所述服务的地址执行所述调用, 并向所述应用程序返回实际服 务结果, 或者 (b ) 向所述应用程序返回预先定义的服务结果。
13. 如权利要求 11所述的装置, 其中在所述应用程序的名称包含在 预先定义的数据库中的白名单中时, 所述处理模块( 240 )根据所述服务 的地址执行所述调用, 并向所述应用程序返回实际服务结果; 或者, 在所 述应用程序的名称包含在预先定义的数据库中的黑名单中时,所述处理模 块 ( 240 ) 向所述应用程序返回预先定义的服务结果; 或者, 在所述应用 程序的名称未包含在预先定义的数据库中的白名单和黑名单中时,所述处 理模块 ( 240 )显示所述应用程序的名称和信息和所述调用的信息, 并且 根据在电子设备上通过操作系统对于所述调用的选择来执行处理。
14. 如权利要求 11所述的装置, 在所述应用程序的信息包含预先定 义的数据库中的特征数据时, 所述处理模块 ( 240 ) 向所述应用程序返回 预先定义的服务结果; 或者, 在所述应用程序的信息不包含预先定义的数 据库中的特征数据时, 所述处理模块 ( 240 ) 显示所述应用程序的名称和 信息和所述调用的信息,并且根据在电子设备上通过操作系统对于所述调 用的选择来执行处理。
15. 如权利要求 13或 14所述的装置, 其中在所述应用程序对所述服 务的调用被选择为允许的情况下, 所述处理模块 ( 240 )根据所述服务的 地址执行所述调用, 并向所述应用程序返回实际服务结果; 或者在所述应 用程序对所述服务的调用被选择为不允许的情况下, 所述处理模块( 240 ) 向所述应用程序返回预先定义的服务结果。
16. 如权利要求 11至 14中的任一项所述的装置, 还包括用于在所述 加载模块 (210 )将拦截动态库加载到服务所在的进程之前暂停所述进程 的暂停模块( 250 )、 以及用于在所述第一替换模块( 220 )将所述进程中 的输入输出控制函数的地址替换为所述拦截动态库的第一地址之后恢复 所述进程的恢复模块( 260 ) 。
17. 如权利要求 11至 14中的任一项所述的装置, 其中所述调用的信 息包括所述调用的接口序号以及要被调用的服务的地址。
18. 如权利要求 11至 14中的任一项所述的装置, 其中所述操作系统 是 Andro i d系统, 所述应用程序通过 Andro id系统的 Binder机制对所述 服务进行调用。
19. 如权利要求 18所述的装置 ,其中所述输入输出控制函数是 Binder 机制中的 I0CTL函数。
20、 如权利要求 19所述的装置, 其中在应用程序对所述服务进行调 用时, 所述第二替换模块( 230 )基于所述第一地址执行所述拦截动态库, 以通过所述 I0CTL函数而先于 Android系统获得所述应用程序的名称和信 息和所述调用的信息。
21、 一种计算机程序, 包括计算机可读代码, 当所述计算机可读代 码在服务器上运行时, 导致所述服务器执行根据权利要求 1-10中的任 一个所述的用于拦截电子设备的操作系统中应用程序对服务的调用的方 法。
22、 一种计算机可读介质, 其中存储了如权利要求 21所述的计算 机程序。
PCT/CN2013/076453 2012-06-07 2013-05-30 一种用于拦截应用程序对服务的调用的方法和装置 WO2013182006A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/405,846 US9697353B2 (en) 2012-06-07 2013-05-30 Method and device for intercepting call for service by application

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210187455.X 2012-06-07
CN201210187455.XA CN102693395B (zh) 2012-06-07 2012-06-07 一种用于拦截应用程序对服务的调用的方法和装置

Publications (1)

Publication Number Publication Date
WO2013182006A1 true WO2013182006A1 (zh) 2013-12-12

Family

ID=46858820

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/076453 WO2013182006A1 (zh) 2012-06-07 2013-05-30 一种用于拦截应用程序对服务的调用的方法和装置

Country Status (3)

Country Link
US (1) US9697353B2 (zh)
CN (1) CN102693395B (zh)
WO (1) WO2013182006A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3203406A4 (en) * 2014-11-05 2018-06-13 ZTE Corporation Sensitive information security protection method and device
CN111209062A (zh) * 2020-01-11 2020-05-29 阿里巴巴集团控股有限公司 信息获取方法、装置、电子设备及计算机存储介质

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693395B (zh) * 2012-06-07 2015-02-11 北京奇虎科技有限公司 一种用于拦截应用程序对服务的调用的方法和装置
CN102693394B (zh) * 2012-06-07 2015-04-22 北京奇虎科技有限公司 一种用于拦截应用程序对服务的调用的方法和装置
CN103116723A (zh) * 2013-02-06 2013-05-22 北京奇虎科技有限公司 一种网址拦截处理的方法、装置和系统
CN103116722A (zh) 2013-02-06 2013-05-22 北京奇虎科技有限公司 一种通知栏消息的处理方法、装置和系统
CN103218564A (zh) * 2013-04-01 2013-07-24 广东欧珀移动通信有限公司 一种移动终端保护方法及装置
CN105282117A (zh) * 2014-07-21 2016-01-27 中兴通讯股份有限公司 访问控制方法及装置
DE102015111625A1 (de) * 2015-07-17 2017-01-19 Backes Srt Gmbh Verfahren zur Bildung einer virtuellen Umgebung in einem Betriebssystem eines Computers
CN105631317B (zh) * 2015-12-18 2018-08-14 浪潮电子信息产业股份有限公司 一种系统调用方法及装置
CN106909838A (zh) * 2015-12-22 2017-06-30 北京奇虎科技有限公司 一种拦截系统调用的方法及装置
CN106537344A (zh) * 2016-03-30 2017-03-22 北京小米移动软件有限公司 一种应用程序调用管理的方法和装置
CN106227585B (zh) * 2016-05-31 2020-02-14 北京金山安全软件有限公司 一种应用程序启动方法、装置及设备
CN107979684A (zh) * 2016-10-21 2018-05-01 中兴通讯股份有限公司 权限管理方法、装置及终端
CN106682165A (zh) * 2016-12-26 2017-05-17 深圳中兴网信科技有限公司 自动路由方法和自动路由系统
CN108446149B (zh) * 2018-02-28 2021-07-20 北京凌宇智控科技有限公司 一种第三方动态库接口拦截方法及系统
CN109657468B (zh) * 2018-11-29 2024-06-18 北京奇虎科技有限公司 病毒行为检测方法、装置及计算机可读存储介质
CN109933960B (zh) * 2019-03-15 2022-03-15 Oppo广东移动通信有限公司 服务调用控制方法、服务调用方法、装置及终端
CN111428234B (zh) * 2020-03-27 2023-07-04 深圳融安网络科技有限公司 应用程序的进程拦截方法、终端及存储介质
CN114625434B (zh) * 2020-12-10 2024-04-23 华为技术有限公司 地址获取方法和设备
CN114489860A (zh) * 2022-02-14 2022-05-13 北京创安恒宇科技有限公司 基于操作系统内核级缓冲区对动态链接库加载校验的方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655892A (zh) * 2009-09-22 2010-02-24 成都市华为赛门铁克科技有限公司 一种移动终端和访问控制方法
CN101667235A (zh) * 2008-09-02 2010-03-10 北京瑞星国际软件有限公司 一种用于保护用户隐私的方法和装置
CN101997912A (zh) * 2010-10-27 2011-03-30 苏州凌霄科技有限公司 基于Android平台的强制访问控制装置及控制方法
US8065734B1 (en) * 2008-03-06 2011-11-22 Symantec Corporation Code module operating system (OS) interactions intercepting system and method
CN102693395A (zh) * 2012-06-07 2012-09-26 奇智软件(北京)有限公司 一种用于拦截应用程序对服务的调用的方法和装置
CN102693394A (zh) * 2012-06-07 2012-09-26 奇智软件(北京)有限公司 一种用于拦截应用程序对服务的调用的方法和装置

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5974549A (en) * 1997-03-27 1999-10-26 Soliton Ltd. Security monitor
US20030055979A1 (en) * 2001-09-19 2003-03-20 Cooley William Ray Internet domain name resolver
US7146638B2 (en) * 2002-06-27 2006-12-05 International Business Machines Corporation Firewall protocol providing additional information
US20040059735A1 (en) * 2002-09-10 2004-03-25 Gold Russell Eliot Systems and methods for enabling failover in a distributed-object computing environment
US20050108562A1 (en) * 2003-06-18 2005-05-19 Khazan Roger I. Technique for detecting executable malicious code using a combination of static and dynamic analyses
US7797733B1 (en) * 2004-01-08 2010-09-14 Symantec Corporation Monitoring and controlling services
US7512672B2 (en) * 2004-03-19 2009-03-31 Gigaset Communications Gmbh Method and system for domain name resolution in a communications system
CN1936849A (zh) * 2005-09-19 2007-03-28 国际商业机器公司 资源动态调整方法及设备
US20070250927A1 (en) * 2006-04-21 2007-10-25 Wintutis, Inc. Application protection
US8495181B2 (en) * 2006-08-03 2013-07-23 Citrix Systems, Inc Systems and methods for application based interception SSI/VPN traffic
US8245289B2 (en) * 2007-11-09 2012-08-14 International Business Machines Corporation Methods and systems for preventing security breaches
US8209757B1 (en) * 2008-03-06 2012-06-26 Symantec Corporation Direct call into system DLL detection system and method
CN101493873A (zh) * 2009-03-04 2009-07-29 浪潮电子信息产业股份有限公司 基于内核层技术实现对win平台文件读写操作访问控制方法
CN101620660B (zh) * 2009-07-31 2012-03-21 北京大学 一种Windows操作系统下钩子的防御方法
US8898443B2 (en) * 2010-10-01 2014-11-25 Z124 Multi-operating system
US9372991B2 (en) * 2012-03-06 2016-06-21 International Business Machines Corporation Detecting malicious computer code in an executing program module
US9087191B2 (en) * 2012-08-24 2015-07-21 Vmware, Inc. Method and system for facilitating isolated workspace for applications
US8990942B2 (en) * 2013-02-18 2015-03-24 Wipro Limited Methods and systems for API-level intrusion detection

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8065734B1 (en) * 2008-03-06 2011-11-22 Symantec Corporation Code module operating system (OS) interactions intercepting system and method
CN101667235A (zh) * 2008-09-02 2010-03-10 北京瑞星国际软件有限公司 一种用于保护用户隐私的方法和装置
CN101655892A (zh) * 2009-09-22 2010-02-24 成都市华为赛门铁克科技有限公司 一种移动终端和访问控制方法
CN101997912A (zh) * 2010-10-27 2011-03-30 苏州凌霄科技有限公司 基于Android平台的强制访问控制装置及控制方法
CN102693395A (zh) * 2012-06-07 2012-09-26 奇智软件(北京)有限公司 一种用于拦截应用程序对服务的调用的方法和装置
CN102693394A (zh) * 2012-06-07 2012-09-26 奇智软件(北京)有限公司 一种用于拦截应用程序对服务的调用的方法和装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3203406A4 (en) * 2014-11-05 2018-06-13 ZTE Corporation Sensitive information security protection method and device
CN111209062A (zh) * 2020-01-11 2020-05-29 阿里巴巴集团控股有限公司 信息获取方法、装置、电子设备及计算机存储介质
CN111209062B (zh) * 2020-01-11 2023-04-25 阿里巴巴集团控股有限公司 信息获取方法、装置、电子设备及计算机存储介质

Also Published As

Publication number Publication date
US20150169872A1 (en) 2015-06-18
CN102693395B (zh) 2015-02-11
CN102693395A (zh) 2012-09-26
US9697353B2 (en) 2017-07-04

Similar Documents

Publication Publication Date Title
WO2013182006A1 (zh) 一种用于拦截应用程序对服务的调用的方法和装置
WO2013182005A1 (zh) 一种用于拦截应用程序对服务的调用的方法和装置
US9104840B1 (en) Trusted security zone watermark
CN108595970B (zh) 处理组件的配置方法、装置、终端及存储介质
US9118655B1 (en) Trusted display and transmission of digital ticket documentation
US8484728B2 (en) Managing securely installed applications
US20110010759A1 (en) Providing a customized interface for an application store
US8850135B2 (en) Secure software installation
US8200962B1 (en) Web browser extensions
US20130055387A1 (en) Apparatus and method for providing security information on background process
US9443088B1 (en) Protection for multimedia files pre-downloaded to a mobile device
US8577334B1 (en) Restricted testing access for electronic device
US9223941B2 (en) Using a URI whitelist
WO2017156784A1 (zh) 一种通知消息处理方法、装置及终端
EP3176719B1 (en) Methods and devices for acquiring certification document
US9600662B2 (en) User configurable profiles for security permissions
US10298586B2 (en) Using a file whitelist
WO2015109668A1 (zh) 应用程序管理方法、装置、终端及计算机存储介质
WO2014166227A1 (zh) 一种在通讯录中添加插件的方法、装置和设备
EP4109861A1 (en) Data processing method, apparatus, computer device, and storage medium
CN111782416A (zh) 数据上报方法、装置、系统、终端及计算机可读存储介质
US10791461B1 (en) Mobile communication device user authenticator
US20140310606A1 (en) Method and device for providing plugin in contact list
US20140378100A1 (en) Data calling method and device
CN111079125A (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: 13801352

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14405846

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13801352

Country of ref document: EP

Kind code of ref document: A1