In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to use Python to crawl wireless network". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use Python to crawl wireless network" can help you solve the problem.
01. How to connect to wifi
First of all, how does our computer connect to wifi? Take our laptops, for example, our laptops have wireless network cards, as shown in the following figure:
When we connect to the WiFi, the wireless card will automatically help us scan the nearby WiFi signal and return some information about the WiFi signal, including the name of the network (SSID), the strength of the signal, the way of encryption and authentication, and so on. This information is not visible to us during the operation. When we want to connect to a specified WiFi, we all need to authenticate. The function of authentication is to protect the access of the wifi. Note that the authentication here is not the password we entered, but the way to encrypt the password we entered.
That is, we will enter the amount of WiFi password, a way of encrypted transmission. The commonly used way is WPA or WPA2PSK, mainly for personal or home networks, etc., and the security requirements are not very high. This is shown in the following figure.
When we enter the password, a prompt will pop up to tell us some information, which is actually specifying the way of authentication encryption. After we click "Yes", we can happily surf the Internet.
02. Analog access using pywifi
Pywifi is a third-party library that needs to be installed with pip in advance, and then we use the pywifi module to simulate this process. The first is to determine whether the computer is in the state of WiFi connection, the code is shown in the following figure.
The first step is to create an object of pywifi, and then assign the information of the computer wireless network card to ifaces. Then determine the status of the ifaces (states) to know whether the computer is connected to the wireless network.
We mentioned above that the wireless network card will return the wireless signal information, and then we will output the nearby wireless signals we scanned and their information.
As shown on the left side of the figure above, we output the name of the wireless signal and its corresponding encryption. The data in the second code is actually a configuration file. The configuration file here can be understood as a file that stores the wireless signal information we are connected to, which contains the wireless signal name, password, authentication method and other information.
03. Crack the wifi password
Next, we will use pywifi to crack the WiFi password. We imitate the process of manually entering passwords and verify them. If the passwords are wrong, we keep on experimenting with slippery passwords until successful. The code for the section is as follows:
In the program, we first read the name of the WiFi we want to crack from console, then from our pre-set WiFi password book, keep reading the WiFi password, and then configure the profile information, including the name of WiFi, authentication method and WiFi password. If the password is incorrect, change the WiFi password and continue to validate until the authentication is correct. The following picture shows the results of the experiment.
This is the end of the introduction to "how to crawl a wireless network with Python". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.