CYBERSECURITY
CYBERSECURITY
CYBERSECURITY
A) Caesar cipher
Encryption:
1. Choose a shift value(key):This is typically a number between 1 and 25. Let's use 3 as an
example
2. Convert plain text to upper case :This make it easier to handle letters.
3. Shift each letter: For each letter in the plane find its position in the alphabet (A=1,B=2,etc).
Add the shift value to the position and wrap around if you reach the end of
alphabets(Z+1becomes A)
4. Map shifted values to letters: Use the new position to find the corresponding letters in the
alphabet.
Example (plain text:”HELLO”,Shift:3)
H+3=k
F+3=H
L+3=O
L+3=O
O+3=R
Cipher text :”KHOOR”
Decryption:
1. Apply the opposite shift: Subtract the shift value from each letters position wrapping around
if necessary example
Ciphertext :”KHOOR”
K-3=H
H-3=E
O-3=L
0-3=L
R-3=O
Plaintext:” HELLO”
B) Rail Fence Technique:
In this the plaintext is written down as a sequence of diagonals and then read off as a
sequence of rows.
Eg:”all the best for exams”->Plaintext
To encrypt this with al rail fence of depth 2, we write the following
a l h b s f r x m
l t e e t o e a s
encrypted message is:
ALHBSFRXMLTEETOEAS
. COLUMN TRANSPOSITION:
We write the message in a rectangle, row by row and read the message of column by column but
permute the order of column.
Key- 4 3 1 2 5 6 7
a t ta ckp
o s t po ne
du n t i l t
w o a m x y z
2. Implement the Diffie-Hellman Key Exchange mechanism using HTML and JavaScript.
Consider the end user as one of the parties (Alice) and the JavaScript application as other
party (bob).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Diffie-Hellman Key Exchange</title>
</head>
<body>
<h1>Diffie-Hellman Key Exchange</h1>
<div id="Alice">
<h2>Alice</h2>
<label for="Alice Private">Private Key:</label>
<input type="text" id="Alice Private" read only>
<br>
<label for="Alice Public">Public Key:</label>
<input type="text" id="Alice Public" read only>
</div>
<div id="bob">
<h2>Bob (JavaScript Application)</h2>
<label for="bob Private">Private Key:</label>
<input type="text" id="bob Private" read only>
<br>
<label for="bob Public">Public Key:</label>
<input type="text" id="bob Public" read only>
</div>
<script>
// Diffie-Hellman parameters (can be chosen randomly)
const prime = 23; // A large prime number
const generator = 5; // A primitive root modulo prime
document.getElementById("bobPrivate").value = bobPrivate;
document.getElementById("bobPublic").value = bobPublic;
document.getElementById("sharedSecret").value = aliceSharedSecret;
</script>
</body>
</html>
Implementation steps:
1. Acquire or created Dictionary of common passwords
2.Integrate through the list attempting each password against the target users account
3.If a match is found unauthorised access is gained
Concept:
1.Tries every possible combination of characters until the correct password is discovered
2.it's an exhaustive method that does not rely on a predefined list of potential passwords
Implementation steps:
1.Define a character set( example :letters, number ,symbols)
2.Generate all possible combination within a specified length
3. Try each combination until the correct password is found or until all possibilities are
exhausted.
4 Installation of Wire shark, tcpdump, etc and observe data transferred in client server
communication using UDP/TCP and identify the UDP/TCP datagram.
1. Install Wireshark:
On Windows:
Check if its already available use your terminal command like TCP dump -h
If not install via your system's package manage (eg. sudo apt install TCP dump on Ubuntu)
1. Start wireshark
2. Select interface
3.Start capture
4. Generate traffic
Perform actions that generate network traffic example visit a website send a message
5.Stop capture
Click the stop button when you have captured enough data
Click on a UDP or TCP packet to view its details in the packet details pane
d. Analyse differences
Note the difference between udp and TCP data grams such as
AIM:
Root kit is a stealth type of malicious software designed to hide the existence of certain process from
normal methods of detection and enables continued privileged access to a computer.
INTRODUCTION:
A rootkit is a type of malicious software that is activated each time your system boots up .Root kits
are difficult to detect because they are activated before your system operating system has
completely boosted up.
A root kit often allows the installation of hidden files process hidden user accounts and more in
system OS
Root kits are able to intercept data from terminals network connections and the keyboard. Root kits
have 2 primary function :remote command /control( back door) and software keeps dropping. Root
kits allow someone legitimate or otherwise to administratively control a computer .This means
executing file accessing logs monitoring user activity and even changing the computer's configuration
therefore in the strictest sense even versions of VNC are root kits.
PROCEDURE:
Step2:This displays the processes, module services, files registry, root kit malwares, auto start, CMD
of local host
Step 3: select process menu and kill any unwanted process if any
Step 4: modules menu display the various system files like .sys etc
Step 5: services menu displays the complete services running with auto start, enable, disable,
system, boot
Step 7:Registry display H _key _current_ user and h_ key_ local_ machine
Step 10:CMD allows the user to interact with command light utilises or registry
AIM:
In this exercise, we have used Better CAP to perform ARP poisoning in LAN environment using
VMware workstation in which we have installed Kali Linux and Ettercap tool to sniff the local traffic in
LAN.
VMware workstation
Kali Linux or Linux Operating system
Ettercap Tool
LAN connection
Step 1:Install the VMware workstation and install the Kali Linux operating system.
Step 2:Login into the Kali Linux using username pass “root, Toor”.
Step 3: Make sure you are connected to local LAN and check the IP address by typing the
Step 4: Open up the terminal and type “Ettercap –G” to start the graphical version of
Ettercap.
Step5:Now click the tab “sniff” in the menu bar and select “unified sniffing” and click OK to select the
interface. We are going to use “eth0” which means Ethernet connection.
Step 6: Now click the “hosts” tab in the menu bar and click “scan for hosts”. It will start scanning
Step7: Next, click the “hosts” tab and select “hosts list” to see the number of hosts available in
the network. This list also includes the default gateway address. We have to be careful when we
select the targets.
Step 8: Now we have to choose the targets. In MITM, our target is the host machine, and the route
will be the router address to forward the traffic. In an MITM attack, the attacker intercepts the
network and sniffs the packets. So, we will add the victim as “target 1” and the router address as
“target 2.”In VMware environment, the default gateway will always end with “2” because “1” is
assigned to the physical machine.
Step 9: In this scenario, our target is “192.168.121.129” and the router is “192.168.121.2”. So we
Step 10:Now click on “MITM” and click “ARP poisoning”. Thereafter, check the option “Sniff remote
connections” and click OK
Step 11:Click “start” and select “start sniffing”. This will start ARP poisoning in the network which
means we have enabled our network card in “promiscuous mode” and now the local traffic can be
sniffed.
Step 12:Now it’s time to see the results; if our victim logged into some websites. You can see the
results in the toolbar of Ettercap.
7 Demonstrate intrusion detection system using any tool (snort or any other s/w).
AIM: Snort is an open source network intrusion detection system (NIDS) has the ability to perform
real-time traffic analysis and packet logging on internet protocol (IP) networks. Snort performs
protocol analysis, content searching and matching. Snort can be configured in three main modes:
sniffer, packet logger, and network intrusion detection.
Description:
Sniffer mode:-
Sniffer mode :-
Snort –v Print out the TCP/IP packets header on the screen
Snort –vd show the TCP/IP ICMP header with application data in transmit
snort –dev –l c:\log [create this directory in the C drive] and snort will automatically know to go into
packet logger mode, it collects every packet it sees and places it in log directory.
snort –dev –l c:\log –h ipaddress/24:This rule tells snort that you want to print out the data link and
TCP/IP headers as well as application data into the log directory. snort –l c:\log –b This is binary mode
logs everything into a single file.
Snort –d –h ipaddress/24 –l c:\log –c snort.conf This will cnfigure snort to run in its most basic NIDS
form, logging packets that trigger rules specifies in the snort.conf.
PROCEDURE:
STEP-1: Sniffer mode€ snort –v € Print out the TCP/IP packets header on the screen.
STEP-2: Snort –vd € Show the TCP/IP ICMP header with application data in transit.
STEP-3: Packet Logger mode € snort –dev –l c:\log [create this directory in the C drive] and snort will
automatically know to go into packet logger mode, it collects every packet it sees and places it in log
directory.
STEP-4: snort –dev –l c:\log –h ipaddress/24 € This rule tells snort that you want to print out the
data link and TCP/IP headers as well as application data into the log directory.
STEP-5: snort –l c:\log –b € this binary mode logs everything into a single file.
STEP-6: Network Intrusion Detection System mode € snort –d c:\log –h ipaddress/24 –c snort.conf €
This is a configuration file that applies rule to each packet to decide it an action based upon the rule
type in the file.
STEP-7: snort –d –h ip address/24 –l c:\log –c snort.conf € This will configure snort to run in its most
basic NIDS form, logging packets that trigger rules specifies in the snort.conf.
STEP-8: Download SNORT from snort.org. Install snort with or without database support.
STEP-9: Select all the components and Click Next. Install and Close.
STEP-11: Add the path variable in windows environment variable by selecting new classpath.
STEP-12: Create a path variable and point it at snort.exe variable name € path and variable value €
c:\snort\bin.
AIM: Demonstrate how to provide secure data storage, secure data transmission and for creating
digital signatures (GnuPG).
INTRODUCTION:
Here’s the final guide in my PGP basics series, this time focusing on Windows.
The OS in question will be Windows 7, but it should work for Win8 and Win8.1 as well
Obviously it’s not recommended to be using Windows to access the DNM, but I won’t go into
the reasons here.
The tool well be using is GPG4Win .