An API-based industrial control network external device detection method and system
By using API interfaces in the industrial control network for client Bluetooth and network card detection, it solves the problems of information leakage and deployment complexity, achieves accurate intrusion detection and blocking, and is suitable for complex network environments.
Patent Information
- Application Number
- CN202210413580.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2042-04-14
AI Technical Summary
Existing industrial control network intrusion detection methods have problems such as the risk of information leakage, cumbersome development, inconvenient deployment, inability to achieve accurate intrusion detection and blocking, and the complexity of deploying monitoring centers in complex networks.
Using an API-based industrial control network external device detection method, by calling the bluetoothapi and iphlpapi interfaces that come with Windows, external detection is performed directly on the client to determine the connection status of Bluetooth and wireless network cards, prevent illegal connections, and design a program protection mechanism Prevent external shutdown.
There is no need to access external networks to avoid information leakage, simplify the detection process, achieve accurate intrusion detection and blocking, reduce deployment complexity, and are suitable for complex network environments.
Smart Images

Figure CN114845303B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of industrial control networks, and more specifically, relates to an API-based industrial control network external device detection method and system. Background Art
[0002] According to the latest industrial control security report released by market research organization RAM, the global industrial network security market will grow at a compound growth rate of 6.6% percentage points in the past five years. The rapid expansion of the global industrial network security market is due to the increasingly severe security issues of industrial control. Among them, data leakage is common, which has led to the gradual aggravation of industrial control security issues. In order to solve this problem, an intrusion detection mechanism must be adopted in the industrial control network to reduce the risk of data leakage.
[0003] Currently, the commonly used industrial control network intrusion detection solutions mainly include the following:
[0004] 1. Construct a method of setting a survival time value (Time To Live, referred to as TTL) to detect illegal external connections: first, record the external network address accessed by the computer each time in a list of external network addresses; then construct an Internet Control Message Protocol ICMP echo request message with a specified survival time TTL value to collect routing information to the specified destination address; finally, determine whether the routing information contains a legal exit address of the network to which the computer belongs, so as to determine whether there is an illegal external connection on the computer.
[0005] 2. Client / Server (C / S) method: The main principle is to monitor the data packets at the bottom of the computer based on the Windows routing table. The implementation method is to set up a monitoring alarm center in the intranet and install a monitoring agent on each detection client to monitor it in real time. If the monitoring agent finds any illegal behavior in the client to be detected, it will send the illegal information to the monitoring alarm center for the next step.
[0006] 3. Dual-machine mode: Based on the detection principle of data packets. An independent monitoring center is installed in the intranet, and an alarm center for receiving responses is installed outside the intranet. The detection center continuously sends detection packets to the clients in the intranet, and at the same time, the source IP of the detection packet is replaced with the source IP of the alarm center in the external network. If the client device is connected to the external network at this time, the response packet will be directly sent to the alarm center in the external network. In this way, the alarm center will know which client in the intranet is in illegal external connection, and block it.
[0007] However, the above-mentioned industrial control network intrusion detection method still has some technical problems that cannot be ignored: First, the above-mentioned method of constructing and setting TTL still needs to access the external network, so there is still a risk of information leakage; second, the above-mentioned C / S method has problems such as cumbersome development and inconvenient deployment; third, if the client of the above-mentioned C / S method strengthens its own protection measures, such as installing a firewall, etc., there is a possibility of blocking or missing the data packet transmission between the monitoring agent on the client and the monitoring alarm center, thereby failing to achieve accurate intrusion detection and blocking; fourth, the above-mentioned dual-machine method will block the detection packet from the beginning for clients with protection measures such as firewalls, thereby avoiding being detected as illegal external connections, which will affect the detection results; fifth, when the above-mentioned dual-machine method is applied to some complex internal networks, it will be more complicated to deploy the monitoring center in the intranet. Summary of the invention
[0008] In response to the above defects or improvement needs of the prior art, the present invention provides an API-based industrial control network external device detection method, which aims to solve the technical problem that the existing method based on constructing a survival time value still requires access to the external network, resulting in the risk of information leakage; the existing C / S method has the technical problems of cumbersome development and inconvenient deployment, and if the client strengthens its own protection measures, there is a possibility of blocking or missing the data packet transmission between the monitoring agent on the client and the monitoring alarm center, thereby failing to achieve accurate intrusion detection and blocking; the existing dual-machine method will block the detection packet from the beginning for clients with protection measures such as firewalls, resulting in affecting the detection results; and when applied to some complex internal networks, it is more complicated to deploy the monitoring center in the intranet.
[0009] To achieve the above object, according to one aspect of the present invention, there is provided an API-based industrial control network external device detection method, which is applied in a client connected to a server, and the industrial control network external device detection method comprises the following steps:
[0010] (1) Set the detection counter check_cnt = 1;
[0011] (2) Determine whether the detection counter check_cnt is greater than the preset detection total number N. If so, the process ends; otherwise, proceed to step (3);
[0012] (3) Determine whether the detection counter check_cnt is an odd number or an even number. If it is an odd number, proceed to step (4); otherwise, proceed to step (9);
[0013] (4) Set counter i=1;
[0014] (5) Determine whether the counter i is greater than the total number of Bluetooth receivers on the client. If so, set the detection counter check_cnt = check_cnt + 1 and return to step (2). Otherwise, go to step (6);
[0015] (6) Determine whether the handle corresponding to the first Bluetooth device connected to the i-th Bluetooth receiver can be obtained by calling the bluetoothapi interface. If so, proceed to step (7); otherwise, set the counter i=i+1 and return to step (5);
[0016] (7) calling the bluetoothapi interface to scan multiple remote Bluetooth devices that can be scanned by the i-th Bluetooth receiver on the client, and determining whether there is at least one remote Bluetooth device connected to the Bluetooth device connected to the i-th Bluetooth receiver. If so, it indicates that the handle is in an illegal connection, an alarm message is popped up, and the process ends; otherwise, proceeding to step (8);
[0017] (8) Call the bluetoothapi interface to determine whether the handle corresponding to the next Bluetooth device connected to the i-th Bluetooth receiver can be obtained. If yes, return to step (7); otherwise, set i=i+1 and return to step (5);
[0018] (9) Set counter j = 1;
[0019] (10) Determine whether the counter j is greater than the total number of adapters on the client. If so, set the detection counter check_cnt = check_cnt + 1 and return to step (2). Otherwise, go to step (11);
[0020] (11) Obtain the adapter information of the jth adapter on the client by calling the iphlpapi interface;
[0021] (12) Determine whether the j-th adapter is a wireless LAN card according to the adapter information of the j-th adapter obtained in step (11); if so, obtain the adapter index and proceed to step (13); otherwise, set j=j+1 and return to step (10);
[0022] (13) According to the index of the j-th adapter obtained in step (12), the port information on which the j-th adapter depends is obtained, and it is determined whether the port on which the j-th adapter depends is in a connected state. If so, an alarm message is popped up (specifically, the wireless network card on the client is turned off, the client is prohibited from transmitting information through WiFi, and an alarm message is sent to the user), and the process ends; otherwise, j=j+1 is set, and the process returns to step (10);
[0023] Preferably, the method further comprises the following steps before step (1):
[0024] (A) Detect whether a process has been closed from the device manager of the client, if so, proceed to step (B), otherwise continue the detection process of this step;
[0025] (B) Obtain the process identifier PID of the closed process;
[0026] (C) determining whether the PID of the closed process is the same as the PID of the protected program set in advance, if the PID is the same, proceeding to step (D), otherwise returning to step (A);
[0027] (D) Obtain the handle of the closed process, modify the permission list corresponding to the process according to the handle, close the process termination permission corresponding to the process, and then return to step (A).
[0028] Preferably, in step (11), the adapter information of the adapter includes the name, detailed description, hardware address, adapter type and adapter index of the adapter; and the adapter identification interface is obtained by obtaining the adapter index.
[0029] Preferably, in step (12), if the detailed description in the adapter information of the adapter does not include the word "Virtual", and the adapter type is IEEE 802.11, it means that the adapter is a wireless LAN card, otherwise it means that it is not.
[0030] Preferably, in step (13), if the operation status of the port on which the j-th adapter depends shows that it has been normally connected to the remote device, it means that the adapter is in a connected state, otherwise it means that it is not.
[0031] According to another aspect of the present invention, there is provided an industrial control network external device detection system based on an API, which is applied in a client connected to a server for communication, and the industrial control network external device detection system comprises:
[0032] The first module is used to set the detection counter check_cnt=1;
[0033] The second module is used to determine whether the detection counter check_cnt is greater than the preset detection total number N. If so, the process ends, otherwise it goes to the third module;
[0034] The third module is used to determine whether the detection counter check_cnt is an odd number or an even number. If it is an odd number, it will be transferred to the fourth module, otherwise it will be transferred to the ninth module;
[0035] The fourth module is used to set the counter i=1;
[0036] The fifth module is used to determine whether the counter i is greater than the total number of Bluetooth receivers on the client. If so, the detection counter check_cnt is set to check_cnt+1, and the second module is returned. Otherwise, the sixth module is entered.
[0037] The sixth module is used to determine whether the handle corresponding to the first Bluetooth device connected to the i-th Bluetooth receiver can be obtained by calling the bluetoothapi interface, if yes, enter the seventh module, otherwise set the counter i=i+1, and the fifth module;
[0038] The seventh module is used to call the bluetoothapi interface to scan multiple remote Bluetooth devices that can be scanned by the i-th Bluetooth receiver on the client, and determine whether there is at least one remote Bluetooth device connected to the Bluetooth device connected to the i-th Bluetooth receiver. If so, it means that the handle is in an illegal connection, an alarm message pops up, and the process ends; otherwise, enter the eighth module;
[0039] The eighth module is used to call the bluetoothapi interface to determine whether the handle corresponding to the next Bluetooth device connected to the i-th Bluetooth receiver can be obtained, if yes, return to the seventh module, otherwise set i=i+1 and return to the fifth module;
[0040] The ninth module is used to set the counter j=1;
[0041] The tenth module is used to determine whether the counter j is greater than the total number of adapters on the client, if so, set the detection counter check_cnt = check_cnt + 1, and return to the second module, otherwise enter the eleventh module;
[0042] The eleventh module is used to obtain the adapter information of the jth adapter on the client by calling the iphlpapi interface;
[0043] The twelfth module is used to determine whether the jth adapter is a wireless local area network card according to the adapter information of the jth adapter obtained by the eleventh module, and if so, obtain the adapter index and enter the thirteenth module, otherwise set j=j+1 and return to the tenth module;
[0044] The thirteenth module is used to obtain the port information on which the j-th adapter depends according to the index of the j-th adapter obtained by the twelfth module, and to determine whether the port on which the j-th adapter depends is in a connected state. If so, an alarm message is popped up (specifically, the wireless network card on the client is turned off, the client is prohibited from transmitting information through WiFi, and an alarm message is sent to the user), and the process ends; otherwise, j=j+1 is set, and the process returns to the tenth module.
[0045] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0046] 1. The present invention calls the application program interface provided by Windows for external connection detection, and does not need to connect to an external network. Therefore, it can solve the technical problem that the first method in the background technology still needs to access an external network, so there is still a risk of information leakage;
[0047] 2. The present invention proposes a software Agent installed on the client to perform external connection detection on the client to confirm whether the client is connected to the WiFi network or connected to other Bluetooth devices for communication. When it is found that the client is in an illegal connection, an alarm is issued and the illegal connection is disconnected. There is no need to install a monitoring alarm center in the intranet, so it can solve the technical problems of cumbersome development and inconvenient deployment of the C / S method in the background technology;
[0048] 3. The present invention directly performs external connection detection in the application layer of the client and prohibits forcibly closing the detection from the outside during the detection process. Therefore, it can solve the technical problems that the C / S method in the background technology cannot achieve accurate intrusion detection and blocking and the dual-machine method cannot detect when encountering a client equipped with a firewall;
[0049] 4. Since the present invention calls the application program interface that comes with Windows to implement the function of external detection, there is no need to consider the underlying source code or understand the details of its internal working mechanism. All operations are implemented at the application layer without considering the network environment. Therefore, it can solve the technical problem that when the dual-machine mode in the background technology is applied to some complex internal networks, the deployment of the monitoring center will be more complicated. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart of the API-based industrial control network external equipment detection method of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended 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 conflict with each other.
[0052] It should be noted that in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method, article or device including the elements. The orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0053] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0054] The basic idea of the present invention is to provide an industrial control network external connection device detection method based on the application programming interface (Application Programming interface, referred to as API). It calls the bluetoothapi interface to obtain the Bluetooth communication device information in the client, and calls the iphlpapi interface to obtain the relevant parameters of the client network to determine whether the client is connecting and communicating with the illegal external connection; design a new program protection mechanism - after detecting that the scanning program is closed from the process manager, modify the process termination authority of the program to prevent the program from being closed from the outside, and ensure continuous scanning of the client. Its purpose is to solve the information security problem existing in industrial control security by continuously scanning the client network card and Bluetooth.
[0055] The present invention is installed on a client that needs to detect illegal external connections (WiFi and Bluetooth), continuously scans the client, obtains client external connection information, and issues an alarm if illegal external connections occur. At the same time, the present invention has the functions of starting up and preventing killing at startup.
[0056] like Figure 1As shown, the present invention provides an industrial control network external device detection method based on an application programming interface (Application Programming interface, referred to as API), which is applied in a client connected to a server for communication, and specifically includes the following steps:
[0057] (1) Set the detection counter check_cnt = 1;
[0058] Preferably, the method of the present invention may further include the following steps before step (1):
[0059] (A) Detect whether a process has been closed from the client's device manager. If so, proceed to step (B). Otherwise, continue the detection process of this step until the program is exited and the process ends;
[0060] (B) Obtain the process identifier (PID) of the closed process;
[0061] (C) determining whether the PID of the closed process is the same as the PID of the protected program set in advance, if the PID is the same, proceeding to step (D), otherwise returning to step (A);
[0062] (D) Get the handle of the closed process, modify the permission list corresponding to the process according to the handle, and close the process termination permission (PROCESS_TERMINATE) corresponding to the process. At this time, the process cannot be terminated, thereby realizing the protection operation of the process, and then return to step (A).
[0063] (2) Determine whether the detection counter check_cnt is greater than the preset detection total number N. If so, the process ends; otherwise, proceed to step (3);
[0064] Specifically, the total number of detections N in this step is between 4000 and 6500, preferably 5760;
[0065] (3) Determine whether the detection counter check_cnt is an odd number or an even number. If it is an odd number, proceed to step (4); otherwise, proceed to step (9);
[0066] (4) Set counter i=1;
[0067] (5) Determine whether the counter i is greater than the total number of Bluetooth receivers on the client. If so, set the detection counter check_cnt = check_cnt + 1 and return to step (2). Otherwise, go to step (6);
[0068] (6) Determine whether the handle corresponding to the first Bluetooth device connected to the i-th Bluetooth receiver can be obtained by calling the bluetoothapi interface. If so, proceed to step (7); otherwise, set the counter i=i+1 and return to step (5);
[0069] (7) calling the bluetoothapi interface to scan multiple remote Bluetooth devices that can be scanned by the i-th Bluetooth receiver on the client, and determining whether there is at least one remote Bluetooth device connected to the Bluetooth device connected to the i-th Bluetooth receiver. If so, it indicates that the handle is in an illegal connection, and an alarm message is popped up (specifically, all Bluetooth devices connected to the i-th Bluetooth receiver on the client are disconnected, and an illegal Bluetooth connection alarm message is sent to the user), and the process ends; otherwise, proceeding to step (8);
[0070] (8) Call the bluetoothapi interface to determine whether the handle corresponding to the next Bluetooth device connected to the i-th Bluetooth receiver can be obtained. If yes, return to step (7); otherwise, set i=i+1 and return to step (5);
[0071] The advantage of step (4) to step (8) is that the Bluetooth devices on the client are checked one by one to confirm whether they are in an illegal connection state, and there will be no omissions that may lead to client information leakage.
[0072] (9) Set counter j = 1;
[0073] (10) Determine whether the counter j is greater than the total number of adapters on the client. If so, set the detection counter check_cnt = check_cnt + 1 and return to step (2). Otherwise, go to step (11);
[0074] (11) Obtain the adapter information of the j-th adapter on the client by calling the iphlpapi interface, and proceed to step (12);
[0075] Specifically, the adapter information of the adapter includes the name, detailed description, hardware address, adapter type, and adapter index of the adapter; the adapter identification interface is obtained by obtaining the adapter index.
[0076] (12) Determine whether the j-th adapter is a wireless LAN card according to the adapter information of the j-th adapter obtained in step (11); if so, obtain the adapter index and proceed to step (13); otherwise, set j=j+1 and return to step (10);
[0077] Specifically, if the detailed description in the adapter information of the adapter does not include the word "Virtual" and the adapter type is IEEE 802.11, it means that the adapter is a wireless LAN card, otherwise it means that it is not.
[0078] (13) According to the index of the j-th adapter obtained in step (12), the port information on which the j-th adapter depends is obtained, and it is determined whether the port on which the j-th adapter depends is in a connected state. If so, an alarm message is popped up (specifically, the wireless network card on the client is turned off, the client is prohibited from transmitting information through WiFi, and an alarm message is sent to the user), and the process ends; otherwise, j=j+1 is set, and the process returns to step (10);
[0079] Specifically, if the operation status of the port on which the j-th adapter depends shows that it is normally connected to the remote device, it means that the adapter is in a connected state, otherwise it means that it is not.
[0080] The advantage of step (9) to step (13) is that after obtaining the information of the client adapter, the obtained information can be filtered. By checking the port status on which the adapter depends after filtering, it can be determined whether the adapter is in a state of illegal connection. It is only necessary to process and filter the obtained information, and there is no need for a complicated detection packet transmission process.
[0081] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting external equipment in an industrial control network based on an API, which is applied in a client connected to a server, and is characterized in that: The industrial control network external device detection method comprises the following steps: (1) Set the detection counter check_cnt=1; (2) Determine whether the detection counter check_cnt is greater than the preset total number of detections N. If so, the process ends; otherwise, proceed to step (3); (3) Determine whether the detection counter check_cnt is an odd number or an even number. If it is an odd number, proceed to step (4); otherwise, proceed to step (9); (4) Set counter i=1; (5) Determine whether the counter i is greater than the total number of Bluetooth receivers on the client. If so, set the detection counter check_cnt = check_cnt + 1 and return to step (2). Otherwise, go to step (6). (6) Determine whether the handle corresponding to the first Bluetooth device connected to the i-th Bluetooth receiver can be obtained by calling the bluetoothapi interface. If so, proceed to step (7); otherwise, set the counter i=i+1 and return to step (5); (7) Call the bluetoothapi interface to scan multiple remote Bluetooth devices that can be scanned by the i-th Bluetooth receiver on the client, and determine whether there is at least one remote Bluetooth device connected to the Bluetooth device connected to the i-th Bluetooth receiver. If so, it means that the handle is in an illegal connection, an alarm message pops up, and the process ends; otherwise, go to step (8); (8) Call the bluetoothapi interface to determine whether the handle corresponding to the next Bluetooth device connected to the i-th Bluetooth receiver can be obtained. If so, return to step (7); otherwise, set i=i+1 and return to step (5); (9) Set counter j = 1; (10) Determine whether the counter j is greater than the total number of adapters on the client. If so, set the detection counter check_cnt=check_cnt+1 and return to step (2). Otherwise, go to step (11). (11) Get the adapter information of the jth adapter on the client by calling the iphlpapi interface; (12) Determine whether the j-th adapter is a wireless LAN card based on the adapter information of the j-th adapter obtained in step (11); if so, obtain the adapter index and proceed to step (13); otherwise, set j=j+1 and return to step (10); (13) According to the index of the j-th adapter obtained in step (12), the port information on which the j-th adapter depends is obtained, and it is determined whether the port on which the j-th adapter depends is in a connected state. If so, an alarm message is popped up, specifically, the wireless network card on the client is turned off, the client is prohibited from transmitting information through WiFi, and an alarm message is sent to the user, and the process ends; otherwise, j=j+1 is set, and the process returns to step (10).
2. The method for detecting external equipment in an industrial control network based on an API according to claim 1, characterized in that: The method further comprises the following steps before step (1): (A) Detect whether a process has been closed from the client's device manager. If so, proceed to step (B). Otherwise, continue the detection process of this step. (B) Get the process identifier PID of the closed process; (C) Determine whether the PID of the closed process is the same as the PID of the pre-set protected program. If they are the same, go to step (D); otherwise, return to step (A); (D) Get the handle of the closed process, modify the permission list corresponding to the process according to the handle, close the process termination permission corresponding to the process, and then return to step (A).
3. The method for detecting external equipment in an industrial control network based on an API according to claim 1 or 2, characterized in that: In step (11), the adapter information of the adapter includes the name, detailed description, hardware address, adapter type and adapter index of the adapter; and the adapter identification interface is obtained by obtaining the adapter index.
4. The method for detecting external equipment in an industrial control network based on an API according to claim 3 is characterized in that: In step (12), if the detailed description in the adapter information of the adapter does not include the word "Virtual" and the adapter type is IEEE 802.11, it means that the adapter is a wireless LAN card, otherwise it means that it is not.
5. The method for detecting external equipment in an industrial control network based on an API according to claim 1, characterized in that: In step (13), if the operation status of the port on which the j-th adapter depends shows that it is normally connected to the remote device, it means that the adapter is in a connected state, otherwise it means that it is not.
6. An API-based industrial control network external equipment detection system, which is applied in a client connected to a server, characterized in that: The industrial control network external equipment detection system includes: The first module is used to set the detection counter check_cnt=1; The second module is used to determine whether the detection counter check_cnt is greater than the preset detection total number N. If so, the process ends, otherwise it goes to the third module; The third module is used to determine whether the detection counter check_cnt is an odd number or an even number. If it is an odd number, it will be transferred to the fourth module, otherwise it will be transferred to the ninth module; The fourth module is used to set the counter i=1; The fifth module is used to determine whether the counter i is greater than the total number of Bluetooth receivers on the client. If so, the detection counter check_cnt is set to check_cnt+1 and the second module is returned. Otherwise, the sixth module is entered. The sixth module is used to determine whether the handle corresponding to the first Bluetooth device connected to the i-th Bluetooth receiver can be obtained by calling the bluetoothapi interface. If so, enter the seventh module, otherwise set the counter i=i+1 and return to the fifth module; The seventh module is used to call the bluetoothapi interface to scan multiple remote Bluetooth devices that can be scanned by the i-th Bluetooth receiver on the client, and determine whether there is at least one remote Bluetooth device connected to the Bluetooth device connected to the i-th Bluetooth receiver. If so, it means that the handle is in an illegal connection, an alarm message pops up, and the process ends; otherwise, enter the eighth module; The eighth module is used to call the bluetoothapi interface to determine whether the handle corresponding to the next Bluetooth device connected to the i-th Bluetooth receiver can be obtained. If yes, return to the seventh module; otherwise, set i=i+1 and return to the fifth module; The ninth module is used to set the counter j=1; The tenth module is used to determine whether the counter j is greater than the total number of adapters on the client. If so, the detection counter check_cnt is set to check_cnt+1, and the second module is returned. Otherwise, the eleventh module is entered. The eleventh module is used to obtain the adapter information of the jth adapter on the client by calling the iphlpapi interface; The twelfth module is used to determine whether the jth adapter is a wireless local area network card according to the adapter information of the jth adapter obtained by the eleventh module, and if so, obtain the adapter index and enter the thirteenth module, otherwise set j=j+1 and return to the tenth module; The thirteenth module is used to obtain the port information on which the j-th adapter depends according to the index of the j-th adapter obtained by the twelfth module, and to determine whether the port on which the j-th adapter depends is in a connected state. If so, an alarm message is popped up, specifically, the wireless network card on the client is turned off, the client is prohibited from transmitting information through WiFi, and an alarm message is sent to the user, and the process ends; otherwise, j=j+1 is set, and the process returns to the tenth module.
