Method, device and equipment for detecting unauthorized access vulnerability of Internet of Things equipment
By decompiling and semantically analyzing the user-side and device-side firmware of IoT devices, combined with hooking and instrumentation technology, the binding function family and requests are determined, which solves the problem that existing technologies can only detect known vulnerabilities, and achieves It detects and repairs unknown vulnerabilities and improves the security of IoT devices.
Patent Information
- Application Number
- CN202410010149.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2024-10-18
AI Technical Summary
Detection methods based on vulnerability libraries in the existing technology can only discover known vulnerabilities, but cannot discover unknown vulnerabilities, and cannot meet the current complex and ever-changing security requirements.
By decompiling and semantically analyzing the user-side and device-side firmware of IoT devices, we obtain binding candidate functions, and obtain the call graph through hooking and instrumentation techniques to determine the binding function family and binding requests to enable unauthorized access. Vulnerability detection.
It realizes the detection of unknown vulnerabilities, can discover and repair vulnerabilities in time, improves the security of IoT devices, adapts to communication algorithms of different manufacturers, does not rely on vulnerability library matching, and has a wide range of adaptability.
Smart Images

Figure CN118802249A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of access vulnerability detection, and in particular to a method, device and equipment for detecting unauthorized access vulnerabilities of Internet of Things devices. Background Art
[0002] Among all IoT device security vulnerabilities, unauthorized access vulnerabilities are often the entry point that attackers focus on. Unauthorized access vulnerabilities refer to security vulnerabilities in the embedded systems of IoT devices, which allow unauthorized users to access system resources. This vulnerability is usually caused by improper permission management of the embedded systems of IoT devices, such as setting too loose access permissions in the system or not authenticating user access.
[0003] The emergence of unauthorized access vulnerabilities in IoT devices may lead to serious security consequences. For example, hackers may use vulnerabilities to access sensitive information stored on the device, such as personal identity, account information, etc.; hackers can use vulnerabilities to remotely control IoT devices and eavesdrop and monitor through devices such as cameras or microphones; hackers tamper with devices to cause device failure, thereby causing personal injury or life-threatening danger. Therefore, the vulnerabilities of IoT devices should be given sufficient attention, and effective vulnerability management and repair measures need to be formulated to ensure the safety and reliability of the devices.
[0004] At present, most of the unauthorized access detection methods on the market are based on vulnerability libraries, which use known vulnerability libraries to match the software version of the target device. If they match, the device is considered to have a vulnerability. However, this method can only detect known vulnerabilities, not unknown vulnerabilities, and cannot meet the current complex and changing security needs. Summary of the invention
[0005] The present invention provides a method, device and equipment for detecting unauthorized access vulnerabilities of Internet of Things devices, so as to solve the defects that the detection method based on vulnerability library in the prior art can only detect known vulnerabilities but cannot detect unknown vulnerabilities and cannot meet the current complex and changing security requirements.
[0006] The present invention provides a method for detecting unauthorized access vulnerabilities of an Internet of Things device, comprising:
[0007] Decompiling the user-side and device-side firmware of the IoT device to obtain program functions, and performing semantic analysis on the program functions to obtain multiple binding candidate functions;
[0008] Hooking all functions of the class where the binding candidate function corresponding to the user end is located, and inserting the binding candidate function corresponding to the device end firmware;
[0009] Performing a device binding operation through the user terminal interface to obtain a triggered function captured by hooking and plugging, obtaining a call graph based on the triggered function, determining a binding function family based on the call graph, and determining a binding request in the binding function family;
[0010] Based on the binding request, unauthorized access vulnerability detection of the Internet of Things device is performed.
[0011] According to a method for detecting unauthorized access vulnerabilities of an Internet of Things device provided by the present invention, the unauthorized access vulnerabilities of the Internet of Things device are detected based on the binding request, including:
[0012] In the case of obtaining a first login request of the Internet of Things device, parsing the binding request to obtain a first key parameter in the binding request and a first return response of successful binding; the first login request is sent based on the account bound to the Internet of Things device;
[0013] In the case of obtaining a second login request of the Internet of Things device, receiving a hijacking binding request, parsing the hijacking binding request, and obtaining a second return response of the hijacking binding request; the second login request is sent based on an account that is not bound to any Internet of Things device;
[0014] The hijacked binding request is obtained by replacing the first key parameter in the binding request in the constructor of the binding request with the second key parameter of the Internet of Things device;
[0015] When the first return response and the second return response are the same, it is determined that the binding request has an unauthorized access vulnerability.
[0016] According to a method for detecting unauthorized access vulnerabilities of an Internet of Things device provided by the present invention, the determining of a binding request in the binding function family includes:
[0017] The binding request in the binding function family is located by code features, where the code features refer to identification marks or specific features contained in the code that are different from other codes.
[0018] According to a method for detecting unauthorized access vulnerabilities in an Internet of Things device provided by the present invention, the code features are obtained by analyzing function semantics and / or identifying field concatenation operations.
[0019] According to a method for detecting unauthorized access vulnerabilities of an Internet of Things device provided by the present invention, the method locates the binding request in the binding function family by code features, and then further includes:
[0020] Determining candidate key parameters of the binding request based on the semantics of the parameters in the binding request;
[0021] Based on the sources of the candidate key parameters, a target key parameter is determined from the candidate key parameters to be a user login credential or an IoT device resource identifier.
[0022] According to a method for detecting unauthorized access vulnerabilities of an Internet of Things device provided by the present invention, determining a binding function family based on the call graph includes:
[0023] Determining a connectivity path in the call graph based on connectivity between the triggered function and the network message function in the call graph;
[0024] The binding function family is determined based on the functions corresponding to the nodes in the connection path and the triggered function.
[0025] The present invention also provides an unauthorized access vulnerability detection device for an Internet of Things device, comprising:
[0026] A decompilation unit, used for decompiling the user-side and device-side firmware of the IoT device to obtain program functions, and performing semantic analysis on the program functions to obtain multiple binding candidate functions;
[0027] A hooking and plugging unit, used for hooking all functions of the class where the binding candidate function corresponding to the user end belongs, and plugging the binding candidate function corresponding to the device end firmware;
[0028] A binding function family determination unit is used to perform a device binding operation through the user terminal interface, obtain a triggered function captured by hooking and plugging, obtain a call graph based on the triggered function, determine a binding function family based on the call graph, and determine a binding request in the binding function family;
[0029] The unauthorized access vulnerability detection unit is used to perform unauthorized access vulnerability detection of the Internet of Things device based on the binding request.
[0030] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an unauthorized access vulnerability detection method for an Internet of Things device as described in any one of the above-mentioned methods is implemented.
[0031] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for detecting unauthorized access vulnerabilities of an Internet of Things device as described in any one of the above is implemented.
[0032] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for detecting unauthorized access vulnerabilities of an Internet of Things device.
[0033] The unauthorized access vulnerability detection method, device and equipment of the Internet of Things device provided by the present invention decompile the user-side and device-side firmware of the Internet of Things device to obtain program functions, perform semantic analysis on the program functions to obtain multiple binding candidate functions, then hook all functions of the class where the binding candidate functions corresponding to the user-side are located, and insert piles for the binding candidate functions corresponding to the device-side firmware, then perform device binding operations through the user-side interface to obtain the triggered functions captured by hooking and inserting piles, obtain a call graph based on the triggered functions, determine the binding function family based on the call graph, and determine the binding request in the binding function family, and finally, perform unauthorized access vulnerability detection of the Internet of Things device based on the binding request. On the one hand, the unauthorized authentication vulnerability is detected by using a combination of dynamic and static technology. After the vulnerability is detected, the security personnel can promptly feedback to the manufacturer to repair the vulnerability to avoid greater losses, and can more comprehensively and efficiently protect the security of the Internet of Things device; on the other hand, the detection method can solve the problem of communication traffic encryption between the client and the server, can adapt to various communication algorithms of different manufacturers, does not rely on vulnerability library matching, and has a wide range of adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 It is a flow chart of the unauthorized access vulnerability detection method of the Internet of Things device provided by the present invention;
[0036] Figure 2 It is a flow chart of determining a binding function family by using a dynamic and static combined analysis algorithm provided by the present invention;
[0037] Figure 3 It is a flow chart of verifying whether a vulnerability exists by sending a binding request provided by the present invention;
[0038] Figure 4 It is a flowchart of locating binding requests and key parameters through code features provided by the present invention;
[0039] Figure 5 It is a schematic diagram of an example of the unauthorized access vulnerability detection method in the binding of IoT devices provided by the present invention;
[0040] Figure 6 It is a structural schematic diagram of an unauthorized access vulnerability detection device for an Internet of Things device provided by the present invention;
[0041] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, rather than to describe a specific order or precedence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type.
[0044] Among the related technologies, the Internet of Things is a new generation of network system that connects massive embedded terminal devices through communication technology, realizes device control based on cloud computing platforms, and realizes real-time interaction and deep integration of people, machines, and objects based on big data and artificial intelligence technologies. As the Internet of Things develops rapidly, the security threats and challenges it faces are becoming increasingly prominent. In recent years, security attacks on Internet of Things devices have also increased. These security incidents have brought a lot of trouble to our lives and even caused huge economic losses and threatened life safety. How to effectively resist security attacks on Internet of Things devices and ensure the security of Internet of Things devices has become an urgent problem that needs to be solved, and detecting and mining potential vulnerabilities in Internet of Things devices has become the most direct and effective way to improve the security of Internet of Things devices.
[0045] Among all IoT device security vulnerabilities, unauthorized access vulnerabilities are often the entry point that attackers focus on. Unauthorized access vulnerabilities refer to security vulnerabilities in the embedded systems of IoT devices, which allow unauthorized users to access system resources. This vulnerability is usually caused by improper permission management of the embedded systems of IoT devices, such as setting too loose access permissions in the system or failing to authenticate user access.
[0046] At present, most of the unauthorized access detection methods on the market are based on vulnerability libraries, which use known vulnerability libraries to match the software version of the target device. If they match, the device is considered to have a vulnerability. However, this method can only detect known vulnerabilities, not unknown vulnerabilities, and cannot meet the current complex and changing security needs.
[0047] IoT devices refer to devices that have wireless transmission module functions such as WIFI (Wireless Fidelity) and can connect to the service provider's server by accessing WIFI hotspots. Users can issue instructions to the device remotely and online through programs (APP or mini-programs, etc.) provided by the service provider.
[0048] There are many ways to bind IoT devices, including scanning a QR code, entering a device ID and verification code, and binding using Bluetooth or NFC (Near Field Communication).
[0049] A common binding method is that the APP connects to the Bluetooth of the IoT device and enters the binding process. It obtains device information through the Bluetooth protocol, such as unique serial numbers and authentication identifiers such as SN and TOKEN. The APP sends the device information to the service provider server and requests to bind the device. The service provider server verifies whether the device information is legal. If it is legal, the device is bound to the user.
[0050] When the device's WIFI module performs the "binding user information" operation, it will actively communicate with the server vendor's server, which will definitely include the IoT device resource identifier (i.e., device ID) and user credentials (including user ID and session cookies). There may be a vulnerability here. If the device ID or user ID in the request is tampered with, other devices may be bound to the user account or the user may bind any device.
[0051] In the existing technology, binding requests are only identified from the data traffic of IoT devices, apps and cloud services, or they rely on vulnerability libraries for identification. However, in actual scenarios, many data traffics are encrypted, such as through HTTPS (Hypertext Transfer Protocol Secure) and AES (Advanced Encryption Standard) encrypted messages, and some manufacturers may design their own protocols, so the method of identifying binding requests from data traffic will be greatly limited.
[0052] Based on the above problems, the present invention provides a method for detecting unauthorized access vulnerabilities of IoT devices. Figure 1 : is a flow chart of the unauthorized access vulnerability detection method of the Internet of Things device provided by the present invention, such as Figure 1As shown, the method includes:
[0053] Step 110, decompile the user-side and device-side firmware of the IoT device to obtain program functions, perform semantic analysis on the program functions, and obtain multiple binding candidate functions.
[0054] Specifically, the user-side APP and device-side firmware of the IoT device serve as the user interaction interface and device control core respectively, and together constitute the basic structure of the IoT system, making the application of IoT technology more convenient and intelligent.
[0055] The user-side and device-side firmware of IoT devices can be decompiled to obtain program functions. Here, decompilation is a kind of reverse engineering, whose main purpose is to convert executable (ready to run) program code (also called object code) into some form of high-level programming language so that it has a more readable format. This process is the opposite of the working direction of the compiler, which is the process of converting high-level language into machine language or object code.
[0056] After obtaining the program function, semantic analysis may be performed on the program function to obtain multiple binding candidate functions.
[0057] Here, NLP (Natural Language Processing) can be used to perform semantic analysis on the program function to obtain multiple binding candidate functions.
[0058] Here, the natural language processing technology can specifically be a decision tree algorithm, a multi-layer convolutional neural network (CNN) with a cascade structure, or a deep neural network (DNN), etc. The embodiment of the present invention does not make any specific limitation on this.
[0059] Perform semantic analysis on the program function to obtain multiple binding candidate functions, that is, use NLP to detect whether the program function includes characters representing the "binding" semantics, such as "bind", "associate", "bond", "device ID", "userID", etc. The embodiment of the present invention does not make specific limitations on this.
[0060] Here, a binding candidate function refers to a program function that contains "binding" semantics.
[0061] It can be understood that decompiling the user-side and device-side firmware of the IoT device to obtain program functions, performing semantic analysis on the program functions to obtain multiple binding candidate functions is equivalent to performing a "static" analysis on the user-side and device-side firmware.
[0062] Step 120, hooking all functions of the class where the binding candidate function corresponding to the user end is located, and inserting the binding candidate function corresponding to the device end firmware.
[0063] Specifically, all functions of the class of the binding candidate function corresponding to the user end can be hooked. Here, hooking technology is a programming technology used to intercept function calls, message transmission and event processing between software modules, so as to modify or extend the behavior of the operating system, application or other software components. This operation achieves customization and extension of program behavior by inserting custom code at a specific location (i.e., hook).
[0064] Here, the binding candidate functions corresponding to the device-side firmware can be instrumented. Instrumentation technology refers to inserting probes into the program on the basis of ensuring the logical integrity of the original program. The probe collects information in the code (the method itself, method parameter values, return values, etc.) and inserts code segments at specific locations to collect dynamic context information when the program is running.
[0065] For example, for device-side firmware, you can use the debug port to connect to the hardware device and use gdbserver to instrument the candidate functions. Here, gdbserver is a program that allows GDB to run on a machine different from the machine running the debugged program.
[0066] It can be understood that hooking all functions of the class where the binding candidate function corresponding to the user side is located, and inserting the binding candidate function corresponding to the device side firmware, is equivalent to performing "dynamic" analysis on the binding candidate function corresponding to the user side and the binding candidate function corresponding to the device side firmware.
[0067] Step 130, perform device binding operation through the user interface to obtain the triggered function captured by hooking and plugging, obtain a call graph based on the triggered function, determine a binding function family based on the call graph, and determine a binding request in the binding function family.
[0068] Specifically, a device binding operation is performed through a user interface to obtain a triggered function captured by hooking and plugging, and then a call graph can be obtained based on the triggered function.
[0069] Figure 2 is a flow chart of determining a binding function family using a dynamic and static combined analysis algorithm provided by the present invention, such as Figure 2 As shown, the binding function family can be determined based on the call graph. Here, the binding function family is a number of functions responsible for operations such as information acquisition and binding request construction before the binding request is sent, and there is a calling relationship between the functions of the binding function family.
[0070] Here, to determine the binding request in the binding function family, the function name, parameter name, variable name, and string of the functions in the binding function family can be analyzed one by one to identify the function representing the "binding" semantics. The key characters include "bind", "bond", "associate", etc. It is also possible to determine whether the function is constructing a network request by analyzing whether the function contains field concatenation (such as continuous object member assignment) operations.
[0071] Step 140: Based on the binding request, unauthorized access vulnerability detection of the IoT device is performed.
[0072] Specifically, after obtaining the binding request, unauthorized access vulnerability detection of the IoT device can be performed based on the binding request.
[0073] Unauthorized access vulnerability detection of IoT devices is an important part of ensuring the security of IoT systems. Attackers may gain unauthorized access to IoT devices in a variety of ways, including exploiting software and hardware vulnerabilities or making illegal login attempts. Therefore, the detection of such vulnerabilities is particularly important.
[0074] The method provided by the embodiment of the present invention decompiles the user-side and device-side firmware of the Internet of Things device to obtain program functions, performs semantic analysis on the program functions to obtain multiple binding candidate functions, then hooks all functions of the class where the binding candidate functions corresponding to the user-side are located, and inserts the binding candidate functions corresponding to the device-side firmware, then performs device binding operations through the user-side interface to obtain the triggered functions captured by hooking and inserting, obtains a call graph based on the triggered functions, determines the binding function family based on the call graph, and determines the binding request in the binding function family, and finally, performs unauthorized access vulnerability detection for the Internet of Things device based on the binding request. On the one hand, the unauthorized authentication vulnerability is detected by using a combination of dynamic and static technologies. After the vulnerability is detected, the security personnel can promptly feedback to the manufacturer to patch the vulnerability to avoid greater losses, and can more comprehensively and efficiently protect the security of the Internet of Things device; on the other hand, the detection method can solve the problem of encryption of communication traffic between the client and the server, can adapt to various communication algorithms of different manufacturers, does not rely on vulnerability library matching, and has a wide range of adaptability.
[0075] Based on the above embodiments, Figure 3 : is a flow chart of verifying whether a vulnerability exists by sending a binding request provided by the present invention, such as Figure 3 As shown, step 140 includes:
[0076] Step 141, when a first login request of the IoT device is obtained, the binding request is parsed to obtain a first key parameter in the binding request and a first return response of successful binding; the first login request is sent based on the account bound to the IoT device;
[0077] Step 142, when a second login request of the IoT device is obtained, receiving a hijacking binding request, parsing the hijacking binding request, and obtaining a second return response of the hijacking binding request; the second login request is sent based on an account that is not bound to any IoT device;
[0078] The hijacked binding request is obtained by replacing the first key parameter in the binding request in the constructor of the binding request with the second key parameter of the Internet of Things device;
[0079] Step 143: When the first return response and the second return response are the same, determine that the binding request has an unauthorized access vulnerability.
[0080] Specifically, when the first login request of the IoT device is obtained, the binding request can be parsed to obtain the first key parameter in the binding request and the first return response of successful binding. Here, the first login request is sent based on account A bound to the IoT device.
[0081] Here, the first key parameter can be a user login credential, an IoT device resource identifier, or a user login credential and an IoT device resource identifier, wherein the user login credential can be a user ID or a session cookie; the IoT device resource identifier can be a device ID.
[0082] When the second login request of the IoT device is obtained, a hijacking binding request can be received, the hijacking binding request can be parsed, and a second return response to the hijacking binding request can be obtained. Here, the second login request is sent based on account B that is not bound to any IoT device.
[0083] The hijacking of the binding request is obtained by replacing the first key parameter in the binding request in the constructor of the binding request with the second key parameter of the IoT device.
[0084] Here, hijacking the binding request may also be obtained by replacing the first key parameter in the binding request in the network message function in the binding request with the second key parameter of the Internet of Things device.
[0085] For example, the first key parameter is the device ID, and the specific ID value of the IoT device can be filled in the device ID field in the binding request.
[0086] Then, it can be determined whether the first return response of account A and the second return response of account B are the same. If the first return response and the second return response are the same, it means that the binding is successful. At this time, it is determined that the binding request has an unauthorized access vulnerability.
[0087] The method provided by the embodiment of the present invention logs in with account A and binds a device, then logs in with another account B that is not bound to any device, hijacks the binding request constructor or network message function, constructs the user login credentials and device ID of account B into a binding request, sends the request, tries to bind the device, and verifies whether the binding of the device is successful; if the binding is successful, there is an IoT device binding vulnerability. The detection method can solve the problem of encryption of communication traffic between the client and the server, can adapt to various communication algorithms of different manufacturers, does not rely on vulnerability library matching, and has a wide range of adaptability.
[0088] Based on the above embodiments, Figure 4 : is a flow chart of locating binding request and key parameters through code features provided by the present invention, such as Figure 4 As shown, the step 130 of determining the binding request in the binding function family includes:
[0089] Step 131, locating the binding request in the binding function family by code features, wherein the code features refer to identification marks or specific features contained in the code that are different from other codes.
[0090] Specifically, the binding request in the binding function family can be located through code features.
[0091] Here, code features refer to identification marks or specific features contained in the code that are different from other codes and can be used to identify and distinguish different codes. Code features can be a variety of elements including comments, variable names, function names, process control structures, algorithm implementation methods, etc., which are not specifically limited in the embodiments of the present invention.
[0092] In addition, the key parameters of the binding request can be located through code features.
[0093] Based on the above embodiment, the code features are obtained by analyzing function semantics and / or identifying field concatenation operations.
[0094] Specifically, the code feature can be obtained by analyzing function semantics and / or identifying field concatenation operations, that is, the code feature can be obtained by analyzing function semantics, or by identifying field concatenation operations, or by analyzing function semantics and identifying field concatenation operations. The embodiments of the present invention do not make specific limitations on this.
[0095] For example, the function names, parameter names, variable names, and strings of functions in the binding function family can be analyzed one by one to identify functions representing "binding" semantics. Characters of "binding" semantics include "bind", "bond", "associate", etc.
[0096] Among them, the characters with "binding" semantics are key parameters, and key parameters refer to the parameters representing the device ID and user login credentials during the binding request process.
[0097] It is also possible to determine whether the functions in the bound function family are constructing network requests by analyzing whether the functions contain field concatenation (such as continuous object member assignment) operations.
[0098] Based on the above embodiment, step 131 further includes:
[0099] Step 1311, determining candidate key parameters of the binding request based on the semantics of the parameters in the binding request;
[0100] Step 1312: Based on the source of the candidate key parameters, determine the target key parameter from the candidate key parameters as a user login credential or an IoT device resource identifier.
[0101] Specifically, the candidate key parameters of the binding request can be determined based on the semantics of the parameters in the binding request. For example, whether the parameters are key parameters can be determined by analyzing the semantics of the parameter names and variable names in the binding request. The semantics of key parameters usually include "device ID", "user ID", etc.
[0102] Then, based on the sources of the candidate key parameters, the target key parameter can be determined from the candidate key parameters as a user login credential or an IoT device resource identifier.
[0103] For example, the sources of tracking function parameters and variables within the function are generally the parameters input by the APP itself, which are user login credentials, and those from information interaction (Bluetooth, WIFI, etc.) are IoT device resource identifiers, such as device IDs.
[0104] Based on the above embodiment, the step 130 of determining the bound function family based on the call graph includes:
[0105] Step 210, determining a connectivity path in the call graph based on connectivity between the triggered function and the network message function in the call graph;
[0106] Step 220: Determine the bound function family based on the function corresponding to each node in the connected path and the triggered function.
[0107] Specifically, the connectivity path in the call graph may be determined based on the connectivity between the triggered function and the network message function in the call graph.
[0108] In the call graph, analyzing the connectivity between the triggered function and the network message function requires traversing all nodes and edges in the graph. If there is a path from the triggered function node to the network message function node, that is, there is a directed edge between the two nodes, then the two nodes are considered to be connected.
[0109] If a path from a triggered function node to a network message function node is found in the call graph, then the functions represented by all nodes on the path and all functions triggered are identified as a bound function family.
[0110] For example, the network message function is: ApiSocketClient.instance().sendData()
[0111] The family of binding functions is:
[0112] bind(Integer)
[0113] executeSocketBind();
[0114] socketBindCamera(this.bindUid);
[0115] ApiSocketClient.instance().sendData(JsonParser.packageCameraBind(AppConfig.getUserName(),AppConfig.getLoginToken(),AppConfig.getUserId(),str)).
[0116] Based on any of the above embodiments, Figure 5 is a schematic diagram of an example of the unauthorized access vulnerability detection method in the binding of IoT devices provided by the present invention, such as Figure 5 As shown, the steps are as follows:
[0117] (1) Environmental configuration
[0118] Dynamic hook of the user-side APP: A rooted Android phone, Windows 10 system, installed with Frida software (12.11.18);
[0119] APP decompilation: apktool (used for resource file acquisition), dex2jar (used for source code acquisition), jd-gui (used for source code viewing).
[0120] (2) Using the dynamic and static combined analysis algorithm to determine the binding function family
[0121] 1) Decompile the IoT device user-side APP and obtain several candidate functions related to "binding" through semantic analysis.
[0122] Disassemble the IoT device user-side APK and obtain the source code.
[0123] Semantic analysis function:
[0124] Through functional semantic analysis, several candidate functions related to "binding" are obtained: packageCameraBind, socketBindCamera
[0125] 2) For the user-side APP, hook all functions of the class where the candidate function is located, perform device binding operations, record the triggered functions, and generate a call graph.
[0126] All functions of the class where the hook candidate function is located;
[0127] Perform device binding operation through the APP interface;
[0128] Generate a call graph.
[0129] 3) Analyze the connectivity between the triggered function and the network message function in the call graph to determine the bound function family
[0130] The network message function is: ApiSocketClient.instance().sendData()
[0131] Binding function family:
[0132] bind(Integer)
[0133] executeSocketBind();
[0134] socketBindCamera(this.bindUid);
[0135] ApiSocketClient.instance().sendData(JsonParser.packageCameraBind(AppConfig.getUserName(),AppConfig.getLoginToken(),AppConfig.getUserId(),str)).
[0136] (3) Locating binding requests and key parameters through code features
[0137] Locate the binding request and key parameters through the binding function family code characteristics.
[0138]
[0139]
[0140] Among them, jSONObject is the variable name, jSONObject.put is a string and also a function function, packageCameraBind is the function name, String str, String str2, int i, String str3 are parameter names, and JsonConfig.JSON_KEY_CONTROL is a variable within the function.
[0141] Function / parameter / variable semantic analysis can be performed based on variable names, function names, and parameter names, and source analysis can also be performed based on parameter names and variables within functions.
[0142] The socketBindCamera function sends a binding request
[0143] AppConfig.getUserName() / / Username
[0144] AppConfig.getLoginToken() / / User token
[0145] AppConfig.getUserId() / / User id
[0146] str / / Device ID
[0147] packageCameraBind, constructs the binding request content, the key parameters are loginToken, id, uid
[0148] ApiSocketClient.instance().sendData is a Socket communication method.
[0149] Hook function packageCameraBind and check the function parameters
[0150] packageCameraUnBind:
[0151] 13667366705--929220f22c31aa33c160b04e218350e4--567750--WFESEFZY8BP17G5M111A
[0152] After the request is sent, the device is successfully bound. The meaning of the fields in the json of the binding device request is sorted out:
[0153]
[0154] (4) Verify the vulnerability by sending a binding request
[0155] There are multiple ways to verify whether the vulnerability exists. One method is to compare the response returned by the binding request to determine whether the device is successfully bound, and then verify whether the vulnerability exists. Another method is to check the device list on the APP to verify whether a new device is bound. If a new device is bound, it means that there is a vulnerability. Here, the second method is used to verify whether the vulnerability exists.
[0156] Prepare two accounts A and B and a device. Log in with account A and bind the device, then record the device ID in the request.
[0157] Hook function packageCameraBind to obtain key parameters
[0158] 13667366705--929220f22c31aa33c160b04e218350e4--567750--WFESEFZY8BP17G5M111A
[0159] Get device ID: WFESEFZY8BP17G5M111A
[0160] Log in to another account B that is not bound to any device, hijack the binding request constructor or network message function, fill the specific ID value of the device into the device ID field in the request, send the request, and try to bind the device
[0161] Hook function, when the program calls ApiSocketClient.instance().sendData function, it sends a device binding request.
[0162] Check whether the APP shows that a new device is bound. If the binding is successful, there is an IoT device binding vulnerability.
[0163] The unauthorized access vulnerability detection device for an Internet of Things device provided by the present invention is described below. The unauthorized access vulnerability detection device for an Internet of Things device described below and the unauthorized access vulnerability detection method for an Internet of Things device described above can be referenced to each other.
[0164] Based on any of the above embodiments, the present invention provides an unauthorized access vulnerability detection device for an Internet of Things device. Figure 6 Schematic diagram of the structure of the unauthorized access vulnerability detection device for the Internet of Things device provided by the present invention. Figure 6 As shown, the device comprises:
[0165] A decompilation unit 610 is used to decompile the user-side and device-side firmware of the IoT device to obtain a program function, and to perform semantic analysis on the program function to obtain a plurality of binding candidate functions;
[0166] A hooking and plugging unit 620, configured to hook all functions of the class where the binding candidate function corresponding to the user end is located, and to plug the binding candidate function corresponding to the device end firmware;
[0167] A binding function family determination unit 630 is used to perform a device binding operation through the user terminal interface, obtain a triggered function captured by hooking and plugging, obtain a call graph based on the triggered function, determine a binding function family based on the call graph, and determine a binding request in the binding function family;
[0168] The unauthorized access vulnerability detection unit 640 is used to perform unauthorized access vulnerability detection on the IoT device based on the binding request.
[0169] The device provided by the embodiment of the present invention decompiles the user-side and device-side firmware of the Internet of Things device to obtain program functions, performs semantic analysis on the program functions to obtain multiple binding candidate functions, then hooks all functions of the class of the binding candidate functions corresponding to the user-side, and inserts the binding candidate functions corresponding to the device-side firmware, then performs device binding operations through the user-side interface to obtain the triggered functions captured by hooking and inserting, obtains a call graph based on the triggered functions, determines the binding function family based on the call graph, and determines the binding request in the binding function family, and finally, performs unauthorized access vulnerability detection of the Internet of Things device based on the binding request. On the one hand, the unauthorized authentication vulnerability is detected by using a combination of dynamic and static technologies. After the vulnerability is detected, the security personnel can promptly feedback to the manufacturer to patch the vulnerability to avoid greater losses, and can more comprehensively and efficiently protect the security of the Internet of Things device; on the other hand, the detection method can solve the problem of communication traffic encryption between the client and the server, can adapt to various communication algorithms of different manufacturers, does not rely on vulnerability library matching, and has a wide range of adaptability.
[0170] Based on any of the above embodiments, the unauthorized access vulnerability detection unit 640 is specifically used to:
[0171] In the case of obtaining a first login request of the Internet of Things device, parsing the binding request to obtain a first key parameter in the binding request and a first return response of successful binding; the first login request is sent based on the account bound to the Internet of Things device;
[0172] In the case of obtaining a second login request of the Internet of Things device, receiving a hijacking binding request, parsing the hijacking binding request, and obtaining a second return response of the hijacking binding request; the second login request is sent based on an account that is not bound to any Internet of Things device;
[0173] The hijacked binding request is obtained by replacing the first key parameter in the binding request in the constructor of the binding request with the second key parameter of the Internet of Things device;
[0174] When the first return response and the second return response are the same, it is determined that the binding request has an unauthorized access vulnerability.
[0175] Based on any of the above embodiments, the unit 630 for determining the binding function family specifically includes:
[0176] The binding request positioning unit is used to locate the binding request in the binding function family through code features, where the code features refer to identification marks or specific features contained in the code that are different from other codes.
[0177] Based on any of the above embodiments, the code features are obtained by analyzing function semantics and / or identifying field concatenation operations.
[0178] Based on any of the above embodiments, the invention further includes a key parameter determination unit, wherein the key parameter determination unit is specifically used for:
[0179] Determining candidate key parameters of the binding request based on the semantics of the parameters in the binding request;
[0180] Based on the sources of the candidate key parameters, a target key parameter is determined from the candidate key parameters to be a user login credential or an IoT device resource identifier.
[0181] Based on any of the above embodiments, a binding function family unit 630 is determined, which is specifically used for:
[0182] Determining a connectivity path in the call graph based on connectivity between the triggered function and the network message function in the call graph;
[0183] The binding function family is determined based on the functions corresponding to the nodes in the connection path and the triggered function.
[0184] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the unauthorized access vulnerability detection method of the IoT device, the method comprising: decompiling the user-side and device-side firmware of the IoT device to obtain program functions, performing semantic analysis on the program functions to obtain multiple binding candidate functions; hooking all functions of the class of the binding candidate functions corresponding to the user-side, and inserting the binding candidate functions corresponding to the device-side firmware; performing device binding operations through the interface of the user-side, obtaining the triggered functions captured by hooking and inserting, obtaining a call graph based on the triggered functions, determining a binding function family based on the call graph, and determining a binding request in the binding function family; performing unauthorized access vulnerability detection on the IoT device based on the binding request.
[0185] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0186] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the unauthorized access vulnerability detection method for the Internet of Things device provided by the above-mentioned methods, and the method includes: decompiling the user-side and device-side firmware of the Internet of Things device to obtain program functions, performing semantic analysis on the program functions to obtain multiple binding candidate functions; hooking all functions of the class where the binding candidate function corresponding to the user-side is located, and inserting the binding candidate function corresponding to the device-side firmware; performing device binding operations through the user-side interface to obtain triggered functions captured by hooking and inserting, obtaining a call graph based on the triggered function, determining a binding function family based on the call graph, and determining a binding request in the binding function family; based on the binding request, performing unauthorized access vulnerability detection on the Internet of Things device.
[0187] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the unauthorized access vulnerability detection method for the Internet of Things device provided by the above-mentioned methods. The method includes: decompiling the user-side and device-side firmware of the Internet of Things device to obtain program functions, performing semantic analysis on the program functions to obtain multiple binding candidate functions; hooking all functions of the class where the binding candidate function corresponding to the user-side is located, and inserting the binding candidate function corresponding to the device-side firmware; performing device binding operations through the user-side interface to obtain triggered functions captured by hooking and inserting, obtaining a call graph based on the triggered functions, determining a binding function family based on the call graph, and determining a binding request in the binding function family; and performing unauthorized access vulnerability detection on the Internet of Things device based on the binding request.
[0188] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0189] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting unauthorized access vulnerabilities of an Internet of Things device, characterized in that: include: Decompiling the user-side and device-side firmware of the IoT device to obtain program functions, and performing semantic analysis on the program functions to obtain multiple binding candidate functions; Hooking all functions of the class where the binding candidate function corresponding to the user end is located, and inserting the binding candidate function corresponding to the device end firmware; Performing a device binding operation through the user interface to obtain a triggered function captured by hooking and plugging, obtaining a call graph based on the triggered function, determining a binding function family based on the call graph, and determining a binding request in the binding function family; Based on the binding request, unauthorized access vulnerability detection of the Internet of Things device is performed.
2. The unauthorized access vulnerability detection method of the Internet of Things device according to claim 1 is characterized in that: The unauthorized access vulnerability detection of the IoT device based on the binding request includes: When a first login request of the IoT device is obtained, the binding request is parsed to obtain a first key parameter in the binding request and a first return response of successful binding; the first login request is sent based on the account bound to the IoT device; In the case of obtaining a second login request of the Internet of Things device, receiving a hijacking binding request, parsing the hijacking binding request, and obtaining a second return response of the hijacking binding request; the second login request is sent based on an account that is not bound to any Internet of Things device; The hijacked binding request is obtained by replacing the first key parameter in the binding request in the constructor of the binding request with the second key parameter of the Internet of Things device; When the first return response and the second return response are the same, it is determined that the binding request has an unauthorized access vulnerability.
3. The unauthorized access vulnerability detection method of the Internet of Things device according to claim 1 is characterized in that: The determining of the binding request in the binding function family comprises: The binding request in the binding function family is located by code features, where the code features refer to identification marks or specific features contained in the code that are different from other codes.
4. The unauthorized access vulnerability detection method of the Internet of Things device according to claim 3 is characterized in that: The code features are obtained by analyzing function semantics and / or identifying field concatenation operations.
5. The unauthorized access vulnerability detection method of the Internet of Things device according to claim 3 is characterized in that: The method further comprises locating the binding request in the binding function family by using the code feature, and then: Determining candidate key parameters of the binding request based on the semantics of the parameters in the binding request; Based on the sources of the candidate key parameters, a target key parameter is determined from the candidate key parameters to be a user login credential or an IoT device resource identifier.
6. The method for detecting unauthorized access vulnerabilities of an Internet of Things device according to any one of claims 1 to 5, characterized in that: The step of determining a binding function family based on the call graph includes: Determining a connectivity path in the call graph based on connectivity between the triggered function and the network message function in the call graph; The binding function family is determined based on the functions corresponding to the nodes in the connection path and the triggered function.
7. An unauthorized access vulnerability detection device for an Internet of Things device, characterized in that: include: A decompilation unit, used for decompiling the user-side and device-side firmware of the IoT device to obtain program functions, and performing semantic analysis on the program functions to obtain multiple binding candidate functions; A hooking and plugging unit, used for hooking all functions of the class where the binding candidate function corresponding to the user end belongs, and plugging the binding candidate function corresponding to the device end firmware; A binding function family determination unit is used to perform a device binding operation through the user terminal interface, obtain a triggered function captured by hooking and plugging, obtain a call graph based on the triggered function, determine a binding function family based on the call graph, and determine a binding request in the binding function family; The unauthorized access vulnerability detection unit is used to perform unauthorized access vulnerability detection of the Internet of Things device based on the binding request.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the unauthorized access vulnerability detection method for an Internet of Things device as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting unauthorized access vulnerabilities of an Internet of Things device as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting unauthorized access vulnerabilities of an Internet of Things device as claimed in any one of claims 1 to 6 is implemented.
