Security detection method of terminal application one-key network authentication protocol

Through reverse engineering and detection environment construction, the identity confusion security risks of the SDK of the one-click authentication service are identified, which solves the problem of lack of security assessment of identity authentication service on mobile platforms and improves the security of mobile smart terminal applications.

CN119095047APending Publication Date: 2024-12-06SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411200837.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing technology lacks a security assessment solution for the new identity authentication service network protocol based on operator capabilities on mobile platforms, and it is difficult to detect identity confusion security risks in one-click authentication services.

Method used

By generating original application samples, performing software reverse engineering, identifying key logical code locations, generating modified application samples, building an identity obfuscation security defect detection environment, and detecting potential identity obfuscation security risks of the one-click authentication service SDK.

Benefits of technology

It effectively improves the security of mobile smart terminal applications of one-click network authentication protocols, identifies and evaluates potential identity confusion security risks, and protects the privacy and security of application service providers and users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119095047A_ABST
    Figure CN119095047A_ABST
Patent Text Reader

Abstract

The invention discloses a security detection method for a terminal application one-key network authentication protocol, and the method comprises the steps: respectively generating an original application program sample, processing the original application program sample based on software reverse engineering, and generating a modified application program sample; based on the original application program sample and the modified application program sample, establishing a detection environment for the safety defect of confusion of two identities; and detecting the identity confusion security defect in the established detection environment, and evaluating the security of the mobile intelligent terminal applying the one-key network authentication protocol according to the detection result. According to the method, potential security risks are identified based on reverse analysis of the one-key authentication service SDK, the security of the mobile intelligent terminal applying the one-key network authentication protocol based on the capability of an operator can be effectively improved, and the privacy and security of related application program service providers and users are protected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a technology in the field of information security, in particular to a security detection method for a terminal application one-key network authentication protocol. Background Art

[0002] The technical problem solved by the core technical improvement of the present invention is that there is currently no solution for performing security assessment on the network protocol of a new identity authentication service based on operator capabilities on a mobile platform. Summary of the invention

[0003] The present invention proposes a security detection method for a one-key network authentication protocol for terminal applications. Based on the reverse analysis of the one-key authentication service SDK, the method identifies potential security risks, and can effectively improve the security of the one-key network authentication protocol for mobile smart terminal applications based on operator capabilities, and protect the privacy and security of related application service providers and users.

[0004] The present invention is achieved through the following technical solutions:

[0005] The present invention relates to a security detection method for a terminal application one-key network authentication protocol, comprising:

[0006] Step ① Generate the original application sample, specifically: after registering a developer account for the one-click authentication service, apply for an application identifier according to the developer document of the one-click authentication provider, generate the original application sample by integrating the one-click authentication service SDK, and submit the developer certificate fingerprint of the original application sample to the one-click authentication service provider;

[0007] Step ② processes the original application sample based on software reverse engineering, specifically: after reverse engineering the one-key authentication service SDK binary code data in the obtained original application sample, locate the key logic code position and collect the application identifier in the original application sample;

[0008] Step ③ generates a modified application sample, specifically: using the application identifier, integrating the one-key authentication service SDK to generate a draft version of the modified application sample, and repackaging the draft version of the modified application sample at the key logic code position to generate the modified application sample;

[0009] Step ④: Build two identity confusion security flaw detection environments based on the original application sample and the modified application sample;

[0010] Step ⑤: Detect identity confusion security flaws in the constructed detection environment, and evaluate the security of the one-click network authentication protocol applied in mobile smart terminals based on the detection results. Technical Effects

[0011] The present invention is based on the identity confusion security defect detection environment of the modified application and the identity confusion security defect detection environment based on the hotspot connection, and identifies the potential identity confusion security risks in the one-key authentication service by detecting the one-key authentication service SDK. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 It is a flow chart of the present invention;

[0013] Figure 2 (a) (b) is a diagram of the detection system environment structure of the embodiment. DETAILED DESCRIPTION

[0014] like Figure 1 As shown, this embodiment relates to a security detection method for a terminal application one-key network authentication protocol, including:

[0015] Step 1: Generate the original application sample, including:

[0016] S11. Register a developer account on the website of the supplier of the one-key authentication service for the mobile intelligent terminal application to be tested;

[0017] S12. Apply for an application identifier (appid and appkey) according to the requirements of the supplier of the one-key authentication service for the mobile intelligent terminal application to be tested;

[0018] S13, downloading the one-key authentication SDK from the website of the supplier of the one-key authentication service for the mobile intelligent terminal application to be tested, integrating the SDK and writing the appid and appkey obtained in step S12, and constructing and generating the original application sample;

[0019] S14. Submit the developer certificate fingerprint of the original application sample to the one-click authentication service provider.

[0020] Step 2: Process the original application sample based on software reverse engineering, including:

[0021] S21, using a disassembly tool to process the original application sample to obtain the assembly code of the original application sample;

[0022] S22, dynamically analyzing the original application sample according to the assembly code, and obtaining the appid and appkey in the original application sample;

[0023] The dynamic analysis refers to: finding the signature of the method (or function) m of the one-click authentication service SDK for receiving the application appid and appkey from the developer documentation of the one-click authentication service provider; finding m and the class to which it belongs according to the method (or function) signature from the assembly code of the original application sample; using a dynamic binary instrumentation tool to instrument m, with the instrumentation point located before entering the function body; dynamically running the original application sample, and using the instrumentation point to obtain the appid and appkey in the parameters of m.

[0024] S23. In the obtained assembly code, locate the method (or function) for controlling the user authorization pop-up window, the method (or function) for obtaining and sending the current application developer certificate fingerprint, and the method (or function) for obtaining the token returned by the one-key authentication server in the binary code of the one-key authentication SDK;

[0025] The method (or function) for locating and controlling the user authorization pop-up window is implemented by searching the code position of the pop-up window related system method (or function) in the binary code, understanding the logical meaning of the method (or function) at the calling position and all upper-level caller methods (or functions) of the method (or function), and judging whether the method (or function) can control the pop-up of the user authorization pop-up window, thereby determining the method (or function) for controlling the user authorization pop-up window.

[0026] The method (or function) for locating, obtaining and sending the current application developer certificate fingerprint is implemented by searching the binary code for the code location of the system method (or function) related to obtaining the application developer certificate fingerprint, understanding the logical meaning of the method (or function) at the calling location and all upper-level caller methods (or functions) of the method (or function), and determining whether the method (or function) contains the logic of sending the current application developer certificate fingerprint, thereby determining the method (or function) for obtaining and sending the current application developer certificate fingerprint.

[0027] The method (or function) for locating and obtaining the token returned by the one-key authentication server is implemented by searching the code position of the system method (or function) related to receiving network data packets in the binary code, understanding the logical meaning of the method (or function) at the calling position and all upper-level caller methods (or functions) of the method (or function), and judging whether the method (or function) contains the logic of receiving the token returned by the one-key authentication server, thereby determining the method (or function) for obtaining the token returned by the one-key authentication server.

[0028] S24. In the obtained assembly code, locate the method (or function) for checking the device network environment in the binary code of the one-key authentication SDK.

[0029] The method (or function) for locating and checking the device network environment is implemented by searching the binary code for the code position of the system method (or function) related to querying the device network status parameters, understanding the logical meaning of the method (or function) at the calling position and all the upper-level caller methods (or functions) of the method (or function), and determining whether the method (or function) contains the logic of the one-click authentication SDK to check the device network environment, thereby determining the method (or function) for checking the device network environment.

[0030] Step 3: Generate a modified application sample, including:

[0031] S31, collecting the developer certificate fingerprint of the original application sample;

[0032] S32, integrating the one-key authentication SDK and writing the appid and appkey of the original application sample obtained in step S22, to construct and generate a draft version of the modified application sample;

[0033] S33, decompile the draft version of the modified application sample, and modify the binary code of the draft version of the modified application sample at the key code position located in step S23 and back compile to obtain the modified application sample.

[0034] The modification refers to performing the following processes in sequence: modifying the code at the code that controls the user authorization pop-up window so that the pop-up window does not appear or appears but is invisible, and making the code related to implementing the authentication process after the user authorization pop-up window code be executed immediately after the application is started; modifying the code at the code that obtains and sends the current application developer certificate fingerprint, and changing the sent current application developer certificate fingerprint to the developer certificate fingerprint of the original application sample; modifying the code at the code that obtains the token returned by the one-click authentication server, and sending the token through the network to the designated server controlled by the simulated attacker, and not to the server of the one-click authentication service provider.

[0035] Step 4: Build an identity confusion security flaw detection environment, including:

[0036] S41. As shown in FIG2(a), an identity confusion security flaw detection environment based on the modified application is established, including: a first detection terminal A1, a second detection terminal B1, a detection server C1, a first simulated third-party application server D1 and a first dynamic binary instrumentation tool E1.

[0037] The first detection terminal A1 includes: a SIM card that has completed cellular mobile data networking, and an installed modified application sample generated in step S33.

[0038] The requirements of the second detection terminal B1 include: a SIM card that has completed cellular mobile data networking, the original application sample generated in step S13 has been installed, and it has root permissions and is equipped with a dynamic binary instrumentation tool.

[0039] The requirements for the detection server C1 include: the server has a public domain name or IP, and the server can send and receive data packets.

[0040] The requirements for the first simulated third-party application server D1 include: the server has a public domain name or IP, and the software environment required by the one-key authentication service operator is configured on the server.

[0041] The requirements of the first dynamic binary instrumentation tool E1 include: being able to perform dynamic binary instrumentation on the application running on the second detection terminal B1, modifying instructions and data at a specified location when the application is dynamically running, and being able to send, receive and store data through a network.

[0042] S42, as shown in FIG2(b), build an identity confusion security flaw detection environment based on hotspot connection, including: a third detection terminal A2, a fourth detection terminal B2, a second simulated third-party application server D2 and a second dynamic binary instrumentation tool E2.

[0043] The requirements of the third detection terminal A2 include: a SIM card that has completed cellular mobile data networking and has and has enabled Wi-Fi hotspot service.

[0044] The requirements of the fourth detection terminal B2 include: not having a SIM card and being connected to the Wi-Fi hotspot of the first detection terminal A1 built in step S41, having installed the original application sample generated in step S13, having root permissions and being equipped with a dynamic binary instrumentation tool.

[0045] The requirements for the second simulated third-party application server D2 built in step S42 include: the server has a public domain name or IP, and the software environment required by the one-key authentication service operator is configured on the server.

[0046] The requirements of the second dynamic binary instrumentation tool E2 constructed in step S42 include: being able to perform dynamic binary instrumentation on the application running on the fourth detection terminal B2, modifying instructions and data at a specified location when the application is dynamically running, and being able to send, receive and store data through a network.

[0047] Step 5: As shown in FIG2(a) and FIG2(b), detecting the identity confusion security flaw includes:

[0048] S51. In the environment established in step S41, detecting identity confusion security flaws based on the modified application, specifically including:

[0049] a) On the first detection terminal A1 built in step S41, start the modified application sample obtained in step S33;

[0050] b) The detection server C1 constructed in step S41 receives token_v sent by the modified application sample obtained in step S33 on the first detection terminal A1;

[0051] c) The detection server C1 constructed in step S41 forwards token_v to the first dynamic binary instrumentation tool E1;

[0052] d) On the second detection terminal B1 built in step S41, starting the original application sample obtained in step S13;

[0053] e) Using the first dynamic binary instrumentation tool E1 built in step S41, token_a sent by the original application sample to the first simulated third-party application server D1 built in step S41 is replaced with token_v;

[0054] f) Testing whether the original application sample obtained in step S13 on the second detection terminal B1 built in step S41 can normally log into the application account associated with the mobile phone number corresponding to the SIM card on the first detection terminal A1 built in step S41.

[0055] S52: In the environment established in step S42, detecting identity confusion security flaws based on hotspot connections, specifically including:

[0056] i) On the fourth detection terminal B2 built in step S42, start the original application sample obtained in step S13;

[0057] ii) using the second dynamic binary instrumentation tool E2 constructed in step S42, modifying the code for checking the device network environment analyzed in step S23, and changing its check result to the check result when the current device is connected to the cellular mobile data network;

[0058] iii) On the fourth detection terminal B2 built in step S42, the original application sample is allowed to continue running, and the acquired token is sent to the detection server D2 built in step S42;

[0059] iv) Testing whether the original application sample obtained in step S13 on the fourth detection terminal B2 built in step S42 can normally log into the application account associated with the mobile phone number corresponding to the SIM card on the third detection terminal A2 built in step S42.

[0060] S53. Safety assessment, specifically:

[0061] ① When steps S11 to S52 are successfully implemented and the second detection terminal B1 built in step S41 or the fourth detection terminal B2 built in step S42 can log in normally to the application account associated with the mobile phone number corresponding to the SIM card on the first detection terminal A1 or the third detection terminal A2, it is assessed that the one-key network authentication protocol has an identity confusion security defect;

[0062] ② When steps S11 to S52 are successfully implemented and the second detection terminal B1 built in step S41 and the fourth detection terminal B2 built in step S42 cannot normally log in to the application account associated with the mobile phone number corresponding to the SIM card on the first detection terminal A1 or the third detection terminal A2, it is assessed that the one-key network authentication protocol does not have an identity confusion security defect;

[0063] ③ When steps S11 to S52 cannot be successfully implemented, the evaluation method fails to take effect and the evaluation results cannot be generated.

[0064] After specific actual experiments, the above method was run under the following specific environment and parameter settings for the local number one-click authentication Android SDK provided by China Mobile, where:

[0065] The one-click authentication service provider in step ① is China Mobile; the website for registering the one-click authentication service is https: / / dev.10086.cn / numIdentific; the development tool used to integrate the one-click authentication service SDK to generate the original application sample is Android Studio.

[0066] The reverse engineering tool used to process the original application sample in step ② is JEB; the pop-up window related system methods searched in the process of locating the method of controlling the user authorization pop-up window include PopupWindow(Context context), PopupWindow(Context context,AttributeSet attrs), PopupWindow(Context context,AttributeSet attrs,int defStyleAttr), PopupWindow(Context context,AttributeSetattrs,int defStyleAttr,int defStyleRes), PopupWindow(), PopupWindow(ViewcontentView), PopupWindow(intwidth,intheight), PopupWindow(ViewcontentView,intwidth,intheight), PopupWindow(View contentView,intwidth,int height,booleanfocusable), etc.; the system methods related to obtaining the application developer certificate fingerprint searched in the process of locating the method of obtaining and sending the current application developer certificate fingerprint include getPackageInfo(String packageName,intflags), getPackageInfo(String packageName,PackageManager.PackageInfoFlagsflags), getPackageInfo(VersionedPackage versionedPackage,PackageManager.PackageInfoFlags flags), getPackageInfo(VersionedPackageversionedPackage,intflags), etc.; the system methods related to receiving network data packets searched in the process of locating the method for obtaining the token returned by the one-key authentication server include read(), read(byte[]b,int off,intlen), etc.; the system methods related to querying device network status parameters searched in the process of locating the method for checking the device network environment include getActiveNetwork(), getActiveNetworkInfo(), etc.

[0067] The tool used to integrate the one-click authentication service SDK in step ③ is Android Studio; the repackaging tool used in the process of repackaging the application sample is ShakaApkTool.

[0068] The first detection terminal A1, the second detection terminal B1, the third detection terminal A2, and the fourth detection terminal B2 used in step ④ are Nokia X5 smartphones; the detection server C1 hardware is an ASUS ROG Magic 15 laptop computer, the operating system is Windows 10 Home Chinese Edition, the server software environment is Python 3.9.0, and the simulated DNS routing forwarding is achieved through the router's custom hosts function; the first simulated third-party application server D1 and the second simulated third-party application server D2 hardware are laptop computers, the operating system is Windows 10 Home Chinese Edition, the server software environment is Python 3.9.0, and the simulated DNS routing forwarding is achieved through the router's custom hosts function; the first dynamic binary instrumentation tool E1 and the second dynamic binary instrumentation tool E2 are Frida 15.2.2; the SIM card is a China Mobile 5G SIM card.

[0069] The detection results in step ⑤ are as follows: the second detection terminal B1 set up in step S41 can log in to the first detection terminal A1 normally, indicating that China Mobile's one-click authentication service has an identity confusion security defect based on the modified application; the fourth detection terminal B2 set up in step S42 can log in to the second detection terminal A2 normally, indicating that China Mobile's one-click authentication service has an identity confusion security defect based on the hotspot connection.

[0070] Compared with the existing technology, this method specifically solves the problem that the existing mobile platform identity authentication defect detection method is difficult to detect the one-click authentication service identity confusion defect, and can detect the one-click authentication service identity confusion defect.

[0071] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.

Claims

1. A method for detecting the security of a terminal application one-key network authentication protocol, characterized in that: include: After respectively generating original application samples and processing the original application samples based on software reverse engineering and generating modified application samples, two identity confusion security defect detection environments are built based on the original application samples and the modified application samples; Detect identity confusion security flaws in the constructed testing environment, and evaluate the security of the one-click network authentication protocol applied in mobile smart terminals based on the test results.

2. The method for detecting the security of the terminal application one-key network authentication protocol according to claim 1 is characterized in that: The generation of the original application sample is specifically as follows: after registering a developer account for the one-click authentication service, applying for an application identifier according to the developer documentation of the one-click authentication provider, generating the original application sample by integrating the one-click authentication service SDK, and submitting the developer certificate fingerprint of the original application sample to the one-click authentication service provider.

3. The method for detecting the security of the terminal application one-key network authentication protocol according to claim 1 is characterized in that: The software reverse engineering-based processing of the original application sample is specifically as follows: after reverse engineering the one-key authentication service SDK binary code data in the obtained original application sample, the key logic code position is located and the application identifier in the original application sample is collected.

4. The method for detecting the security of a terminal application one-key network authentication protocol according to claim 1, characterized in that: The generating of the modified application sample specifically comprises: utilizing the application identifier to generate a draft version of the modified application sample by integrating the one-key authentication service SDK, and repackaging the draft version of the modified application sample at the key logic code position to generate the modified application sample.

5. The method for detecting the security of a terminal application one-key network authentication protocol according to claim 1, characterized in that: The detection environment of the two identity confusion security flaws includes: An identity obfuscation security defect detection environment based on a modified application includes: a first detection terminal, a second detection terminal, a detection server, a first simulated third-party application server, and a first dynamic binary instrumentation tool, and The identity confusion security flaw detection environment based on hotspot connection includes: a third detection terminal, a fourth detection terminal, a second simulated third-party application server and a second dynamic binary instrumentation tool.

6. The method for detecting the security of the terminal application one-key network authentication protocol according to claim 5 is characterized in that: The first detection terminal includes: a SIM card that has completed cellular mobile data networking, and an installed modified application sample generated in step 3; The requirements of the second detection terminal include: a SIM card that has completed cellular mobile data networking, an original application sample installed, root permissions, and a dynamic binary instrumentation tool; The requirements for the detection server include: the server has a public domain name or IP, and the server can send and receive data packets; The requirements for the first simulated third-party application server include: the server has a public domain name or IP, and the software environment required by the one-key authentication service operator is configured on the server; The requirements of the first dynamic binary instrumentation tool include: being able to perform dynamic binary instrumentation on the application running on the second detection terminal, modifying instructions and data at a specified location when the application is dynamically running, and being able to send, receive and store data through a network; The requirements of the third detection terminal include: a SIM card that has completed cellular mobile data networking and has and has enabled Wi-Fi hotspot service; The requirements of the fourth detection terminal include: not equipped with a SIM card and connected to the Wi-Fi hotspot of the first detection terminal built in step 1, having installed the original application sample, having root permissions and having a dynamic binary instrumentation tool; The requirements of the second simulated third-party application server include: the server has a public domain name or IP, and the software environment required by the one-key authentication service operator is configured on the server; The requirements of the second dynamic binary instrumentation tool include: being able to perform dynamic binary instrumentation on the application running on the fourth detection terminal, modifying instructions and data at a specified location when the application is dynamically running, and being able to send, receive and store data through a network.

7. The method for detecting the security of the terminal application one-key network authentication protocol according to claim 5 or 6, characterized in that: The aforementioned security flaws in detecting identity confusion include: In the identity confusion security flaw detection environment based on modified applications, the identity confusion security flaw based on modified applications is detected, specifically including: a) On the first detection terminal A1, start the modified application sample; b) The detection server C1 receives token_v sent by the modified application sample on the first detection terminal A1; c) The detection server C1 forwards token_v to the first dynamic binary instrumentation tool E1; d) On the second detection terminal B1, start the original application sample; e) replacing token_a sent by the original application sample to the first simulated third-party application server D1 with token_v through the first dynamic binary instrumentation tool E1; f) testing whether the original application sample on the second detection terminal B1 can normally log in to the application account associated with the mobile phone number corresponding to the SIM card on the first detection terminal A1; In the hotspot connection-based identity confusion security flaw detection environment, the identity confusion security flaw based on the hotspot connection is detected, specifically including: i) On the fourth detection terminal B2, start the original application sample; ii) using the second dynamic binary instrumentation tool E2, modifying the analyzed code for checking the device network environment, and changing its check result to a check result when the current device is connected to a cellular mobile data network; iii) On the fourth detection terminal B2, the original application sample continues to run, and the acquired token is sent to the detection server D2; iv) Testing whether the original application sample on the fourth detection terminal B2 can normally log into the application account associated with the mobile phone number corresponding to the SIM card on the third detection terminal A2.

8. The method for detecting the security of a terminal application one-key network authentication protocol according to claim 1, characterized in that: The test results are: ① When the identity confusion security defect based on hotspot connection is successfully detected in the identity confusion security defect detection environment based on hotspot connection, and the application account associated with the mobile phone number corresponding to the SIM card on the first detection terminal A1 or the third detection terminal A2 can be logged in normally on the second detection terminal B1 or the fourth detection terminal B2, it is assessed that the one-key network authentication protocol has an identity confusion security defect; ② When the identity confusion security defect based on hotspot connection is successfully detected in the identity confusion security defect detection environment based on hotspot connection, and the second detection terminal B1 and the fourth detection terminal B2 cannot normally log in to the application account associated with the mobile phone number corresponding to the SIM card on the first detection terminal A1 or the third detection terminal A2, it is assessed that the one-key network authentication protocol does not have an identity confusion security defect; ③ When the identity confusion security flaw based on hotspot connection cannot be successfully detected in the identity confusion security flaw detection environment based on hotspot connection, the evaluation method fails to take effect and the evaluation results cannot be generated.