You are on page 1of 6

Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Cracking Wi-Fi using Python


Bhuvana Chandra Shetty, Thanushree T., Divya Lokannavar
Computer Science of Engineering
AMC Engineering College Bengaluru, India

Dr. Nirmala S.
Professor, AIML
AMC Engineering College Bengaluru, India

Abstract:- Ethical hacking of Wi-Fi passwords is a A. Hacking of Wi-Fi


process of intentionally testing the security of a Wi-Fi The challenge with public Wi-Fi is that it come with a
network with the owner's permission. The main multiplicity of security dangers. While big businesses may
objective of ethical hacking is to identify and address any believe they are providing a useful service to their
security vulnerabilities before malicious actors can consumers, the security on these networks is likely to be
exploit them. In an ethical hacking engagement, a weak or non-existent. Since the initial days of something
certified and experienced security professional conducts like the 802.11b architecture in the late 1990s, mobile
various tests to determine the level of security of the Wi- hotspots have proven infamously unsafe. Major 802.11
Fi network. The tests may include network scanning, faults, including as fundamental security flaws, decryption
passwords cracking, social engineering, and other flaws, and authenticity issues, have been uncovered since
methods to identify weaknesses in the network's security. the standard's debut[5][9]. Since then, wireless operations
Once the security vulnerabilities are identified, the have always been on the rise. The situation is getting enough
security professional works with the network owner to that severe that the Wi-Fi Affiliation has established two
address the issues and improve the security of the intrusion prevention standards and guidelines to fightback
network. This may involve changing default passwords, against the aggressors. The Wi-Fi Secured Access (WPA)
updating firmware, and implementing stronger standard, which was established by the Wi-Fi Affiliation,
encryption protocols. The benefits of ethical hacking of represented as a temporary fix to a well WEP attack vectors
Wi-Fipasswords include enhancing the security of the it until IEEE released the 802.11i standard. This is now the
network, preventing unauthorized access, and protecting approved Standard specification that includes the WPA
the privacy of the network owner and its users. It is patches for WEP, as well as various cryptographic
important to note that any hacking activity without the procedures to make wireless networks even more secure.
owner's consent is illegal and can lead to serious legal  Most common attacks
consequences.  Jamming signals
 Unencrypted networks
Keywords:- Wireless network, Wi-Fipasswords, Wi-Fi
 Malware distribution
hacking, phishing using Python script, Wireless security
 Mis configuration Attacks
protocols.
 Sniffing and snooping
I. INTRODUCTION  Malicious hotspots[4]

Ethical hacking of Wi-Fi passwords is a process of  Aircrack-ng:


testing the security of a Wi-Fi network with the owner's Aircrack is an all in one packet sniffer, WEP and
permission. The objective is to identify potential WPA/WPA2 cracker, analyzing tool and a hash capturing
vulnerabilities in the network's security and address them tool. It is a tool used for Wi-Fi hacking. It helps in capturing
before malicious actors can exploit them[1]. The increasing the package and reading the hashes out of them and even
reliance on wireless networks for personal and business use cracking those hashes by various attacks like dictionary
has made Wi-Fi security a critical concern. Hackers and attacks. It supports almost all the latest wireless interfaces.
cybercriminals can use a variety of methods to gain
unauthorized access to Wi-Fi networks, steal sensitive Reaver is a package that is a handy and effective tool
information, and compromise the security of the network's to implement a the brute force attack against Wi-Fi
users. Ethical hacking of Wi-Fipasswords involves Protected Setup (WPS) registrar PINs to recover
simulating the techniques used by malicious actors to WPA/WPA2 passphrases. It is depicted to be a robust and
identify any security weaknesses in the network. By doing practical attack against WPS, and it has been tested against a
so, it allows network owners to take proactive measures to wide variety of access points and WPS implementations. In
secure their networks and prevent unauthorized access[2][3]. today’s time hacking WPA/WPA2 is exceptionally a tedious
In an ethical hacking engagement, a certified security job.A dictionary attack could take days, and still will not
professional uses various tools and techniques to test the succeed. On average Reaver will take 4-10 hours to recover
network's security. The results of the tests are then used to the target AP’s plain text WPA/WPA2 passphrase,
identify potential vulnerabilities and develop a plan to depending on the AP. Generally, it takesaround half of this
address them in this paper we are using the brute force time to guess the correct WPS pin and recover the
algorithm method to crack the Wi-Fi passwords. passphrase.

IJISRT23MAY1044 www.ijisrt.com 1500


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
 Pixie WPS:  Reconnaissance: Gathering information about the target
PixieWPS is a tool used to perform the the brute force network, such as the type of Wi-Fi router being used and
attack on WPS pins to crack them. It is a tool written in C the security measures in place.
language and has a lot of features like checksum  Scanning: Using tools to scan the network for open ports,
optimization, Reduced entropy of the seed, Small Diffie- services, and vulnerabilities that can be exploited.
Hellman keys, etc.  Enumeration: Gathering more detailed information about
the target systems and services that were identified during
 Wi-Fite: scanning.
When it comes to Wi-Fi Hacking Wi-Fite is one of the
 Exploitation: Attempting to exploit the identified
most useful tools when you have a lot of wireless devices
vulnerabilities to gain unauthorized access to the network.
across your location. It is used to crack WEP or WPA/WPS
 Post-Exploitation: Once access has been gained, the
encrypted wireless networks in a row. It could easily be
ethical hacker may attempt to maintain access and
customized to automate the process of multiple Wi-Fi
escalate their privileges, in order to identify additional
hacking. It comes packed with many features, few of them
vulnerabilities or gather more sensitive information.
are listed below.
 Reporting: Finally, the ethical hacker should report their
B. Hacking using phishing with Python script: findings to the owner of the network, along with
Phishing is a tactic that entails impersonating a recommendations for improving security and addressing
trustworthy company or service in order to fool a user into the vulnerabilities that were identified.
revealing sensitive information or login credentials.
Phishing may be utilised over Wi-Fi networks, despite the The most crucial phase of building any model is
fact that it is typically connected with email or websites. It's system design. shows our project's fundamental system
architecture.
crucial to tackle this subject carefully and ethically,
though.Before carrying out any tests or gathering any data, it This project looked at WPA cracking, and it was
is crucial to adhere to ethical standards and get the required discovered that WPA-PSK cracking is the sole method that
permits and approvals from the appropriate parties if you can be used to compromise this security standard. According
want to do research on the use of phishing on Wi-Fi to the standard for PSK after authentication occurs key
networks. This might entail requesting permission from the derivation. Key derivation consist softwo handshakes. The
network's owner or receiving ethical clearance from the first is 4-Way Handshake for PTK (Pairwise Transient Key)
appropriate institutional review board (IRB).[7][9] and GTK (Group Transient Key) derivation. And the second
It is crucial to take into account any dangers and one is Group Key Handshake for GTK renewal[7]. The
outcomes before undertaking research on the use of phishing cracking concept is based on imperfection in 4-Way
on Wi-Fi networks. Cybersecurity may be seriously Hanshake, where the PTK andGTK keys are derivated from
threatened by phishing, thus any study on the subject needs PMK (Pairwise Master Key). In the WPA-PSK system PMK
is derived from PSK. The way to derived KCK (Key
to be done carefully and cautiously. It is crucial to make sure
Confirmation Key) fromPSK is visible in this figure.
that any testing is carried out with the owner of the
network's express written approval and correct authority, Subsequently is calculated PMK from PSK, then the PTK is
derived and first 128 bits of PTK represents the Key
and that all necessary precautions are followed to prevent
any harm or damage from being done to the target or their Confirmation key [8]. KCK is so important for WPA-PSK
network. passwords cracking, because it is used for computing MIC.
Below fig. 1 represents the architecture of the system.
II. SYSTEM ARCHITECTURE

A secure Wi-Fi network typically includes a Wi-Fi


router, wireless access points (WAPs), clients, and network
security measures such as encryption protocols, access
control mechanisms, firewalls, and intrusion detection
systems. Some potential vulnerabilities that an ethical
hacker may look for include weak passwords, unsecured
access points, outdated software, man-in-the-middle attacks,
and rogue access points. It is important to remember that
ethical hacking should only be conducted with the
permission and consent of the network owner, and in a
responsible and ethical manner.

IJISRT23MAY1044 www.ijisrt.com 1501


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165

Fig. 1: Basic system architecture

III. EXISTING SYSTEM Perpetration testing, sometimes known as a "pen test," is a


popular technique for evaluating the security of a WLAN
The Wi-Fi encrypted protocols as everyone is aware of network. Pen testing simulates a cyberattack against a
very much can be easily cracked, damaged, used and network to find possible security gaps and vulnerabilities.
destroyed using several ways is also considered as a drastic The objective is to identify potential attack vectors and offer
and wide category flaw . The most popular and famous suggestions for mitigating them. The owner's consent is
procedures or steps that almost every technically sound required for penetration testing, and it's crucial to make sure
person knows in cracking the passwords and exploiting the the test doesn't harm the network or data.
user’s network by not letting him know is using
“aircrackng” To crack using this method quickly without  Retreiving the saved passwords of WLAN networks:
much major thought or effort, the user has to have a laptop a The passwords for the WLAN networks that their PCs are
desktop or a machine with Kali Linux. Along with it a typically connected to are frequently forgotten by the
remote card which supports monitor/injection mode. Aside users. If the networks are permitted to join automatically,
from these apparatuses, the client additionally needs to get all previously entered passwords will be retained on the
an outside remote card which can monitor/injection mode. computer. On the other hand, if a third party gains access
The form of packets in the air is transmitted by Wi-Fi. By to the user system, he can retrieve the saved passwords. If
using ‘airodump’ the captured packets are dumped in the air. the next two commands are entered into the Windows
The users that are connected to victim’s Wi-Fi are selected command prompt, a list of all the SSIDs to which the
since cracking isn’t possible for this a valid WPA handshake machine has connected using the "Connect
is needed The attacker captures handshake by sending de- Automatically" option will be shown. For each SSID, the
authentication packets to the host which is connected to Wi- passwords is saved as key content in the security settings.
Fi [5][6]. This method tests Wi-Fipasswords through a Fig 2 depictsthe basic system architecture for our project.
wordlist basically performing a dictionary attack. Also, the In this project, an investigation of WPA cracking has been
time taken is very long. So to overcome this limitation the carried out, and it has been found out that WPA-PSK
proposed project comes with much more reliable and cracking is the only possible way to crack this security
standard cracking methods.Without adequate authorisation, standard
passwords extraction from WLAN networks is seen as
unethical and maybe illegal. With the right permission and  Commands: C1. netsh wlan show profiles
the express legal approval of the network owner, there are C2. netsh wlan show profile key=clear
ethical ways to evaluate the security of WLAN networks.

Fig . 2: Organization Structure.

IJISRT23MAY1044 www.ijisrt.com 1502


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
IV. DATA PREPARATION TECHNIQUES Testing Accuracy of prediction
Performance 75%
Because of its simple syntax and readability, Python, Precision 0.8
an interpreted, object-oriented programming language Recall 0.8181
comparable to PERL, has grown in popularity. Python is Table 1: Logistic Regression Classifier.
touted as being very simple to learn and portable, meaning
that its statements may be understood in a variety of VI. METHODOLOGY
operating systems, including UNIX-based systems, Mac OS,
MS-DOS, OS/2, and several versions of Microsoft Windows The brute force is a problem-solving strategy that
98[4][8]. Python was developed by Guido van Rossum, a involves extensively testing all viable solutions. The
former resident of the Netherlands and a fan of Monty mechanism for employing the brute force is determined by
Python's Flying Circus at the time. The source code is the problem at hand. The generic approach, on the other
publicly accessible and ready for reuse and modification. hand.
Significant numbers of people utilise Python.
The brute force is a technique for solving problems by
Collect data from the ethical hacking process, exhaustively testing all possible solutions. The methodology
including information on the tools and methods used, the for using the brute force depends on the specific problem
results obtained, and any vulnerabilities identified. you are trying to solve. However, the general approach
involves the following steps:
Clean and organize the data to remove any  Identify the problem: You need to clearly understand the
inconsistencies or errors that may affect the accuracy of the problem you are trying to solve and determine if a the
analyze. brute force approach is appropriate.
 Define the solution space: You need to define the space of
Use data analysis techniques to identify patterns and
possible solutions. This includes determining the range of
trends in the data, such as identifying common passwords
values that each variable can take, and how many
patterns or weak spots in the network security.
variables are involved.
Use the results of the data analysis to identify potential  Generate all possible solutions: Once you have defined
vulnerabilities and weaknesses in the network security. This the solution space, you need to generate all possible
can include identifying passwords that are easily guessable, solutions. This can be done by systematically iterating
outdated encryption methods, or open ports that may be through all possible combinations of values for the
vulnerable to attack[3][7]. variables involved.
 Evaluate each solution: For each possible solution, you
Provide the owner of the Wi-Fi network with a need to evaluate whether it satisfies the problem
detailed report that includes recommendations for improving constraints and objectives. This may involve performing
the security of the network, such as upgrading encryption calculations or simulations.
methods, changing passwords, and implementing additional  Select the best solution: Once you have evaluated all
security measures. possible solutions, you need to select the one that meets
the problem requirements and objectives.
V. SYSTEM TESTING  Optimize the solution: If necessary, you may need to
System Testing is a level of the software testing where optimize the selected solution further by refining the
complete and integrated software is tested.Thepurposeof this variables, or applying additional algorithms or techniques.
test istoevaluatethe system’scompliance It should be noted that the brute force can be a very
withthespecifiedrequirements.System Testing (ST) is a black computationally expensive strategy, particularly for
box testing technique performed to evaluate the complete problems with huge solution spaces. In such circumstances,
systemthesystem's compliance against specified more efficient algorithms or techniques may be required to
requirements. InSystem testing, the functionalities ofthe lessen the computing load.
systemare tested from an end-to-end perspective[6]. An
accuracy of 75% in cracking Wi-Fipasswords using Python VII. CREDENTIALS
is a significant achievement. It means that out of 100
attempts, the passwords was successfully cracked in 75 Using penetration testing tools like Metasploit, a well-
cases, which is a good success rate. However, the remaining known open-source platform for creating, testing, and
25% may still pose a challenge, and the accuracy rate may running exploit code, is one moral way to evaluate network
vary depending on various factors, such as the complexity of security. Nmap is a programme for network discovery and
the passwords, the security level of the Wi-Fi network, and mapping, and other tools like Wireshark may be used to
the hardware and software used for cracking. It is also capture and analyse network traffic.
essential to note that cracking Wi-Fi passwords without the
owner's consent is a serious offense and may result in legal It is crucial to make sure that any testing is done with
consequences. the owner of the network's correct authority and legal
agreement while doing research on the security of Wi-Fi
networks. Furthermore, it's critical to take the necessary

IJISRT23MAY1044 www.ijisrt.com 1503


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
precautions to guarantee that any testing doesn't harm or discusses the many sorts, strategies, and hacker assaults.
damage the target or their network[6][3]. Finally, it must be noted that ethical hacking is a tool that,
when used properly, can contribute to a deeper
Consider adopting ethical hacking methods like comprehension of computers.
passwords cracking if you're interested in learning more
about a Wi-Fi network's credentials. For cracking In a sense, any wireless network can be attacked in a
passwords, a variety of programmes and tools are available, variety of ways. Potential vulnerabilities include using the
including Hashcat and John the Ripper. default SSID or passwords, WPS pin authentication,
inadequate access control, and leaving the access point
Wi-Fi credentials are frequently compromised accessible in unlocked locations, all of which can lead to
ethically for the following reasons: data theft of critical information. The architecture of kismet
 Compliance: Ethical hacking of Wi-Fipasswords may be in WIDS mode may protect the network from DOS, MiTM,
motivated by compliance requirements, such as regulatory and MAC spoofing attacks. Regular software upgrades and
or industry-specific requirements for security testing. the usage of firewalls, on the other hand, may assist protect
 Risk mitigation: Organizations may use ethical hacking the network from external intruders. Ethical hacking is the
of Wi-Fipasswords as a proactive measure to identify practice of identifying problems in a service, system, or
potential vulnerabilities before they can be exploited by institution's infrastructure that may be inject malicious code.
malicious attackers, thus reducing the risk of a security By legitimately breaking into networks and searching for
breach. weakest places, they employ this approach to avoid
 Reputation: Ethical hacking of Wi-Fipasswords can help invasions and privacy violations.
organizations demonstrate their commitment to security
and their proactive approach to identifying and addressing IX. RESULTS
potential vulnerabilities.
For validating the task of retrieving the saved
 Security improvement: By identifying weaknesses in the
passwords of connected WLAN networks, the commands
network security, ethical hacking of Wi- Fi passwords can
help organizations implement stronger security measures C1 and C2 are executed in the second author’s machine.
When the command C1 is executed, the list of all WLAN
and reduce the risk of a security breach.
networks or profiles (SSIDs) to which the machine is
 Customer trust: Customers may be more likely to trust
previously connected through the option “Connect
organizations that demonstrate a commitment to security
Automatically”. The same can be observed. It can be
and a proactive approach to identifying and addressing
observed that the machine was previously connected to five
potential vulnerabilities.
networks earlier and the user profiles in the graphic include
VIII. CONCLUSION AND FUTURE the names of those networks. Executing the command C2
ENHANCEMENTS will allow you to crack profiles that have been obtained, as
demonstrated above. The command was entered into the
The entire world is advancing towards technological command line and run on one of the networks for
advancement, and as a result, real-world processes are confirmation. The command C2 will be in the format "netsh
becoming more and more digitalized, increasing the danger wlan show profile Redmi key=clear" and will be directed to
of security. The workings of malevolent hackers, also known the network "Redmi". Figure 3 displays a list of all user
as crackers, who attempt to illegally breach security, and networks and passwords that have been documented in
white hat hackers, also known as ethical hackers, who try to detail. The below fig 3 tells about cracked passwords using
preserve security, were discussed in this study. Hacking is Python. The saved passwords will be put up but it won’t put
important since it deals with all sides of being good or up other networks passwords but it will be encypted with
harmful, much like the computer system. This essay also jumbled passwords.

Fig. 3: Cracked Wi-Fi passwords

IJISRT23MAY1044 www.ijisrt.com 1504


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
REFERENCES
.
[1.] Jamil and M. N. A. Khan, “Is Ethical Hacking
Ethical?,” Int. J. Eng. Sci. Technol., 2011.
[2.] R. Hartley, D. Medlin, and Z. Houlik, “Ethical
Hacking: Educating Future Cyber security
Professionals,” Proc. EDSIG Conf., 2017.
[3.] Palmer, “Ethical hacking,” IBM Syst. J., 2001,
doi: 10.1147/sj.403.0769.
[4.] H.-R. Bae, M.-Y. Kim, S.-K. Song, S.-G. Lee, and Y.-
H. Chang, “Security Attack Analysis for Wireless
Router and Free Wi-Fi Hacking Solutions,” J.
Converg. Cult. Technol., 2016, doi:
10.17703/jcct.2016.2.4.65.
[5.] Z. Zhou, C. Wu, Z. Yang, and Y. Liu, “Sensorless
sensing with Wi-Fi,” Tsinghua Sci. Technol., 2015,
doi: 10.1109/TST.2015.7040509.
[6.] D. Bharadia, K. R. Joshi, M. Kotaru, and S. Katti,
“BackFi: High Throughput Wi-Fi Backscatter,”
Comput. Commun. Rev., 2015, doi:
10.1145/2785956.2787490.
[7.] Y. He, M. Chen, B. Ge, and M. Guizani, “On Wi-Fi
Offloading in Heterogeneous Networks: Various
Incentives and Trade-Off Strategies,” IEEE Commun.
Surv. Tutorials, 2016, doi:
10.1109/COMST.2016.2558191.
[8.] V. Kondrat, “Factors influencing consumer behavior,”
2016. doi: 10.21661/r-80748.
[9.] M. (2012). Bansal A.& Arora, “Ethical Hacking and
Social Security. Radix International Journal of
Research in Social Science”

IJISRT23MAY1044 www.ijisrt.com 1505

You might also like