Method for preventing agent bypassing, detection device and access system
By detecting the operating system and application configuration of the host, determining whether to use a proxy connection, and sending information to the access platform to block the access of the host, the problem of access failure caused by the proxy server is solved and the security of the access system is improved. and effectiveness.
Patent Information
- Application Number
- CN202310169120.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Proxy servers may cause access failures in computer networks. When users access the external network through a proxy, the proxy server masks the true source, leading to bypass detection problems.
By detecting the host's operating system, application and network configuration, it determines whether to use a proxy connection. If a proxy configuration or proxy process is found, information is sent to the access platform to block the host's access.
It effectively prevents hosts from bypassing the admission system as a proxy, improves the effectiveness of admission, reduces security risks, and prevents unauthorized hosts from making external connections through proxies.
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network and information security technology, and in particular relates to a method for preventing a host from bypassing an access system through a proxy, a device for detecting whether a host has a proxy, and an access system applying the method and the device. Background Art
[0002] In computer networking, a proxy server is a server-side application that acts as an intermediary between a client requesting a resource and the server providing that resource. Rather than connecting directly to a server that can fulfill the resource request, the client directs the request to the proxy server, which evaluates the request and performs the desired network transaction.
[0003] Users can use a network proxy to access the external network through a proxy server (forward proxy). The proxy server works on behalf of the client when requesting services, which may mask the true source of the request to the resource server, thereby invalidating the access. This brings trouble to proxy bypass prevention. Therefore, it is necessary to study the implementation of the proxy and how to implement proxy bypass prevention. Summary of the invention
[0004] Based on the above background, the present invention aims to propose a method, a detection device and an access system for preventing proxy bypass, and the specific technical scheme is described as follows.
[0005] In a first aspect, a method for preventing proxy bypass is provided, comprising: When it is detected that the host meets any of the following conditions, it is determined that the host uses a proxy to connect to the network: there is a proxy configuration item in the global configuration of the host operating system, there is a proxy configuration item in the specific application of the host, the host uses automatic proxy configuration, and there is a proxy client process on the host; When it is detected that the host meets any of the following conditions, the host is judged to be connected to the network as a proxy: there is a proxy server process on the host, the host is scanned to have a proxy protocol port, and the proxy service protocol and port are detected using nmap when the host is connected to the network; If the host is detected to meet at least one of the above conditions, the access of the current host is blocked by sending information to the access platform to obtain preset processing instructions.
[0006] The host uses automatic proxy configuration, including: The host is detected to use PAC (Proxy auto-config).
[0007] Furthermore, the global configuration of the operating system has a proxy configuration item, including: if the host is a Windows system, the registry information has a proxy server configuration item; if the host is a Linux system, the system has a global variable for proxy service settings.
[0008] The specific application has a proxy configuration, including: the configuration information of the application in the preset list has the proxy server IP and port information.
[0009] Furthermore, determining whether the host uses a proxy to connect to the network also includes: the host's access client actively sends a data packet to the access platform, the packet's payload contains the host's real IP address, the access platform compares the IP address with the IP source address resolved by the network layer, if they are different, it means that the host uses a proxy.
[0010] As a better method, it also includes capturing and analyzing the host network data packets, querying the host's real IP in the http header "HTTP_X_FORWARDED_FOR" field, and comparing it with the source IP obtained by network layer resolution. If there is inconsistency, it means that the host uses a proxy.
[0011] In a second aspect, a network proxy detection device is provided, the device comprising: Information acquisition module, used to capture data packets and obtain system network configuration, process, and application information; A judgment module, used to judge whether the acquired information contains agent-related content; The processing module is used to make preset processing actions according to the judgment results.
[0012] Preferably, the judging module judges whether the acquired information contains agent-related content, including: When it is detected that the host meets any of the following conditions, it is determined that the host uses a proxy to connect to the network: there is a proxy configuration item in the global configuration of the host operating system, a specific application has a proxy configuration item, the host uses automatic proxy configuration, and there is a proxy client process on the host; When it is detected that the host meets any of the following conditions, the host is judged to be connected to the network as a proxy: there is a proxy server process on the host, the host is scanned to have a proxy protocol port, and the proxy service protocol and port are detected using nmap when the host is connected to the network; If the judgment module detects that the host uses a proxy or connects to the network as a proxy, the handling module sends information to the access platform to obtain a preset processing instruction, thereby blocking the access of the current host.
[0013] According to a third aspect, a network access system is provided, which includes a terminal and a server, wherein the terminal includes an access client having the module as described above, and the server includes a platform for accessing a host on which the terminal is installed.
[0014] When the access client detects that the host of an admitted user uses a proxy to access the Internet or acts as a proxy server to provide proxy services for other hosts that are not admitted, it sends information to the access platform, and the platform performs a preset processing action on the host.
[0015] The present invention adopting the above technical scheme has at least the following beneficial effects: a plurality of items to be detected in the host are obtained by installing an access client on the host, and judging whether the items to be detected meet the conditions specified in the rules according to preset detection rules, so as to determine whether the host is connected to the network through a proxy or as a proxy. If a proxy is detected, the access client sends the detection result to the access platform, and the access platform performs a forced blocking operation on the host using the proxy or acting as a proxy, which can prevent the admitted host from acting as a proxy to provide connection services for other non-admitted hosts or the admitted host from bypassing the access platform through the proxy to connect externally, which is beneficial to improving the effectiveness of access and reducing security risks. Implementation
[0016] In order to make the objectives, technical solutions and advantages of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below.
[0017] For ease of understanding, the terms involved in the embodiments of the present invention are explained below: When a user uses a proxy to access a website, the client and server first establish a connection. When the client wants to send a network request, the request is first transmitted to the proxy server, and after a series of processing by the proxy server, the request is sent to the destination website. The information returned by the website is also transmitted to the user by the proxy server. This is a way to simplify or control the complexity of requests, while also providing additional benefits such as load balancing, privacy, or security.
[0018] There are two types of proxies: forward proxies and reverse proxies.
[0019] (1) Forward proxy: users use proxy servers to access target servers. The main uses are: accessing illegal pages (non-permitted hosts use the proxy servers of permitted hosts to access the Internet illegally) and accelerating access (online game accelerators).
[0020] (2) Reverse proxy: The server uses a proxy server to provide services to users. The reverse proxy hides the real server. When we request http: / / www.baidu.com, there are thousands of servers behind us serving us. What the reverse proxy server does for us is to forward our requests to the real server. The commonly used ngnix is a high-performance reverse proxy server that can be used to achieve load balancing.
[0021] There are three types of client-side proxy Internet access, namely using system settings, in-application settings, and using proxy clients. At the same time, we can also use automatic proxy configuration to select different proxy servers by ourselves.
[0022] In a first aspect, a method for preventing proxy bypass is provided, comprising: When it is detected that the host meets any of the following conditions, it is determined that the host uses a proxy to connect to the network: there is a proxy configuration item in the global configuration of the host operating system, there is a proxy configuration item for a specific application of the host, the host uses automatic proxy configuration, and there is a proxy client process on the host.
[0023] The global configuration of the operating system has proxy configuration items, including: if the host is a Windows system, the registry information has proxy server configuration items, specifically "ProxyEnable" is closed, and "ProxyServer" includes the proxy protocol, server address, and port; if the host is a Linux system, the system has global variables for proxy service settings.
[0024] Specific applications have proxy configurations, including: the configuration information of the applications in the preset list has the proxy server IP and port information. For example, the proxy configuration of the Firefox browser is stored in the prefs.js file in the "%APPDATA%\Mozilla\Firefox\Profiles" directory.
[0025] The host uses automatic proxy configuration, including: detecting that the host uses PAC (Proxy auto-config). Proxy auto-configuration is a web browser technology that defines how the browser should automatically select an appropriate proxy server to access a URL. For example, use proxy server A when accessing https: / / www.baidu.com, use proxy server B when accessing https: / / www.taobao.com, and connect directly without using a proxy server when accessing other URLs. A pac file contains a JavaScript function "FindProxyForUrl(url, host)", which returns a string containing one or more access rules. The user agent uses a specific proxy or direct access based on these rules. These rules also have priorities. When a high-priority rule cannot be accessed, a low-priority rule (if it exists) provides an alternative access method. The browser will first access this PAC file before accessing a web page. The URL in the PAC file may be manually configured or automatically configured through the web page's network proxy automatic discovery protocol.
[0026] The host has proxy client processes, including obtaining whether the following common proxy clients exist in the current system processes: Proxifier, Proxycap, Redsocks, SocksCap64, OpenText, Socks Client, WinDivert, FreeCap, Proximac, etc.
[0027] As a preferred implementation, the above-mentioned determination of whether the host uses a proxy to connect to the network also includes: the host's access client actively sends a data packet to the access platform, the payload of the packet contains the host's real IP address, the access platform compares the IP address with the IP source address resolved by the network layer, if they are different, it means that the host uses a proxy.
[0028] When it is detected that the host meets any of the following conditions, the host is judged to be connected to the network as a proxy: there is a proxy server process on the host, the host is scanned to have a proxy protocol port, and the proxy service protocol and port are detected using nmap when the host is connected to the network; Common proxy protocols include http, http, ftp, socks, etc., and the corresponding ports are 808, 2121, 1080.
[0029] The host has a proxy server process, including obtaining whether the following common proxy servers exist in the current system process: CCProxy, WinGate, Squid, nginx, etc. Common proxy protocols include HTTP Proxy, Scoks Proxy, etc.
[0030] If the host is detected to be using a proxy or acting as a proxy, the access of the current host is blocked by sending information to the access platform to obtain preset processing instructions.
[0031] As a preferred implementation, an embodiment of the present invention for preventing proxy bypass also includes capturing and analyzing host network data packets, querying the host's real IP in the http header "HTTP_X_FORWARDED_FOR" field, and comparing it with the source IP obtained by network layer resolution. If there is inconsistency, it means that the host uses a proxy.
[0032] In a second aspect, a network proxy detection device is provided, the device comprising: Information acquisition module, used to capture data packets and obtain system network configuration, process, and application information; A judgment module, used to judge whether the acquired information contains agent-related content; The processing module is used to make preset processing actions according to the judgment results.
[0033] Preferably, the judging module judges whether the acquired information contains agent-related content, including: When it is detected that the host meets any of the following conditions, it is determined that the host uses a proxy to connect to the network: there is a proxy configuration item in the global configuration of the host operating system, a specific application has a proxy configuration item, the host uses automatic proxy configuration, and there is a proxy client process on the host; When it is detected that the host meets any of the following conditions, the host is judged to be connected to the network as a proxy: there is a proxy server process on the host, the host is scanned to have a proxy protocol port, and the proxy service protocol and port are detected using nmap when the host is connected to the network; If the judgment module detects that the host uses a proxy or connects to the network as a proxy, the handling module sends information to the access platform to obtain a preset processing instruction, thereby blocking the access of the current host.
[0034] According to a third aspect, a network access system is provided, which includes a terminal and a server, wherein the terminal includes an access client having the module as described above, and the server includes a platform for accessing a host on which the terminal is installed.
[0035] When the access client detects that the host of an admitted user uses a proxy to access the Internet or acts as a proxy server to provide proxy services for other hosts that are not admitted, it sends information to the access platform, and the platform performs a preset processing action on the host.
[0036] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc.
[0037] According to the technical solution of the embodiment of the present invention as described above, a plurality of items to be detected in the host are obtained by installing an access client on the host, and judging whether the items to be detected meet the conditions specified in the rules according to preset detection rules, thereby determining whether the host is connected to the network through a proxy or as a proxy. If a proxy is detected, the access client sends the detection result to the access platform, and the access platform performs a forced blocking operation on the host using the proxy or acting as a proxy, which can prevent the admitted host from acting as a proxy to provide connection services for other non-admitted hosts or the admitted host from bypassing the access platform through the proxy for external connection, which is conducive to improving the effectiveness of access and reducing security risks.
[0038] The above description of the above disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the broadest scope consistent with the principles disclosed herein.
Claims
1. An access method for preventing proxy bypass, characterized in that: include: When it is detected that the host meets any of the following conditions, it is determined that the host uses a proxy to connect to the network: there is a proxy configuration item in the global configuration of the host operating system, there is a proxy configuration item in the specific application of the host, the host uses automatic proxy configuration, and there is a proxy client process on the host; When it is detected that the host meets any of the following conditions, the host is judged to be connected to the network as a proxy: there is a proxy server process on the host, the host is scanned to have a proxy protocol port, and the proxy service protocol and port are detected using nmap when the host is connected to the network; If the host is detected to meet at least one of the above conditions, the access of the current host is blocked by sending information to the access platform to obtain preset processing instructions.
2. The access method according to claim 1, characterized in that: The global configuration of the operating system has a proxy configuration item, including: if the host is a Windows system, the registry information has a proxy server configuration item; if the host is a Linux system, the system has a global variable for proxy service settings.
3. The access method according to claim 1, characterized in that: The specific application has a proxy configuration, including: the configuration information of the application in the preset list has the proxy server IP and port information.
4. The access method according to claim 1, characterized in that: The host uses automatic proxy configuration, including: detecting that the host uses PAC (Proxy auto-config).
5. The access method according to claim 1, characterized in that: The method of determining whether the host uses a proxy to connect to the network also includes: the host's access client actively sends a data packet to the access platform, the payload of the packet includes the host's real IP address, the access platform compares the IP address with the IP source address resolved by the network layer, if they are different, it means that the host uses a proxy.
6. The access method according to claim 1, characterized in that: Capture and analyze the host network data packets, query the host's real IP in the "HTTP_X_FORWARDED_FOR" field of the http header, and compare it with the source IP obtained by network layer analysis. If they are inconsistent, it means that the host uses a proxy.
7. A network proxy detection device, characterized in that: The device comprises: Information acquisition module, used to capture data packets and obtain system network configuration, process, and application information; A judgment module, used to judge whether the acquired information contains agent-related content; The processing module is used to make preset processing actions according to the judgment results.
8. The proxy detection device according to claim 7, characterized in that: The judging module judges whether the acquired information contains agent-related content, including: When it is detected that the host meets any of the following conditions, it is determined that the host uses a proxy to connect to the network: there is a proxy configuration item in the global configuration of the host operating system, a specific application has a proxy configuration item, the host uses automatic proxy configuration, and there is a proxy client process on the host; When it is detected that the host meets any of the following conditions, the host is judged to be connected to the network as a proxy: there is a proxy server process on the host, the host is scanned to have a proxy protocol port, and the proxy service protocol and port are detected using nmap when the host is connected to the network; If the judgment module detects that the host uses a proxy or connects to the network as a proxy, the handling module sends information to the access platform to obtain a preset processing instruction, thereby blocking the access of the current host.
9. A network access system, characterized in that: The system includes a terminal and a server, wherein the terminal includes an access client having the module as claimed in claim 7 or 8, and the server includes a platform for accessing a host on which the terminal is installed.
10. The admission system according to claim 9, characterized in that: When the access client detects that the host of an admitted user uses a proxy to access the Internet or acts as a proxy server to provide proxy services for other hosts that are not admitted, it sends information to the access platform, and the platform performs a preset processing action on the host.
