Access request processing method and related device
By intercepting the client's access request and judging the legitimacy of the interface address, the problem of difficulty in intercepting overright attacks in the prior art is solved, and the effect of improving server data security is achieved.
Patent Information
- Application Number
- CN202411738936.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The existing technology is difficult to intercept overright attacks in a timely and effective manner, resulting in security problems in data resources in the server.
By intercepting the client's access request to the server, determine the target user and the target interface address, obtain the historical interface address of the target user's last access, obtain the interface jump data of the historical interface address from the code database, and determine whether the target interface address belongs to the candidate interface address of the historical interface address. If it does not belong, the access request will be intercepted.
It realizes timely and effectively intercepts overright attacks, and improves the security of data resources in the server.
Smart Images

Figure CN119544346A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an access request processing method and related devices. Background Art
[0002] With the continuous development of network technology, unauthorized attacks on servers are increasing.
[0003] The so-called unauthorized attack behavior refers to an attacker trying to access data resources in the server that the attacker does not have permission to access. For example, only administrators have access to certain business interfaces in the server, and ordinary users do not have access rights, so they naturally cannot access these business interfaces. However, attackers who are not administrators can access these business interfaces through other illegal means. The traditional way to solve unauthorized attacks is mainly to manually check the relevant codes of the server to reduce the security vulnerabilities in the code. However, manual checking of code vulnerabilities has a lag and cannot fully check all security vulnerabilities, so it is impossible to intercept unauthorized attacks in a timely and effective manner, resulting in security issues in the data resources in the server. Summary of the invention
[0004] In view of the above problems, the present application provides an access request processing method and related devices, which can timely and effectively intercept access requests belonging to unauthorized attacks and improve the data security in the server.
[0005] On the one hand, the present application provides an access request processing method, applied to a server, comprising:
[0006] Intercepting an access request sent by a client to the server, and determining a target user who initiates the access request and a target interface address to be accessed by the access request;
[0007] Obtain the historical interface address corresponding to the historical interface last accessed by the target user;
[0008] Determine, from the interface jump data corresponding to different interface addresses stored in the code database, historical interface jump data corresponding to the historical interface address, the historical interface jump data including: at least one candidate interface address to which the historical interface address can jump;
[0009] If the target interface address does not belong to the at least one candidate interface address corresponding to the historical interface address, the access request is intercepted.
[0010] In yet another possible implementation, the method further includes:
[0011] If the target interface address belongs to at least one candidate interface address corresponding to the historical interface address, the access request is determined to be a legitimate access request, and in response to the access request, the historical interface address corresponding to the historical interface last accessed by the target user is updated to the target interface address.
[0012] In yet another possible implementation, the method further includes:
[0013] If there is no historical interface address corresponding to the historical interface last accessed by the target user, determine that the access request is a legitimate access request, respond to the access request, and store the target interface address as the historical interface address corresponding to the historical interface last accessed by the target user.
[0014] In yet another possible implementation, determining a target user who initiates the access request and a target interface address to be accessed by the access request includes:
[0015] Obtaining a user identifier of a target user and an address of a target interface to be accessed carried in the access request;
[0016] The obtaining of the historical interface address corresponding to the historical interface last accessed by the target user includes:
[0017] The last interface access information corresponding to the user ID of the target user is queried from the last interface access information corresponding to different user IDs, wherein the last interface access information corresponding to the user ID of the target user includes the historical interface address corresponding to the historical interface last accessed by the target user.
[0018] In another possible implementation, the interface jump data corresponding to different interface addresses in the code database is obtained in the following manner:
[0019] Get the project source code uploaded by the user;
[0020] Determine at least one interface address in the project source code, a page file of at least one access page, and a page list corresponding to the interface address, wherein the page list includes a page identifier of at least one access page to which the interface address can jump;
[0021] For each access page, determining, based on a page file of the access page, a first interface address list to which the access page can be linked, the first interface address list comprising at least one interface address to which the access page can be linked;
[0022] For each interface address, based on the page identifier of at least one access page to which the interface address can jump and at least one interface address to which each access page can be linked, a second interface address list to which the interface address can jump is determined, and the second interface address list is determined as the interface jump data corresponding to the interface address, and the second interface address list includes at least one interface address.
[0023] In yet another possible implementation, the determining at least one interface address in the project source code, at least one page file of an access page, and a page list corresponding to the interface address includes:
[0024] Parsing a syntax tree corresponding to the project source code using an abstract syntax tree algorithm, wherein the syntax tree includes nodes corresponding to different elements in the project source code;
[0025] Based on the node representing the interface address in the syntax tree, at least one interface address included in the project source code is determined, and a list of pages to which the interface address can jump is extracted from the project source code;
[0026] Based on the nodes representing the access pages in the syntax tree, a page file of at least one access page included in the project source code is determined.
[0027] In yet another possible implementation, while or after intercepting the access request, the method further includes:
[0028] An unauthorized access reminder is sent to the client of the target user, where the unauthorized access reminder is used to prompt the target user that he does not have the authority to access the target interface address.
[0029] In yet another possible implementation, the method further includes:
[0030] It is detected that the communication connection between the client and the server is disconnected, and the historical interface address corresponding to the historical interface last accessed by the target user stored in the server is deleted.
[0031] In another aspect, the present application further provides an access request processing device, applied to a server, comprising:
[0032] A request interception unit, used to intercept an access request sent by a client to the server, and determine a target user who initiates the access request and a target interface address to be accessed by the access request;
[0033] An information obtaining unit, used to obtain a historical interface address corresponding to the historical interface last visited by the target user;
[0034] A jump determination unit, configured to determine historical interface jump data corresponding to the historical interface address from interface jump data corresponding to different interface addresses stored in a code database, wherein the historical interface jump data includes at least one candidate interface address to which the historical interface address can jump;
[0035] The request interception unit is used to intercept the access request if the target interface address does not belong to at least one candidate interface address corresponding to the historical interface address.
[0036] In another aspect, the present application further provides a server, comprising: a processor and a memory;
[0037] The processor is used to execute the access request processing method as described in any one of the above;
[0038] The memory is used to store programs required for the processor to perform operations.
[0039] From the above content, it can be seen that after the server receives the access request, this application will intercept the access request sent by the client to the server, and determine the target user who initiated the access request and the target interface address to be accessed by the access request. On this basis, considering that the target user has accessed the historical interface last time, the interface address to be accessed by the access request legally initiated by the target user can only be the interface address that the historical interface address corresponding to the historical interface can jump to. Therefore, if the target interface address to be accessed by the access request does not belong to the interface address that the historical interface address that the target user last accessed can jump to, then it can be determined that the access request belongs to an unauthorized attack, so that the unauthorized attack can be intercepted in a timely and reliable manner, thereby improving the security of data resources in the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0041] Figure 1 A flowchart of the access request processing method provided by this application;
[0042] Figure 2 A schematic diagram of another flow chart of the access request processing method provided by the present application;
[0043] Figure 3 A schematic diagram of an implementation flow of determining interface jump data corresponding to different interface addresses in a code database in this application;
[0044] Figure 4 A schematic diagram of an implementation framework of the access request processing method of the present application;
[0045] Figure 5 A schematic diagram of the structure of an access request processing device provided by the present application;
[0046] Figure 6 A schematic diagram of the composition architecture of the server provided for this application. DETAILED DESCRIPTION
[0047] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0048] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0049] like Figure 1 , shows a flow chart of the access request processing method provided by the present application. The method of this embodiment can be applied to a server, which can provide business services corresponding to multiple interface functions. The method of this embodiment may include:
[0050] S101, intercepting an access request sent by a client to a server, and determining a target user initiating the access request and a target interface address to be accessed by the access request.
[0051] For example, in one possible implementation, the present application may add an interception code on the server side, intercept access requests to the server through the interception code, and perform subsequent processing to analyze and intercept unauthorized attacks on the access requests.
[0052] The target user is the user who initiates an access request to the server through the client. The target interface address to be accessed by the access request is the interface address to be accessed indicated by the access request. It is understandable that the interface address requested to be accessed by the access request will be different depending on the timing when the client of the target user initiates the access request. The interface address requested to be accessed by the access request can point to any page in the server, which is determined according to the actual access situation and is not limited to this.
[0053] For example, the access request may carry the user ID of the target user initiating the access request and the target interface address to be accessed by the access request. On this basis, after intercepting the access request, the user ID of the target user carried in the access request and the target interface address to be accessed may be obtained.
[0054] S102, obtaining a historical interface address corresponding to the historical interface last accessed by the target user.
[0055] The historical interface address corresponding to the historical interface last accessed by the target user is the interface address last accessed by the target user before obtaining the access request. For the sake of distinction, the interface last accessed by the target user is called the historical interface, and the address of the historical interface is called the historical interface address.
[0056] It is understandable that the historical interface address accessed by the target user last time may be stored in the server at the same time or after the server responds to the historical access request initiated by the target user last time.
[0057] It is understandable that in order to enable the target user to access different interfaces in the server, the target user needs to log in to the server through the client, that is, the target user establishes a communication connection with the server through the client. On the basis of the target user's client establishing a communication connection with the server, the target user can initiate different access requests to the server, and the interface that the target user can access will be related to the page address that the target user last visited. Based on this, the historical interface that the target user last visited and the access request initiated by the target user are both implemented based on the communication connection currently established between the target user's client and the server.
[0058] S103, determining historical interface jump data corresponding to the historical interface address from the interface jump data corresponding to different interface addresses stored in the code database.
[0059] The interface jump data corresponding to each interface address may include at least one interface address to which the interface address can jump. Correspondingly, the historical interface jump data includes: at least one interface address to which the historical interface address can jump. For ease of distinction, the interface address to which the historical interface address can jump is referred to as a candidate interface address.
[0060] It is understandable that one interface address may be associated with multiple access pages. For example, if the interface address is an interface address for implementing password or identity authentication, the interface address may be associated with a main page for successful server login and a failure prompt page for password or identity authentication failure. Each access page associated with the interface address may have one or more link addresses, and each link address corresponds to an interface address to which the access page can jump.
[0061] Based on this, in any access page associated with the interface address, the user can only access the interface address that the access page can jump to, and cannot access other interface addresses that the access page cannot jump to. In other words, under the premise that the user legally accesses the server, if the user accesses a certain interface address, the user can only access a certain interface address that can be jumped to by the interface address next time.
[0062] The code database is a database used to implement code management and version control, etc. Based on this, the code database at least stores project source codes corresponding to the service business that can be provided by the server.
[0063] In the present application, the code database also stores interface jump data corresponding to different interface addresses, and the interface jump data corresponding to each interface address can be obtained in advance based on the project source code analysis stored in the code database. There are many possibilities for the specific implementation of analyzing the interface jump data corresponding to each interface address based on the project source code, and the present application does not impose any restrictions on this.
[0064] In a possible implementation, the interface jump data corresponding to the interface address may be an interface jump state machine, and the interface jump state machine corresponding to the interface address is configured with at least one interface address to which the interface address can jump.
[0065] S104: If the target interface address does not belong to at least one candidate interface address corresponding to the historical interface address, intercept the access request.
[0066] As can be seen from the above introduction, under the premise that the interface address last accessed by the target user is a historical interface address, if the target user legally initiates an access request, then the target interface address requested to be accessed in the access request can only be one of the candidate interface addresses to which the historical interface address can jump. On the contrary, if the target interface address does not belong to at least one of the candidate interface addresses corresponding to the historical interface address, it means that the target interface address requested to be accessed by the access request is not an interface address that the target user can legally access, that is, it means that the access request is an unauthorized attack access, and thus the access request needs to be intercepted.
[0067] The purpose of intercepting the access request is to make the server no longer respond to the access request. For example, intercepting the access request may be discarding the access request. Of course, there may be other processing methods, which are not limited.
[0068] Furthermore, while or after intercepting the access request, the present application may also send an unauthorized reminder to the client of the target user, where the unauthorized reminder is used to prompt the target user that he does not have the authority to access the target interface address.
[0069] From the above content, it can be seen that after the server receives the access request, this application will intercept the access request sent by the client to the server, and determine the target user who initiated the access request and the target interface address to be accessed by the access request. On this basis, considering that the target user has accessed the historical interface last time, the interface address to be accessed by the access request legally initiated by the target user can only be the interface address that the historical interface address corresponding to the historical interface can jump to. Therefore, if the target interface address to be accessed by the access request does not belong to the interface address that the historical interface address that the target user last accessed can jump to, then it can be determined that the access request belongs to an unauthorized attack, so that the unauthorized attack can be intercepted in a timely and reliable manner, thereby improving the security of data resources in the server.
[0070] It is understandable that if the target interface address belongs to at least one candidate interface address corresponding to the historical interface address, then the access request can be determined to be a legitimate access request, and on this basis, the server can respond to the access request. The specific processing that the server may perform in response to the access request may vary depending on the access request, and there is no restriction on this. For example, the interception program may transmit the access request to the corresponding service program in the server, and the service program may process the access request.
[0071] Furthermore, in order to be able to determine whether the next access request initiated by the user is an unauthorized function, if the target interface address belongs to at least one candidate interface address corresponding to the historical interface address, while responding to the access request or after, the present application will also update the historical interface address corresponding to the historical interface last accessed by the target user to the target interface address corresponding to the access request.
[0072] It is understandable that if the server does not contain the historical interface address corresponding to the historical interface that the target user last accessed, it means that the currently intercepted access request is the first access request initiated after the client establishes a communication connection with the server. In this case, since the first access request initiated by the client is generally an access request to log in to the server or to perform identity authentication, and the interface addresses requested by these access requests are not associated with more important data resources in the server, it can be considered that the access request is a legal or safe access request.
[0073] Correspondingly, if there is no historical interface address corresponding to the historical interface that the target user last accessed, it can be determined that the access request is a legitimate access request, and the access request is responded to.
[0074] Furthermore, in order to determine whether other access requests initiated by the target user after the access request constitute an unauthorized attack, if there is no historical interface address corresponding to the historical interface last accessed by the target user, the present application will also store the target interface address as the historical interface address corresponding to the historical interface last accessed by the target user while or after responding to the access request.
[0075] The following uses an implementation as an example to introduce the access request processing method provided by this application. Figure 2 , shows another flow chart of the access request processing method provided by the present application. The method of this embodiment may include:
[0076] S201, intercepting an access request sent by a client to a server, and obtaining a user identifier of a target user and an address of a target interface to be accessed carried in the access request.
[0077] The user identification of the target user is used to uniquely identify the target user. For example, the user identification of the target user can be the user name of the target user or a hash value of the user name, etc., without limitation.
[0078] S202, query whether there is the last interface access information corresponding to the user identifier of the target user from the last interface access information corresponding to different user identifiers, if yes, execute step S203; if not, execute step S206.
[0079] The last interface access information corresponding to the user identification of the target user includes a historical interface address corresponding to the historical interface last accessed by the target user.
[0080] For example, the last interface access information may include: a user identifier of a target user; and a historical interface address corresponding to the historical interface that the target user last accessed.
[0081] S203, if the last interface access information corresponding to the user identification of the target user is queried, based on the historical interface address in the last interface access information, determine the historical interface jump data corresponding to the historical interface address from the interface jump data corresponding to different interface addresses stored in the code database.
[0082] The historical interface jump data includes: at least one candidate interface address that can be jumped to by the historical interface address.
[0083] For example, the code database stores interface jump state machines corresponding to different interface addresses. On this basis, the interface jump state machine corresponding to the historical interface address can be determined, and the interface jump state machine is configured with at least one candidate interface address to which the historical interface address can jump.
[0084] S204: If the target interface address does not belong to at least one candidate interface address corresponding to the historical interface address, intercept the access request.
[0085] S205, if the target interface address belongs to at least one candidate interface address corresponding to the historical interface address, determine that the access request is a legitimate access request, respond to the access request, and store the target interface address as the last interface access information corresponding to the user identifier of the target user.
[0086] It is understandable that after obtaining the user ID of the target user and the target interface address to be accessed by the access request, the user ID of the target user and the target interface address can be determined as the current interface access information. On this basis, while or after responding to the access request, the current interface access information can be stored as the previous interface access information, that is, the previous interface access information is updated as the current interface access information.
[0087] S206, if there is no last interface access information corresponding to the user ID of the target user, determine that the access request is a legitimate access request, respond to the access request, and store the target interface address as the last interface access information corresponding to the user ID of the target user.
[0088] For this step, please refer to the related introduction of the previous embodiment and will not be described in detail again.
[0089] It is understandable that in any of the above embodiments of the present application, after the communication connection between the client of the target user and the server is disconnected, if the client of the target user subsequently initiates a request to the client again, it is necessary to re-establish the communication connection between the client and the server. Then, the access request initiated by the client is the first access request after the communication connection is established, and naturally there will be no historical interface address of the last access. Based on this, in order to avoid misjudgment, when it is detected that the communication connection between the client and the server is disconnected, the historical interface address corresponding to the historical interface last accessed by the target user stored in the server is deleted.
[0090] It is understandable that there are many possibilities for the specific implementation of generating interface jump data corresponding to different interface addresses in the code database in the present application. An implementation is described below by taking one implementation as an example.
[0091] like Figure 3 , shows a schematic diagram of an implementation process of determining interface jump data corresponding to different interface addresses in a code database in the present application. The method of this embodiment may include:
[0092] S301, obtaining the project source code uploaded by the user.
[0093] Among them, the project source code is the source code corresponding to the service program that the server needs to run to implement the corresponding service.
[0094] S302, determining at least one interface address in the source code of the project, at least one page file of an access page, and a page list corresponding to each interface address.
[0095] The page list includes a page identifier of at least one access page to which the interface address can jump.
[0096] It can be understood that the project source code may include the interface address of the interface that the service program can provide, the page file resource path information related to each interface address, and the page file corresponding to the access page that the service program can display. Therefore, by parsing the project source file, the interface address and the page file of the access page can be extracted from the project source file, and the page list corresponding to each interface address can be determined.
[0097] For example, in one possible implementation, an Abstract Syntax Tree (AST) algorithm can be used to parse a syntax tree corresponding to the source code of the project. The syntax tree includes nodes corresponding to different elements in the source code of the project. The elements in the source code of the project may include, but are not limited to, elements such as pages and interfaces contained in the source code of the project. On this basis, based on the nodes representing the interface addresses in the syntax tree, at least one interface address included in the source code of the project can be determined, and a list of pages to which each interface address can jump can be extracted from the source code of the project.
[0098] Similarly, based on the node representing the access page in the syntax tree, the page file of at least one access page included in the source code of the project can be determined. The access page included in the source code of the project can be determined through the syntax tree, and the storage location of the page text corresponding to the access page can also be obtained, so that the page file in the access page can be extracted. Among them, the page file of the access page can include the code related to the access page, so the page file can include information of at least one interface address that can be linked to in the access page.
[0099] Among them, by parsing the classes, methods and statements in the project source code through the AST algorithm, a syntax tree of the project source code can be constructed, and the specific process of constructing the syntax tree is not restricted.
[0100] S303: For each access page, based on the page file of the access page, determine a first interface address list to which the access page can be linked.
[0101] The first interface address list includes at least one interface address to which the access page can be linked.
[0102] For the sake of distinction, the interface address list to which the access page can be linked is referred to as a first interface address list, and the interface address list to which a subsequent interface address can jump is referred to as a second interface address list.
[0103] As described above, the page file of the access page may include the interface addresses to which the access request can be linked. Therefore, based on the page file, a first interface address list consisting of the interface addresses to which the access page can be linked can naturally be determined.
[0104] For example, an entry tool and an analysis tool may be run in the code database, and the entry tool and the analysis tool are different programs respectively. The entry tool may obtain a page list of each interface address and at least one interface address list to which each access page can be linked based on the target source code, and send the page list of each interface address and the first interface address list of each access page to the analysis tool so that the analysis tool executes step S304 to determine a second interface address list to which each interface address can jump.
[0105] S304, for each interface address, based on the page identifier of at least one access page to which the interface address can jump and at least one interface address to which each access page can be linked, determine a list of second interface addresses to which the interface address can jump, and list the second interface addresses as the interface jump data corresponding to the interface address.
[0106] The second interface address list includes at least one interface address.
[0107] It is understandable that after the page identifiers of the access pages that each interface address can jump to are determined, for each page identifier of the access page that the interface access address can jump to, at least one interface address that the access request can link to can be determined based on the page identifier of the access page, thereby obtaining at least one interface address that the interface address can jump to based on the access page. On this basis, all the access pages that the interface address can jump to, each of which can jump to the interface address, constitute the second interface address list.
[0108] It is understandable that after determining the interface jump data of each interface address, the present application can also send a release confirmation request to the developer's terminal, and the release confirmation request is used to request the developer to confirm whether to release the interface jump data of each interface address. After receiving the release confirmation instruction sent by the developer's terminal, the interface jump data corresponding to each interface address is stored in the code database, so as to analyze whether the access request belongs to an unauthorized attack based on the interface jump data of each interface address.
[0109] Understandably, Figure 3 This is only one implementation method of determining the interface jump data corresponding to each interface address in the art. Other implementation methods of analyzing the project source code to determine the interface jump data corresponding to each interface address are also applicable to this embodiment.
[0110] To understand the complete implementation of this application, please refer to Figure 4 , Figure 4 A schematic diagram of the implementation framework of the solution of the present application is shown.
[0111] Depend on Figure 4It can be seen that after the developer develops the project source code, the project source code can be uploaded to the code database. In the code database, based on the project source code, the code interface information data and the page information data are determined. Among them, the code interface information data can be a list of pages corresponding to each interface address, and the page information data is a list of first interface addresses corresponding to each access page. On this basis, in the code database, based on the page information data and the code interface information data, the data of the interface jump state machine corresponding to each interface address can be determined.
[0112] On this basis, the interface jump state machine corresponding to each interface address can be used as the basis for the interception tool in the server to determine whether the access request of the screenshot is an unauthorized attack. Correspondingly, if the access request is determined to be a normal access request based on the interface jump state machine corresponding to each interface address, the access request can be released; otherwise, the access request that is abnormal will be intercepted.
[0113] On the other hand, the present application also provides an access request processing device.
[0114] like Figure 5 , shows a schematic diagram of a composition structure of an access request processing device provided by the present application. The device of this embodiment can be applied to a server, and the device may include:
[0115] The request interception unit 501 is used to intercept the access request sent by the client to the server, and determine the target user who initiates the access request and the target interface address to be accessed by the access request;
[0116] An information obtaining unit 502 is used to obtain a historical interface address corresponding to the historical interface last accessed by the target user;
[0117] The jump determination unit 503 is used to determine the historical interface jump data corresponding to the historical interface address from the interface jump data corresponding to different interface addresses stored in the code database, wherein the historical interface jump data includes: at least one candidate interface address that can be jumped to by the historical interface address;
[0118] The request interception unit 504 is configured to intercept the access request if the target interface address does not belong to at least one candidate interface address corresponding to the historical interface address.
[0119] In yet another possible implementation, the access request processing device further includes:
[0120] The first response unit is used to determine that the access request is a legitimate access request if the target interface address belongs to at least one candidate interface address corresponding to the historical interface address, respond to the access request, and update the historical interface address corresponding to the historical interface last accessed by the target user to the target interface address.
[0121] In yet another possible implementation, the access request processing device further includes:
[0122] The second response unit is used to determine that the access request is a legitimate access request if there is no historical interface address corresponding to the historical interface last visited by the target user, respond to the access request, and store the target interface address as the historical interface address corresponding to the historical interface last visited by the target user.
[0123] In yet another possible implementation, the request interception unit includes:
[0124] A request interception subunit, used to intercept the access request sent by the client to the server, and obtain the user identifier of the target user and the target interface address to be accessed carried in the access request;
[0125] Information acquisition unit, including:
[0126] The information acquisition subunit is used to query the last interface access information corresponding to the user identifier of the target user from the last interface access information corresponding to different user identifiers, and the last interface access information corresponding to the user identifier of the target user includes the historical interface address corresponding to the historical interface last accessed by the target user.
[0127] In another possible implementation, the device further includes: a jump data determining unit, configured to determine the interface jump data corresponding to different interface addresses in the code database in the following manner:
[0128] Get the project source code uploaded by the user;
[0129] Determine at least one interface address in the project source code, a page file of at least one access page, and a page list corresponding to the interface address, wherein the page list includes a page identifier of at least one access page to which the interface address can jump;
[0130] For each access page, determining, based on a page file of the access page, a first interface address list to which the access page can be linked, the first interface address list including at least one interface address to which the access page can be linked;
[0131] For each interface address, based on the page identifier of at least one access page to which the interface address can jump and at least one interface address to which each access page can be linked, a second interface address list to which the interface address can jump is determined, and the second interface address list is the interface jump data corresponding to the interface address, wherein the second interface address list includes at least one interface address.
[0132] In another possible implementation, when determining at least one interface address in the project source code, at least one page file of an access page, and a page list corresponding to the interface address, the jump data determination unit is specifically configured to:
[0133] Parsing a syntax tree corresponding to the project source code using an abstract syntax tree algorithm, wherein the syntax tree includes nodes corresponding to different elements in the project source code;
[0134] Based on the node representing the interface address in the syntax tree, at least one interface address included in the project source code is determined, and a list of pages to which the interface address can jump is extracted from the project source code;
[0135] Based on the nodes representing the access pages in the syntax tree, a page file of at least one access page included in the project source code is determined.
[0136] In yet another possible implementation, the device further includes:
[0137] The reminder sending unit is used to send an unauthorized reminder to the client of the target user at the same time or after the request interception unit intercepts the access request, and the unauthorized reminder is used to prompt the target user that he does not have the authority to access the target interface address.
[0138] In yet another possible implementation, the device further includes:
[0139] The information deleting unit is used to detect that the communication connection between the client and the server is disconnected, and delete the historical interface address corresponding to the historical interface last visited by the target user stored in the server.
[0140] The present application also provides a server. Figure 6 As shown, it shows a schematic diagram of a composition structure of a server, and the server at least includes a processor 601 and a memory 602;
[0141] The processor 601 is used to execute the access request processing method described in any one of the above embodiments;
[0142] The memory 602 is used to store programs required for the processor to perform operations.
[0143] It can be understood that the electronic device may further include a display unit 603 and an input unit 604 .
[0144] Of course, the electronic device may also have Figure 6 There may be more or fewer components, without limitation.
[0145] A computer program product is also provided in an embodiment of the present application, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any access request processing method provided in the embodiment of the present application.
[0146] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any access request processing method provided in an embodiment of the present application.
[0147] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0148] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0149] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0150] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for processing an access request, characterized in that: Applicable to servers, including: Intercepting an access request sent by a client to the server, and determining a target user who initiates the access request and a target interface address to be accessed by the access request; Obtain the historical interface address corresponding to the historical interface last accessed by the target user; Determine, from the interface jump data corresponding to different interface addresses stored in the code database, historical interface jump data corresponding to the historical interface address, the historical interface jump data including: at least one candidate interface address to which the historical interface address can jump; If the target interface address does not belong to the at least one candidate interface address corresponding to the historical interface address, the access request is intercepted.
2. The access request processing method according to claim 1, characterized in that: Also includes: If the target interface address belongs to at least one candidate interface address corresponding to the historical interface address, the access request is determined to be a legitimate access request, and in response to the access request, the historical interface address corresponding to the historical interface last accessed by the target user is updated to the target interface address.
3. The access request processing method according to claim 1, characterized in that: Also includes: If there is no historical interface address corresponding to the historical interface last accessed by the target user, determine that the access request is a legitimate access request, respond to the access request, and store the target interface address as the historical interface address corresponding to the historical interface last accessed by the target user.
4. The access request processing method according to any one of claims 1 to 3, characterized in that: The determining of the target user initiating the access request and the target interface address to be accessed by the access request includes: Obtaining a user identifier of a target user and an address of a target interface to be accessed carried in the access request; The obtaining of the historical interface address corresponding to the historical interface last accessed by the target user includes: The last interface access information corresponding to the user ID of the target user is queried from the last interface access information corresponding to different user IDs, wherein the last interface access information corresponding to the user ID of the target user includes the historical interface address corresponding to the historical interface last accessed by the target user.
5. The access request processing method according to claim 1, characterized in that: The interface jump data corresponding to different interface addresses in the code database is obtained in the following manner: Get the project source code uploaded by the user; Determine at least one interface address in the project source code, a page file of at least one access page, and a page list corresponding to the interface address, wherein the page list includes a page identifier of at least one access page to which the interface address can jump; For each access page, determining, based on a page file of the access page, a first interface address list to which the access page can be linked, the first interface address list including at least one interface address to which the access page can be linked; For each interface address, based on the page identifier of at least one access page to which the interface address can jump and at least one interface address to which each access page can be linked, a second interface address list to which the interface address can jump is determined, and the second interface address list is determined as the interface jump data corresponding to the interface address, and the second interface address list includes at least one interface address.
6. The access request processing method according to claim 5, characterized in that: The determining of at least one interface address in the project source code, a page file of at least one access page, and a page list corresponding to the interface address includes: Parsing a syntax tree corresponding to the project source code using an abstract syntax tree algorithm, wherein the syntax tree includes nodes corresponding to different elements in the project source code; Based on the node representing the interface address in the syntax tree, at least one interface address included in the project source code is determined, and a list of pages to which the interface address can jump is extracted from the project source code; Based on the nodes representing the access pages in the syntax tree, a page file of at least one access page included in the project source code is determined.
7. The access request processing method according to claim 1, characterized in that: While or after intercepting the access request, the method further includes: An unauthorized access reminder is sent to the client of the target user, where the unauthorized access reminder is used to prompt the target user that he does not have the authority to access the target interface address.
8. The access request processing method according to any one of claims 1 to 3, characterized in that: Also includes: It is detected that the communication connection between the client and the server is disconnected, and the historical interface address corresponding to the historical interface last accessed by the target user stored in the server is deleted.
9. An access request processing device, characterized in that: Applicable to servers, including: A request interception unit, used to intercept an access request sent by a client to the server, and determine a target user who initiates the access request and a target interface address to be accessed by the access request; An information obtaining unit, used to obtain a historical interface address corresponding to the historical interface last visited by the target user; A jump determination unit, configured to determine historical interface jump data corresponding to the historical interface address from interface jump data corresponding to different interface addresses stored in a code database, wherein the historical interface jump data includes at least one candidate interface address to which the historical interface address can jump; The request interception unit is used to intercept the access request if the target interface address does not belong to at least one candidate interface address corresponding to the historical interface address.
10. A server, characterized in that: include: Processor and memory; The processor is used to execute the access request processing method according to any one of claims 1 to 8; The memory is used to store programs required for the processor to perform operations.
Citation Information
Patent Citations
Abnormal access behavior detection method and device, electronic equipment and storage medium
CN108665297A
System access permission granting method and device, server and storage medium
CN111698228A
Intelligent analysis method and system for unauthorized access vulnerabilities
CN117376005A
Multi-core browser and method for intercepting malicious network address in multi-core browser
US20150281262A1