CN110233774A - A kind of Distributed probing method and system of Socks proxy server - Google Patents
A kind of Distributed probing method and system of Socks proxy server Download PDFInfo
- Publication number
- CN110233774A CN110233774A CN201910453811.XA CN201910453811A CN110233774A CN 110233774 A CN110233774 A CN 110233774A CN 201910453811 A CN201910453811 A CN 201910453811A CN 110233774 A CN110233774 A CN 110233774A
- Authority
- CN
- China
- Prior art keywords
- tested
- host
- proxy server
- socks proxy
- module
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims description 12
- 238000001514 detection method Methods 0.000 claims abstract description 147
- 230000004044 response Effects 0.000 claims abstract description 37
- 239000000523 sample Substances 0.000 claims abstract 2
- 238000004458 analytical method Methods 0.000 claims description 10
- 238000004891 communication Methods 0.000 claims description 10
- 238000012546 transfer Methods 0.000 claims description 8
- 238000009826 distribution Methods 0.000 claims description 6
- 238000003860 storage Methods 0.000 claims description 6
- 238000012360 testing method Methods 0.000 claims description 4
- 239000008186 active pharmaceutical agent Substances 0.000 description 7
- 239000003795 chemical substances by application Substances 0.000 description 7
- 230000008859 change Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000013467 fragmentation Methods 0.000 description 3
- 238000006062 fragmentation reaction Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 239000012634 fragment Substances 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- CKRLIWFOVCLXTP-UHFFFAOYSA-N 4-phenyl-1-propyl-3,6-dihydro-2h-pyridine Chemical compound C1N(CCC)CCC(C=2C=CC=CC=2)=C1 CKRLIWFOVCLXTP-UHFFFAOYSA-N 0.000 description 1
- 208000001613 Gambling Diseases 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0695—Management of faults, events, alarms or notifications the faulty arrangement being the maintenance, administration or management system
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明公开了一种Socks代理服务器的分布式探测方法和系统,属于网络资源空间探测领域,包括:若待测主机开放服务,则执行后续步骤;否则,探测结束;将预先构造的基于HTTP协议的GET请求报文通过预设的端口分别发送至待测主机,并获取各端口的响应信息;解析各端口的响应信息,若不包含第一特征字符串且包含第二特征字符串,则判定主机通过对应端口开放了Socks代理服务;否则,判定主机未通过对应端口开放Socks代理服务;若主机通过任意一个端口开放了Socks代理服务,则识别待测主机为Socks代理服务器;否则,识别待测主机为非Socks代理服务器;探测结束。本发明能够有效解决现有的Socks代理服务器探测方法识别率低的问题,并通过分布式探测系统加快了探测速度。
The invention discloses a distributed detection method and system of a Socks proxy server, belonging to the field of network resource space detection, including: if the host to be tested opens the service, then perform subsequent steps; otherwise, the detection ends; The GET request message is sent to the host to be tested through the preset ports, and the response information of each port is obtained; the response information of each port is analyzed, and if the first characteristic string is not included and the second characteristic string is included, then it is determined The host has opened the Socks proxy service through the corresponding port; otherwise, it is determined that the host has not opened the Socks proxy service through the corresponding port; if the host has opened the Socks proxy service through any port, then identify the host to be tested as a Socks proxy server; otherwise, identify the host to be tested The host is a non-Socks proxy server; the probe ends. The invention can effectively solve the problem of low recognition rate of the existing Socks proxy server detection method, and accelerates the detection speed through a distributed detection system.
Description
技术领域technical field
本发明属于网络资源空间探测领域,更具体地,涉及一种Socks代理服务器的分布式探测方法和系统。The invention belongs to the field of network resource space detection, and more specifically relates to a distributed detection method and system of a Socks proxy server.
背景技术Background technique
随着网络社会的快速发展,目前各个行业都在依赖互联网处理相关业务,而且我们日常的聊天、购物、娱乐和学习等活动与网络密切结合,互联网得以与生活息息相关。虽然网络便利了我们的生活,但同时带来的安全性问题不容忽视。With the rapid development of the network society, various industries are relying on the Internet to handle related businesses, and our daily activities such as chatting, shopping, entertainment and learning are closely integrated with the Internet, and the Internet is closely related to our lives. Although the network facilitates our life, but at the same time, the security problems cannot be ignored.
互联网作为开放性很强的领域,目前企业和用户都可以搭建自己的代理服务器,用户通过代理服务器可以获取正常情况下难以访问的资源,比如谷歌学术和YouTobe等,此外,代理服务器一般具有较大缓冲区,可以加快访问网络资源的速度,还可以隐藏自己的隐私信息,基于以上用途,HTTP代理、Telnet代理、PPTP代理、L2TP代理、Socks代理等代理服务器在互联网中取得了广泛的应用。代理服务器在给互联网用户带来便利的同时,也存在一定的安全隐患。许多网络攻击和违法信息传递都是通过违规代理实现的,例如黑客使用代理服务器进行DDoS攻击来隐藏自己的信息,不法分子通过代理服务器进行赌博和诈骗信息传递。因此,研究代理服务器识别方法,不仅对于进一步的使用有重要意义,还可以为网络安全提供技术保障。在众多代理服务器中,Socks代理服务器是目前使用最为广泛的代理服务器,探测难度相对较大,因此,研究Socks代理探测方法,在生产生活中具有重要的意义。The Internet is a highly open field. At present, both enterprises and users can build their own proxy servers. Through proxy servers, users can obtain resources that are difficult to access under normal circumstances, such as Google Scholar and YouTube. In addition, proxy servers generally have relatively large The buffer zone can speed up access to network resources, and can also hide your private information. Based on the above purposes, proxy servers such as HTTP proxy, Telnet proxy, PPTP proxy, L2TP proxy, and Socks proxy have been widely used in the Internet. While proxy servers bring convenience to Internet users, they also have certain security risks. Many network attacks and illegal information transmission are realized through illegal agents. For example, hackers use proxy servers to carry out DDoS attacks to hide their information, criminals use proxy servers for gambling and fraud information transmission. Therefore, the study of proxy server identification method is not only of great significance for further use, but also can provide technical guarantee for network security. Among many proxy servers, Socks proxy server is currently the most widely used proxy server, and its detection is relatively difficult. Therefore, it is of great significance to study Socks proxy detection methods in production and life.
目前,主流的探测工具,如Zmap、ProxyBroker等可以实现对Socks代理服务器的探测,但是,这些探测工是基于Socks协议请求响应包分析方法,仅能识别无账号密码的Socks代理服务器,对于设置了账号和密码的Socks代理服务器,实际探测时,所发送的探测数据包往往被待测主机直接丢弃,获取不到响应信息,进而导致不能有效识别Socks代理服务器。总体而言,现有的Socks代理服务器探测方法的识别率较低。At present, mainstream detection tools, such as Zmap, ProxyBroker, etc., can detect Socks proxy servers. However, these detection tools are based on the Socks protocol request response packet analysis method, and can only identify Socks proxy servers without account passwords. The Socks proxy server with the account number and password, when actually detecting, the detection data packets sent are often directly discarded by the host to be tested, and no response information can be obtained, which leads to the inability to effectively identify the Socks proxy server. Generally speaking, the recognition rate of existing Socks proxy server detection methods is low.
发明内容Contents of the invention
针对现有技术的缺陷和改进需求,本发明提供了一种Socks代理服务器的分布式探测方法和系统,旨在解决现有的Socks代理服务器探测方法识别率低的问题。Aiming at the defects and improvement needs of the prior art, the present invention provides a distributed detection method and system for a Socks proxy server, aiming at solving the problem of low recognition rate of the existing Socks proxy server detection method.
为实现上述目的,按照本发明的第一方面,提供了一种Socks代理服务器的探测方法,用于识别一个ip已知的待测主机是否为Socks代理服务器,包括:For achieving the above object, according to the first aspect of the present invention, a kind of detection method of Socks proxy server is provided, is used to identify whether a known host to be tested of an ip is a Socks proxy server, comprising:
(1)判断待测主机是否开放服务,若是,则转入步骤(2);否则,转入步骤(6);(1) Judging whether the host computer to be tested is open for service, if so, then proceed to step (2); otherwise, proceed to step (6);
(2)在待测主机上预设多个用于建立通信连接的端口;(2) multiple ports for establishing communication connections are preset on the host computer to be tested;
(3)将预先构造的基于HTTP协议的GET请求报文通过预设的各端口分别发送至待测主机,并获取各端口的响应信息;(3) Send the pre-configured GET request message based on the HTTP protocol to the host to be tested through each preset port, and obtain the response information of each port;
(4)解析各端口的响应信息,若其中不包含第一特征字符串,且包含第二特征字符串,则判定待测主机通过对应的端口开放了Socks代理服务;否则,判定待测主机未通过对应的端口开放Socks代理服务;(4) parse the response information of each port, if it does not contain the first characteristic character string, and contains the second characteristic character string, then it is determined that the host computer to be tested has opened the Socks proxy service through the corresponding port; otherwise, it is determined that the host computer to be tested has not Open the Socks proxy service through the corresponding port;
(5)若待测主机通过任意一个端口开放了Socks代理服务,则识别待测主机为Socks代理服务器;否则,识别待测主机为非Socks代理服务器;(5) if the host to be tested has opened the Socks proxy service through any port, then identify the host to be tested as a Socks proxy server; otherwise, identify the host to be tested as a non-Socks proxy server;
(6)探测结束;(6) The detection ends;
其中,第一特征字符串和第二特征字符串均为根据代理特征预收集的字符串,第一特征字符串用于排除其他代理服务器的干扰,第二特征字符串用于识别Socks代理服务器。Wherein, both the first characteristic string and the second characteristic character string are pre-collected character strings according to the proxy characteristics, the first characteristic character string is used to eliminate interference from other proxy servers, and the second characteristic character string is used to identify the Socks proxy server.
本发明基于HTTP协议的GET请求报文进行Socks代理服务器的探测,并根据待测主机端口的响应信息中是否包含特征字符串来识别待测主机是否为Socks代理服务器,由于无论是有账号密码的Socks代理服务器,还是无账号密码的Socks代理服务器,均会相应针对HTTP协议的GET请求报文产生响应信息,因此,本发明既能识别无账号密码的Socks代理服务器,也能够识别有账号密码的Socks代理服务器,从而有效解决了现有的Socks代理服务器探测方法识别率低的问题。The present invention detects the Socks proxy server based on the GET request message of the HTTP protocol, and identifies whether the host to be tested is a Socks proxy server according to whether the response information of the port of the host to be tested contains a characteristic character string. A Socks proxy server or a Socks proxy server without an account password will generate response information correspondingly to the GET request message of the HTTP protocol. Therefore, the present invention can identify both the Socks proxy server without an account password and the one with an account password. The Socks proxy server effectively solves the problem of low recognition rate of the existing Socks proxy server detection method.
进一步地,第一特征字符串为'SSH'、'FTP'、'\xff\xfd\x18\xff\xfd\xff\xfd#\xff\xfd'、'SMTP'或者'HTTP'。Further, the first characteristic string is 'SSH', 'FTP', '\xff\xfd\x18\xff\xfd\xff\xfd#\xff\xfd', 'SMTP' or 'HTTP'.
进一步地,第二特征字符串为'\x05\x00'、'\x00[\x00\x00\x00\x00\x00\x00'或者'www.herokucdn.com'。Further, the second feature string is '\x05\x00', '\x00[\x00\x00\x00\x00\x00\x00' or 'www.herokucdn.com'.
上述第一特征字符串为SSH、FTP、SMTP、HTTP等其他代理服务器针对HTTP协议的GET请求报文产生响应信息中,所特有的字符串;上述第二特征字符串为Socks代理服务器针对HTTP协议的GET请求报文产生响应信息中,所特有的字符串;由于SSH、FTP、SMTP、HTTP等其他代理服务器会对Socks代理服务器的探测产生干扰,本发明仅将不包含上述第一特征字符串且包含第二特征字符串的待测主机识别为Socks代理服务器,在识别Socks代理服务器的过程中,避免了其他代理服务器的干扰,因此本发明的识别精度较高。The above-mentioned first characteristic character string is that other proxy servers such as SSH, FTP, SMTP, HTTP produce the response information for the GET request message of HTTP protocol, the unique character string; The unique character string in the GET request message generation response information; Since other proxy servers such as SSH, FTP, SMTP, HTTP can interfere with the detection of the Socks proxy server, the present invention will only not include the above-mentioned first characteristic character string And the host to be tested containing the second characteristic character string is identified as the Socks proxy server, and the interference of other proxy servers is avoided during the process of identifying the Socks proxy server, so the identification accuracy of the present invention is relatively high.
进一步地,本发明所提供的Socks代理服务器的探测方法,还包括:若识别待测主机为Socks代理服务器,则根据其ip获得待测主机的空间位置,从而实现对Socks代理服务器的物理定位;Further, the detection method of the Socks proxy server provided by the present invention also includes: if the identification host to be tested is a Socks proxy server, then obtain the spatial location of the host to be tested according to its ip, thereby realizing the physical location of the Socks proxy server;
本发明进一步根据ip实现对Socks代理服务器的定位,为针对Socks代理服务器的监管提供了便利。The invention further realizes the positioning of the Socks proxy server according to the IP, and provides convenience for the supervision of the Socks proxy server.
按照本发明的第二方面,提供了一种Socks代理服务器的分布式探测方法,用于识别大规模ip已知的待测主机是否为Socks代理服务器,包括:According to the second aspect of the present invention, a kind of distributed detection method of Socks proxy server is provided, is used to identify whether the known host to be tested of large-scale ip is a Socks proxy server, comprising:
将所有的待测主机划分为多个待测主机集合;Divide all hosts to be tested into multiple host sets to be tested;
对于每一个待测主机集合,利用本发明第一方面提供的Socks代理服务器的探测方法依次对其中的待测主机进行探测,以识别出其中的Socks代理服务器;对所有待测主机集合的探测并行执行。For each set of hosts to be tested, utilize the detection method of the Socks proxy server provided by the first aspect of the present invention to detect the hosts to be tested in turn to identify the Socks proxy server therein; to the detection of all host sets to be tested in parallel implement.
上述Socks代理服务器的分布式探测方法,通过将多个待测主机划分为待测主机集合,使得集合内待测主机的探测串行执行,而多个集合的探测并行执行,由此能够有效提高探测速率。The above-mentioned distributed detection method of the Socks proxy server divides a plurality of hosts to be tested into a set of hosts to be tested, so that the detection of the hosts to be tested in the set is executed serially, and the detection of multiple sets is executed in parallel, thereby effectively improving detection rate.
按照本发明的第三方面,提供了一种Socks代理服务器的探测系统,用于识别一个ip已知的待测主机是否为Socks代理服务器,包括:预判模块、端口设定模块、收发模块、解析模块以及识别模块;According to the third aspect of the present invention, a kind of detection system of Socks proxy server is provided, is used to identify whether a host to be tested known by ip is a Socks proxy server, comprising: pre-judgment module, port setting module, transceiver module, Analysis module and identification module;
预判模块,用于判断待测主机是否开放服务,并在待测主机未开放服务时,结束探测;A pre-judgment module is used to judge whether the host to be tested is open for service, and when the host to be tested is not open for service, end the detection;
端口设定模块,用于在预判模块判定待测主机开放服务时,在待测主机上预设多个用于建立通信连接的端口;The port setting module is used to preset a plurality of ports for establishing communication connections on the host to be tested when the prediction module determines that the host to be tested is open for service;
收发模块,用于将预先构造的基于HTTP协议的GET请求报文通过预设的各端口分别发送至待测主机,并获取各端口的响应信息;The transceiver module is used to send the pre-configured GET request message based on the HTTP protocol to the host to be tested through each preset port, and obtain the response information of each port;
解析模块,用于解析各端口的响应信息,并在响应信息中不包含第一特征字符串,且包含第二特征字符串时,判定待测主机通过对应的端口开放了Socks代理服务;以及在其他情况下,判定待测主机未通过对应的端口开放Socks代理服务;Parsing module, for parsing the response information of each port, and when the response information does not contain the first characteristic character string, and when the second characteristic character string is included, it is determined that the host to be tested has opened the Socks proxy service through the corresponding port; and In other cases, it is determined that the host to be tested has not opened the Socks proxy service through the corresponding port;
识别模块,用于在解析模块判定待测主机通过任意一个端口开放了Socks代理服务时,则识别待测主机为Socks代理服务器;并在其他情况下,识别待测主机为非Socks代理服务器;The identification module is used to identify the host to be tested as a Socks proxy server when the analysis module determines that the host to be tested has opened the Socks proxy service through any port; and in other cases, identify the host to be tested as a non-Socks proxy server;
其中,第一特征字符串和第二特征字符串均为根据代理特征预收集的字符串,第一特征字符串用于排除其他代理服务器的干扰,第二特征字符串用于识别Socks代理服务器。Wherein, both the first characteristic string and the second characteristic character string are pre-collected character strings according to the proxy characteristics, the first characteristic character string is used to eliminate interference from other proxy servers, and the second characteristic character string is used to identify the Socks proxy server.
按照本发明的第四方面,提供了一种Socks代理服务器的分布式探测系统,用于识别大规模ip已知的待测主机是否为Socks代理服务器,包括:数据库、中心调度节点和多个并行的任务执行节点;According to the fourth aspect of the present invention, a kind of distributed detection system of Socks proxy server is provided, is used for identifying whether the host computer to be tested known in large-scale ip is a Socks proxy server, including: database, central scheduling node and multiple parallel task execution node;
中心调度节点,用于将所有的待测主机划分为多个待测主机集合,并将各待测主机集合的探测任务分发给多个不同的任务执行节点,使得各待测主机集合的探测任务并行执行;The central scheduling node is used to divide all the hosts to be tested into multiple host sets to be tested, and distribute the detection tasks of each host set to be tested to multiple different task execution nodes, so that the detection tasks of each host set to be tested parallel execution;
任务执行节点,用于对其所接收到的待测主机集合,利用本发明第一方面所提供的Socks代理服务器的探测方法依次对其中的待测主机进行探测,以识别出其中的Socks代理服务器,并将任务执行结果回传给中心调度结果,将探测结果持久化存储到数据库中;执行结果用于显示任务执行成功或失败,探测结果包括Socks代理服务器的ip地址、端口、空间位置信息;The task execution node is used to detect the hosts to be tested in sequence by using the detection method of the Socks proxy server provided by the first aspect of the present invention to identify the Socks proxy server therein. , and send the task execution result back to the central scheduling result, and store the detection result persistently in the database; the execution result is used to display the success or failure of the task execution, and the detection result includes the ip address, port, and spatial location information of the Socks proxy server;
中心调度节点,还用于接收各任务执行节点返回的执行结果,并根据执行结果将执行失败的任务从原任务执行节点转移至其他的任务执行节点继续执行。The central scheduling node is also used to receive the execution results returned by each task execution node, and transfer the failed tasks from the original task execution node to other task execution nodes to continue execution according to the execution results.
上述Socks代理服务器的分布式探测系统,其中的中心调度节点和任务执行节点构成了Master-Slave(主-从)模型,经过调度,使得各任务执行节点并行地执行Socks代理服务器的探测任务,由此能够有效提高对大规模待测主机进行探测的速率。In the distributed detection system of the above-mentioned Socks proxy server, the central scheduling node and the task execution node constitute the Master-Slave (master-slave) model, through scheduling, each task execution node is made to perform the detection task of the Socks proxy server in parallel, by This can effectively improve the detection rate of a large-scale host to be tested.
进一步地,中心调度节点包括:任务分发模块和故障转移模块;Further, the central scheduling node includes: a task distribution module and a failover module;
任务分发模块,用于将所有的待测主机划分为多个待测主机集合,并将各待测主机集合的探测任务分发给多个不同的任务执行节点,使得各待测主机集合的探测任务并行执行;The task distribution module is used to divide all the hosts to be tested into multiple host sets to be tested, and distribute the detection tasks of each host set to be tested to a plurality of different task execution nodes, so that the detection tasks of each host set to be tested parallel execution;
故障转移模块,用于接收各任务执行节点返回的执行结果,并根据执行结果将执行失败的任务从原任务执行节点转移至其他的任务执行节点继续执行。The failover module is used to receive the execution result returned by each task execution node, and transfer the failed task from the original task execution node to another task execution node to continue execution according to the execution result.
上述分布式探测系统,通过将失败的探测任务从原任务执行节点转移到另一个任务执行节点,实现了一种故障转移机制,由此保证了对各待测主机的探测均正常执行。The above distributed detection system implements a failover mechanism by transferring failed detection tasks from the original task execution node to another task execution node, thereby ensuring that the detection of each host to be tested is normally performed.
进一步地,任务执行节点包括:预判模块、端口设定模块、收发模块、解析模块、识别模块、存储模块以及回传模块;Further, the task execution node includes: a pre-judgment module, a port setting module, a transceiver module, an analysis module, an identification module, a storage module, and a return module;
预判模块,用于判断待测主机是否开放服务,并在待测主机未开放服务时,结束对该待测主机的探测;A prediction module, used to judge whether the host to be tested is open for service, and when the host to be tested is not open for service, end the detection of the host to be tested;
端口设定模块,用于在预判模块判定待测主机开放服务时,在待测主机上预设多个用于建立通信连接的端口;The port setting module is used to preset a plurality of ports for establishing communication connections on the host to be tested when the prediction module determines that the host to be tested is open for service;
收发模块,用于将预先构造的基于HTTP协议的GET请求报文通过预设的各端口分别发送至待测主机,并获取各端口的响应信息;The transceiver module is used to send the pre-configured GET request message based on the HTTP protocol to the host to be tested through each preset port, and obtain the response information of each port;
解析模块,用于解析各端口的响应信息,并在响应信息中不包含第一特征字符串,且包含第二特征字符串时,判定待测主机通过对应的端口开放了Socks代理服务;以及在其他情况下,判定待测主机未通过对应的端口开放Socks代理服务;Parsing module, for parsing the response information of each port, and when the response information does not contain the first characteristic character string, and when the second characteristic character string is included, it is determined that the host to be tested has opened the Socks proxy service through the corresponding port; and In other cases, it is determined that the host to be tested has not opened the Socks proxy service through the corresponding port;
识别模块,用于在解析模块判定待测主机通过任意一个端口开放了Socks代理服务时,识别待测主机为Socks代理服务器;并在其他情况下,识别待测主机为非Socks代理服务器;The identification module is used to identify the host to be tested as a Socks proxy server when the analysis module determines that the host to be tested has opened the Socks proxy service through any port; and in other cases, identify the host to be tested as a non-Socks proxy server;
存储模块,用于将探测结果持久化存储到数据库中;The storage module is used to persistently store the detection results in the database;
回传模块,用于将执行结果回传至中心调度节点;The return module is used to return the execution result to the central scheduling node;
其中,第一特征字符串和第二特征字符串均为根据代理特征预收集的字符串,第一特征字符串用于排除其他代理服务器的干扰,第二特征字符串用于识别Socks代理服务器。Wherein, both the first characteristic string and the second characteristic character string are pre-collected character strings according to the proxy characteristics, the first characteristic character string is used to eliminate interference from other proxy servers, and the second characteristic character string is used to identify the Socks proxy server.
总体而言,通过本发明所构思的以上技术方案,能够取得以下有益效果:Generally speaking, through the above technical solutions conceived by the present invention, the following beneficial effects can be obtained:
(1)本发明所提供的Socks代理服务器的探测方法及Socks代理服务器的探测系统,利用基于HTTP协议的GET请求报文进行Socks代理服务器的探测,并根据待测主机端口的响应信息中是否包含特定的特征字符串来识别待测主机是否为Socks代理服务器,由于无论是有账号密码的Socks代理服务器,还是无账号密码的Socks代理服务器,均会相应针对HTTP协议的GET请求报文产生响应信息,因此,本发明既能识别无账号密码的Socks代理服务器,也能够识别有账号密码的Socks代理服务器,从而有效解决了现有的Socks代理服务器探测方法识别率低的问题。(1) The detection method of the Socks proxy server provided by the present invention and the detection system of the Socks proxy server utilize the GET request message based on the HTTP protocol to carry out the detection of the Socks proxy server, and according to whether the response information of the host port to be tested contains A specific characteristic string is used to identify whether the host to be tested is a Socks proxy server, because whether it is a Socks proxy server with an account password or a Socks proxy server without an account password, it will generate response information for the GET request message of the HTTP protocol accordingly Therefore, the present invention can identify both the Socks proxy server without account password and the Socks proxy server with account password, thereby effectively solving the problem of low recognition rate of the existing Socks proxy server detection method.
(2)本发明所提供的Socks代理服务器的探测方法及Socks代理服务器的探测系统,准确设定了用于排除干扰的第一特征字符串和用于识别Socks代理服务器的第二特征字符串,并将不包含上述第一特征字符串且包含第二特征字符串的待测主机识别为Socks代理服务器,使得本发明能够在识别Socks代理服务器的过程中,避免了其他代理服务器的干扰,因此,本发明的识别精度较高。(2) the detection method of the Socks proxy server provided by the present invention and the detection system of the Socks proxy server accurately set the first characteristic character string for eliminating interference and the second characteristic character string for identifying the Socks proxy server, And do not contain above-mentioned first characteristic character string and the host computer to be tested that contains second characteristic character string is identified as Socks proxy server, make the present invention can in the process of identifying Socks proxy server, avoid the interference of other proxy servers, therefore, The recognition accuracy of the present invention is relatively high.
(3)本发明所提供的Socks代理服务器的探测方法及Socks代理服务器的探测系统,还可根据ip对Socks代理服务器进行空间定位,为针对Socks代理服务器的监管提供了便利。(3) The detection method of the Socks proxy server provided by the present invention and the detection system of the Socks proxy server can also carry out spatial positioning to the Socks proxy server according to ip, which provides convenience for the supervision of the Socks proxy server.
(4)本发明所提供的Socks代理服务器的分布式探测方法和Socks代理服务器的分布式探测系统,基于本发明所提供的Socks代理服务器的探测方法,并以分布式的方式在多个任务执行节点同时进行Socks代理服务器探测,使得任务可以并行执行,因此,本发明能够在保证较高识别率的基础上,有效提高探测速率。(4) the distributed detection method of the Socks proxy server provided by the present invention and the distributed detection system of the Socks proxy server, based on the detection method of the Socks proxy server provided by the present invention, and execute in multiple tasks in a distributed manner The nodes detect the Socks proxy server at the same time, so that tasks can be executed in parallel. Therefore, the invention can effectively improve the detection rate on the basis of ensuring a high recognition rate.
(5)本发明所提供的Socks代理服务器的分布式探测系统,其中心调度节点在对任意一个待测主机的探测失败时,会将对该待测主机的探测任务从原任务执行节点转移到另一个任务执行节点,以重新启动对该待测主机的探测任务,由此实现了一种故障转移机制,保证了对各待测主机的探测均正常执行。(5) the distributed detection system of the Socks proxy server provided by the present invention, when its central dispatching node fails to the detection of any host computer to be tested, the detection task of this host computer to be tested will be transferred from the original task execution node to Another task execution node is used to restart the detection task of the host to be tested, thereby implementing a failover mechanism to ensure that the detection of each host to be tested is performed normally.
附图说明Description of drawings
图1为本发明实施例提供的Socks代理服务器的探测方法流程图;Fig. 1 is the detection method flowchart of the Socks proxy server that the embodiment of the present invention provides;
图2为本发明实施例提供的Socks代理服务器的分布式探测方法示意图;Fig. 2 is the distributed detection method schematic diagram of the Socks proxy server that the embodiment of the present invention provides;
图3为本发明应用实例提供的Socks代理服务器的分布式探测系统模块示意图;Fig. 3 is the distributed detection system module schematic diagram of the Socks proxy server that the application example of the present invention provides;
图4为本发明应用实例提供的Socks代理服务器的分布式探测系统执行流程示意图。Fig. 4 is a schematic diagram of the execution flow of the distributed detection system of the Socks proxy server provided by the application example of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.
为实现对有账号密码的Socks代理服务器的探测,以解决现有的Socks代理服务器探测方法识别率低的问题,本发明提供了一种Socks代理服务器的探测方法,用于识别一个ip已知的待测主机是否为Socks代理服务器,如图1所示,该探测方法包括:In order to realize the detection of Socks proxy servers with account passwords, to solve the problem of low recognition rate of existing Socks proxy server detection methods, the invention provides a detection method of Socks proxy servers, which is used to identify a known IP Whether the host to be tested is a Socks proxy server, as shown in Figure 1, the detection method includes:
(1)判断待测主机是否开放服务,若是,则转入步骤(2);否则,转入步骤(6);(1) Judging whether the host computer to be tested is open for service, if so, then proceed to step (2); otherwise, proceed to step (6);
可选地,可结合待测主机的ip,通过ping、tracert等网络测试指令对待测进行探测,例如,向待测主机发送测试指令"ping-c 3-w 6"+ip;若待测主机返回了相应的信息,则表示待测主机开放了服务;若待测主机没有任何返回信息,则表示待测主机未开放服务;Optionally, the ip of the host to be tested can be combined with network test commands such as ping and tracert to detect the host to be tested, for example, to send the test command "ping-c 3-w 6"+ip to the host to be tested; if the host to be tested If the corresponding information is returned, it means that the host to be tested has opened the service; if the host to be tested does not return any information, it means that the host to be tested has not opened the service;
仅在待测主机开放服务时,才继续执行后续的Socks代理服务器探测任务,能够避免无效操作,从而大幅度节省探测所需时间;Only when the host to be tested opens the service, continue to perform the subsequent Socks proxy server detection task, which can avoid invalid operations and greatly save the time required for detection;
(2)在待测主机上预设多个用于建立通信连接的端口;(2) multiple ports for establishing communication connections are preset on the host computer to be tested;
在互联网中1-65535的端口号并不是所有的都可以用于Socks开启代理,通过设置常见端口,可以节省探测速度,提高探测效率,在本发明实施例中,所预设的端口包括27274,443,2333,80,8080,4145,6667,9999,8082,9050,3128,8388,8000,8888,8088,1080,9000,53281,54566,808,8081,8118,65103,21071,1080,64312,53281,54321;In the Internet, not all port numbers of 1-65535 can be used for Socks to open the proxy. By setting common ports, the detection speed can be saved and the detection efficiency can be improved. In the embodiment of the present invention, the preset ports include 27274, 443,2333,80,8080,4145,6667,9999,8082,9050,3128,8388,8000,8888,8088,1080,9000,53281,54566,808,8081,8118,65103,21071,1080,64312, 53281, 54321;
应当理解的是,在其他应用场景下,也可根据被探测主机的实际端口开放情况设定;It should be understood that in other application scenarios, it can also be set according to the actual port opening status of the detected host;
(3)将预先构造的基于HTTP协议的GET请求报文通过预设的各端口分别发送至待测主机,并获取各端口的响应信息;(3) Send the pre-configured GET request message based on the HTTP protocol to the host to be tested through each preset port, and obtain the response information of each port;
所构造的GET请求报文,可以是符合HTTP协议的任意内容的GET请求报文,例如,一个根据空白网站构造的GET请求报文的内容如下:The constructed GET request message can be a GET request message with any content conforming to the HTTP protocol. For example, the content of a GET request message constructed according to a blank website is as follows:
'GET/HTTP/1.1\r\nHost:hm.baidu.com\r\n\r\n';'GET/HTTP/1.1\r\nHost:hm.baidu.com\r\n\r\n';
该请求报文中,hm.baidu.com即为空白网站的网址;上述内容仅为对GET请求报文的示例性说明,不应理解为对本发明的唯一限定;In the request message, hm.baidu.com is the URL of the blank website; the above content is only an exemplary description of the GET request message, and should not be understood as the only limitation of the present invention;
(4)解析各端口的响应信息,若其中不包含第一特征字符串,且包含第二特征字符串,则判定待测主机通过对应的端口开放了Socks代理服务;否则,判定待测主机未通过对应的端口开放Socks代理服务;(4) parse the response information of each port, if it does not contain the first characteristic character string, and contains the second characteristic character string, then it is determined that the host computer to be tested has opened the Socks proxy service through the corresponding port; otherwise, it is determined that the host computer to be tested has not Open the Socks proxy service through the corresponding port;
其中,第一特征字符串和第二特征字符串均为根据代理特征预收集的字符串,第一特征字符串用于排除其他代理服务器的干扰,第二特征字符串用于识别Socks代理服务器;Wherein, the first characteristic character string and the second characteristic character string are character strings pre-collected according to the agent characteristics, the first characteristic character string is used to eliminate the interference of other proxy servers, and the second characteristic character string is used to identify the Socks proxy server;
具体来说,第一特征字符串和第二特征字符串,均为根据代理服务器针对上述GET请求报文的响应特征所预先定义的字符串;Specifically, the first characteristic character string and the second characteristic character string are pre-defined character strings according to the response characteristics of the proxy server to the above GET request message;
在一个可选的实施方式中,第一特征字符串为'SSH'、'FTP'、'\xff\xfd\x18\xff\xfd\xff\xfd#\xff\xfd'、'SMTP'或者'HTTP';In an optional implementation, the first feature string is 'SSH', 'FTP', '\xff\xfd\x18\xff\xfd\xff\xfd#\xff\xfd', 'SMTP' or ' HTTP';
第一特征字符串为SSH、FTP、SMTP、HTTP等其他代理服务器针对HTTP协议的GET请求报文产生响应信息中,所特有的字符串;这些代理服务器会对Socks代理服务器的探测产生干扰;The first characteristic character string is that other proxy servers such as SSH, FTP, SMTP, HTTP produce in the response information for the GET request message of HTTP protocol, the peculiar character string; These proxy servers can interfere with the detection of Socks proxy server;
在一个可选的实施方式中,第二特征字符串为'\x05\x00'、'\x00[\x00\x00\x00\x00\x00\x00'或者'www.herokucdn.com';In an optional implementation, the second feature string is '\x05\x00', '\x00[\x00\x00\x00\x00\x00\x00' or 'www.herokucdn.com';
第二特征字符串为Socks代理服务器针对HTTP协议的GET请求报文产生返回信息中,所特有的字符串;The second characteristic character string is that the Socks proxy server produces the unique character string in the return information for the GET request message of the HTTP protocol;
通过将不包含上述第一特征字符串且包含上述第二特征字符串的待测主机识别为Socks代理服务器,能够在识别Socks代理服务器的过程中,避免了其他代理服务器的干扰,因此本发明的识别精度较高;By not including the above-mentioned first characteristic string and including the host to be tested of the second characteristic character string identified as the Socks proxy server, in the process of identifying the Socks proxy server, the interference of other proxy servers can be avoided, so the present invention High recognition accuracy;
应当说明的是,第一特征字符串和第二特征字符串并不限于上述几种,其他可识别出相关干扰服务器的字符串,也可被纳入到第一特征字符串中;同样地,其他可识别出Socks代理服务器的字符串,也可被纳入到第二特征字符串中;此外,上述第一特征字符串和第二特征字符串,还可根据实际的应用场景进行更新;It should be noted that the first characteristic character string and the second characteristic character string are not limited to the above-mentioned ones, and other character strings that can identify relevant interfering servers can also be included in the first characteristic character string; similarly, other The string that can identify the Socks proxy server can also be included in the second feature string; in addition, the above-mentioned first feature string and second feature string can also be updated according to actual application scenarios;
(5)若待测主机通过任意一个端口开放了Socks代理服务,则识别待测主机为Socks代理服务器;否则,识别待测主机为非Socks代理服务器;(5) if the host to be tested has opened the Socks proxy service through any port, then identify the host to be tested as a Socks proxy server; otherwise, identify the host to be tested as a non-Socks proxy server;
(6)探测结束。(6) Detection ends.
本发明利用基于HTTP协议的GET请求报文进行Socks代理服务器的探测,并根据待测主机上端口的响应信息中是否包含特定的特征字符串来识别待测主机是否为Socks代理服务器,由于无论是有账号密码的Socks代理服务器,还是无账号密码的Socks代理服务器,均会相应针对HTTP协议的GET请求报文产生返回信息,因此,本发明既能识别无账号密码的Socks代理服务器,也能够识别有账号密码的Socks代理服务器,从而有效解决了现有的Socks代理服务器探测方法识别率低的问题。The present invention utilizes the GET request message based on the HTTP protocol to carry out the detection of the Socks proxy server, and according to whether the response information of the port on the host computer to be tested contains a specific characteristic character string to identify whether the host computer to be tested is a Socks proxy server, because whether it is A Socks proxy server with an account password or a Socks proxy server without an account password will generate return information correspondingly to the GET request message of the HTTP protocol. Therefore, the present invention can identify both the Socks proxy server without an account password and the The Socks proxy server with the account password effectively solves the problem of low recognition rate of the existing Socks proxy server detection method.
为了进一步实现对Socks代理服务器的空间定位,可选地,上述Socks代理服务器的探测方法,还可包括:In order to further realize the spatial location of the Socks proxy server, optionally, the detection method of the above-mentioned Socks proxy server may also include:
若识别待测主机为Socks代理服务器,则根据其ip获得待测主机的空间位置,从而实现对Socks代理服务器的物理定位,由此能够为针对Socks代理服务器的监管提供了便利;If the host to be tested is identified as a Socks proxy server, the spatial location of the host to be tested is obtained according to its ip, so as to realize the physical location of the Socks proxy server, which can provide convenience for the supervision of the Socks proxy server;
可选地,在识别待测主机为Socks代理服务器后,根据其ip条用百度地图的API、谷歌地图的API或其他API获取对应的经纬度,从而获取到Socks代理服务器的地理位置;进一步的,可根据应用需求,基于获取到的Socks代理服务器的经纬度判断该Socks代理服务器所属的城市或其他行政区划,具体方式也可通过相关的地图API获得。Optionally, after identifying the host to be tested as the Socks proxy server, obtain the corresponding latitude and longitude according to its ip bar with the API of Baidu map, the API of Google Maps or other APIs, thereby obtaining the geographic location of the Socks proxy server; further, According to application requirements, the city or other administrative divisions to which the Socks proxy server belongs can be judged based on the obtained latitude and longitude of the Socks proxy server. The specific method can also be obtained through the relevant map API.
基于上述Socks代理服务器的探测方法,本发明还提供了一种Socks代理服务器的分布式探测方法,用于识别大规模ip已知的待测主机(即多个ip已知的待测主机)是否为Socks代理服务器,该分布式探测方法包括:Based on the detecting method of above-mentioned Socks proxy server, the present invention also provides a kind of distributed detecting method of Socks proxy server, is used for identifying whether For the Socks proxy server, the distributed detection method includes:
将所有的待测主机划分为多个待测主机集合;Divide all hosts to be tested into multiple host sets to be tested;
对于每一个待测主机集合,利用上述Socks代理服务器的探测方法依次对其中的待测主机进行探测,以识别出其中的Socks代理服务器;对所有待测主机集合的探测并行执行;For each host set to be tested, the detection method of the above-mentioned Socks proxy server is used to detect the host to be tested in turn, to identify the Socks proxy server wherein; the detection of all host sets to be tested is performed in parallel;
上述Socks代理服务器的分布式探测方法,通过将多个待测主机划分为待测主机集合,使得集合内待测主机的探测串行执行,而多个集合的探测并行执行,由此能够有效提高探测速率;通常情况下,为了最大程度的提高并行性,各待测主机集合中所包含的待测主机数量相等或相近。The above-mentioned distributed detection method of the Socks proxy server divides a plurality of hosts to be tested into a set of hosts to be tested, so that the detection of the hosts to be tested in the set is executed serially, and the detection of multiple sets is executed in parallel, thereby effectively improving Probing rate; usually, in order to maximize parallelism, the number of hosts to be tested contained in each set of hosts to be tested is equal or similar.
本发明还提供了一种Socks代理服务器的探测系统,用于实现上述Socks代理服务器的探测方法,该探测系统包括:预判模块、端口设定模块、收发模块、解析模块以及识别模块;The present invention also provides a detection system of a Socks proxy server, which is used to realize the detection method of the above-mentioned Socks proxy server. The detection system includes: a pre-judgment module, a port setting module, a transceiver module, an analysis module and an identification module;
预判模块,用于判断待测主机是否开放服务,并在待测主机未开放服务时,结束探测;A pre-judgment module is used to judge whether the host to be tested is open for service, and when the host to be tested is not open for service, end the detection;
端口设定模块,用于在预判模块判定待测主机开放服务时,在待测主机上预设多个用于建立通信连接的端口;The port setting module is used to preset a plurality of ports for establishing communication connections on the host to be tested when the prediction module determines that the host to be tested is open for service;
收发模块,用于将预先构造的基于HTTP协议的GET请求报文通过预设的各端口分别发送至待测主机,并获取各端口的响应信息;The transceiver module is used to send the pre-configured GET request message based on the HTTP protocol to the host to be tested through each preset port, and obtain the response information of each port;
解析模块,用于解析各端口的响应信息,并在响应信息中不包含第一特征字符串,且包含第二特征字符串时,判定待测主机通过对应的端口开放了Socks代理服务;以及在其他情况下,判定待测主机未通过对应的端口开放Socks代理服务;Parsing module, for parsing the response information of each port, and when the response information does not contain the first characteristic character string, and when the second characteristic character string is included, it is determined that the host to be tested has opened the Socks proxy service through the corresponding port; and In other cases, it is determined that the host to be tested has not opened the Socks proxy service through the corresponding port;
识别模块,用于在解析模块判定待测主机通过任意一个端口开放了Socks代理服务时,识别待测主机为Socks代理服务器;并在其他情况下,识别待测主机为非Socks代理服务器;The identification module is used to identify the host to be tested as a Socks proxy server when the analysis module determines that the host to be tested has opened the Socks proxy service through any port; and in other cases, identify the host to be tested as a non-Socks proxy server;
其中,第一特征字符串和第二特征字符串均为根据代理特征预收集的字符串,第一特征字符串用于排除其他代理服务器的干扰,第二特征字符串用于识别Socks代理服务器;Wherein, the first characteristic character string and the second characteristic character string are character strings pre-collected according to the agent characteristics, the first characteristic character string is used to eliminate the interference of other proxy servers, and the second characteristic character string is used to identify the Socks proxy server;
在本发明实施例中,各模块的具体实施方式可参考上述方法实施例中的描述,在此将不作复述。In the embodiment of the present invention, for the specific implementation manner of each module, reference may be made to the description in the foregoing method embodiment, which will not be repeated here.
按照本发明的第四方面,提供了一种Socks代理服务器的分布式探测系统,用于实现上述Socks代理服务器的分布式探测方法,如图2所示,该分布式探测系统包括:数据库、中心调度节点和多个并行的任务执行节点;According to the fourth aspect of the present invention, a kind of distributed detection system of Socks proxy server is provided, for realizing the distributed detection method of above-mentioned Socks proxy server, as shown in Figure 2, this distributed detection system comprises: database, center Scheduling nodes and multiple parallel task execution nodes;
中心调度节点,用于将所有的待测主机划分为多个待测主机集合,并将对各待测主机集合的探测任务分发给多个不同的任务执行节点,以使得对各待测主机集合的探测任务并行执行;The central scheduling node is used to divide all the hosts to be tested into multiple sets of hosts to be tested, and distribute the detection tasks of each set of hosts to be tested to a plurality of different task execution nodes, so that each set of hosts to be tested The detection tasks are executed in parallel;
任务执行节点,用于对其所接收到的待测主机集合,利用上述Socks代理服务器的探测方法依次对其中的待测主机进行探测,以识别出其中的Socks代理服务器,并将任务执行结果回传给中心调度结果,将探测结果持久化存储到数据库中;执行结果用于显示任务执行成功或失败,探测结果包括Socks代理服务器的ip地址、端口、空间位置信息;The task execution node is used to detect the hosts to be tested by using the detection method of the above-mentioned Socks proxy server to identify the Socks proxy server therein, and return the task execution result to the set of hosts to be tested. Pass it to the central scheduling result, and store the detection result persistently in the database; the execution result is used to display the success or failure of the task execution, and the detection result includes the IP address, port, and spatial location information of the Socks proxy server;
中心调度节点,还用于接收各任务执行节点返回的执行结果,并根据执行结果将执行失败的任务从原任务执行节点转移至其他的任务执行节点继续执行;The central scheduling node is also used to receive the execution results returned by each task execution node, and transfer the failed tasks from the original task execution node to other task execution nodes to continue execution according to the execution results;
如图3所示,在本发明实施例中,中心调度节点具体包括:任务分发模块和故障转移模块;As shown in Figure 3, in the embodiment of the present invention, the central scheduling node specifically includes: a task distribution module and a failover module;
任务分发模块,用于将所有的待测主机划分为多个待测主机集合,并将对各待测主机集合的探测任务分发给多个不同的任务执行节点,以使得对各待测主机集合的探测任务并行执行;The task distribution module is used to divide all the hosts to be tested into multiple sets of hosts to be tested, and distribute the detection tasks of each set of hosts to be tested to a plurality of different task execution nodes, so that each set of hosts to be tested The detection tasks are executed in parallel;
故障转移模块,用于接收各任务执行节点返回的执行结果,并根据执行结果将执行失败的任务从原任务执行节点转移至其他的任务执行节点继续执行;The failover module is used to receive the execution result returned by each task execution node, and transfer the failed task from the original task execution node to another task execution node to continue execution according to the execution result;
任务执行节点包括:预判模块、端口设定模块、收发模块、解析模块、识别模块、存储模块以及回传模块;Task execution nodes include: pre-judgment module, port setting module, transceiver module, analysis module, identification module, storage module and return module;
预判模块,用于判断待测主机是否开放服务,并在待测主机未开放服务时,结束对该待测主机的探测;A prediction module, used to judge whether the host to be tested is open for service, and when the host to be tested is not open for service, end the detection of the host to be tested;
端口设定模块,用于在预判模块判定待测主机开放服务时,在待测主机上预设多个用于建立通信连接的端口;The port setting module is used to preset a plurality of ports for establishing communication connections on the host to be tested when the prediction module determines that the host to be tested is open for service;
收发模块,用于将预先构造的基于HTTP协议的GET请求报文通过预设的各端口分别发送至待测主机,并获取各端口的响应信息;The transceiver module is used to send the pre-configured GET request message based on the HTTP protocol to the host to be tested through each preset port, and obtain the response information of each port;
解析模块,用于解析各端口的响应信息,并在响应信息中不包含第一特征字符串,且包含第二特征字符串时,判定待测主机通过对应的端口开放了Socks代理服务;以及在其他情况下,判定待测主机未通过对应的端口开放Socks代理服务;Parsing module, for parsing the response information of each port, and when the response information does not contain the first characteristic character string, and when the second characteristic character string is included, it is determined that the host to be tested has opened the Socks proxy service through the corresponding port; and In other cases, it is determined that the host to be tested has not opened the Socks proxy service through the corresponding port;
识别模块,用于在解析模块判定待测主机通过任意一个端口开放了Socks代理服务时,识别待测主机为Socks代理服务器;并在其他情况下,识别待测主机为非Socks代理服务器;The identification module is used to identify the host to be tested as a Socks proxy server when the analysis module determines that the host to be tested has opened the Socks proxy service through any port; and in other cases, identify the host to be tested as a non-Socks proxy server;
存储模块,用于将探测结果持久化存储到数据库中;The storage module is used to persistently store the detection results in the database;
回传模块,用于将执行结果回传至中心调度节点;The return module is used to return the execution result to the central scheduling node;
其中,第一特征字符串和第二特征字符串均为根据代理特征预收集的字符串,第一特征字符串用于排除其他代理服务器的干扰,第二特征字符串用于识别Socks代理服务器;Wherein, the first characteristic character string and the second characteristic character string are character strings pre-collected according to the agent characteristics, the first characteristic character string is used to eliminate the interference of other proxy servers, and the second characteristic character string is used to identify the Socks proxy server;
在本发明实施例中,各模块的具体实施方式可参考上述方法实施例中的描述,在此将不作复述。In the embodiment of the present invention, for the specific implementation manner of each module, reference may be made to the description in the foregoing method embodiment, which will not be repeated here.
上述Socks代理服务器的分布式探测系统,其中的中心调度节点和任务执行节点构成了Master-Slave(主-从)模型,经过调度,使得各任务执行节点并行地执行Socks代理服务器的探测任务,由此能够有效提高对大规模待测主机进行探测的速率。In the distributed detection system of the above-mentioned Socks proxy server, the central scheduling node and the task execution node constitute the Master-Slave (master-slave) model, through scheduling, each task execution node is made to perform the detection task of the Socks proxy server in parallel, by This can effectively improve the detection rate of a large-scale host to be tested.
在一个可选的实施方式中,上述Socks代理服务器的分布式探测系统中,任务执行节点,还用于在每经过一个预设的时间间隔后,重新执行分发到其中的所有探测任务;时间间隔可根据探测任务的执行时长和待探测代理变化综合设定,探测任务的执行时长根据实际任务执行时间确定,待探测代理变化可设置常量,时间间隔为探测任务的执行时长和常数总和;例如,比如说一个任务执行节点执行任务需要3小时,待探测代理主机3小时更新一次,因为代理会经常变化地址和端口,那么,相应的时间间隔就是6小时,任务执行节点执行任务时间可以通过实验预测,但是代理变化是由代理提供方改变的,所以实际探测中可以设置一个常数,比如说几天、一周或者一月等;In an optional embodiment, in the distributed detection system of the above-mentioned Socks proxy server, the task execution node is also used to re-execute all detection tasks distributed therein after each preset time interval; time interval It can be comprehensively set according to the execution time of the detection task and the change of the agent to be detected. The execution time of the detection task is determined according to the actual task execution time. A constant can be set for the change of the agent to be detected. The time interval is the sum of the execution time of the detection task and the constant; for example, For example, it takes 3 hours for a task execution node to execute a task, and the proxy host to be detected is updated every 3 hours, because the agent will often change the address and port, then the corresponding time interval is 6 hours, and the task execution time of the task execution node can be predicted through experiments , but the proxy change is changed by the proxy provider, so a constant can be set in the actual detection, such as a few days, a week or a month;
Socks代理服务器的ip和端口列表经会被更新,任务执行节点每经过预设的时间间隔后,即重新执行分发到其中的所有探测任务,能够保证探测结果的有效性和实时性。The ip and port list of the Socks proxy server will be updated, and the task execution node will re-execute all the detection tasks distributed to it after each preset time interval, which can ensure the validity and real-time performance of the detection results.
应用实例Applications
图3所示为本发明所提供的Socks代理服务器的分布式探测系统的一个应用实例,基于该探测系统,本发明所提供的Socks代理服务器的分布式探测方法的执行示意图,如图4所示;Fig. 3 shows an application example of the distributed detection system of the Socks proxy server provided by the present invention, based on this detection system, the execution schematic diagram of the distributed detection method of the Socks proxy server provided by the present invention, as shown in Figure 4 ;
其中,Master节点即为中心调度节点,Slave节点即为任务执行节点;原始数据存储在数据库中,相应的执行结果保存在日志中;Among them, the Master node is the central scheduling node, and the Slave node is the task execution node; the original data is stored in the database, and the corresponding execution results are stored in the log;
基于图3所示的分布式探测系统,本发明所提供的Socks代理服务器的分布式探测方法大体可以简化成如下步骤:Based on the distributed detection system shown in Figure 3, the distributed detection method of the Socks proxy server provided by the present invention can generally be simplified into the following steps:
1.用户向Master节点提交任务->2.Master节点接收任务并将任务分发到Slave节点中->3.Slave节点启动探测任务->4.Slave节点获取Socks代理数据并记录日志->5.Slave节点将Socks代理数据存储到数据库中->6.Slave节点返回执行结果到Master节点->7.Master节点将执行结果以磁盘文件方式存储,并根据执行结果确定是否采用故障转移机制。1. The user submits the task to the Master node -> 2. The Master node receives the task and distributes the task to the Slave node -> 3. The Slave node starts the detection task -> 4. The Slave node obtains the Socks proxy data and records the log -> 5. The Slave node stores the Socks proxy data in the database -> 6. The Slave node returns the execution result to the Master node -> 7. The Master node stores the execution result as a disk file, and determines whether to adopt a failover mechanism according to the execution result.
以下结合图3及图4进行具体说明:The following is a specific description in conjunction with Fig. 3 and Fig. 4:
(S1)用户收集需要探测的目标服务器,主要收集一些云服务厂商开放ip段收集;(S1) The user collects the target server that needs to be detected, mainly collects the open ip segment collection of some cloud service vendors;
(S2)用户Client提交待探测主机列表到Master节点,Master节点查询在线Slave节点数量,对待测主机进行分片,分片策略可以动态的使用各种定制策略,包括选择轮询、随机、一致性HASH、最不经常使用、最近最久未使用、故障转移、忙碌转移等策略,一般为了实现负载均衡可以选择一致性HASH策略,Master节点根据所选的分片策略将分片任务下发到各个Slave节点;(S2) The user Client submits the list of hosts to be detected to the Master node. The Master node queries the number of online Slave nodes and fragments the hosts to be tested. The fragmentation strategy can dynamically use various customized strategies, including polling, randomness, consistency HASH, least frequently used, least recently used, failover, busy transfer and other strategies, generally in order to achieve load balancing, you can choose a consistent HASH strategy, and the Master node will distribute the fragmentation tasks to each Slave according to the selected fragmentation strategy node;
(S3)Master节点与Slave节点通过心跳信息通信,接收到Master节点下发的分片后,启动代理探测任务,根据预设定的端口对这些ip探测,主要使用网络I/O实现数据传输,所探测的信息包括ip、开放Socks代理服务的端口和Socks代理服务器所在的经纬度信息和所属城市;(S3) The Master node communicates with the Slave node through heartbeat information. After receiving the fragment issued by the Master node, it starts the proxy detection task, detects these IPs according to the preset port, and mainly uses network I/O to realize data transmission. The detected information includes ip, the port where the Socks proxy service is open, the latitude and longitude information and the city where the Socks proxy server is located;
(S4)Slave节点代理探测时可以直接获取ip、开放端口等信息,其中网站所在的地理位置即经纬度不能直接探测获取,需要根据具体ip调用百度地图的API或者谷歌地图的API进行获取,网站所属城市同理需要调用相关地图API获得;(S4) Slave node proxy detection can directly obtain information such as ip, open port, etc., where the geographical location of the website, that is, the latitude and longitude cannot be directly detected and obtained. It needs to call the API of Baidu map or the API of Google map according to the specific ip to obtain, and the website belongs to Similarly, the city needs to call the relevant map API to obtain;
(S5)Slave节点在执行探测任务的过程中,针对任意一个待测主机的探测任务执行失败,任务执行节点会进行一定次数的重试,如果仍然失败,则相Master节点发送任务执行失败的相关信息;(S5) During the execution of the detection task, if the Slave node fails to execute the detection task for any host to be tested, the task execution node will retry a certain number of times. information;
(S6)Slave节点执行探测任务的同时与Master节点保持通信,一旦Slave节点执行任务失败,Master可以监控到该异常情况,Mater节点会将执行失败的探测任务从原执行节点转移到另外一个执行节点,以实现故障转移机制;(S6) The Slave node maintains communication with the Master node while executing the detection task. Once the Slave node fails to perform the task, the Master can monitor the abnormal situation, and the Master node will transfer the failed detection task from the original execution node to another execution node , to implement a failover mechanism;
(S7)各个Slave节点将收集到的数据存储到数据库中,数据库需要开启允许远程连接,为了保证安全性,该数据库仅允许Slave节点登录,同时Master节点也需要自己的数据库用来存储任务执行日志,记录任务的执行情况,任务一旦失败,可以通过查询日志进行分析,进而确定具体是针对哪一个待测主机的探测任务失败,并重新启动该探测任务,由此保证数据收集的完整性。(S7) Each Slave node stores the collected data in the database. The database needs to be enabled to allow remote connections. In order to ensure security, the database only allows Slave nodes to log in, and the Master node also needs its own database to store task execution logs. , to record the execution status of the task. Once the task fails, you can analyze it by querying the log, and then determine which specific host to be tested failed the detection task, and restart the detection task, thereby ensuring the integrity of data collection.
本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。Those skilled in the art can easily understand that the above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention, All should be included within the protection scope of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910453811.XA CN110233774B (en) | 2019-05-28 | 2019-05-28 | A detection method, distributed detection method and system for a Socks proxy server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910453811.XA CN110233774B (en) | 2019-05-28 | 2019-05-28 | A detection method, distributed detection method and system for a Socks proxy server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110233774A true CN110233774A (en) | 2019-09-13 |
CN110233774B CN110233774B (en) | 2020-12-29 |
Family
ID=67858806
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910453811.XA Active CN110233774B (en) | 2019-05-28 | 2019-05-28 | A detection method, distributed detection method and system for a Socks proxy server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110233774B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111130916A (en) * | 2018-10-31 | 2020-05-08 | 中国电信股份有限公司 | Network quality detection method and management device |
CN112769635A (en) * | 2020-12-10 | 2021-05-07 | 青岛海洋科学与技术国家实验室发展中心 | Service identification method and device for multi-granularity feature analysis |
CN113965577A (en) * | 2021-08-31 | 2022-01-21 | 联通沃音乐文化有限公司 | System and method for intelligently switching Socks5 proxy server nodes |
Citations (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020112152A1 (en) * | 2001-02-12 | 2002-08-15 | Vanheyningen Marc D. | Method and apparatus for providing secure streaming data transmission facilities using unreliable protocols |
CN101031124A (en) * | 2006-03-03 | 2007-09-05 | 中兴通讯股份有限公司 | Platform for testing applied large-traffic volume of packet data service father in CDMA telecommunication system |
CN101030889A (en) * | 2007-04-18 | 2007-09-05 | 杭州华为三康技术有限公司 | Method and apparatus against attack |
CN101031134A (en) * | 2006-02-28 | 2007-09-05 | 华为技术有限公司 | Agent server and method and safety telecommunication system therewith |
CN101175036A (en) * | 2007-11-01 | 2008-05-07 | 南京大学 | Firewall/subnet penetration method based on intranet node forwarding technology |
CN101217508A (en) * | 2007-12-29 | 2008-07-09 | 腾讯科技(深圳)有限公司 | A network agent system and the corresponding realizing methods based on instant communication platform |
CN101431511A (en) * | 2007-11-09 | 2009-05-13 | 友讯科技股份有限公司 | Method for establishing online channel between network terminal devices by penetrating firewall |
CN101662387A (en) * | 2009-10-14 | 2010-03-03 | 中国电信股份有限公司 | System for detecting computer accessing situation in network and method thereof |
CN102882865A (en) * | 2012-09-19 | 2013-01-16 | 上海美琦浦悦通讯科技有限公司 | Method for realizing multimedia agency service control on basis of socks5 agency agreement |
CN104919833A (en) * | 2012-12-20 | 2015-09-16 | 爱尔比奎特公司 | Efficient head unit communication integration |
CN106534172A (en) * | 2016-12-07 | 2017-03-22 | 北京数字观星科技有限公司 | Intranet remote scanning system and method thereof for scanning intranet |
WO2017154978A1 (en) * | 2016-03-09 | 2017-09-14 | 東洋紡株式会社 | Elastic conductor sheet and paste for forming elastic conductor sheet |
CN107818132A (en) * | 2017-09-21 | 2018-03-20 | 中国科学院信息工程研究所 | A kind of webpage agent discovery method based on machine learning |
CN108628722A (en) * | 2018-05-11 | 2018-10-09 | 华中科技大学 | A kind of distributed Web Component services detection system |
WO2018213615A2 (en) * | 2017-05-17 | 2018-11-22 | Legionarius Llc | Wearable device |
CN109756501A (en) * | 2019-01-02 | 2019-05-14 | 中国科学院信息工程研究所 | A method and system for a high-secrecy network proxy based on HTTP protocol |
-
2019
- 2019-05-28 CN CN201910453811.XA patent/CN110233774B/en active Active
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020112152A1 (en) * | 2001-02-12 | 2002-08-15 | Vanheyningen Marc D. | Method and apparatus for providing secure streaming data transmission facilities using unreliable protocols |
CA2438180A1 (en) * | 2001-02-13 | 2002-08-22 | Aventail Corporation | Method and apparatus for providing secure streaming data transmission facilities using unreliable protocols |
CN101031134A (en) * | 2006-02-28 | 2007-09-05 | 华为技术有限公司 | Agent server and method and safety telecommunication system therewith |
CN101031124A (en) * | 2006-03-03 | 2007-09-05 | 中兴通讯股份有限公司 | Platform for testing applied large-traffic volume of packet data service father in CDMA telecommunication system |
CN101030889A (en) * | 2007-04-18 | 2007-09-05 | 杭州华为三康技术有限公司 | Method and apparatus against attack |
CN101175036A (en) * | 2007-11-01 | 2008-05-07 | 南京大学 | Firewall/subnet penetration method based on intranet node forwarding technology |
CN101431511A (en) * | 2007-11-09 | 2009-05-13 | 友讯科技股份有限公司 | Method for establishing online channel between network terminal devices by penetrating firewall |
CN101217508A (en) * | 2007-12-29 | 2008-07-09 | 腾讯科技(深圳)有限公司 | A network agent system and the corresponding realizing methods based on instant communication platform |
CN101662387A (en) * | 2009-10-14 | 2010-03-03 | 中国电信股份有限公司 | System for detecting computer accessing situation in network and method thereof |
CN102882865A (en) * | 2012-09-19 | 2013-01-16 | 上海美琦浦悦通讯科技有限公司 | Method for realizing multimedia agency service control on basis of socks5 agency agreement |
CN104919833A (en) * | 2012-12-20 | 2015-09-16 | 爱尔比奎特公司 | Efficient head unit communication integration |
WO2017154978A1 (en) * | 2016-03-09 | 2017-09-14 | 東洋紡株式会社 | Elastic conductor sheet and paste for forming elastic conductor sheet |
CN106534172A (en) * | 2016-12-07 | 2017-03-22 | 北京数字观星科技有限公司 | Intranet remote scanning system and method thereof for scanning intranet |
WO2018213615A2 (en) * | 2017-05-17 | 2018-11-22 | Legionarius Llc | Wearable device |
CN107818132A (en) * | 2017-09-21 | 2018-03-20 | 中国科学院信息工程研究所 | A kind of webpage agent discovery method based on machine learning |
CN108628722A (en) * | 2018-05-11 | 2018-10-09 | 华中科技大学 | A kind of distributed Web Component services detection system |
CN109756501A (en) * | 2019-01-02 | 2019-05-14 | 中国科学院信息工程研究所 | A method and system for a high-secrecy network proxy based on HTTP protocol |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111130916A (en) * | 2018-10-31 | 2020-05-08 | 中国电信股份有限公司 | Network quality detection method and management device |
CN111130916B (en) * | 2018-10-31 | 2022-02-08 | 中国电信股份有限公司 | Network quality detection method and management device |
CN112769635A (en) * | 2020-12-10 | 2021-05-07 | 青岛海洋科学与技术国家实验室发展中心 | Service identification method and device for multi-granularity feature analysis |
CN113965577A (en) * | 2021-08-31 | 2022-01-21 | 联通沃音乐文化有限公司 | System and method for intelligently switching Socks5 proxy server nodes |
CN113965577B (en) * | 2021-08-31 | 2024-02-27 | 联通沃音乐文化有限公司 | System and method for intelligently switching Socks5 proxy server nodes |
Also Published As
Publication number | Publication date |
---|---|
CN110233774B (en) | 2020-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10693734B2 (en) | Traffic pattern detection and presentation in container-based cloud computing architecture | |
US10785345B2 (en) | Information processing method, client, server and computer-readable storage medium | |
CN115118705B (en) | Industrial edge management and control platform based on micro-service | |
US8479048B2 (en) | Root cause analysis method, apparatus, and program for IT apparatuses from which event information is not obtained | |
AU2020276394B2 (en) | Systems and methods for using DNS messages to selectively collect computer forensic data | |
Neudecker et al. | A simulation model for analysis of attacks on the bitcoin peer-to-peer network | |
JP6490059B2 (en) | Method for processing data, tangible machine readable recordable storage medium and device, and method for querying features extracted from a data record, tangible machine readable recordable storage medium and device | |
US20200280576A1 (en) | Systems and methods for testing known bad destinations in a production network | |
JP2019067398A (en) | Automatic mitigation of electronic message based security threats | |
US20170026401A1 (en) | System and method for threat visualization and risk correlation of connected software applications | |
CN110233774B (en) | A detection method, distributed detection method and system for a Socks proxy server | |
CN113162954B (en) | Target drone creating method and network attack and defense training system | |
US11354152B2 (en) | Self-evolving microservices | |
US10419351B1 (en) | System and method for extracting signatures from controlled execution of applications and application codes retrieved from an application source | |
CN112822208A (en) | Internet of things equipment identification method and system based on block chain | |
WO2019043804A1 (en) | Log analysis device, log analysis method, and computer-readable recording medium | |
CN115225347A (en) | Method and device for monitoring shooting range resources | |
RU2008121872A (en) | NEAREST NODE FOR CONNECTIONS OF DISTRIBUTED SERVICES | |
US20120110160A1 (en) | System and method for determining topology of monitored entities | |
Li et al. | Supereye: A distributed port scanning system | |
CN106534046A (en) | Mimicry data transmission server and data transmission method | |
Dong et al. | E-DoH: Elegantly detecting the depths of open DoH service on the internet | |
CN115190107A (en) | Multi-subsystem management method based on extensive domain name, management terminal and readable storage medium | |
CN115190159A (en) | Session control method, device, electronic equipment and medium | |
CN114500379A (en) | Message transmission method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |