WO2023273139A1 - 越权漏洞检测方法、装置、设备及计算机程序产品 - Google Patents

越权漏洞检测方法、装置、设备及计算机程序产品 Download PDF

Info

Publication number
WO2023273139A1
WO2023273139A1 PCT/CN2021/134315 CN2021134315W WO2023273139A1 WO 2023273139 A1 WO2023273139 A1 WO 2023273139A1 CN 2021134315 W CN2021134315 W CN 2021134315W WO 2023273139 A1 WO2023273139 A1 WO 2023273139A1
Authority
WO
WIPO (PCT)
Prior art keywords
hash value
service request
fragment
response data
unauthorized
Prior art date
Application number
PCT/CN2021/134315
Other languages
English (en)
French (fr)
Inventor
刘宇滨
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023273139A1 publication Critical patent/WO2023273139A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1433Vulnerability analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Definitions

  • This application relates to the technical field of financial technology (Fintech), in particular to a detection method, device system, equipment and computer program product for unauthorized vulnerability.
  • Privilege violation vulnerability a common security vulnerability in web applications, means that due to the negligence of programmers, there is no strict restriction on the permissions/users required for an operation, so that users who should not have operation permissions can operate normally.
  • the threat is that one account can control the user data of the entire site, that is, an attacker can use a legitimate account to perform illegal operations on other account data that has unauthorized flaws, such as query, insert, delete, modify and other routine database commands.
  • the detection of unauthorized access is mainly by manually logging into an account and modifying the account ID, obtaining the request response data returned by different account IDs, and judging whether there is an unauthorized access by obtaining the text similarity of different response data , this scheme needs to compare each character in the response data one by one.
  • the efficiency of unauthorized vulnerability detection is low.
  • the main purpose of this application is to propose an unauthorized vulnerability detection method, device, equipment and computer program product, aiming to solve the existing technical problem of low efficiency of unauthorized vulnerability detection.
  • the present application provides a method for detecting an unauthorized vulnerability, which includes the following steps:
  • performing splicing processing on the first fragment hash value to obtain a first spliced hash value, and performing splicing processing on the second fragment hash value to obtain a second spliced hash value Steps include:
  • the step of modifying the first identity in the first service request to obtain the second service request includes:
  • the step of determining the similarity between the first concatenated hash value and the second concatenated hash value comprises:
  • the step of calculating the minimum number of editing operations of the first concatenated hash value and the second concatenated hash value comprises:
  • the character length of the first concatenated hash value the character length of the second concatenated hash value, the character content of the first concatenated hash value and the character content of the second concatenated hash value, construct Editing the matrix of operation times, and initializing the matrix of editing operations;
  • the number of editing operations corresponding to each matrix element in the matrix of the number of editing operations is cyclically calculated according to the preset number of editing operations formula; the formula of the number of preset editing operations is:
  • dp[i, j] min(dp[i-1, j]+1, dp[i, j-1]+1, dp[i-1, j-1]+temp),
  • dp[i, j] is the number of editing operations corresponding to the matrix elements in the i-th row and j-th column in the editing operation times matrix;
  • dp[i-1, j] is the number of edit operations corresponding to the matrix elements in row i-1 and column j in the edit operation times matrix;
  • dp[i, j-1] is the number of editing operations corresponding to the matrix elements in row i and column j-1 in the number of editing operations matrix;
  • dp[i-1, j-1] is the number of edit operations corresponding to the matrix elements in row i-1 and column j-1 in the edit operation times matrix;
  • the minimum number of editing operations is determined according to the number of editing operations corresponding to each matrix element.
  • the step of determining whether there is an unauthorized vulnerability in the system to be detected according to the similarity includes:
  • the similarity is less than the preset similarity threshold, it is determined that there is no unauthorized vulnerability in the system to be detected.
  • the step of receiving the first service request including the first identity of the system to be detected it further includes:
  • an unauthorized vulnerability detection device which includes:
  • An identity modification module configured to receive a first service request including a first identity from a system to be detected, modify the first identity in the first service request, and obtain a second service request;
  • a request execution module configured to execute the first service request and the second service request through the system to be detected, and obtain the first response data corresponding to the first service request and the first response data corresponding to the second service request. 2 response data;
  • a slice hash module configured to perform slice processing on the first response data and the second response data respectively, perform a hash operation on each slice data obtained through the slice processing, and obtain the first response data The corresponding first fragment hash value and the second fragment hash value corresponding to the second response data;
  • a hash concatenation module configured to concatenate the first fragment hash values to obtain a first concatenated hash value, and to concatenate the second fragment hash values to obtain a second concatenate hash value
  • the unauthorized determination module is configured to determine the similarity between the first concatenated hash value and the second concatenated hash value, and determine whether there is an unauthorized vulnerability in the system to be detected according to the similarity.
  • the present application also provides an unauthorized vulnerability detection device, which includes: a memory, a processor, and an unauthorized vulnerability detection device stored on the memory and operable on the processor.
  • a program when the unauthorized vulnerability detection program is executed by the processor, the steps of the above-mentioned unauthorized vulnerability detection method are realized.
  • the present application also provides a computer storage medium, on which an unauthorized loophole detection program is stored, and when the unauthorized loophole detection program is executed by a processor, the above-mentioned unauthorized loophole detection method is realized A step of.
  • the present application also provides a computer program product, the computer program product includes an unauthorized vulnerability detection program, and when the unauthorized vulnerability detection program is executed by a processor, the steps of the above-mentioned unauthorized vulnerability detection method are realized. .
  • the present application receives the first service request including the first identity from the system to be detected, modifies the first identity in the first service request, and obtains the second service request; executes the For the first service request and the second service request, obtain the first response data corresponding to the first service request and the second response data corresponding to the second service request; Fragmentation processing is performed on the two response data respectively, and a hash operation is performed on each fragmentation data obtained by the fragmentation processing to obtain the first fragmentation hash value corresponding to the first response data and the second fragmentation hash value corresponding to the second response data.
  • Two fragmented hash values performing splicing processing on the first fragmented hash value to obtain a first spliced hash value, and performing splicing processing on the second fragmented hash value to obtain a second spliced hash value; determine The similarity between the first concatenated hash value and the second concatenated hash value is used to determine whether there is an unauthorized vulnerability in the system to be detected according to the similarity.
  • the efficiency of the similarity comparison is improved, thereby improving the efficiency of unauthorized vulnerability detection;
  • segmenting the response data according to the obtained
  • the hash value of the piece of data is then compared for similarity, which improves the efficiency of unauthorized vulnerability detection under the premise of ensuring the detection accuracy of unauthorized vulnerabilities.
  • Fig. 1 is a schematic structural diagram of an unauthorized vulnerability detection device in a hardware operating environment involved in the embodiment of the present application;
  • FIG. 2 is a schematic flow diagram of the first embodiment of the method for detecting unauthorized vulnerabilities in the present application
  • FIG. 3 is a schematic diagram of modules of the unauthorized detection device of the present application.
  • FIG. 1 is a schematic structural diagram of an unauthorized vulnerability detection device in a hardware operating environment involved in the solution of the embodiment of the present application.
  • the unauthorized vulnerability detection device in the embodiment of the present application may be a PC or a server device on which a virtual machine runs.
  • the unauthorized vulnerability detection device may include: a processor 1001 , such as a CPU, a network interface 1004 , a user interface 1003 , a memory 1005 , and a communication bus 1002 .
  • the communication bus 1002 is used to realize connection and communication between these components.
  • the user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory.
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .
  • the structure of the unauthorized vulnerability detection device shown in Figure 1 does not constitute a limitation on the device, and may include more or less components than shown in the figure, or combine some components, or arrange different components .
  • the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an unauthorized vulnerability detection program.
  • the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server;
  • the user interface 1003 is mainly used to connect to the client (client) and perform data communication with the client;
  • the processor 1001 can be used to call the unauthorized vulnerability detection program stored in the memory 1005, and execute the operations in the following unauthorized vulnerability detection method.
  • FIG. 2 is a schematic flow chart of the first embodiment of the method for detecting unauthorized vulnerabilities in the present application, and the method includes:
  • Step S10 receiving a first service request including a first identity from the system to be detected, modifying the first identity in the first service request, and obtaining a second service request;
  • the method for detecting an unauthorized vulnerability in this embodiment is applied to an unauthorized vulnerability detection device, which may be a terminal, a robot or a PC device.
  • the detection of unauthorized access is mainly by manually logging into an account and modifying the account ID, obtaining the request response data returned by different account IDs, and judging whether there is an unauthorized access by obtaining the text similarity of different response data , this scheme needs to compare each character in the response data one by one.
  • the efficiency of unauthorized vulnerability detection is low.
  • this embodiment provides an unauthorized vulnerability detection solution.
  • the efficiency of similarity comparison is improved, thereby improving the efficiency of unauthorized vulnerability detection;
  • the efficiency of unauthorized vulnerability detection can be improved while ensuring the detection accuracy of unauthorized vulnerabilities.
  • the identifier refers to information used to indicate the identity of the originator of the service request, and the identifier may be at least one of a cookie or a user account identifier.
  • cookie refers to the data stored on the user's local terminal. It is a simple text file stored in the client computer. Information (such as user personal information), which is available to the Web document when the client computer revisits the Web document.
  • the unauthorized vulnerability detection device will collect the first service request for accessing the system to be detected, and after collecting the first service request, modify the identity in the first service request, and other content in the request Left unchanged, get the second service request.
  • the method of modifying the identity in the first service request includes two processing methods: deletion and/or replacement.
  • Deletion refers to deleting the first identity in the first service request and retaining other content in the request. , to obtain the second service request; replacement refers to replacing the first identity in the first service request with a second identity different from the first identity to obtain the second service request.
  • the first identity mark is used to identify the identity information of the first user
  • the second identity mark is used to identify the identity information of the second user
  • the first user and the second user are two persons with different Legal users with operating authority.
  • Step S20 execute the first service request and the second service request through the system to be tested, and obtain the first response data corresponding to the first service request and the second response data corresponding to the second service request ;
  • this embodiment does not limit the sequence of generating the second service request and executing the first service request, that is, after receiving the first service request, the second service request can be generated before the first service is executed. request, the first service request may be executed first and then the second service request may be executed, or both may be executed at the same time.
  • the character length of the first response data is greater than the preset character length threshold, if not, it means that the character length of the first response data is relatively short, and not It will significantly affect the speed of unauthorized vulnerability detection.
  • Step S30 performing fragmentation processing on the first response data and the second response data respectively, performing a hash operation on each fragmentation data obtained through the fragmentation processing, and obtaining a first score corresponding to the first response data
  • the first service request and the second service request After obtaining the first service request and the second service request, execute the first service request and the second service request through the system to be detected, respectively obtain the first response data corresponding to the first service request, and the second response data corresponding to the second service request data.
  • the first response data is directly compared with the second response data, and it is determined whether there is an unauthorized vulnerability in the system to be detected according to the similarity comparison results.
  • the character length of the data is long, it will generate a huge workload and the efficiency is low.
  • this embodiment will perform a hash operation on the response data after obtaining the response data, and convert the response data of any length into a fixed-length hash value, so that in subsequent steps, according to the hash value of the response data Values are compared to reduce the workload of similarity calculations; furthermore, because the hash operation is sensitive to input changes, that is, even if there is a very small change in the original input data, the output hash value will also appear huge.
  • this embodiment performs fragmentation processing on the response data first, that is, the response data is divided according to the first preset character length Split the response data into several pieces of data.
  • the first preset character length is set by the management personnel according to the requirements for detection accuracy and efficiency of unauthorized vulnerability detection. High; the smaller the length of the first preset character, the higher the accuracy of unauthorized vulnerability detection and the lower the detection efficiency.
  • the hash operation is performed on each fragment data respectively to obtain the hash value of each fragment data of the first response data, that is, the hash value of the first fragment data hash value, and the hash value of each fragment data of the second response data, that is, the second fragment hash value.
  • the algorithm of the hash operation can specifically be MD5 (Message Digest Algorithm MD5, message digest algorithm), or other hash function algorithms, such as at least one of MD4, SHA1, SHA-224, SHA-256, SHA-384, and SHA-512.
  • Step S40 performing splicing processing on the first fragment hash value to obtain a first spliced hash value, and performing splicing processing on the second fragment hash value to obtain a second spliced hash value;
  • splicing is performed according to the position of the fragment data corresponding to the first fragment hash value in the first response data to obtain the first Splicing hash values; after obtaining the second fragment hash value corresponding to the second response data, splicing according to the position of the fragment data corresponding to the second fragment hash value in the second response data to obtain the second splicing hash value.
  • Step S50 determining the similarity between the first concatenated hash value and the second concatenated hash value, and determining whether there is an unauthorized vulnerability in the system to be detected according to the similarity.
  • the similarity between the two can be calculated.
  • the identity in the first service request is deleted and replaced to obtain the second service request B and C
  • the similarity between the spliced hash value and the spliced hash value corresponding to B is calculated according to the response data of A and C.
  • the similarity between the spliced hash value corresponding to A and the spliced hash value corresponding to C if the two similarities are If one of them is greater than or equal to the preset similarity threshold, it is determined that there is an unauthorized vulnerability in the system to be detected; if the two similarities are both smaller than the preset similarity threshold, it is determined that there is no unauthorized vulnerability in the system to be detected.
  • an unauthorized vulnerability alarm may be output.
  • the unauthorized vulnerability alarm includes one or more of the identification information of the system to be detected, the similarity between the first spliced hash value and the second spliced hash value.
  • the step of outputting an unauthorized vulnerability warning may specifically include: determining a corresponding warning level according to the similarity, and outputting a corresponding level of unauthorized vulnerability warning according to the determined warning level.
  • the first identity in the first service request is modified to obtain the second service request;
  • the system to be detected executes the first service request and the second service request, and obtain the first response data corresponding to the first service request and the second response data corresponding to the second service request; for the first response data and the Fragmentation processing is performed on the second response data respectively, and a hash operation is performed on each fragmentation data obtained by the fragmentation processing to obtain the first fragmentation hash value corresponding to the first response data and the hash value corresponding to the second response data.
  • the second fragmentation hash value performing splicing processing on the first fragmentation hash value to obtain a first splicing hash value, and performing splicing processing on the second fragmentation hash value to obtain a second splicing hash value; Determine the similarity between the first spliced hash value and the second spliced hash value, and determine whether there is an unauthorized vulnerability in the system to be detected according to the similarity.
  • this embodiment improves the efficiency of similarity comparison by performing similarity comparison on the hash value of response data, thereby improving the efficiency of unauthorized vulnerability detection; on the other hand, by performing fragmentation processing on response data, according to The hash values of the obtained fragmented data are then compared for similarity, which improves the efficiency of unauthorized vulnerability detection under the premise of ensuring the detection accuracy of unauthorized vulnerabilities.
  • step S40 comprises:
  • Step S41 performing data extraction on the first fragment hash value to obtain the first fragment extraction hash value of the second preset character length, performing splicing processing on the first fragment extraction hash value to obtain the first fragment hash value A concatenated hash value, the preset character length is less than the character length of the first fragment hash value;
  • Step S42 performing data extraction on the second fragmented hash value to obtain a second fragmented extracted hash value with a second preset character length, performing splicing processing on the second fragmented extracted hash value to obtain the second fragmented hash value Two concatenated hash values.
  • the second preset character length is smaller than the character length of the fragment hash value; the data extraction method adopted for the first fragment hash value and the second fragment hash value is the same.
  • the data extraction method may be to take a character string with a preset specified position and a second preset character length of each fragment hash value, for example, take a character string with 12 digits at the head or tail of the fragment hash value as a fragment Extract the hash value.
  • the second preset character length is set by the management personnel according to the requirements for detection accuracy and efficiency of unauthorized vulnerability detection. The larger the second preset character length is, the higher the accuracy of detection of unauthorized vulnerabilities is, and the lower the detection efficiency is; The smaller the length of the first preset character is, the lower the accuracy of unauthorized vulnerability detection is, and the higher the detection efficiency is.
  • the character length of the spliced hash values can be shortened, thereby increasing the speed of similarity calculation, and further Improve the efficiency of unauthorized vulnerability detection.
  • the step of determining the similarity between the first concatenated hash value and the second concatenated hash value includes:
  • Step S51 calculating the minimum number of editing operations of the first combined hash value and the second combined hash value
  • Step S52 according to the sum of the character lengths of the first concatenated hash value and the second concatenated hash value, and the minimum number of editing operations to determine the first concatenated hash value and the second concatenated hash value Hive similarity.
  • a solution for calculating the similarity based on the minimum number of editing operations is provided, specifically, firstly determine the minimum number of editing operations dp[m, n] of the first splicing hash value and the second splicing hash value , and then determine the sum m+n of the character lengths of the first concatenated hash value and the second concatenated hash value, then the similarity is dp[m, n]/(m+n).
  • step S51 includes:
  • Step S511 according to the character length of the first concatenated hash value, the character length of the second concatenated hash value, the character content of the first concatenated hash value, and the characters of the second concatenated hash value content, constructing an editing operation times matrix, and initializing and assigning values to the editing operation times matrix;
  • Step S512 according to the character length of the first concatenated hash value, the character length of the second concatenated hash value, the character content of the first concatenated hash value, and the characters of the second concatenated hash value content, constructing an editing operation times matrix, and initializing and assigning values to the editing operation times matrix;
  • the number of editing operations corresponding to each matrix element in the matrix of the number of editing operations is cyclically calculated according to the preset number of editing operations formula; the formula of the number of preset editing operations is:
  • dp[i, j] min(dp[i-1, j]+1, dp[i, j-1]+1, dp[i-1, j-1]+temp),
  • dp[i, j] is the number of editing operations corresponding to the matrix elements in the i-th row and j-th column in the editing operation times matrix;
  • dp[i-1, j] is the number of edit operations corresponding to the matrix elements in row i-1 and column j in the edit operation times matrix;
  • dp[i, j-1] is the number of editing operations corresponding to the matrix elements in row i and column j-1 in the number of editing operations matrix;
  • dp[i-1, j-1] is the number of edit operations corresponding to the matrix elements in row i-1 and column j-1 in the edit operation times matrix;
  • Step S513 determining the minimum number of editing operations according to the number of editing operations corresponding to each matrix element.
  • This embodiment is a specific process of determining the minimum number of editing operations. First, create a matrix of editing operations times, set the lengths of the character strings of the first splicing hash value and the second splicing hash value to be m and n respectively, then, the dimension of the editing operations matrix is (m+1 )*(n+1), fill the first row and the first column with the first splicing hash value and the second splicing hash value respectively, and obtain the matrix shown in Table 1 below (assuming that the first splicing hash value is ABCD, the second concatenated hash value is ACD);
  • the complexity of text similarity calculation can be reduced, thereby improving the efficiency of unauthorized vulnerability detection.
  • step S10 after the step of receiving the first service request including the first identity of the system to be detected, it also includes:
  • the first service request is parsed, the request content of the first service request is acquired, and it is determined whether the request content includes a mobile phone number, Sensitive information such as email address, account password, bank card number, or ID card number. If yes, it indicates that the system to be detected corresponding to the request needs to perform unauthorized vulnerability detection to prevent sensitive information from being obtained by illegal users; Vulnerability detection.
  • an automatic trigger condition for unauthorized vulnerability detection is set, so that the unauthorized vulnerability detection scheme can be automatically executed when the trigger condition is satisfied, thereby making the unauthorized vulnerability detection more flexible and efficient.
  • the present application also provides an unauthorized loophole detection device.
  • the unauthorized loophole detection device includes:
  • the identity modification module 10 is configured to receive a first service request including a first identity from a system to be detected, modify the first identity in the first service request, and obtain a second service request;
  • the request execution module 20 is configured to execute the first service request and the second service request through the system to be detected, and obtain the first response data corresponding to the first service request and the response data corresponding to the second service request. second response data;
  • Fragmentation and hashing module 30 configured to perform fragmentation processing on the first response data and the second response data respectively, perform a hash operation on each fragmentation data obtained by the fragmentation processing, and obtain the first response The first fragment hash value corresponding to the data and the second fragment hash value corresponding to the second data;
  • a hash splicing module 40 configured to splice the first fragment hash value to obtain a first spliced hash value, and perform splicing processing on the second fragment hash value to obtain a second spliced hash value
  • the unauthorized determination module 50 is configured to determine the similarity between the first concatenated hash value and the second concatenated hash value, and determine whether there is an unauthorized vulnerability in the system to be detected according to the similarity.
  • the shard hash module is also used for:
  • the identity modification module is also used for:
  • the unauthorized determination module is also used for:
  • the unauthorized determination module is also used for:
  • the character length of the first concatenated hash value the character length of the second concatenated hash value, the character content of the first concatenated hash value and the character content of the second concatenated hash value, construct Editing the matrix of operation times, and initializing the matrix of editing operations;
  • the number of editing operations corresponding to each matrix element in the matrix of the number of editing operations is cyclically calculated according to the preset number of editing operations formula; the formula of the number of preset editing operations is:
  • dp[i, j] min(dp[i-1, j]+1, dp[i, j-1]+1, dp[i-1, j-1]+temp),
  • dp[i, j] is the number of editing operations corresponding to the matrix elements in the i-th row and j-th column in the editing operation times matrix;
  • dp[i-1, j] is the number of edit operations corresponding to the matrix elements in row i-1 and column j in the edit operation times matrix;
  • dp[i, j-1] is the number of editing operations corresponding to the matrix elements in row i and column j-1 in the number of editing operations matrix;
  • dp[i-1, j-1] is the number of edit operations corresponding to the matrix elements in row i-1 and column j-1 in the edit operation times matrix;
  • the minimum number of editing operations is determined according to the number of editing operations corresponding to each matrix element.
  • the unauthorized determination module is also used for:
  • the similarity is less than the preset similarity threshold, it is determined that there is no unauthorized vulnerability in the system to be detected.
  • the identity modification module is also used for:
  • the application also provides an unauthorized vulnerability detection device.
  • the unauthorized vulnerability detection device includes: a memory, a processor, and an unauthorized vulnerability detection program stored on the memory and operable on the processor.
  • the unauthorized vulnerability detection program is executed by the processor, the For the method, reference may be made to the various embodiments of the detection method for unauthorized access in this application, which will not be repeated here.
  • the present application also provides a computer storage medium.
  • An unauthorized loophole detection program is stored on the computer storage medium of the present application, and when the unauthorized loophole detection program is executed by a processor, the steps of the above-mentioned unauthorized loophole detection method are realized.
  • the present application also provides a computer program product.
  • the computer program product of the present application includes an unauthorized loophole detection program, and when the unauthorized loophole detection program is executed by a processor, the steps of the above-mentioned unauthorized loophole detection method are realized.
  • the term “comprises”, “comprises” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or system comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or system. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article or system comprising that element.
  • the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation.
  • the technical solution of the present application can be embodied in the form of a software product in essence or the part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , magnetic disk, optical disk), including several instructions to enable a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

本申请涉及金融科技(Fintech)技术领域,公开了一种越权漏洞检测方法、装置、设备及产品,所述方法包括:接收对待检测***的包括第一身份标识的第一服务请求,对第一身份标识进行修改得到第二服务请求;执行第一服务请求和第二服务请求得到响应数据;对各响应数据分别进行分片,对各分片数据进行哈希得到第一分片哈希值和第二分片哈希值;对第一分片哈希值进行拼接得到第一拼接哈希值,对第二分片哈希值进行拼接得到第二拼接哈希值;根据两个拼接哈希值的相似度确定待检测***是否存在越权漏洞。

Description

越权漏洞检测方法、装置、设备及计算机程序产品
本申请要求于2021年6月28日申请的、申请号为202110722722.8的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及金融科技(Fintech)技术领域,尤其涉及越权漏洞检测方法、装置统、设备及计算机程序产品。
背景技术
随着计算机技术的发展,越来越多的技术(大数据、分布式、区块链Blockchain、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,但由于金融行业的安全性、实时性要求,也对越权漏洞检测技术提出了更高的要求。
随着近期爆发的各种高危漏洞,网络安全问题引起了越来越多的关注。越权漏洞,Web应用程序中一种常见的安全漏洞,是指由于程序员疏忽,没有对某个操作所需的权限/用户进行严格的限制,导致本应没有操作权限的用户可正常进行操作,其威胁在于一个账户即可控制全站用户数据,即攻击者使用一个合法账户,即可对存在越权缺陷漏洞的其他账户数据进行非法的操作,例如查询、***、删除、修改等常规数据库命令。
现有技术中,对于越权漏洞的检测主要是通过人工登录一个账号并修改账号ID,获取不同的账号ID所返回的请求响应数据,通过求取不同响应数据的文本相似度来判断是否存在越权漏洞,该方案需要对响应数据中的每个字符逐一进行比对,当响应数据的数据量比较大时,越权漏洞检测的效率较低。
技术问题
本申请的主要目的在于提出一种越权漏洞检测方法、装置、设备及计算机程序产品,旨在解决现有的越权漏洞检测的效率较低的技术问题。
技术解决方案
为实现上述目的,本申请提供一种越权漏洞检测方法,所述越权漏洞检测方法包括如下步骤:
接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;
通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;
对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;
对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值;
确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。
在一实施例中,所述对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值的步骤包括:
对所述第一分片哈希值进行数据提取,得到第二预设字符长度的第一分片提取哈希值,对所述第一分片提取哈希值进行拼接处理得到第一拼接哈希值,所述预设字符长度小于所述第一分片哈希值的字符长度;
对所述第二分片哈希值进行数据提取,得到第二预设字符长度的第二分片提取哈希值,对所述第二分片提取哈希值进行拼接处理得到第二拼接哈希值。
在一实施例中,所述对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求的步骤包括:
删除所述第一服务请求中的第一身份标识,得到第二服务请求;
和/或,
将所述第一服务请求中的第一身份标识替换为第二身份标识,得到第二服务请求,所述第二身份标识与所述第一身份标识不同。
在一实施例中,所述确定所述第一拼接哈希值和所述第二拼接哈希值的相似度的步骤包括:
计算所述第一拼接哈希值和所述第二拼接哈希值的最少编辑操作次数;
根据所述第一拼接哈希值和所述第二拼接哈希值的字符长度之和,与所述最少编辑操作次数确定所述第一拼接哈希值和所述第二拼接哈希值的相似度。
在一实施例中,所述计算所述第一拼接哈希值和所述第二拼接哈希值的最少编辑操作次数的步骤包括:
根据所述第一拼接哈希值的字符长度、所述第二拼接哈希值的字符长度、所述第一拼接哈希值的字符内容和所述第二拼接哈希值的字符内容,构建编辑操作次数矩阵,并对所述编辑操作次数矩阵进行初始化赋值;
按照预设编辑操作次数公式循环计算所述编辑操作次数矩阵中各矩阵元素对应的编辑操作次数;所述预设编辑操作次数公式为:
dp[i,j]=min(dp[i-1,j]+1,dp[i,j-1]+1,dp[i-1,j-1]+temp) ,
其中,dp[i,j]为编辑操作次数矩阵中第i行、第j列的矩阵元素对应的编辑操作次数;
dp[i-1,j]为编辑操作次数矩阵中第i-1行、第j列的矩阵元素对应的编辑操作次数;
dp[i,j-1]为编辑操作次数矩阵中第i行、第j-1列的矩阵元素对应的编辑操作次数;
dp[i-1,j-1]为编辑操作次数矩阵中第i-1行、第j-1列的矩阵元素对应的编辑操作次数;
若矩阵中第i行、第j列的矩阵元素所对应的两个字符相同,则temp=0;若矩阵中第i行、第j列的矩阵元素所对应的两个字符不相同,则temp=1;
根据各所述矩阵元素对应的编辑操作次数确定最少编辑操作次数。
在一实施例中,所述根据所述相似度确定所述待检测***是否存在越权漏洞的步骤包括:
若所述相似度大于或等于预设相似度阈值,确定所述待检测***存在越权漏洞;
若所述相似度小于预设相似度阈值,确定所述待检测***不存在越权漏洞。
在一实施例中,所述接收对待检测***的包括第一身份标识的第一服务请求的步骤之后,还包括:
确定所述第一服务请求是否涉及敏感信息;
若是,则执行步骤:对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求。
此外,为实现上述目的,本申请还提供一种越权漏洞检测装置,所述越权漏洞检测装置包括:
身份标识修改模块,用于接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;
请求执行模块,用于通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;
分片哈希模块,用于对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;
哈希拼接模块,用于对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值
越权确定模块,用于确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。
此外,为实现上述目的,本申请还提供一种越权漏洞检测设备,所述越权漏洞检测设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的越权漏洞检测程序,所述越权漏洞检测程序被所述处理器执行时实现如上所述的越权漏洞检测方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机存储介质,所述计算机存储介质上存储有越权漏洞检测程序,所述越权漏洞检测程序被处理器执行时实现如上所述的越权漏洞检测方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机程序产品,所述计算机程序产品包括越权漏洞检测程序,所述越权漏洞检测程序被处理器执行时实现如上所述的越权漏洞检测方法的步骤。
有益效果
本申请通过接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值;确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。一方面通过对响应数据的哈希值进行相似度比对,提升了相似对比对的效率,进而提升了越权漏洞检测的效率;另一方面,通过对响应数据进行分片处理,根据得到的分片数据的哈希值再进行相似度比对,实现了在保证越权漏洞检测精度的前提下,提升越权漏洞检测的效率。
附图说明
图1是本申请实施例方案涉及的硬件运行环境的越权漏洞检测设备结构示意图;
图2为本申请越权漏洞检测方法第一实施例的流程示意图;
图3为本申请越权漏洞检测装置的模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
如图1所示,图1是本申请实施例方案涉及的硬件运行环境的越权漏洞检测设备结构示意图。
本申请实施例越权漏洞检测设备可以是PC机或服务器设备,其上运行有虚拟机。
如图1所示,该越权漏洞检测设备可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的越权漏洞检测设备结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图1所示,作为一种计算机存储介质的存储器1005中可以包括操作***、网络通信模块、用户接口模块以及越权漏洞检测程序。
在图1所示的越权漏洞检测设备中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端(用户端),与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的越权漏洞检测程序,并执行下述越权漏洞检测方法中的操作。
基于上述硬件结构,提出本申请越权漏洞检测方法实施例。
参照图2,图2为本申请越权漏洞检测方法第一实施例的流程示意图,所述方法包括:
步骤S10,接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;
本实施例越权漏洞检测方法运用于越权漏洞检测设备中,越权漏洞检测设备可以是终端、机器人或者PC设备。
现有技术中,对于越权漏洞的检测主要是通过人工登录一个账号并修改账号ID,获取不同的账号ID所返回的请求响应数据,通过求取不同响应数据的文本相似度来判断是否存在越权漏洞,该方案需要对响应数据中的每个字符逐一进行比对,当响应数据的数据量比较大时,越权漏洞检测的效率较低。
在此背景下,本实施例提供了一种越权漏洞检测方案,一方面通过对响应数据的哈希值进行相似度比对,提升了相似对比对的效率,进而提升了越权漏洞检测的效率;另一方面,通过对响应数据进行分片处理,根据得到的分片数据的哈希值再进行相似度比对,实现了在保证越权漏洞检测精度的前提下,提升越权漏洞检测的效率。
在本实施例中,身份标识指的是用于表明服务请求的发起者身份的信息,身份标识可以为cookie或用户账户标识等中的至少一种。其中,cookie指的是储存在用户本地终端上的数据,是一个保存在客户机中的简单的文本文件,这个文件与特定的Web文档关联在一起,保存了该客户机访问这个Web 文档时的信息(例如用户个人信息),当客户机再次访问这个 Web 文档时,这些信息可供该Web文档使用。
本实施例中,越权漏洞检测设备会对访问待检测***的第一服务请求进行收集,在收集到第一服务请求后,对该第一服务请求中的身份标识进行修改,请求中的其他内容保持不变,得到第二服务请求。
进一步地,对第一服务请求中的身份标识进行修改的方式包括删除和/或替换两种处理方式,删除指的是将第一服务请求中的第一身份标识删除,保留请求中的其他内容,得到第二服务请求;替换指的是将第一服务请求中的第一身份标识,替换为与第一身份标识不同的第二身份标识,得到第二服务请求。其中,第一身份标识用于标识第一用户的身份信息,第二身份标识用于标识第二用户的身份信息,该第一用户和该第二用户为两个在该待检测***中具有不同操作权限的合法用户。
步骤S20,通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;
可以理解的是,本实施例不对第二服务请求的生成和第一服务请求的执行先后顺序进行限制,即,在接收到第一服务请求后,可以先生成第二服务请求再执行第一服务请求,也可以先执行第一服务请求再生成第二服务请求,还可以二者同时执行。
进一步地,在执行第一服务请求得到对应的第一响应数据后,可以确定第一响应数据的字符长度是否大于预设字符长度阈值,若否,说明第一响应数据的字符长度较短,不会显著影响越权漏洞检测的速度,可以将第一响应数据与第二响应数据直接进行相似度比对,无需进行分片和哈希;若是,说明第一响应数据的字符长度较短,直接将第一响应数据与第二响应数据进行相似度比对,其计算速度会显著降低,则执行步骤S30。如此,可以根据响应数据的字符长度,动态选择检测速度较快的方案。
步骤S30,对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;
在得到第一服务请求和第二服务请求后,通过待检测***执行第一服务请求和第二服务请求,分别得到第一服务请求对应的第一响应数据,第二服务请求对应的第二响应数据。通常在进行越权漏洞检测时,是直接将第一响应数据与第二响应数据直接进行相似度比对,根据相似度比对结果确定待检测***是否存在越权漏洞,但这种比对方式在响应数据的字符长度较长时,会产生巨大的工作量,且效率较低。
为避免这种情况,本实施例在得到响应数据之后,会对响应数据进行哈希运算,将任意长度的响应数据转换为固定长度的哈希值,以在后续步骤中根据响应数据的哈希值进行相似度比对,以减少相似度计算的工作量;进一步地,由于哈希运算具有输入变动敏感性,即输入的原始数据哪怕出现极其微小的变动,输出的哈希值也会出现巨大的变化,因此,若直接根据响应数据的哈希值进行相似度比对,即使第一响应数据和第二响应数据只有微小差异,由于二者的哈希值有较大差异,因此,根据二者的哈希值确定的相似度无法反映第一响应数据和第二响应数据的真实相似度,故而本实施例对响应数据先进行分片处理,即,按照第一预设字符长度对响应数据进行拆分,将响应数据拆分为若干个分片数据。
其中,第一预设字符长度由管理人员根据越权漏洞检测精度需求和越权漏洞检测效率需求进行设置,可以理解的是,第一预设字符长度越大,越权漏洞检测精度越低,检测效率越高;第一预设字符长度越小,越权漏洞检测精度越高,检测效率越低。
在得到第一响应数据和第二响应数据各自的分片数据后,分别对各分片数据进行哈希运算,得到第一响应数据的各分片数据的哈希值,即第一分片哈希值,以及第二响应数据的各分片数据的哈希值,即第二分片哈希值。其中,哈希运算的算法具体可以为MD5(Message Digest Algorithm MD5,消息摘要算法),或者其他散列函数算法,例如MD4、SHA1、SHA-224、SHA-256、SHA-384和SHA-512等中的至少一种。
步骤S40,对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值;
在本实施例中,在得到第一响应数据对应的第一分片哈希值后,按照第一分片哈希值对应的分片数据在第一响应数据中的位置进行拼接,得到第一拼接哈希值;在得到第二响应数据对应的第二分片哈希值后,按照第二分片哈希值对应的分片数据在第二响应数据中的位置进行拼接,得到第二拼接哈希值。
步骤S50,确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。
在本实施例中,在得到第一拼接哈希值和第二拼接哈希值后,即可计算二者的相似度,二者的相似度越高,存在越权漏洞的倾向性越高,二者的相似度越低,存在越权漏洞的倾向性越低,故可根据越权漏洞检测的精度要求,设置一区分越权漏洞存在与否的临界相似度阈值,即预设相似度阈值,若相似度大于或等于预设相似度阈值,确定待检测***存在越权漏洞;若相似度小于预设相似度阈值,确定待检测***不存在越权漏洞。
进一步地,若第一服务请求为A,对第一服务请求中的身份标识进行删除和替换得到第二服务请求B和C,则按照前述实施例,根据A和B的响应数据计算A对应的拼接哈希值与B对应的拼接哈希值的相似度,根据A和C的响应数据计算A对应的拼接哈希值与C对应的拼接哈希值的相似度,若这两个相似度中存在一者大于或等于预设相似度阈值,确定待检测***存在越权漏洞;若这两个相似度均小于预设相似度阈值,则确定待检测***不存在越权漏洞。
进一步地,若确定待检测***存在越权漏洞,则可输出越权漏洞告警。其中,越权漏洞告警中包括待检测***的标识信息、第一拼接哈希值和第二拼接哈希值的相似度中的一种或多种。
进一步地,所述输出越权漏洞告警的步骤具体可以包括:根据相似度的大小确定对应的告警等级,根据所确定的告警等级输出对应等级的越权漏洞告警。
本实施例通过接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值;确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。本实施例一方面通过对响应数据的哈希值进行相似度比对,提升了相似对比对的效率,进而提升了越权漏洞检测的效率;另一方面,通过对响应数据进行分片处理,根据得到的分片数据的哈希值再进行相似度比对,实现了在保证越权漏洞检测精度的前提下,提升越权漏洞检测的效率。
进一步地,基于上述实施例,提出本申请越权漏洞检测方法第二实施例。
上述步骤S40包括:
步骤S41,对所述第一分片哈希值进行数据提取,得到第二预设字符长度的第一分片提取哈希值,对所述第一分片提取哈希值进行拼接处理得到第一拼接哈希值,所述预设字符长度小于所述第一分片哈希值的字符长度;
步骤S42,对所述第二分片哈希值进行数据提取,得到第二预设字符长度的第二分片提取哈希值,对所述第二分片提取哈希值进行拼接处理得到第二拼接哈希值。
在本实施例中,为进一步提升越权漏洞检测效率,在得到分片哈希值后,按照第二预设字符长度对分片哈希值进行数据提取,得到字符长度为第二预设字符长度的分片提取哈希值,再对分片提取哈希值进行拼接,以缩短拼接哈希值的字符长度。可以理解的是,第二预设字符长度小于分片哈希值的字符长度;对第一分片哈希值和第二分片哈希值采用的数据提取方式相同。
其中,该数据提取方式可以为取各分片哈希值预设指定位置和第二预设字符长度的字符串,例如,取分片哈希值头部或尾部12位的字符串作为分片提取哈希值。可以理解的是,第二预设字符长度由管理人员根据越权漏洞检测精度需求和越权漏洞检测效率需求进行设置,第二预设字符长度越大,越权漏洞检测精度越高,检测效率越低;第一预设字符长度越小,越权漏洞检测精度越低,检测效率越高。
在本实施例中,通过对分片哈希值进行数据提取,再对提取到的分片提取哈希值进行拼接,能够缩短拼接哈希值的字符长度,从而提升相似度计算的速度,进而提升越权漏洞检测的效率。
进一步地,基于上述实施例,提出本申请越权漏洞检测方法第三实施例。
在上述步骤S50中,所述确定所述第一拼接哈希值和所述第二拼接哈希值的相似度的步骤包括:
步骤S51,计算所述第一拼接哈希值和所述第二拼接哈希值的最少编辑操作次数;
步骤S52,根据所述第一拼接哈希值和所述第二拼接哈希值的字符长度之和,与所述最少编辑操作次数确定所述第一拼接哈希值和所述第二拼接哈希值的相似度。
在本实施例中,提供了一种根据最少编辑操作次数计算相似度的方案,具体为,首先确定第一拼接哈希值和第二拼接哈希值的最少编辑操作次数dp[m,n],再确定第一拼接哈希值和第二拼接哈希值的字符长度之和m+n,则相似度为dp[m,n]/(m+n)。
进一步地,上述步骤S51包括:
步骤S511,根据所述第一拼接哈希值的字符长度、所述第二拼接哈希值的字符长度、所述第一拼接哈希值的字符内容和所述第二拼接哈希值的字符内容,构建编辑操作次数矩阵,并对所述编辑操作次数矩阵进行初始化赋值;
步骤S512,根据所述第一拼接哈希值的字符长度、所述第二拼接哈希值的字符长度、所述第一拼接哈希值的字符内容和所述第二拼接哈希值的字符内容,构建编辑操作次数矩阵,并对所述编辑操作次数矩阵进行初始化赋值;
按照预设编辑操作次数公式循环计算所述编辑操作次数矩阵中各矩阵元素对应的编辑操作次数;所述预设编辑操作次数公式为:
dp[i,j]=min(dp[i-1,j]+1,dp[i,j-1]+1,dp[i-1,j-1]+temp) ,
其中,dp[i,j]为编辑操作次数矩阵中第i行、第j列的矩阵元素对应的编辑操作次数;
dp[i-1,j]为编辑操作次数矩阵中第i-1行、第j列的矩阵元素对应的编辑操作次数;
dp[i,j-1]为编辑操作次数矩阵中第i行、第j-1列的矩阵元素对应的编辑操作次数;
dp[i-1,j-1]为编辑操作次数矩阵中第i-1行、第j-1列的矩阵元素对应的编辑操作次数;
若矩阵中第i行、第j列的矩阵元素所对应的两个字符相同,则temp=0;若矩阵中第i行、第j列的矩阵元素所对应的两个字符不相同,则temp=1;
步骤S513,根据各所述矩阵元素对应的编辑操作次数确定最少编辑操作次数。
本实施例为确定最少编辑操作次数的具体过程。首先,创建一个编辑操作次数矩阵,设第一拼接哈希值和第二拼接哈希值的字符长度的字符串的长度分别是m和n,那么,编辑操作次数矩阵的维度为(m+1)*(n+1),将第一拼接哈希值和第二拼接哈希值分别填入第一行和第一列,得到下表1所示的矩阵(设第一拼接哈希值为ABCD,第二拼接哈希值为ACD);
    A B C D
           
A          
C          
D          
表1
对表1对应的矩阵进行初始化赋值,使各拼接哈希值的各字符均有对应的定位字符,得到表2所示的矩阵;
    A B C D
  0 1 2 3 4
A 1        
C 2        
D 3        
表2
再按照预设编辑操作次数公式,从矩阵的左上角遍历到右下角,循环计算表2中的各矩阵元素对应的编辑操作次数,得到表3所示的矩阵,则最少编辑操作次数dp[m,n]为1。该预设编辑操作次数公式为dp[i,j]=min(dp[i-1,j]+1,dp[i,j-1]+1,dp[i-1,j-1]+temp) ,其中,dp[i,j]指的是矩阵中第i行、第j列的矩阵元素对应的编辑操作次数;dp[i-1,j]指的是矩阵中第i-1行、第j列的矩阵元素对应的编辑操作次数;dp[i,j-1]指的是矩阵中第i行、第j-1列的矩阵元素对应的编辑操作次数;dp[i-1,j-1]指的是矩阵中第i-1行、第j-1列的矩阵元素对应的编辑操作次数;关于temp,若矩阵中第i行、第j列的矩阵元素所对应的两个字符相同,则temp=0,若矩阵中第i行、第j列的矩阵元素所对应的两个字符不相同,则temp=1。
    A B C D
  0 1 2 3 4
A 1 0 1 2 3
C 2 1 1 1 2
D 3 2 2 2 1
表3
在本实施例中,通过根据最少编辑操作次数确定相似度,能够降低文本相似度计算的复杂度,进而提升越权漏洞检测的效率。
进一步地,在计算第一拼接哈希值和第二拼接哈希值相似度时,还可以采用其他相似度计算方法,例如余弦相似度算法等。
进一步地,在上述步骤S10中,所述接收对待检测***的包括第一身份标识的第一服务请求的步骤之后,还包括:
确定所述第一服务请求是否涉及敏感信息;
若是,则执行步骤:对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求。
在本实施例中,在接收到包括第一身份标识的第一服务请求后,对该第一服务请求进行解析,获取该第一服务请求的请求内容,确定该请求内容中是否包括手机号码、邮箱、账号密码、银行***或身份证号码等敏感信息,若是,则表明需要对该请求对应的待检测***进行越权漏洞检测,以防止敏感信息被非法用户获取;若否,则可以不进行越权漏洞检测。
本实施例设置了越权漏洞检测的自动触发条件,使得越权漏洞检测方案能够在满足触发条件时自动执行,从而使越权漏洞检测更加灵活和高效。
本申请还提供一种越权漏洞检测装置,参照图3,所述越权漏洞检测装置包括:
身份标识修改模块10,用于接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;
请求执行模块20,用于通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;
分片哈希模块30,用于对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;
哈希拼接模块40,用于对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值
越权确定模块50,用于确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。
在一实施例中,所述分片哈希模块,还用于:
对所述第一分片哈希值进行数据提取,得到第二预设字符长度的第一分片提取哈希值,对所述第一分片提取哈希值进行拼接处理得到第一拼接哈希值,所述预设字符长度小于所述第一分片哈希值的字符长度;
对所述第二分片哈希值进行数据提取,得到第二预设字符长度的第二分片提取哈希值,对所述第二分片提取哈希值进行拼接处理得到第二拼接哈希值。
在一实施例中,所述身份标识修改模块,还用于:
删除所述第一服务请求中的第一身份标识,得到第二服务请求;
和/或,
将所述第一服务请求中的第一身份标识替换为第二身份标识,得到第二服务请求,所述第二身份标识与所述第一身份标识不同。
在一实施例中,所述越权确定模块,还用于:
计算所述第一拼接哈希值和所述第二拼接哈希值的最少编辑操作次数;
根据所述第一拼接哈希值和所述第二拼接哈希值的字符长度之和,与所述最少编辑操作次数确定所述第一拼接哈希值和所述第二拼接哈希值的相似度。
在一实施例中,所述越权确定模块,还用于:
根据所述第一拼接哈希值的字符长度、所述第二拼接哈希值的字符长度、所述第一拼接哈希值的字符内容和所述第二拼接哈希值的字符内容,构建编辑操作次数矩阵,并对所述编辑操作次数矩阵进行初始化赋值;
按照预设编辑操作次数公式循环计算所述编辑操作次数矩阵中各矩阵元素对应的编辑操作次数;所述预设编辑操作次数公式为:
dp[i,j]=min(dp[i-1,j]+1,dp[i,j-1]+1,dp[i-1,j-1]+temp) ,
其中,dp[i,j]为编辑操作次数矩阵中第i行、第j列的矩阵元素对应的编辑操作次数;
dp[i-1,j]为编辑操作次数矩阵中第i-1行、第j列的矩阵元素对应的编辑操作次数;
dp[i,j-1]为编辑操作次数矩阵中第i行、第j-1列的矩阵元素对应的编辑操作次数;
dp[i-1,j-1]为编辑操作次数矩阵中第i-1行、第j-1列的矩阵元素对应的编辑操作次数;
若矩阵中第i行、第j列的矩阵元素所对应的两个字符相同,则temp=0;若矩阵中第i行、第j列的矩阵元素所对应的两个字符不相同,则temp=1;
根据各所述矩阵元素对应的编辑操作次数确定最少编辑操作次数。
在一实施例中,所述越权确定模块,还用于:
若所述相似度大于或等于预设相似度阈值,确定所述待检测***存在越权漏洞;
若所述相似度小于预设相似度阈值,确定所述待检测***不存在越权漏洞。
在一实施例中,所述身份标识修改模块,还用于:
确定所述第一服务请求是否涉及敏感信息;
若是,则执行步骤:对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求。
上述各程序单元所执行的方法可参照本申请越权漏洞检测方法各个实施例,此处不再赘述。
本申请还提供一种越权漏洞检测设备,越权漏洞检测设备包括:存储器、处理器及存储在存储器上并可在处理器上运行的越权漏洞检测程序,越权漏洞检测程序被处理器执行时所实现的方法可参照本申请越权漏洞检测方法各个实施例,此处不再赘述。
本申请还提供一种计算机存储介质。
本申请计算机存储介质上存储有越权漏洞检测程序,所述越权漏洞检测程序被处理器执行时实现如上所述的越权漏洞检测方法的步骤。
其中,在所述处理器上运行的越权漏洞检测程序被执行时所实现的方法可参照本申请越权漏洞检测方法各个实施例,此处不再赘述。
本申请还提供一种计算机程序产品。
本申请计算机程序产品包括越权漏洞检测程序,所述越权漏洞检测程序被处理器执行时实现如上所述的越权漏洞检测方法的步骤。
其中,在所述处理器上运行的越权漏洞检测程序被执行时所实现的方法可参照本申请越权漏洞检测方法各个实施例,此处不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者***不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者***所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者***中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (10)

  1. 一种越权漏洞检测方法,其中,所述越权漏洞检测方法包括:
    接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;
    通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;
    对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;
    对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值;
    确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。
  2. 如权利要求1所述的越权漏洞检测方法,其中,所述对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值的步骤包括:
    对所述第一分片哈希值进行数据提取,得到第二预设字符长度的第一分片提取哈希值,对所述第一分片提取哈希值进行拼接处理得到第一拼接哈希值,所述预设字符长度小于所述第一分片哈希值的字符长度;
    对所述第二分片哈希值进行数据提取,得到第二预设字符长度的第二分片提取哈希值,对所述第二分片提取哈希值进行拼接处理得到第二拼接哈希值。
  3. 如权利要求1所述的越权漏洞检测方法,其中,所述对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求的步骤包括:
    删除所述第一服务请求中的第一身份标识,得到第二服务请求;
    和/或,
    将所述第一服务请求中的第一身份标识替换为第二身份标识,得到第二服务请求,所述第二身份标识与所述第一身份标识不同。
  4. 如权利要求1所述的越权漏洞检测方法,其中,所述确定所述第一拼接哈希值和所述第二拼接哈希值的相似度的步骤包括:
    计算所述第一拼接哈希值和所述第二拼接哈希值的最少编辑操作次数;
    根据所述第一拼接哈希值和所述第二拼接哈希值的字符长度之和,与所述最少编辑操作次数确定所述第一拼接哈希值和所述第二拼接哈希值的相似度。
  5. 如权利要求4所述的越权漏洞检测方法,其中,所述计算所述第一拼接哈希值和所述第二拼接哈希值的最少编辑操作次数的步骤包括:
    根据所述第一拼接哈希值的字符长度、所述第二拼接哈希值的字符长度、所述第一拼接哈希值的字符内容和所述第二拼接哈希值的字符内容,构建编辑操作次数矩阵,并对所述编辑操作次数矩阵进行初始化赋值;
    按照预设编辑操作次数公式循环计算所述编辑操作次数矩阵中各矩阵元素对应的编辑操作次数;所述预设编辑操作次数公式为:
    dp[i,j]=min(dp[i-1,j]+1,dp[i,j-1]+1,dp[i-1,j-1]+temp) ,
    其中,dp[i,j]为编辑操作次数矩阵中第i行、第j列的矩阵元素对应的编辑操作次数;
    dp[i-1,j]为编辑操作次数矩阵中第i-1行、第j列的矩阵元素对应的编辑操作次数;
    dp[i,j-1]为编辑操作次数矩阵中第i行、第j-1列的矩阵元素对应的编辑操作次数;
    dp[i-1,j-1]为编辑操作次数矩阵中第i-1行、第j-1列的矩阵元素对应的编辑操作次数;
    若矩阵中第i行、第j列的矩阵元素所对应的两个字符相同,则temp=0;若矩阵中第i行、第j列的矩阵元素所对应的两个字符不相同,则temp=1;
    根据各所述矩阵元素对应的编辑操作次数确定最少编辑操作次数。
  6. 如权利要求1所述的越权漏洞检测方法,其中,所述根据所述相似度确定所述待检测***是否存在越权漏洞的步骤包括:
    若所述相似度大于或等于预设相似度阈值,确定所述待检测***存在越权漏洞;
    若所述相似度小于预设相似度阈值,确定所述待检测***不存在越权漏洞。
  7. 如权利要求1所述的越权漏洞检测方法,其中,所述接收对待检测***的包括第一身份标识的第一服务请求的步骤之后,还包括:
    确定所述第一服务请求是否涉及敏感信息;
    若是,则执行步骤:对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求。
  8. 一种越权漏洞检测装置,其中,所述越权漏洞检测装置包括:
    身份标识修改模块,用于接收对待检测***的包括第一身份标识的第一服务请求,对所述第一服务请求中的第一身份标识进行修改,得到第二服务请求;
    请求执行模块,用于通过所述待检测***执行所述第一服务请求和所述第二服务请求,得到所述第一服务请求对应的第一响应数据和所述第二服务请求对应的第二响应数据;
    分片哈希模块,用于对所述第一响应数据和所述第二响应数据分别进行分片处理,对分片处理得到的各分片数据进行哈希运算,得到所述第一响应数据对应的第一分片哈希值和所述第二应数据对应的第二分片哈希值;
    哈希拼接模块,用于对所述第一分片哈希值进行拼接处理得到第一拼接哈希值,对所述第二分片哈希值进行拼接处理得到第二拼接哈希值
    越权确定模块,用于确定所述第一拼接哈希值和所述第二拼接哈希值的相似度,根据所述相似度确定所述待检测***是否存在越权漏洞。
  9. 一种越权漏洞检测设备,其中,所述越权漏洞检测设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的自定义图表生成程序,所述自定义图表生成程序被所述处理器执行时实现如权利要求1至7中任一项所述的越权漏洞检测方法的步骤。
  10. 一种计算机程序产品,其中,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的越权漏洞检测方法的步骤。
PCT/CN2021/134315 2021-06-28 2021-11-30 越权漏洞检测方法、装置、设备及计算机程序产品 WO2023273139A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110722722.8 2021-06-28
CN202110722722.8A CN113452710B (zh) 2021-06-28 2021-06-28 越权漏洞检测方法、装置、设备及计算机程序产品

Publications (1)

Publication Number Publication Date
WO2023273139A1 true WO2023273139A1 (zh) 2023-01-05

Family

ID=77813550

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/134315 WO2023273139A1 (zh) 2021-06-28 2021-11-30 越权漏洞检测方法、装置、设备及计算机程序产品

Country Status (2)

Country Link
CN (1) CN113452710B (zh)
WO (1) WO2023273139A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117807575A (zh) * 2024-01-02 2024-04-02 广州优加市场调研有限公司 一种基于云计算的访员管理方法及***
CN118041700A (zh) * 2024-04-12 2024-05-14 江西曼荼罗软件有限公司 一种医疗知识分发方法及***

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113452710B (zh) * 2021-06-28 2022-12-27 深圳前海微众银行股份有限公司 越权漏洞检测方法、装置、设备及计算机程序产品
CN114244581B (zh) * 2021-11-29 2024-03-29 西安四叶草信息技术有限公司 缓存中毒漏洞检测方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107508839A (zh) * 2017-09-28 2017-12-22 ***股份有限公司 一种控制web***越权访问的方法和装置
CN111125718A (zh) * 2019-12-24 2020-05-08 北京三快在线科技有限公司 越权漏洞的检测方法、装置、设备及存储介质
CN112115475A (zh) * 2020-08-05 2020-12-22 杭州数梦工场科技有限公司 越权漏洞的检测方法、装置、存储介质及计算机设备
US20210099490A1 (en) * 2015-10-28 2021-04-01 Qomplx, Inc. Privilege assurance of enterprise computer network environments
CN113452710A (zh) * 2021-06-28 2021-09-28 深圳前海微众银行股份有限公司 越权漏洞检测方法、装置、设备及计算机程序产品

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577949A (zh) * 2017-09-05 2018-01-12 郑州云海信息技术有限公司 一种Web越权漏洞检测方法与***
CN110719173B (zh) * 2019-09-18 2022-04-12 平安科技(深圳)有限公司 一种信息处理方法及装置
CN111416811B (zh) * 2020-03-16 2022-07-22 携程旅游信息技术(上海)有限公司 越权漏洞检测方法、***、设备及存储介质
CN112217835B (zh) * 2020-10-23 2022-11-04 中国工商银行股份有限公司 报文数据的处理方法、装置、服务器和终端设备
CN112612810A (zh) * 2020-12-23 2021-04-06 贝壳技术有限公司 慢sql语句识别方法及***
CN112818371A (zh) * 2021-02-23 2021-05-18 建信金融科技有限责任公司 资源访问控制方法、***、装置、设备及介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210099490A1 (en) * 2015-10-28 2021-04-01 Qomplx, Inc. Privilege assurance of enterprise computer network environments
CN107508839A (zh) * 2017-09-28 2017-12-22 ***股份有限公司 一种控制web***越权访问的方法和装置
CN111125718A (zh) * 2019-12-24 2020-05-08 北京三快在线科技有限公司 越权漏洞的检测方法、装置、设备及存储介质
CN112115475A (zh) * 2020-08-05 2020-12-22 杭州数梦工场科技有限公司 越权漏洞的检测方法、装置、存储介质及计算机设备
CN113452710A (zh) * 2021-06-28 2021-09-28 深圳前海微众银行股份有限公司 越权漏洞检测方法、装置、设备及计算机程序产品

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117807575A (zh) * 2024-01-02 2024-04-02 广州优加市场调研有限公司 一种基于云计算的访员管理方法及***
CN118041700A (zh) * 2024-04-12 2024-05-14 江西曼荼罗软件有限公司 一种医疗知识分发方法及***

Also Published As

Publication number Publication date
CN113452710B (zh) 2022-12-27
CN113452710A (zh) 2021-09-28

Similar Documents

Publication Publication Date Title
WO2023273139A1 (zh) 越权漏洞检测方法、装置、设备及计算机程序产品
US9450883B2 (en) Managing redirected website login using a short address
US11088828B2 (en) Blockchain-based data evidence storage method and apparatus
US8656494B2 (en) System and method for optimization of antivirus processing of disk files
CN106576051B (zh) 一种检测零日威胁的方法、网络设备、非暂态机器可读介质
CN104680064A (zh) 利用文件指纹来优化文件的病毒扫描的方法和***
US20200412740A1 (en) Methods, devices and systems for the detection of obfuscated code in application software files
WO2024021577A1 (zh) 防篡改的数据保护方法及***
WO2021258789A1 (zh) 一种恶意软件识别的方法、***、设备及可读存储介质
WO2021174882A1 (zh) 数据分片校验方法、装置、计算机设备及可读存储介质
WO2023231681A1 (zh) 账号创建方法、物联网多租户***、设备、程序和介质
CN112600864A (zh) 一种验证码校验方法、装置、服务器及介质
CN115242436B (zh) 一种基于命令行特征的恶意流量检测方法及***
CN116055067A (zh) 一种弱口令检测的方法、装置、电子设备及介质
CN113746805B (zh) 一种用户身份识别方法、***、计算机设备及存储介质
CN115001768A (zh) 基于区块链的数据交互方法、装置、设备及存储介质
Moreaux et al. Blockchain assisted near-duplicated content detection
CN115242608A (zh) 告警信息的生成方法、装置、设备及存储介质
CN113360575A (zh) 联盟链中交易数据的监管方法、装置、设备及存储介质
CN113722307A (zh) 敏感数据处理方法、装置、电子设备和存储介质
CN112883422A (zh) 基于协议分析的数据库访问控制方法、装置及服务器
CN112800463B (zh) 信息处理方法、装置及***
CN115630409B (zh) 一种数据的存储控制方法及装置
CN114095239B (zh) 分片登录方法及装置
CN117201053B (zh) 一种基于视频安全的传输和存储的方法和***

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21948065

Country of ref document: EP

Kind code of ref document: A1