Ccs354-Network-Ecurity Manual
Ccs354-Network-Ecurity Manual
AIM:
To use Data Encryption Standard (DES)Algorithm for a practical application like User Message
Encryption.
ALGORITHM:
1. Create a DES Key.
2. Create a Cipher instance from Cipher class, specify the following information and separated by
a slash (/).
a. Algorithm name
b. Mode(optional)
c. Padding scheme (optional)
3. Convert String into Byte[] array format.
4. Make Cipher in encrypt mode, and encrypt it with Cipher.doFinal() method.
5. Make Cipher in decrypt mode, and decrypt it with Cipher.doFinal() method.
PROGRAM:
DES.java
Import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
try{
System.out.println("Message Encryption Using DES Algorithm\n ------ ");
KeyGenerator keygenerator=KeyGenerator.getInstance("DES");
SecretKey myDesKey = keygenerator.generateKey();
Cipher desCipher;
desCipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
desCipher.init(Cipher.ENCRYPT_MODE,myDesKey);
byte[] text = "Secret Information ".getBytes();
System.out.println("Message [Byte Format] : " + text);
System.out.println("Message : " + new String(text));
byte[] textEncrypted = desCipher.doFinal(text);
System.out.println("EncryptedMessage:"+textEncrypted);
desCipher.init(Cipher.DECRYPT_MODE, myDesKey);
byte[] textDecrypted = desCipher.doFinal(textEncrypted);
System.out.println("DecryptedMessage:"+newString(textDecrypted));
lOMoARcPSD|31951331
}
}
OUTPUT:
Message Encryption Using DES Algorithm
Message[Byte Format]:[B@4dcbadb4
Message : Secret Information
Encrypted Message: [B@504bae78
Decrypted Message:Secret Information
RESULT:
Thus the java program for DES Algorithm has been implemented and the output verified successfully.
lOMoARcPSD|31951331
AIM:
To use Advanced Encryption Standard(AES)Algorithm for a practical application like
URL Encryption.
ALGORITHM:
1. AES is based on a design principle known as a substitution–permutation.
2. AES does not use a Feistel network like DES,it uses variant of Rijndael.
3. It has a fixed block size of 128bits, andakeysizeof128, 192, or256 bits.
4. AES operates on a4 ×4column-major order array of bytes,termed the state
PROGRAM:
AES.java
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
importjava.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
setKey(secret);
lOMoARcPSD|31951331
Cipher cipher=Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE,secretKey);
return Base64.getEncoder().encodeToString(cipher.doFinal(strToEncrypt.getBytes("UTF-8")));
}catch (Exception e){
System.out.println("Error while encrypting:"+e.toString());
}
return null;
}
String originalString="www.annauniv.edu";
String encryptedString = AES.encrypt(originalString, secretKey);
String decryptedString=AES.decrypt(encryptedString,secretKey);
OUTPUT:
URL Encryption Using AES Algorithm
Original URL:www.annauniv.edu
Encrypted URL:vibpFJW6Cvs5Y+L7t4N6YWWe07+JzS1d3CU2h3mEvEg=
Decrypted URL : www.annauniv.edu
RESULT:
Thus the java program for AES Algorithm has been implemented for URL Encryption and the output
verified successfully.
lOMoARcPSD|31951331
AIM:
To implement RSA(Rivest–Shamir–Adleman)algorithm by using HTML and Javascript.
ALGORITHM:
1. Choose two prime number p and q
2. Compute the value of n and p
3. Find the value of e(public key)
4. Compute the value of d(private key) using gcd()
5. Do the encryption and decryption
a. Encryption is given as,
c=temodn
b. Decryption is given as,
t=cdmodn
PROGRAM:
rsa.html
<html>
<head>
<title>RSA Encryption</title>
<metaname="viewport"content="width=device-width,initial-scale=1.0">
</head>
<body>
<center>
<h1>RSA Algorithm</h1>
<h2>Implemented Using HTML& Java script</h2>
<hr>
<table>
<tr>
<td>Enter First Prime Number:</td>
<td><input type="number" value="53"id="p"></td>
</tr>
<tr>
<td>Enter Second Prime Number:</td>
<td><input type="number" value="59"id="q"></p>
</td>
</tr>
<tr>
<td>Enter the Message(cipher text):<br>[A=1,B=2,...]</td>
<td><input type="number" value="89"id="msg"></p>
</td>
</tr>
<tr>
<td>Public Key:</td>
<td>
<p id="public key"></p>
lOMoARcPSD|31951331
</td>
</tr>
<tr>
<td>Exponent:</td>
<td>
<pid="exponent"></p>
</td>
</tr>
<tr>
<td>Private Key:</td>
<td>
<p id="private key"></p>
</td>
</tr>
<tr>
<td>Cipher Text:</td>
<td>
<p id="cipher text"></p>
</td>
</tr>
<tr>
<td><button on click="RSA();">Apply RSA</button></td>
</tr>
</table>
</center>
</body>
<scripttype="text/java
script">function RSA() {
var gcd, p, q,no, n, t,e, i,x;
gcd=function (a,b){return(!b)?a:gcd(b,a% b); };
p =document.getElementById('p').value;
q=document.getElementById('q').value;
no=document.getElementById('msg').value;
n = p * q;
t=(p-1)*(q-1);
for(e=2;e<t;e++){ if
(gcd(e, t) == 1) {
break;
}
}
for(i=0;i<10;i++){ x =
1+i*t
if(x%e==0){ d =
x / e; break;
}
}
ctt=Math.pow(no, e).toFixed(0);
ct = ctt % n;
)
lOMoARcPSD|31951331
dtt=Math.pow(ct,d).toFixed(0);
dt = dtt % n;
document.getElementById('publickey').innerHTML = n;
document.getElementById('exponent').innerHTML = e;
document.getElementById('privatekey').innerHTML=d;
document.getElementById('ciphertext').innerHTML=ct;
}
</script>
</html>
OUTPUT:
RESULT:
Thus the RSA algorithm has been implemented using HTML& CSS and the output has been verified
successfully.
lOMoARcPSD|31951331
AIM:
To implement the Diffie-Hellman Key Exchange algorithm for a given problem .
ALGORITHM:
PROGRAM:
DiffieHellman.java
class DiffieHellman{
public static void main(String args[]){
int p=23;/*publicly known(prime number)*/
System.out.println("SharedSecret:"+sharedSecret);
/*sharedsecretsshouldmatchandequalityistransitive*/
if((aliceComputes==sharedSecret)&&(aliceComputes==bobComputes))
System.out.println("Success: Shared Secrets Matches! " + sharedSecret);
else
System.out.println("Error:SharedSecretsdoesnotMatch");
}
}
OUTPUT:
Simulation of Diffie-Hellman key exchange algorithm
Alice Sends : 4.0
BobComputes:18.0
Bob Sends : 10.0
AliceComputes:18.0 Shared
Secret : 18.0
Success: Shared Secrets Matches!18.0
RESULT:
Thus the Diffie-Hellman key exchange algorithm has been implemented using Java Program and the
output has been verified successfully.
)
lOMoARcPSD|31951331
Ex.No:3
Date: SHA-1 Algorithm
AIM:
To Calculate the message digest of a text using the SHA-1algorithm.
ALGORITHM:
1. Append Padding Bits
2. Append Length-64bits are appended to the end
3. Prepare Processing Functions
4. Prepare Processing Constants
5. Initialize Buffers
6. ProcessingMessagein512-bitblocks(L blocks in total message)
PROGRAM:
sha1.java
import java.security.*;
publicclasssha1{
public static void main(String[]a){
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
System.out.println("Message digest object info:\n ---------------- ");
System.out.println("Algorithm="+md.getAlgorithm());
System.out.println("Provider=" + md.getProvider());
System.out.println("ToString=" + md.toString());
String input = "";
md.update(input.getBytes());
byte[] output = md.digest();
System.out.println();
System.out.println("SHA1(\""+input+"\")="+bytesToHex(output));
input = "abc";
md.update(input.getBytes());
output = md.digest();
System.out.println();
System.out.println("SHA1(\""+input+"\")="+bytesToHex(output));
input = "abcdefghijklmnopqrstuvwxyz";
lOMoARcPSD|31951331
md.update(input.getBytes());
output=md.digest();
System.out.println();
System.out.println("SHA1(\""+input+"\")="+bytesToHex(output));
System.out.println();
} catch (Exception e) {
System.out.println("Exception:"+e);
}
}
for(byte aB:b){
buf.append(hexDigit[(aB>>4)&0x0f]);
buf.append(hexDigit[aB & 0x0f]);
}
return buf.toString();
}
}
OUTPUT:
Message digest object info:
Algorithm=SHA1
Provider=SUNversion12
To String=SHA1 Message Digest from SUN,
<initialized>SHA1("")=DA39A3EE5E6B4B0D3255BFEF95601890AFD80709
SHA1("abc")=A9993E364706816ABA3E25717850C26C9CD0D89D
SHA1("abcdefghijklmnopqrstuvwxyz")=32D10C7B8CF96570CA04CE37F2A19D84240D3A89
RESULT:
Thus the Secure Hash Algorithm(SHA-1)has been implemented and the output has been verified
successfully.
lOMoARcPSD|31951331
AIM:
To implement the SIGNATURE SCHEME- Digital Signature Standard.
ALGORITHM:
1. Create a KeyPairGenerator object.
2. Initialize the KeyPairGenerator object.
3. Generate the KeyPairGenerator....
4. Get the private key from the pair.
5. Create a signature object.
6. Initialize the Signature object.
7. Add data to the Signature object
8. Calculate the Signature
PROGRAM:
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.Signature;
import java.util.Scanner;
KeyPairGenerator keyPairGen=KeyPairGenerator.getInstance("DSA");
keyPairGen.initialize(2048);
KeyPair pair=keyPairGen.generateKeyPair();
Signature sign=Signature.getInstance("SHA256withDSA");
sign.initSign(privKey);
byte[]bytes="msg".getBytes();
sign.update(bytes);
byte[] signature=sign.sign();
System.out.println("Digitalsignatureforgiventext:"+newString(signature, "UTF8"));
}
}
lOMoARcPSD|31951331
OUTPUT:
Enter sometext
Hi how are you
Digital signature for given text:0=@gRD???-?.????/yGL?i??a!?
RESULT:
Thus the Digital Signature Standard Signature Scheme has been implemented and the output has
been verified successfully.
lOMoARcPSD|31951331
Ex. No:5 Installation of Wireshark, tcpdump and observe data transferred in client- server
communication
Date:
Aim:
To installation of Wireshark,tcpdump and observe data transferred in client-server communication using
UDP/TCP and identify the UDP/TCP datagram.
Introduction:
The first part of the lab introduces packet sniffer, Wireshark. Wireshark is a free open- source
network protocol analyzer. It is used for network troubleshooting and communication
protocol analysis. Wireshark captures network packets in real time and display them in
human-readable format. It provides many advanced features including live capture and
offline analysis, three-pane packet browser, coloring rules for analysis. This document uses
Wireshark for the experiments, and it covers Wireshark installation, packet capturing, and
protocol analysis.
lOMoARcPSD|31951331
Background
In the CSC 4190 Introduction to Computer Networking (one of the perquisite courses), TCP/IP
network stack is introduced and studied. This background section briefly explains the concept of
TCP/IP network stack to help you better understand the experiments. TCP/IP is the most
commonly used network model for Internet services. Because its most important protocols, the
Transmission Control Protocol (TCP) and the Internet Protocol (IP) were the first networking
protocols defined in this standard, it is named as TCP/IP. However, it contains multiple layers
including application layer, transport layer, network layer, and data link layer.
- Application Layer: The application layer includes the protocols used by most applications
for providing user services. Examples of application layer protocols are Hypertext
lOMoARcPSD|31951331
Transfer Protocol (HTTP), Secure Shell (SSH), File Transfer Protocol (FTP), and Simple
Mail Transfer Protocol (SMTP).
- Transport Layer: The transport layer establishes process-to-process connectivity, and it
provides end-to-end services that are independent of underlying user data. To implement
the process-to-process communication, the protocol introduces a concept of port. The
examples of transport layer protocols are Transport Control Protocol (TCP) and User
Datagram Protocol (UDP). The TCP provides flow- control, connection establishment,
and reliable transmission of data, while the UDP is a connectionless transmission model.
- Internet Layer: The Internet layer is responsible for sending packets to across networks. It
has two functions: 1) Host identification by using IP addressing system (IPv4 and IPv6);
and 2) packets routing from source to destination. The examples of Internet layer
protocols are Internet Protocol (IP), Internet Control Message Protocol (ICMP), and
Address Resolution Protocol (ARP).
- Link Layer: The link layer defines the networking methods within the scope of the local
network link. It is used to move the packets between two hosts on the same link. An
common example of link layer protocols is Ethernet.
Packet Sniffer
Packet sniffer is a basic tool for observing network packet exchanges in a computer .As the name
suggests, a packet sniffer captures (―sniffs‖) packets being sent/received from/by your
computer; it will also typically store and/or display the contents of the various protocol fields in
these captured packets. A packet sniffer itself is passive. It observes messages being sent and
received by applications and protocols running on your computer, but never sends packets itself.
Figure 3 shows the structure of a packet sniffer. At the right of Figure 3 are the protocols(in this
case, Internet protocols) and applications (such as a web browser or ftp client) that normally run
on your computer. The packet sniffer, shown within the dashed rectangle in Figure 3 is an
addition to the usual software in your computer, and consists of two parts. The packet capture
library receives a copy of every link-layer frame that is sent from or received by your computer.
Messages exchanged by higher layer protocols such as HTTP, FTP, TCP, UDP, DNS, or IP all
are eventually encapsulated in link-layer frames that are transmitted over physical media such as
an Ethernet cable. In Figure 1, the assumed physical media is an Ethernet, and so all upper-layer
protocols are eventually encapsulated within an Ethernet frame. Capturing all link-layer frames
Thus gives you access to all messages sent/received from/by all protocols and applications
lOMoARcPSD|31951331
executinginyour computer.
The second component of a packet sniffer is the packet analyzer, which displays the contents of
all fields within a protocol message. In order to do so, the packet analyzer
must ―understand‖ the structure of all messages exchanged by protocols. For example, suppose
we are interested in displaying the various fields in messages exchanged by the HTTP protocol in
Figure 3. The packet analyzer understands the format of Ethernet frames, and so can identify the
IP datagram within an Ethernet frame. It also understands the IP datagram format, so that it can
extract the TCP segment within the IP datagram. Finally, it understands the TCP segment
structure, so it can extract the HTTP message contained in the TCP segment. Finally, it
understands the HTTP protocol and so, for example, knows that the first bytes of an HTTP
message will contain the string―GET,‖―POST,‖or―HEAD‖.
We will be using the Wireshark packet sniffer [http://www.wireshark.org/] for these labs,
allowing us to display the contents of messages being sent/received from/by protocols at
different levels of the protocol stack. (Technically speaking, Wireshark is a packet analyzer that
uses a packet capture library in your computer). Wireshark is a free network protocol analyzer
that runs on Windows, Linux/Unix, and Mac computers.
Getting Wireshark
The KaiLinux has Wireshark installed.You can just launch the KaliLinux VM and open Wireshark
there.Wireshark can also be downloaded from here:
https://www.wireshark.org/download.html
lOMoARcPSD|31951331
Starting Wireshark:
When you run theWireshark program,the Wireshark graphic user interface will be shown as
Figure5.Currently,the program is not capturing the packets.
Then, you need to choose an interface. If you are running the Wireshark on your laptop, you need
to select WiFi interface. If you are at a desktop, you need to select the Ethernet interface being
used. Note that there could be multiple interfaces. In general, you can select any interface but that
does not mean that traffic will flow through that interface. The network interfaces (i.e., the
physical connections) that your computer has to the network are shown. The attached Figure 6
was taken from my computer.
After you select the interface you can click start to capture the packets as shown inFigure7.
The commandmenus are standard pull down menus located at the top of the window. Of interest
to us now is the File and Capture menus. The File menu allows you to save captured packet data
or open a file containing previously captured packet data, and exit the Wireshark application.
The Capture menu allows you to begin packet capture.
The packet-listing window displays a one-line summary for each packet captured, including the
packet number (assigned by Wireshark; this is not a packet number contained in any protocol‘s
header), the time at which the packet was captured, the packet‘s source and destination addresses,
the protocol type, and protocol-specific information contained in the packet. The packet listing
can be sorted according to any of these categories by clicking on a column name. The protocol
type field lists the highest- level protocol that sent or received this packet, i.e., the protocol that is
the source or ultimate sink for this packet.
The packet-header details window provides details about the packet selected (highlighted) in
the packet-listing window.(To select a packet in the packet-listing window, place the cursor over
the packet‘s one- line summary in the packet-listing window and click with the left mouse
button.). These details include information about the Ethernet frame and IP datagram that
lOMoARcPSD|31951331
contains this packet. The amount of Ethernet and IP-layer detail displayed can be expanded or
minimized by clicking on the right- pointing or down- pointing arrowhead to the left of the
Ethernet frame or IP datagram line in the packet details window. If the packet has been carried
over TCP or UDP, TCP or UDP details will also be displayed, which can similarly be expanded
or minimized. Finally, details about the highest-level protocol that sent or received this packet
are also provided.
The packet-contents window displays the entire contents of the captured frame, in both ASCII
and hexadecimal format.
Towards the top of the Wireshark graphical user interface, is the packet display filter field, into
which a protocol name or other information can be entered in order to filter the information
displayed in the packet-listing window (and hence the packet-header and packet-contents
windows). In the example below, we‘ll use the packet-display filter field to have Wireshark hide
(not display) packets except those that correspond to HTTP messages.
Capturing Packets
After downloading and installing Wireshark, you can launch it and click the name ofan interface
under Interface List to start capturing packets on that interface. For example, if you want to
capture traffic on the wireless network, click your wireless interface.
Test Run
1. Start up the Wireshark program(select an interface and press start to capture packets).
2. Start up your favorite browser(ceweaselinKaliLinux).
3. Inyourbrowser,gotoWayneStatehomepagebytypingwww.wayne.edu.
4. After your browser has displayed the http://www.wayne.edu page, stop Wireshark packet
capturebyselectingstopintheWiresharkcapturewindow.ThiswillcausetheWireshark
capture window to disappear and the main Wireshark window to display all
packets captured since you began packet capture see image below:
lOMoARcPSD|31951331
5. Color Coding: You‘ll probably see packets highlighted in green, blue, and black.
Wiresharkusescolorstohelpyouidentifythetypesoftrafficataglance.Bydefault,
green is TCP traffic, dark blue is DNS traffic, light blue is UDP traffic, and black
identifies TCP packets with problems — for example, they could have been deliveredout-
of-order.
6. You now have live packet data that contains all protocol messages exchanged between
yourcomputerandothernetworkentities!However,asyouwillnoticetheHTTP
messages are not clearly shown because there are many other packets included in the
packet capture. Even though the only action you took was to open your browser, there are
many other programs in your computer that communicate via the network in the
lOMoARcPSD|31951331
back ground. To filter the connections to the ones we want to focus on, we have to use
the filteringfunctionalityofWiresharkbytyping―http‖inthefilteringfieldasshownbelow:
Notice that we now view only the packets that are of protocol HTTP. However, we also still do
not have the exact communication we want to focus on because using HTTP as a filter is not
descriptive enough to allow us to find our connection to http://www.wayne.edu. We need to be
more precise if we want to capture the correct set of packets.
7. To further filter packets in Wireshark, we need to use a more precise filter. By setting the
http.host www.wayne.edu, we are restricting the view to packets that have as an http host the
www.wayne.edu website. Notice that we need two equal signs to perform the match not just
one. See the screenshot below:
8. Now, we can try another protocol. Let‘s use Domain Name System (DNS) protocol as an
example here.
lOMoARcPSD|31951331
9. Let‘strynowtofindoutwhatarethosepacketscontainbyfollowing ofthe
conversations (also called network flows), select one of the packets and press the right
mouse button (if you are on a Mac use the command button and click), you should see
something similar to the screen below:
Click on Follow UDP Stream,and then you will see following screen.
lOMoARcPSD|31951331
10. If we close this window and change the filter back to ―http.hos ww.wayne.edu‖ and then follow a
packetfromthelistofpacketsthatmatchthatfilter,weshouldgetthesomethingsimilartothefollowing screens.
Note that we click on Follow TCP Stream this time.
lOMoARcPSD|31951331
Result:
Installation of Wireshark, tcpdump and observe data transferred in client-server communication using
UDP/TCP and identify the UDP/TCP datagram.
lOMoARcPSD|31951331
Aim
Client sends a plaintext Client_Hello message and suggests some cryptographic parameters
(collectively called ciphersuit) to be used for their communication session. The Client_Hello
message also contains a 32-byte random number denoted as client_random. For example,
Client_Hello:
Protocol Version: TLSv1 if you can, else SSLv3.
KeyExchange:RSAifyoucan,elseDiffe-Hellman.
SecretKeyCipherMethod:3DESifyoucan,elseDES. Message
Digest: SHA-1 if you can, else MD5.
DataCompressionMethod:PKZipifyoucan,elsegzip. Client
Random Number: 32 bytes.
The stronger method (in terms of security) shall precede the weaker one, e.g. RSA (1024-bit)
precedes DH, 3DES precedes DES, SHA-1 (160-bit) precedes MD5 (128-bit).
Server responds with a plaintext Server_Helllo to state the ciphersuit of choice (server decides on
the ciphersuit). The message also contains a 32-byte random number denoted as server_random.For
example,
Server_Hello:
ProtocolVersion:TLSv1.
KeyExchange:RSA.
SecretKeyCipherMethod:DES.
Message Digest: SHA-1.
DataCompressionMethod:PKZip.
Server Random Number: 32 bytes.
Handshaking-KeyExchange
The server sends its digital certificate to the client, which is supposedly signed by a root CA. The
client uses the root CA'spublic key to verify the server's certificate (trusted root-CAs' public key are
pre-installed inside the browser). It then retrieves the server's public key from the server's
certificate. (If the server's certificate is signed by a sub-CA, the client has to build a digital
certificate chain, leading to a trusted root CA, to verify the server's certificate.)
The server can optionally request for the client's certificate to authenticate the client. In practice,
server usually does not authenticate the client. This is because:
lOMoARcPSD|31951331
1. The client generates a 48-byte (384-bit) random number called pre_master_secret, encrypts
it using the verified server's public key and sends it to the server.
2. Server decrypts the pre_master_secret using its own private key. Eavesdroppers cannot
decrypt the pre_master_secret, as they do not possess the server's private key.
3. Client and serverthen independently and simultaneously create the session key, based on the
pre_master_secret, client_random and server_random. Notice that both the server and client
contribute to the session key,through the inclusion of the random number exchange in the
hello messages. Eavesdroppers can intercept client_random and server_random as they are
sent in plaintext, but cannot decrypt the pre_master_secret.
4. In a SSL/TLSsession, the session key consists of 6 secret keys (to thwart crypto-analysis).3
secret keys are used for client-to-server messages, and the other 3 secret keys are used for
server-to-client messages. Among the 3 secret keys, one is used for encryption (e.g., DES
secret key), one is used for message integrity (e.g., HMAC) and one is used for cipher
initialization. (Cipher initialization uses a random plaintext called Initial Vector (IV) to
prime the cipher pump.)
5. Client and server use the pre_master_secret (48-byte random number created by the client
and exchange securely), client_random, server_random, and a pseudo-random function
(PRF) to generate a master_secret. They can use the master_secret, client_random,
server_random, and the pseudo-random function (PRF) to generate all the 6 shared secret
keys. Once the secret keys are generated, the pre_master_secret is no longer needed and
should be deleted.
6. From this point on wards,all the exchanges are encrypted using the sessionkey.
7. The client sends Finished handshake message using their newly created session key. Server
responds with a Finished handshake message.
Message Exchange
Client and server can use the agreed-upon session key(consistsof6secretkeys)for secure exchange of
messages.
Sendin gmessages:
1. The sender compresses the message using the agreed-upon compression method(e.g.,
PKZip, gzip).
2. The sende rhashes the compressed data and the secret HMAC key to make an HMAC, to
assure message integrity.
3. The sender encrypts the compressed data and HMAC using encryption/decryption secret
key, to assure message confidentiality.
Retrieve messages:
1. The receiver decrypts the cipher text using the encryption/decryption secret key to retrieve
the compressed data and HMAC.
lOMoARcPSD|31951331
2. The receiver hashes the compressed data to independently produce the HMAC. It then
verifies the generated HMAC with the HMAC contained in the message to assure message
integrity.
3. The receiver un-compresses the data using the agreed-upon compression method to recover
the plaintext.
The following diagram shows the sequence of the SSL messages for a typical client/server session.
We could use OpenSSL's s_client (with debug option)to produce a SSL session trace.
The following command turns on the debug option and forces the protocol tobeTLSv1:
> openssls_client-connectlocalhost:443-CAfileca.crt-debug-tls1
writeto00988EB0[009952C8](102bytes=>102(0x66))
0000-16 03 01 00 61 01 00 00-5d 03 01 40 44 35 27 5c....a...]..@D5'\
0010-5ae8 74 26 e949 37 e2-06 3b 1c6d77 37 d1 aeZ.t&.I7..;.mw7..
0020-44 07 86 47 98fa84 1a-8d f472 0000 36 00 39D..G ............. r..6.9
0030-00 38 00 35 00 16 00 13-00 0a00 33 00 3200 2f.8.5.......3.2./
0040-00 07 00 66 0005 00 04-00 63 00 62 00 61 00 15...f.....c.b.a..
0050-00 12 00 09 00 65 00 64-00 60 00 14 00 11 00 08.....e.d.`......
0060 -00 06 00 03 01 .....
0066-<SPACES/NULS>
readfrom00988EB0[00990AB8](5bytes=>5(0x5))
0000 - 16 03 01 00 2a...................................... *
readfrom00988EB0[00990ABD] (42bytes=>42(0x2A))
0000-020000 26 03 0140 44-35 27ccef 2b 51e1 b0...&..@D5'..+Q..
0010-44 1fefc4 83 72 df37-4f9b 2b dd 115013 87D....r.7O.+..P..
0020-91 0aa2d2 28 b9 00 00-16 ....(....
002a-<SPACES/NULS>
readfrom00988EB0[00990AB8](5bytes=>5(0x5))
0000 - 16 03 01 02 05 .....
readfrom00988EB0[00990AB8](5bytes=>5(0x5))
0000 - 16 03 01 00 04 .....
readfrom00988EB0[00990ABD](4bytes=>4(0x4))
0000 - 0e .
0004-<SPACES/NULS>
writeto00988EB0[00999BE0](139bytes=>139(0x8B))
0000-16 03 01 00 86 10 0000-82 00 80 63 c23c69 26...........c...dU.....]n..
0030 -05 f1db44 f313 a8 24-3a 76 0e3e1a6e55 0c...D..$:v.>.nU.
0040-31 9b 0499 30 ff8fd2-8d8e0d b1 67 ac43 ee1...0 ................ g.C.
0050-b2 3fd3 c7 c5 3381 e1-3fd2 47 6f5d 8afb 4c.?...3..?.Go]..L
0060-62 c723 b3 f7ad3ca9-0c87 4a08 07 55 ba06b.#...<...J..U..
0070-3418 0c5fd935 f0 2b-90 9a9d 6b87 6241 0f4.._.5.+..k.bA.
0080-b3 47 745f5b b859 5a-b221 dd .Gt_[.YZ.!.
writeto00988EB0[00999BE0](6bytes=>6(0x6))
0000 - 14 03 01 00 01 01 ......
writeto00988EB0[00999BE0](45bytes=>45 (0x2D))
0000-16 03 01 00 28 0f31 83-e0f8 91fa33 98 68 46....(.1............. 3.hF
0010-c060 83 66 28fed3 a5-00f0 98 d5df22 72 2d.`.f( .................. "r-
0020-e4 409b 96 3b4cf9 02-13a7e7 77 74 .@..;L .... wt
readfrom00988EB0[00990AB8](5bytes=>5(0x5))
0000 - 14 03 01 00 01 .....
readfrom00988EB0[00990ABD](1bytes=>1(0x1))
0000 - 01 .
readfrom00988EB0[00990AB8](5bytes=>5(0x5))
0000 - 16 03 01 00 28 ..................................... (
readfrom00988EB0[00990ABD] (40bytes=>40(0x28))
0000-d40ba6b7 e891 09 1e-e4 1e fc44 5f80 cca1 ...........D_...
0010-5d 51 55 3e62 e80f78-07f62f cdf9 bc49 8d]QU>b..x../..I.
0020-56 5b e8b2 09 2c18 52- V[.,.R
---
Certificatechain
0s:/C=US/CN=chc/[email protected]
lOMoARcPSD|31951331
i:/C=US/OU=test101/CN=chc/[email protected]
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIB9zCCAWACAQEwDQYJKoZIhvcNAQEEBQAwTTELMAkGA1UEBhMCVVMxEDAOB
gNV
BAsTB3Rlc3QxMDExDDAKBgNVBAMTA2NoYzEeMBwGCSqGSIb3DQEJARYPY2hjQHRl
c3QxMDEuY29tMB4XDTA0MDIyNjA2NTY1NFoXDTA1MDIyNTA2NTY1NFowOzELMAkG
A1UEBhMCVVMxDDAKBgNVBAMTA2NoYzEeMBwGCSqGSIb3DQEJARYPY2hjQHRlc3Q
xMDEuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDN5J58ttI0TtNTRiXH
U4glYOZG22Q6c2GSrCOSzSyUqY/Gf0dzwNmNNLcs3cmGvYJvzqzY4roP5fU6ZyyJ
GhsD6yGFKOMpmITtRnWC+g8wo6mlcUZM1g0XxBn9RPviGEamnauR3muhf/4wBihd
2NMpAMMdTBMAYY/zhVH1aNhpJQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBACn9v1rt
cI9TpOkUTF66hMZUG/LAPMQwD38SgE4Bt/05UPFBDdiqd9mHJRoe4peIT1N1yHAi
agFhD1E+ExmcZPJ2FOiFJSOiEcSM+CMs0cPTcTrmcVQQB9xy/+7oPs+Od3Ppn/Wa
kGBNoKoDMh8Rby6aXzx3BSIMgb8plq3LOxiu
-----ENDCERTIFICATE-----
subject=/C=US/CN=chc/[email protected]=/C=US/OU=test101/CN=chc/emailAddress=chc@t
est101.com
---
SSLhandshakehasread1031bytesandwritten292bytes
---
New,TLSv1/SSLv3,CipherisEDH-RSA-DES-CBC3-SHA
Serverpublickeyis1024bit
SSL-Session:
Protocol: TLSv1
Cipher :EDH-RSA-DES-CBC3-SHA
Session-ID:
Session-ID-ctx:
Master-Key:57FDDAF85C7D287F9F9A070E8784A29C75E788DA2757699B
20F3CA50E7EE01A66182A71753B78DA218916136D50861AE
Key-Arg:None
Start Time: 1078211879
Timeout : 7200 (sec)
Verifyreturncode:0(ok)
---
GET/test.htmlHTTP/1.0
writeto00988EB0[009952C8](82bytes=>82(0x52))
0000-17 030100 1874 fa45-35 2db1 24 59cfad 96.....t.E5-.$Y...
0010-34 30 01 7dbe8e70 f9-41 62 11f1 36 1703 0140.}..p.Ab..6...
lOMoARcPSD|31951331
writeto00988EB0[009952C8](58bytes=>58(0x3A))
0000-17 03 01 00 1839 2fdf-4375 91 13 34 1b 12 04.....9/.Cu..4...
0010-7def 8d e1 86544f67-c81dcd 07a417 0301}....TOg........
0020-00 1853 d9 22 9deb 6e-8b79 f8e4 82 2fbaea..S."..n.y.../..
0030-03a5 3f 1285 2e 9f64-ffdc ..?... d..
readfrom00988EB0[00990AB8](5bytes=>5(0x5))
0000 - 17 03 01 01 48 ..................................... H
readfrom00988EB0[00990ABD] (328bytes=>328(0x148))
0000 - bd eb 8b 9c 01 ac 73 30-8f ca a4 8b 2a 6f bd 02 ......s0....*o..
0010-d7fc7118 61 47f2 1d-708b 10 7d 98 28a4 50..q.aG..p..}.(.P
0020-f3 0f42 e8 c5 e13e53-34bdc762 34 1b 5e8c..B...>S4..b4.^.
0030-99 2d89 c6b3f019 96-2297 43 b8 8f9d 76 42.-......".C..vB
0040-95a5 7cdb 3b22dd 57-29 8d e8 d428 3e89 d8..|.;".W)...(>..
0050-46e5 dc35 5156f844-d1 82 44 a065b093 22F..5QV.D..D.e.."
0060-4b0aeb07 26 c9 2ae2-45 4cde07 0cbb3ec6K...&.*.EL ................. >.
0070-bc37 94 cdec942f 35-76 37 13 4d0f88 9cb1.7..../5v7.M....
0080-d71c58 8a355b 32 bc-122b 9ce65b d4 86 bd..X.5[2..+..[...
0090-39 fc99 18 79ecf7 53-db 59 74 49da0769 549...y..S.YtI..iT
00a0-f466 aa36 34 39f9 0b-87 50 9e76 db 9fd0 44.f.649...P.v. .D
00b0-0c0de765809bb851-563dd0dbaa55ffca...e...QV=...U.. 00c0- 74
38 24 c1 8c d7 32 cf-ab 03 b3 59 29 0f 80 18t8$...2....Y)...
00d0-6ad4e07efd418cf7-1d 81 12a7 00 b3 7139j..~.A..................... q9
00e0-78 1e3c17 42 d499 22-697b 2d 09 efd8 6ef4x.<.B.."i{...............n.
00f0-64 f661 34 72 8c89 f5-a8ea1cb1 0d 08 ff 17d.a4r...........
0100-51 3e46 2b 38 7561 6a-1e 34 f4 1414 38 0d 5eQ>F+8uaj.4 .......... 8.^
0110-6ebadb ef83 88 eea5-2c18 5a0c27 e3d9 19n.......,.Z.'...
0120-6ca312c0a1 3de114-96 d31af9c9 f2aad6l....=..........
0130-12 d5 36 ae36 f218 f5-dfc6ef34 d7 7d 2b 70..6.6 ............... 4.}+p
0140 -99 88 47 93 91 09 56 b1- ..G..V.
HTTP/1.1200 OK
Date:Tue,02Mar200407:18:08GMT
Server:Apache/1.3.29(Win32)mod_ssl/2.8.16OpenSSL/0.9.7c
Last-Modified: Sat, 07 Feb 2004 10:53:25 GMT
ETag:"0-23-4024c3a5"
Accept-Ranges: bytes
Content-Length: 35
Connection: close
Content-Type:text/html
readfrom00988EB0[00990AB8] (5bytes=>5(0x5))
lOMoARcPSD|31951331
readfrom00988EB0[00990ABD] (24bytes=>24(0x18))
0000-a54751bdaa0f9be4-acd428f2d0a0c8fa.GQ.......(..... 0010 - 2c
d4 e5 e4 be c5 01 85- ,.......
closed
writeto00988EB0[009952C8](29bytes=>29(0x1D))
0000-15 03 0100 18 d4 19b9-5988 88 c0 c9 38ab5c........Y............. 8.\
0010-98 8c43 fdb8 9e14 3d-77 5e4c68 03 ..C ... =w^Lh.
Trace Analysis
Thedatatobetransmittedisbrokenupintoseriesoffragments.Eachfragmentisprotectedfor integrity
using HMAC. (more)
• Byte0:RecordContentType.FourContentTypesaredefined,asfollows:
Let us begin looking into the handshake message contained within a SSLrecord (of Content Type
0x16).Thehandshakemessagehasa4-byteheader:
• Byte0:HandshakeType,asfollows:
HandshakeType HexCode
hello_request 0x00
client_hello 0x01
server_hello 0x02
certificate 0x0b
server_key_exchange 0x0c
certificate_request 0x0d
server_hello_done 0x0e
certificate_verify 0x0f
client_key_exchange 0x10
finished 0x14
• Byte1-3:Themessagelength,excludingthe3-byteheader.
lOMoARcPSD|31951331
Hence,aclient_hellorecordwillbeginwitha5-byterecordheader,followedbya4-byte handshake
message header. For example,
Client_Hello
The first handshake message is always sent by the client, called client_hello message. In this
message, the client tells the server its preferences in terms of protocol version, ciphersuit, and
compression method. The client also includes a 32-byte random number (client_random) in the
message, which is made up of a 4-byte GMT Unix time (seconds since 1970), plus another 28
random bytes.
YoumustrefertoRFC2246forthestructureoftheClient_Hellomessage.
Server_Hello
In responsetotheclient_hellomessage,theserverreturnsaserver_hellomessagetotellthe
clientitschoiceofprotocolversion,ciphersuitandcompressionmethod.Theserveralsoincludesa 32-byte
random number (server_random) in the message.
lOMoARcPSD|31951331
Certificate
The certificate message consists of a chain of X.509 certificates in the correct order. The first
certificate belongs to the server, and the next certificate contains the key that certifies the first
certificate(i.e., the server's certificate), and so on. The client uses the server's publickey(contained
inside the server's certificate) to either encrypt the pre_master_secret or verify the
server_key_exchange, depending on which cipher suit is used.
BytesLenValue Description
00 1 16 RecordContentType-HandshakeMessage
01-02 2 03 01 SSLversion -TLSv1
03-04 2 02 05 Record Length
05 1 0b HandshakeType- certificate
06-08 3 00 02 01 MessageLength
09-0B 3 00 01 fe Certificate Length
Certificates(tobetraced)
TheX.509certificatestructurecanbefoundfromtheITUrecommendationX.509"Thedirectory- Authentication
Framework".
Server_Key_Exchange
Server_Hello_Done
This is an empty message indicating that the server has sent all the handshaking messages. This is
needed because the server can send some optional messages after the certificate message.
lOMoARcPSD|31951331
Client_Key_Exchange
The client_key_exchange message contains the pre_master_secret when RSA key exchange
is used. The pre_master_secret is 48-byte, consists of protocol version (2 bytes) and 46 random
bytes.
Change_Cipher_Spec
Certificate_Verify
Change_Cipher_Spec
UnknownHandshakingMessage(D4) -to check
Application_Data
Client-to-Server-theHTTPrequestmessage:GET/test.htmlHTTP/1.0
Server-to-Client-theHTTPresponse message
Alert
ComparisonofTLSv1,SSLv3andSSL v2
lOMoARcPSD|31951331
TheTLSv1specificationstated,"TLSv1andSSLv3areverysimilar".Someofminordifferences include
minor changes in HMAC calculation, ciphersuit support, and pseudo-random number generation.
TLS v1 can be regarded as SSL v3.1.
SSL v2 has a big security hole in the negotiation of the ciphersuit (and should not be used). The
attackercanconvincetheclientandservertouseaweakerencryptionthanwhattheyarecapableof. This is
called "ciphersuit rollback" attack.
Result:
Aim:
To experiment eavesdropping, Dictionary attacks, MIMT attacks
Visual Objective:
Introduction
Password cracking is a term used to describe the penetration of a network, system, or resource
with or without the use of tools to unlock a resource that has been secured with a password.
Password cracking tools may seem like powerful decryptors, but in reality are little more than
fast, sophisticated guessing machines.
Passwords that are composed of random letters numbers and characters are most vulnerable to this
type of attack.
Hybrid attack
Another well-known form of attack is the hybrid attack. A hybrid attack will add numbers or
symbols to the search words to successfully crack a password. Many people change their
passwords by simply adding a number to the end of their current password. Therefore, this
type of attack is the most versatile, while it takes longer then a standard dictionary attack it
does not take as long as a brute force attack.
Cracking Process
Since a brute force attack is the most time consuming and is not likely to break any passwords
that are not composed of random characters, the best plan is to use techniques that are
computationally efficient compared to untargeted and unspecific techniques .By applying what is
known about how users select passwords, an intruder can tremendously increase the odds in their
favor of finding passwords. With the right techniques, some poor passwords can be cracked in
under a second.
The real power of dictionary attacks come from understanding the ways in which most people
vary names and dictionary words when attempting to create a password. By applying all the
common transformations to every word in the electronic list and encrypting each result the
number tested passwords multiplies rapidly. Cracking tools can often detect ―clever‖ ways of
manipulating words to hide their origin. For example, such cracking programs often subject each
word to a list of rules. A rule could be anything, any manner in which a word might appear.
Typical rules might include
Naturally, the more rules one applies to the words, the longer the cracking process takes.
However, more rules also guarantee a higher likelihood of success.
lOMoARcPSD|31951331
Task1–MicrosoftOfficePasswordRecovery
Many applications require you to establish an ID and password that may be saved and
automatically substituted for future authentication. The password will usually appear on the
screen as a series of asterisks. This is fine as long as your system remembers the password for
you but what if it "forgets" or you need it for use on another system. Fortunately, many utilities
have been written to recover such passwords. In this task, you will use OfficeKey to recover the
password for a MS word document.
Step1:Findthefolder―Lab1‖onyourdesktop,andopenit.
Step3:Pressthe―Recover‖buttonintheupperleftcorner,orselectFileRecover
Step4:ChoosethepasswordprotectedMSOfficeFileyouhavesavedtotheDesktop.
Step 5: After running the first password auditing session, check to see if Office key has cracked
the password. If the password has not been cracked press the Settings button on the upper
tool bar.
lOMoARcPSD|31951331
Step8:Write down the contents of the MS word document and the password into your lab report
and submit it to your TA.
lOMoARcPSD|31951331
Task2–PasswordAuditing(Windows platform):
The purpose of this task is to familiarize you with act of password cracking/recovery. Password
cracking software uses a variety of approaches, including intelligent guessing, dictionary attacks
and automation that tries every possible combination of characters. Given enough time the
automated method can crack any password, but more effective passwords will last months before
breaking.
When a password is entered and saved on a computer it is encrypted, the encrypted password
becomes a string of characters called a ―hash‖ and is saved to a password file. A password
cannot be reverse-decrypted. So a cracking program encrypts words and characters given to it
(wordlist or randomly generated strings of characters) and compares the results with hashed
passwords. If the hashes match then the password has successfully been guessed or ―cracked‖.
This process is usually performed offline against a captured password file so that being locked
out of the account is not an issue, and guessing can go on continuously. Thus, revealing the
passwords is simply a mater of CPU time and dictionary size
1. You obtain a dictionary file, which is no more than a flat file (plain text) list of words
(commonly referred to as wordlists).
2. These words are fed through any number of programs that encrypt each word. Such
encryption conforms to the DES standard.
3. Each resulting encrypted word is compared with the target password. If a match
occurs, there is better than a 90 percent chance that the password was cracked.
Step1:Goto Lab1folder,and open LC4 to audit the passwords on your Windows system.
Objectives
This password file has been retrieved from a system that we must gain access to. To do this you
must crack as many passwords as possible as quickly as possible. We have captured the user
names and encrypted passwords for ten users. The user names follow a standard pattern of first
initial and last name, but the passwords have no set standards. We do know that users of this
system are encouraged to add numbers and other characters to the words they chose for
passwords.
To aid you in cracking these passwords we have managed to collect some basic information
about the users. This personal information may help you target your searches as to what the
user‘s password may be.
her‗LittlePrecious‘*
Use this menu to customize your password search. Here you can add different word list
for Dictionary attacks, change Hybrid attack features. Keep in mind you are working with
a short dead line and more in depth searches will take longer then you have. You must
use the information given to you to target your search most specifically at more likely
passwords.
lOMoARcPSD|31951331
Step 3:Select Session Begin ―Audit‖ or Press the blue play button on the upper toolbar to start the
password search.
Step4:After the first search has run check your progress. Have some of the passwords been cracked
all the way though or have some only been partially cracked. Use what you‘ve learned from
this first search to target your next few searches. You will need to search the internet and use
the information you have been given about each user to find words they may have used as
their password.
Note: The question marks in the partially cracked passwords do not necessarily represent the
number of remaining undiscovered characters.
Press the ‗Dictionary List‘ button in the Dictionary crack section. Here you can edit your
currentwordlistandaddwordsbyselectingthe‗EDIT‘buttonandenteringeachwordon a new line.
You can also add multiple dictionaries and wordlist.
lOMoARcPSD|31951331
Step6: You may chose to conduct dictionary attacks with other wordlists. You can find
additional wordlist to use here: ftp://ftp.cerias.purdue.edu/pub/dict
Step7:Continuesearchingforpossiblepasswordsduringtheremainderofthelab.Repeatingsteps3 and 4
each time you modify your search.
Result:
Thus the experiment for Eavesdropping, Dictionary attacks ,MITM attacks was done successfully.
lOMoARcPSD|31951331
AIM
Perform an Experiment to Sniff Traffic using ARP Poisoning.
Description:
ARP is the acronym for Address Resolution Protocol. It is used to convert IP address to physical
addresses [MAC address] on a switch. The host sends an ARP broadcast on the network, and the
recipient computer responds with its physical address [MAC Address]. The resolved IP/MACaddress
is then used to communicate. ARP poisoning is sending fake MAC addresses to the switch so that
it can associate the fake MAC addresses with the IP address of a genuine computer on a
Static ARP entries: these can be defined in the local ARP cache and the switch configured to
ignoreall auto ARP reply packets. The disadvantage of this method is, it‘s difficult to maintain on
large networks. IP/MAC address mapping has to be distributed to all the computers on the
network. ARP poisoning detection software: these systems can be used to cross check the
IP/MAC address resolution and certify them if they are authenticated. Uncertified IP/MAC address
Operating System Security: this measure is dependent on the operating system been used. The
• Microsoft Windows: the ARP cache behavior can be configured via the registry. The
followinglistincludessomeofthesoftwarethatcanbeusedtoprotectnetworksagainst
lOMoARcPSD|31951331
sniffing;
network LAN or exposed to the internet. Network Sniffers are programs that capture
low-levelpackagedatathatistransmittedoveranetwork.Anattackercananalyzethis
• In this article, we will introduce you to common network sniffing techniques and
ComputerscommunicatebybroadcastingmessagesonanetworkusingIPaddresses.Oncea
message has been sent on a network, the recipient computer with the matching IP address
the specialized software program or hardware equipment. Sniffing can be used to;
• CapturefileshavebeentransmittedoveranetworkThefollowingareprotocolsthat are
vulnerable to sniffing
• Telnet
lOMoARcPSD|31951331
• Rlogin
• HTTP
• SMTP
• NNTP
• POP
• FTP
• IMAP
The above protocols are vulnerable if login details are sent in plain text
Before we look at passive and active sniffing ,let‘s look at two major devices used to network
A hub works by sending broadcast messages to all output ports on it except the one that has
sentthebroadcast.TherecipientcomputerrespondstothebroadcastmessageiftheIPaddress
lOMoARcPSD|31951331
Aswitchworksdifferently;itmapsIP/MACaddressestophysicalportsonit.Broadcast
computer. This means broadcast messages are onlyseen bythe recipient computer. Switches
operate at the data link layer (layer 2) and network layer (layer 3).
Thediagrambelowillustrates howtheswitchworks.
Passive sniffing is intercepting packages transmitted over a network that uses a hub. It is called
passive sniffing because it is difficult to detect. It is also easy to perform as the hub sends
lOMoARcPSD|31951331
broadcastmessagestoallthecomputersonthe network.
Activesniffingisinterceptingpackagestransmittedoveranetworkthatusesaswitch.There aretwo
main methods used to sniff switch linked networks, ARP Poisoning, and MAC flooding.
Sniffingthenetworkusing Wireshark
Theillustrationbelowshowsyouthestepsthatyouwillcarryouttocompletethis exercise
withoutconfusion
DownloadWiresharkfromthislinkhttp://www.wireshark.org/download.html
• OpenWireshark
• Youwillget thefollowingscreen
• Select the network interface you want to sniff. Note for this demonstration, we are using
awireless network connection.Ifyouare on a local area network, thenyou should select the
lOMoARcPSD|31951331
localareanetworkinterface.
• Clickonstartbuttonasshownabove
• Openyourwebbrowserandtypeinhttp://www.techpanda.org/
• Filter for HTTP protocol results only using the filter textbox
lOMoARcPSD|31951331
• LocatetheInfocolumnandlookforentrieswiththeHTTPverbPOSTandclickon it
• Justbelowthelogentries,thereisapanelwithasummaryofcaptureddata.Lookfor the
• YoushouldbeabletoviewtheplaintextvaluesofallthePOSTvariablessubmittedto the
Result:
Thus the experiment to Sniff Traffic using ARP Poisoning was performed.
lOMoARcPSD|31951331
AIM:
To demonstrate Intrusion Detection System(IDS)using Snort software ool.
Finding an interface
Example:
examplesnort
ChangetheRULE_PATHvariabletothepathofrulesfolder. var
RULE_PATH c:\snort\rules
pathto rules
Changethepathofalllibraryfileswiththenameandpathonyoursystem.and youmustchangethe path
of snort_dynamicpreprocessorvariable.
C:\Snort\lib\snort_dynamiccpreprocessor
Youneedtodothistoalllibraryfilesinthe―C:\Snort\lib‖folder.Theoldpathmightbe:
―/usr/local/lib/…‖. you will need to replacethatpathwithyoursystempath.UsingC:\Snort\lib
Changethepathofthe―dynamicengine‖variable valueinthe―snort.conf‖file..
lOMoARcPSD|31951331
Example:
dynamicengineC:\Snort\lib\snort_dynamicengine\sf_engine.dll
Addthepathsfor―includeclassification.config‖and―includereference.config‖files.
include c:\snort\etc\classification.config
includec:\snort\etc\reference.config
Removethecomment(#)onthelinetoallowICMPrules,ifitiscommented witha#. include
$RULE_PATH/icmp.rules
YoucanalsoremovethecommentofICMP-inforulescomment,ifitis commented.
include $RULE_PATH/icmp-info.rules
Toaddlogfilestostorealertsgeneratedbysnort,searchforthe―outputlog‖testinsnort.confand add the
following line:
outputalert_fast:snort-alerts.ids
Comment(adda#)thewhitelist$WHITE_LIST_PATH/white_list.rulesandtheblacklist
Savethe―snort.conf‖file.
TostartsnortinIDS mode,runthefollowingcommand:
snort-cc:\snort\etc\snort.conf-lc:\snort\log-i3
(Note: 3 is used for my interface card)
Snortmonitoringtraffic–
lOMoARcPSD|31951331
RESULT:
Thus the Intrusion Detection System(IDS)has been demonstrated by using the OpenSource
Snort Intrusion Detection Tool.
lOMoARcPSD|31951331
Aim:
Network monitoring is an essential part of network management. It involves using various tools to
monitor a system network and determine slowness and weak connections, among other issues.
Knowing more about these tools can help you understand them better and use the right ones that suit
your requirements. In this article, we define what network monitoring tools are, provide details about
various tools and discuss about some tips that can help you choose the right tool for your requirements.
Network monitoring tools are software that you can use to evaluate network connections. These
software programs can help you monitor network connection and identify network issues, which may
include failing network components, slow connection speed, network outage or unidentifiable
connections. Network management and monitoring tools can also help you resolve these issues or
establish solutions that prevent specific issues from occurring in the future.
NetworkMonitoringTools
Solar Winds Network Performance Monitor is a multi-vendor monitoring tool. It allows users to
monitor multiple vendors' networks at the same time. It also provides network insights for thorough
visibility into the health of the networks. Some prominent features include network availability
monitoring, intelligent network mapping, critical path visualisation, performance analysis and
advanced alerting. SolarWindsalsoallows usersto trackVPNtunnel status.Itpromptswhena VPN
lOMoARcPSD|31951331
tunnel is available to help users ensure a stable connection between sites. SolarWinds provides aseven-
day free trial, after which users can choose a preferred subscription plan.
2. Auvik
Auvik is a network monitoring and management tool. It offers a quick implementation process that
helps users to set up the tool easily. It also has a clean user interface that makes it easyto navigate and
use. The tool provides in-depth network visibility that enables faster troubleshooting for network
issues. Users can automate network visibility using Auvik. It provides real-time updates on network
issues and configuration changes.
3. DatadogNetworkMonitoring
Datadog Network Monitoring offers services for on-premises devices and cloud networks. A
highlighting feature of this tool is the visualisations. It offers various graphical representationsof all the
network connections on a system. It also allows users to track key metrics like network latency,
connection churn and transmission control protocol (TCP) retransmits. Users can monitor the health of
a network connection at different endpoints at the application, IP address, port or process ID layers.
Other prominent features include automated log collection and user interface monitoring.
4. PaesslerPRTGNetwork Monitor
5. ManageEngineOpManager
ManageEngine OpManager is a good network monitoring and managing tool for users that prefer in-
depth view of network health and issues. This tool provides over 2000 network performance monitors
that allow users to track and monitor their connections and perform detailed analyses on issues. It also
lOMoARcPSD|31951331
provides over 200 dashboard widgets that can help users customise their dashboard to their own
suitability. Other features include CPU, memory and disk utilisation monitoring on local and virtual
machines. It also allows setting network performance threshold and notifies the user in case of a
violation.
6. Domotz
Domotz is an expansive tool that provides a list of features for monitoring network connections. It
allows users to customisetheirnetwork monitoringpreferences. Users can writescripts the retrievethe
data they wish to evaluate. It also allows connection to open ports on remote devices while ensuring
network security. Users can also scan and monitor network connections globally. Domotz also allows
to backup and restore network configuration for switches, firewalls and access points and alerts when
there is a change in the configuration.
7. Checkmk
Checkmk is a tool that allows users to automate it completely. You can customise its operations and
enableittoperformtasksautomatically. Italsoidentifiesnetworkandsecuritycomponentswithoutthe
userrequiringmanual set up. For example, the tool can identifya firewall even if the user has not set it
up. Its Agent Bakery feature enables users to manage agents and automate agentupdating. This reduces
manual effort to monitor network connections. The tool also includes over 2000 plug-ins for enhancing
network monitoring.
8. ProgressWhatsup Gold
Progress Whatsup Gold is a basic network monitoring software. It provides a minimal user interface
with essential features like device monitoring, application monitoring, analysing network traffic and
managing configurations. The tool allows users to monitor cloud devices, inspect suspicious
connections, automate configuration backups and identify, and resolve bandwidth issues.
OtherToolsForNetwork Monitoring
Herearethreeadditionaltoolsfornetworkmonitoring:
lOMoARcPSD|31951331
• Fortra Intermapper: This tool enables users to monitor network connections using network
maps, allowing them to get a holistic view of all the connections. Italso provides various colour
codes for different network status, along with real-time notifications through text, email and
sound.
• Nagios Core: Nagios Core is a monitoring engine that works as the primary application for all
Nagios projects, including the Nagios Network Analyser. It integrates with other Nagios
applications and provides users with features like a visual dashboard, custom application
monitoring, automated alert system, advanced user management and network security
monitoring.
• Zabbix: Zabbix provides a thorough network monitoring solution with features like server
monitoring, cloud monitoring, application monitoring and service monitoring. The tool also
includesfeatureslikemetriccollection,businessmonitoringandrootcauseanalysesofnetwork issues,
and allows users to establish a threshold for connection anomalies.
TipsToChooseANetworkMonitoringAndManagementTool
Understandtherequirements
Understanding why you require network monitoring software is important in the process. Define what
feature you want and for what purpose. This can help you identify the right tool for your use. It may
also help you choose the correct subscription plan on paid tools.
Browsemultipletools
Once you identify the requirements, consider browsing multiple tools. Visit the websites of the tools
andlookforthefeaturesyourequire.Spendtimestudyingthefeaturesandunderstandhowtheycanbe usefulto
yourrequirements.Youcanalsoidentifyafewtoolsandcompare their featurestoeachother.
Considerthebudget
Sometools maybe freeto use,while somemayrequire you to purchase a subscription plan.Paid tools
typically offera freetrialperiodofupto30 days.Onceyouidentifywhichtoolyoumay liketouse,
lOMoARcPSD|31951331
see if it is free or requires payment. If it is a paid tool, try exploring its features and efficiency during
thetrialperiod.Considerkeepingabackuptoolincasethetoolthat youchoosedoesnotfit yourusage.
Result:
Thusthenetworkmonitoringtoolswas explored
lOMoARcPSD|31951331
AIM:
Tostudythefeaturesoffirewallinprovidingnetworksecurityandtoset Firewall
Security in windows.
FirewallinWindows7
Windows 7 comes with two firewalls that work together. One istheWindows Firewall, andtheother is
Windows Firewall with Advanced Security (WFAS). Themaindifferencebetweenthemisthe
complexityofthe rules configuration. Windows Firewall uses simple rules thatdirectlyrelate to a
program or a service. The rules in WFAS can be configured based on protocols, ports, addresses and
authentication. By default, both firewalls come with predefined set of rules that allow us to utilize
network resources. This includes things like browsing the web, receiving e-mails, etc. Other standard
firewall exceptions are File andPrinterSharing,NetworkDiscovery, PerformanceLogsand Alerts,
Remote Administration, Windows Remote Management, RemoteAssistance,RemoteDesktop,
Windows Media Player, Windows Media Player Network Sharing Service
With firewall in Windows 7 we can configure inbound and outbound rules. By default, all outbound
traffic is allowed, and inbound responses to that traffic are also allowed. Inbound trafficinitiated from
external sources is automatically blocked.
When we first connect to some network, we are prompted toselecta network location. This feature is
known as Network Location Awareness(NLA). This feature enables us to assign a network profile to
the connection based on the location. Different network profiles contain different collections of
firewall rules. In Windows7,different network profilescanbe configured ondifferentinterfaces. For
example, our wired interface can have different profile than our wireless interface. There are three
different network profiles available:
• Public
• Home/Work- privatenetwork
• Domain-usedwithinadomain
ConfiguringWindowsFirewall
lOMoARcPSD|31951331
ToopenWindowsFirewallwecangotoStart>ControlPanel>Windows
Firewall.
By default,Windows Firewallisenabledfor bothprivate(home or work)and public networks.It is also
configured to block all connections to programs that are not on the list of allowed programs. To
configure exceptions we can go to the menu on the left and select "Allow a program or feature trough
Windows Firewall" option.
Exceptions
lOMoARcPSD|31951331
To change settings in this window we have to click the "Change settings" button. As you cansee, here
we have a list of predefined programs and features that can be allowed to communicate on private or
public networks. For example, notice that the Core Networking feature is allowed on both private and
public networks, while the File and Printer Sharing is only allowed on private networks. We can also
see the details of the items in the listby selecting it and then clicking the Details button.
Details
If we have a program on our computer that is not in this list, wecanmanuallyadd it byclicking on
the "Allow another program" button.
AddaProgram
Here we have to browse to the executable of our program and then click the Add button. Notice that
we can also choose location types on which this program will be allowedto communicate by clicking
on the"Network location types" button.
lOMoARcPSD|31951331
NetworkLocations
Many applications will automatically configure properexceptionsin Windows Firewall when we run
them. For example, if we enable streaming from Media Player, it will automatically configure
firewall settings to allowstreaming. Thesamethingis ifweenableRemoteDesktop featurefromthe
system properties window. By enabling Remote Desktop feature we actually create an exception in
Windows Firewall.
Windows Firewall can be turned off completely. To do that we can select the "Turn Windows
Firewall on or off" option from the menu on the left.
FirewallCustomization
Note that we can modify settings for each type of network location (private or public). Interesting
thing here is that we can block all incoming connections, including those in the list of allowed
programs.
Windows Firewall is actuallya Windows service.Asyou know, services can be stopped and started. If
the Windows Firewall service is stopped, the Windows Firewall will not work.
FirewallService
Warning
Remember that with Windows Firewall we can only configure basic firewall settings, and this is
enough for most day-to-day users. However, we can't configure exceptions based on portsin Windows
Firewall any more. For that we have to use Windows Firewall with Advanced Security.
HowtoStart&UsetheWindowsFirewallwithAdvancedSecurity
The Windows Firewall with Advanced Security is a tool which gives you detailed control over the
rules that are applied by the Windows Firewall. You can view all the rules that are used by the
Windows Firewall, change their properties, create new rules or disable existing ones. In this tutorial
we will share how to open the Windows Firewall with Advanced Security, how to find your way
around it and talk about the types of rules that are available and what kind of traffic they filter.
HowtoAccesstheWindowsFirewallwithAdvancedSecurity
Youhaveseveralalternatives toopeningtheWindowsFirewallwithAdvancedSecurity:
One is to open the standard Windows Firewall window, by going to "Control Panel -> System and
Security -> WindowsFirewall".Then,click or tap Advanced settings.
In Windows 7, another method is to search for the word firewall in the Start Menu search box and
click the "Windows Firewall with Advanced Security"result.
lOMoARcPSD|31951331
In Windows 8.1, Windows Firewall with Advanced Securityis not returned in search results
and you need to use the first method shared aboveforopening it.
The Windows Firewall with Advanced Security looks and works the samebothin Windows
7 and Windows 8.1. To continue our tutorial, we will use screenshots that were made in
Windows 8.1.
What AreTheInbound&OutboundRules?
In order to provide the security you need, the Windows Firewall has a standard set of
inbound and outbound rules, which are enabled depending on the location of the network
you are connected to.
Inbound rules areapplied to thetraffic that is comingfrom the networkand the Internet to
your computer or device. Outbound rules apply to the traffic from your computer to the
network or the Internet.
These rules can be configured so that they are specific to: computers, users, programs,
services, ports or protocols. You can also specify to which type of network adapter (e.g.
wireless, cable, virtual private network) or user profileit is applied to.
lOMoARcPSD|31951331
In the Windows Firewall with Advanced Security, you can access all rulesand edit their
properties. All youhaveto do is clickor tap the appropriate unit in the left-side panel.
The rules used by the Windows Firewall can be enabled or disabled. The ones which are
enabled or active are marked with a green check-box in the Name column. The onesthat are
disabled are marked with a gray check-box.
WhatAreTheConnectionSecurityRules?
Connection security rules are used to secure traffic between two computers whileit crosses
the network. One example would be a rule which definesthatconnections between two
specific computers must be encrypted.
Unlike the inbound or outbound rules, which are applied only toonecomputer, connection
security rules require that both computers have the same rules defined and enabled.
If you want to see if there are any such rules on your computer, click or tap "Connection
Security Rules"on the panel on the left. By default, there are no such rules defined on
Windows computers and devices. They are generally used in business environments and
such rules aresetbythe network administrator.
lOMoARcPSD|31951331
WhatDoestheWindowsFirewallwithAdvancedSecurity
Monitor?
The Windows Firewall with Advanced Security includes some monitoringfeatures as well.
In the Monitoring section you can find the following information: the firewall rulesthat are
active (both inbound and outbound),the connection security rules that are active and
whether there are any active security associations.
You should note thatthe Monitoring section shows onlythe active rules for the current
network location.
lOMoARcPSD|31951331
used to determine the operating system running on the host machine. Another feature is
"boot-time filtering". This feature ensures that the firewall is working at the same time
when the network interface becomes active, which was not the case in previous versions of
Windows.
When we first connect to some network, we are prompted toselecta network location. This
feature is known as Network Location Awareness (NLA). This feature enables us to assign
a network profile to the connection based on the location.Differentnetworkprofiles contain
different collections of firewall rules. In Windows 7, different network profiles can be
configured on different interfaces. For example,our wired interface can have different
profile than our wireless interface. There are three different network profiles available:
• Public
• Home/Work- privatenetwork
• Domain-usedwithinadomain
We choose those locations when we connect to a network. We can always change the
location in theNetworkandSharing Center,inControl Panel. The Domain profile can be
automatically assigned by the NLA service when we log on to an Active Directory domain.
Note that we must have administrative rights in order to configure firewall in Windows 7.
ConfiguringWindowsFirewall
ToopenWindowsFirewallwecangotoStart>ControlPanel>
lOMoARcPSD|31951331
WindowsFirewall.
By default, Windows Firewall is enabled for both private (home or work) and public
networks. It is also configured to block all connections to programs that are not on the list
of allowed programs. Toconfigureexceptions we can goto the menu on the left andselect
"Allow a program or feature trough Windows Firewall" option.
Exceptions
To change settings in this window we have to click the "Change settings" button. As you
can see, here we have a list of predefined programs and features that can be allowed to
communicate on private or public networks. For example, notice thattheCore Networking
feature is allowed on both private and public networks, while the File and Printer Sharing
is only allowed on private networks. We can also see the details of the items in the list by
selecting it and then clicking the Details button.
lOMoARcPSD|31951331
Details
Ifwehaveaprogramonour computerthatisnotinthislist,wecan
manuallyadditbyclickingonthe"Allowanotherprogram"button.
AddaProgram
Here we have to browse to the executable of our program and then click the Add button.
Notice that we can also choose location types on which this program will be allowed to
communicate by clicking on the"Network location types" button.
lOMoARcPSD|31951331
NetworkLocations
Many applications will automatically configure proper exceptions in Windows Firewall
when we run them. For example, if we enable streaming from Media Player, it will
automatically configure firewall settings to allow streaming. The same thing is if we
enable Remote Desktop feature from the system properties window. By enabling Remote
Desktop feature we actually create an exception in Windows Firewall.
Windows Firewall can be turned off completely. To do that we can select the "Turn
Windows Firewall on or off" option from the menu on the left.
FirewallCustomization
Note that we can modify settings for each type of network location (private or public).
Interesting thing here is that we can block all incoming connections, including those in the
list of allowed programs.
Windows Firewall is actually a Windows service. As you know, services can be stopped
and started. If the Windows Firewall service is stopped, the Windows Firewall will not
work.
lOMoARcPSD|31951331
FirewallService
In our case the service is running.Ifwestop it, wewillgeta warningthatwe should turn on our
Windows Firewall.
Warning
Remember that with Windows Firewall we can only configure basic firewall settings, and
this is enough for most day-to-day users. However, we can't configure exceptions based on
ports in Windows Firewall any more. For that we have to use Windows Firewall with
Advanced Security.
HowtoStart&UsetheWindowsFirewallwithAdvancedSecurity
The Windows Firewall with Advanced Security is a tool which gives you detailed control
overtherulesthatareappliedbythe WindowsFirewall.Youcan view all therulesthat are used by
the Windows Firewall, change their properties, create new rules or disable existing ones. In
this tutorial we will share how to open the Windows Firewall with Advanced Security,
howto find your wayaround it and talk about the types of rules that are available and what
kind of traffic they filter. How to Access the Windows Firewall with Advanced Security
Youhaveseveralalternatives toopeningtheWindowsFirewallwithAdvancedSecurity:
lOMoARcPSD|31951331
One is to open the standard Windows Firewall window, bygoing to "Control Panel ->
System and Security -> WindowsFirewall".Then,click or tap Advanced settings.
In Windows 7, another method is to search for the word firewall in the Start Menu search
box and click the "Windows Firewall with Advanced Security"result.
lOMoARcPSD|31951331
In Windows 8.1, Windows Firewall with Advanced Security is not returned in search
results and you need to use the first method shared aboveforopening it.
The Windows Firewall with Advanced Security looks and works the samebothin Windows
7 and Windows 8.1. To continue our tutorial, we will use screenshots that were made in
Windows 8.1.
WhatAreThe Inbound&OutboundRules?
In order to provide the security you need, the Windows Firewall has a standard set of
inbound and outbound rules, which are enabled depending on the location of the network
you are connected to.
Inbound rules are applied to the traffic that is coming from the network and the Internet to
your computer or device. Outbound rules apply to the traffic from your computer to the
network or the Internet.
These rules can be configured so that they are specific to: computers, users, programs,
services, ports or protocols. You can also specify to which type of network adapter (e.g.
wireless, cable, virtual private network) or user profileit is applied to.
In theWindows Firewall withAdvancedSecurity,youcanaccessallrules and edittheir
properties. All you have to do is clickor tap the appropriate unit in the left-side panel.
lOMoARcPSD|31951331
The rules used by the Windows Firewall can be enabled or disabled. The ones which are
enabled or active are marked with a green check-box in the Name column. The ones that
are disabled are marked with a gray check-box.If you want to know more about a specific
ruleandlearnitsproperties,rightclickonitandselectPropertiesorselectitandpress
Propertiesinthecolumnonright, whichliststheactionsthatare availableforyour selection.
lOMoARcPSD|31951331
WhatAreTheConnectionSecurityRules?
Connection security rules are used to secure traffic between two computers while it
crosses the network. One example would be a rule which defines that connections
between two specific computers must be encrypted.
Unlike the inbound or outbound rules, which are applied only to one computer,
connection security rules require that both computers have thesame rules defined and
enabled.
If you want to see if there are any such rules on your computer, click ortap"Connection
Security Rules"on the panel on the left.By default,there are no such
rulesdefinedonWindowscomputersanddevices.Theyaregenerallyusedin business
environments and such rules aresetbythe network administrator.
lOMoARcPSD|31951331
The Windows Firewall with Advanced Security includes some monitoring features as well. In
the Monitoring section you can find the following information: the firewall rules that are active
(both inbound and outbound), the connection security rules that are active and whether there are
any active security associations.
You should note that the Monitoring section shows only the active rules for the current
network location.
Result:
Study of the features of firewall in providing network security and to set Firewall
Security in windows.