You are on page 1of 6

Phishing Attack Using Python Scripting

Nathan Anderson, Matthew Ennis, John LaCava and Mira Yun


Department of Computer Science
Boston College
Chestnut Hill, MA 02467, USA
{anderagh, lacavajo, ennismg, yunmd}@bc.edu

Abstract – Connecting to WiFi networks, Attackers no longer need to directly


both private and public, can be done in target the network in order to obtain sensitive
seconds by almost any electronic device. information - they can simply manipulate the
Despite their widespread use, they are still user into giving it away themselves. While more
incredibly susceptible to attackers attempting technical and advanced hacking tools exist, no
to steal information from individuals and method has been more popular or easier to
larger organizations. This paper will propose implement than the clone phishing attack.
a clone phishing attack that provides an
attacker with an undetectable method to steal II. CLONE PHISHING ATTACKS
WiFi network names and passwords, then ​ Clone phishing, a form of phishing
demonstrate a Denial of Service attack on a attack in which fraudulent websites or email
victim’s network. messages are created to impersonate legitimate
sources, has become increasingly dangerous in
I. INTRODUCTION recent years. According to a study by
Wireless networks have become nearly cybersecurity firm Proofpoint, clone phishing
unavoidable in our daily twenty-first century accounted for nearly one-third of all phishing
lives. Simply put, wireless networks connect us attacks in 2020, and this number is only
to other computers, cell phones, and tablets expected to rise in the coming years [1].
without the need for any wires. ​However as the The use of advanced tactics and
prevalence of wireless networks increases, technologies by attackers has made clone
specifically Wireless Local Area Networks phishing more difficult to detect and mitigate. In
(WLANs), the issue of network security 2020, the number of clone phishing attacks that
becomes exceedingly important. leveraged compromised accounts or domains
Given that these networks transmit increased by 200%, according to a report by
information through the air, hackers attempting cybersecurity firm Cofense [2]. This approach
to intercept and disrupt this traffic have crafted allows attackers to bypass traditional security
inventive ways to do so since the inception of measures and gain access to sensitive
wireless networks. As newer wireless security information without being detected.
protocols are developed and implemented to The consequences of clone phishing
prevent these attacks, hackers have begun to attacks can be severe and long-lasting, as
exploit the one aspect of the connective network evidenced by the increasing number of data
that doesn’t receive updates - the user. breaches and financial losses reported by
individuals and organizations. A recent survey
by cybersecurity company, Ironscales, found identifiers (SSIDs), or simply the
that 75% of IT professionals reported an network names, and passwords from the victim
increase in phishing attacks during the onto a .txt file that would be returned to the
COVID-19 pandemic, with 31% reporting at attacker’s inbox. In the end, the script would
least one successful attack resulting in a data then delete their stored network names and
breach [3]. disconnect them entirely from the internet.
For the success of the attack, it is crucial
III. CLONE PHISHING SIMULATION
for the victim to be using a PC that is running
To prevent and mitigate clone phishing any recent Windows OS. The Python script
attacks, we ran an experiment to test how easy it takes advantage of the Windows specific
could be to execute one that attempts to steal a command line argument “netsh” to fetch then
user’s stored WiFi passwords. In order to fully delete the SSIDs and passwords, which requires
understand a clone phishing attack, we had to do no detectable administrative access. Once this
it from the perspective of the attacker. criteria is met, the script is then free to iterate
Eventually, we hope to brainstorm through the stored network profiles, saving to
implementation methods in which larger the .txt file along the way.
organizations or individuals can use to avoid
clone phishing attacks.
A. Setup and Phishing Attack
For our experiment, we prepared
software and hardware such as Python3,
Windows OS, Gmail, Kali Linux as well as two
Windows computers. The attack loosely follows
the experiment conducted by Harish Musthyala
and P. Nagarjuna Reddy, who provided us with
the basic Python instructions for the attack [4].
We then drafted a clone phishing email that
mimics that of an official Boston College email.
For this email, we based it off of survey emails
that are typically sent by BC to its students. We
surveyed about ten BC students, with a majority
confirming it to be believable.
From this, we embedded a hyperlink
into the BC email as well as step by step
instructions in order for us to run a Python script
Fig. 1. Drafted Clone Phishing Email
[Fig.1]. Then, we wrote a Python script that
successfully obtained stored network service set
B. Denial of Service Attack (DoS) TP-Link router on BC’s campus, but soon came
to realize that the campus’ WiFi protocols
In order to demonstrate how a hacker
wouldn’t allow us to run this attack. Thus, we
could take this phishing attack a step further, we
conducted the experiment off campus on a
showed how a DoS attack would be performed.
private WiFi router. Following all these steps,
Within the Python script we included a line of
we could test the effectiveness of a full phishing
code that would retrieve the victim's Basic
attack from the perspective of an attacker.
Service Set Identifier (BSSID) for the current
network they are using, and send this The phishing attack consistently and
information back to the hacker along with the successfully executed on the personal WiFi
other SSIDs. For this attack to be feasible, we network during the three separate trials. The
are making the assumption that the hacker is attack effectively gathered network SSIDs and
within range of the victim’s wireless network. their corresponding passwords, which were then
After obtaining this information, we switch to a successfully returned to the attackers without
machine running Kali Linux Live and use the the victim’s knowledge [Fig. 3]. The latter was
correct SSID and password from the .txt file to especially important for our goals, as the
join the victims network. Once connected to the principal idea behind a phishing attack (and
network, we use the victim’s BSSID along with cyber attacks in general) is the inability for the
our own machine's Media Access Control user to know that they are falling victim.
(MAC) address as input arguments to run a DoS
Public networks that require no
Kali Linux terminal command [Fig. 2].
password or an external method of
This deauthentication command will authentication were returned with no passwords,
send packets to the router at an immense rate, whereas private networks were returned with
denying any user the ability to connect to it. their corresponding unique password.
Unfortunately, we weren’t able to actually Additionally, the victims were successfully
execute the attack due to configuration issues, disconnected from their current network, as
but this is just one simple example of a harmful intended. These outcomes demonstrate the
action a hacker could do once obtaining this attack's effectiveness in achieving its goals.
information.

Fig. 2. Kali Linux DoS Command

IV. EVALUATION
Fig. 3. Retrieved SSIDs and Passwords
We conducted the WiFi attack in three
separate trials. If the results are consistent
A. Limitations
throughout the three trials, we would assume
that the attack is successful and that the Python
One aspect that our team wishes we
script works. Our first hope was to use a
could have improved upon was the delivery of
the Python code to the victim. In order for the
attack to correctly execute, the victim needs to V. CONCLUSION

follow a series of suspicious looking


instructions within our email in order to The phishing attack demonstrated high
download the proper components onto their efficiency in terms of execution time and effort
machine. Attempts using an online Python required. Once the Python script was written, it
hosting website to deploy our attack were could be deployed quickly for efficient and
unsuccessful, as server side internet protocol repetitive testing. The only aspect of the attack
forbids client side command line execution - the that would need to be changed between victims
main conductor of our attack. While the attack is their email address as well as the victim’s
itself functioned exactly as intended, we wish name in the email. Besides those small details,
we were able to make the design seamless and theoretically a hacker could distribute these
require less of the victim’s participation. attacks at an immense rate, boosting the
likelihood of success.
Another part we unfortunately were The project's impact lies in raising
unable to execute was the DoS attack [5]. awareness about the potential risks of phishing
Ideally, performing a DoS attack and flooding attacks and the significance of user education in
the TP-Link router with packages would preventing such incidents. There are some
demonstrate how a hacker could take this methods we proposed which would be able to
information passively to then actively harm a better educate and potentially protect
network. However, machines we had access to individuals and employees of corporations
were not compatible with the Kali Linux OS and against phishing attacks.
therefore we could only demonstrate the
implementation of how an attacker would A. Education and Protection
theoretically execute the DoS attack.
Firstly, companies can conduct their own
The project aimed to showcase the risks mock phishing attacks on their users, to test
associated with phishing attacks, emphasize the individuals and their abilities to detect
importance of cybersecurity awareness, and suspicious emails. We created our own mock
demonstrate the capabilities of a simulated phishing email in the same format as our attack
attack. The conducted research successfully phishing email, which upon clicking the
achieved these objectives by illustrating how hyperlink redirects the user to a website that
easily users can be deceived into compromising gives them a “strike” [Fig. 4]. These strikes can
their sensitive information. The project be monitored by companies to take note of
highlights the need for robust security measures which employees or age groups might be most
and user education to mitigate such threats susceptible to these attacks, prompting some
effectively. form of internal training. The first and most
important step in preventing phishing attacks is
spreading awareness and educating users. not conducted with the intent to spread
malicious practices but to educate users on the
ways in which they might be at risk of exposing
private information across a wireless network. If
the network itself is unable to provide sufficient
security for the users connected to it, it is up to
the individual themselves to remain vigilant and
beware of the possible ways in which they could
be attacked.
Fig. 4. Mock Phishing Email with Strike System
REFERENCES
Secondly, we proposed that a program 1. Chapman, Lizzy. "Proofpoint Q4 2020
such as Wireshark, a network protocol analyzer Threat Report: Social Engineering,
(or “packet sniffer”), could be run in the Cloud and Malware Attacks Take Root."
background in order to monitor SMTP traffic on ISBuzz News, 4 Mar. 2021,
the network [6]. Wireshark would be able to not https://www.informationsecuritybuzz.co
only see any unwarranted outbound emails m/news/proofpoint-q4-2020-threat-repor
being sent, but could allow the user to inspect t-social-engineering-cloud-and-malware-
the contents of the initial phishing email without attacks-take-root/.
clicking on the email itself. This would 2. Cofense. "2021 State of Phishing
hopefully alert the user to a potential file Defense Report." Cofense, 2021,
download or unwanted redirect when clicking https://cofense.com/resource/2021-state-
on hyperlinks, as our phishing email took of-phishing-defense-report/.
advantage of. 3. Ironscales. "2021 State of Phishing
Finally, our attack takes advantage of the Attack Report." Ironscales, 2021,
user’s participation in storing network https://ironscales.com/resources/2021-st
passwords on their computer in the first place - ate-of-phishing-attack-report/.
clicking on the “Remember Network” checkbox 4. Musthyala, Harish, and Nagarjuna
when connecting to a network for the first time. Reddy. “Hacking Wireless Network
While inconvenient for the user, opting out of Credentials by Performing Phishing
this choice would prevent an attack like ours Attack Using Python Scripting.” Ieee
from collecting the network’s information at all. Xplore,
This would prevent potential future attacks https://ieeexplore.ieee.org/document/943
(such as DoS) from happening on a personal or 2155.
on a company-wide network. 5. ​Occupytheweb, et al. “How to Hack
By showcasing how easily attackers can Wi-Fi: Performing a Denial of Service
deceive users and gain unauthorized access to (Dos) Attack on a Wireless Access
sensitive information, the project promotes a Point.” WonderHowTo, WonderHowTo,
culture of cybersecurity awareness and 23 July 2013,
proactive defensive strategies. This attack was https://null-byte.wonderhowto.com/how-
to/hack-wi-fi-performing-denial-service-
dos-attack-wireless-access-point-014798
8/.
6. Wireshark · about. Wireshark. (n.d.).
https://www.wireshark.org/about.html

You might also like