Network Security Lab Manual
Network Security Lab Manual
SECUNDERABAD
(AN ISO 9001:2018 Certified Institution)
NETWORK SECURITY
CPS-406
Lab RECORD
Name: ____________________________________
PIN: _____________________________________
Batch: ____________________________________
GOVERNMENT INSTITUTE OF ELECTRONICS,
SECUNDERABAD
(AN ISO 9001:2018 Certified Institution)
CERTIFICATE
Date: ............................................
Download the latest version of Sun Virtual Box from the website.
3. Custom Setup Screen with all the features of VM appears Click Next.
4. Options to create shortcut on Desktop and Quick launch bar Click Next.
6. Click Finish Start Oracle VM Virtual Box. And now install any kind of Operating Systems as Guest
Operating System. The Configuration of Guest OS is shown below
2 . PERFORM AN EXPERIMENT TO GRAB A BANNER WITH
TELNET AND PERFORM THE TASK USING NETCAT UTILITY.
Banner Grabbing is a technique to determine which application or service
is running on the specified port by attempting to make a connection to
this host.
3. Start Caputuring
6.Perform an experiment on how to use Dumpsec.
AIM : Perform an experiment on how to use Dumpsec.
TOOLS REQUIRED:
1.personal computer.
2.Dumpsec software tool.
T HEORY:
DumpSec is a utility tool that can be used to gather detailed information about user and group
permissions, file and folder permissions, and other security-related information on a Windows
system.
DumpSec is a security auditing program for Microsoft Windows NT/XP/200x. It dumps the
permissions and audit settings for the file system, registry, printers and shares in a concise,
readable format, so that holes in system security are readily apparent. DumpSec also dumps
user. group and replication information. Verifying periodically the security of a certain system
can tackle a variety of aspects and among them the permissions are of the utmost importance,
because through them it is decided which user can access one resource or another.
The DumpSec installation is simple and the program is easy to run. Run DumpSec executable
file ".exe" so that you get the DumpSec window.
It can be used to dump security settings of the local system or of a remote system. In order for
Dumpsec to access a remote system, you must first login to the remote user with administrative
previliges.
PROCEDURE:
1.Download and install DumpSec: The first step is to download DumpSec from the official
website or a reliable source. Once downloaded, run the installation file and follow the
instructions to install it on your system.
2.Launch DumpSec: After installation, launch DumpSec from the Start menu or by clicking on its
desktop icon.
3.Connect to the target system: In the DumpSec main window, select the "Scan" tab and click
on the "Target" button. Enter the name of the target system, its IP address, or the network path
to connect to it. You can also specify the login credentials if necessary.
4.Select the scan options: In the Scan tab, you can select the scan options to choose which
security-related information you want to collect. You can select options such as User Rights,
Group Memberships, Share Permissions, NTFS Permissions, and more.
5.Start the scan: After selecting the scan options, click on the "Start" button to begin the scan
process. Depending on the size of the target system and the options selected, the scan process
may take some time.
6.View the results: Once the scan is complete, you can view the results in the DumpSec main
window. You can export the results to a file, print them, or copy them to the clipboard for further
analysis.
7.Interpret the results: The results obtained from DumpSec can provide valuable insights into
the security settings of the target system. You can use the results to identify potential security
vulnerabilities, check for compliance with security policies, and perform other security-related
tasks.
RESULT:performed the experiment how to use dumpsec.
7. PERFORM AN EXPERIMENT TO SNIFF TRAFFIC USING ARP
POISIONING
5. Click on ✅ button
6. Click on option button. “Scan for host”.
7. Click on option button. “Hosts list”.
→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 ip address/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.
Network Intrusion Detection System mode :
5. Click “Next” and then choose install location for snort preferably
a separate folder in Windows C Drive.
7. When you click “ Close” you are prompted with this dialogue box:
8. Installing Npcap is required by snort for proper functioning.
13. Now the window for installation of Npcap shows it has been installed.
Clicking “Finish”.
Successful installation for Npcap 1.10 completed
14. After installing Snort and Npcap enter these commands in windows
10 Command prompt to check snorts working
15. As you can see in the above figure that snort runs successfully.
This is how you can download and install Snort along with its
dependency i.e. Npcap.
Running Snoít
/etc/snort/snort.conf
Substitute youí own netwoík IP íange in place of the 192.168.1.0/24. ľhe
Snoít scíolls a lot of output in the teíminal window, then enteís its monitoíing an
analysis mode. Unless it sees some suspicious activity, you won’t see any moíe
scíeen output.
Fíom anotheí computeí, we staíted to geneíate malicious activity that was diíectly
aimed at ouí test computeí, which was íunning Snoít.
Snoít identifies the netwoík tíaffic as potentially malicious, sends aleíts to the
console window, and wíites entíies into the logs.
Aim: Install the JCrypt tool (or any other equivalent) and demonstrate Asymmetric,
Symmetric crypto algorithm, Hash and Digital/PKI signatures .
INTRODUCTION: In this experiment, we will install the JCrypt tool, which is a Java-based
cryptographic library. We will use this tool to demonstrate the working of different types of
cryptographic algorithms such as symmetric, asymmetric encryption, hash functions, and
digital signatures.
Go to the JCrypt website (https://www.jcrypt.org/) and download the latest version of the
tool.
Extract the downloaded file and place it in a folder.
Open the terminal/command prompt and navigate to the folder where the JCrypt tool is
extracted.
Run the command java -jar jcrypt.jar to start the JCrypt tool.
ASYMMETRIC ALGORITHM
o Download the Jcrypt tool from Crypt tool Website and Install
o Open Jcrypt Software and Click on NEW text editor, type the text information into it.
o Click on the Algorithm menu bar and Select Asymmetric algorithm RSA for encryption.
o Click create a New KeyPair and type in the contact name[#####] and enter the
password and confirm password, then Click finish again.
o same output bin file to decrypt select RSA Algorithm and Click on Decrypt, Select key
name you have declared earlier and Click Finish.
o Enter the password to Decrypt and see the output with original Decrypted text on the
Screen.
SYMMETRIC ALGORITHM
o Click on Algorithm Menu bar Select Symmetric➡️ AES and Click on it.
o Click on create a new key, type contact name and enter the password and confirm,
Click finish ➡️Click finish again.
o Enter the password to open the output file.
o To Decrypt Select Algorithms➡️Symmetric➡️ Select the key which you have created
and Click ➡️Finish.
o Enter the password and see the result in output bin file with
hexadecimal values and plain text.
HASH GENERATION
o Click on Algorithms, Click on Hash➡️Select MD5 ➡️ Click Finish.
o Nowview the output bin file HASH generated.
o Practice using SHA and SHA3 and verify the result on the screen
DIGITAL SIGNATURE
o Click on algorithms, Click on Signature, Select DSA and Click on it.
o Select sign operation and Click on create a new key.
O Enter the password and save the file and Click finish.
o To verify Click on Algorithm, Click on Signature and Click DSA.
o Select verify operation, Click open and type the password and Click finish.
o The Signature file is opened and verified.
Result: Installed the JCrypt tool (or any other equivalent) and demonstrated Asymmetric,
Symmetric crypto algorithm, Hash and Digital/PKI signatures .
10. Understand a Java Program to implement Digital Signature scheme.
DIGITAL S IGNATURE JAVA PROGRAM
CREATING AN INITIAL PROGRAM STRUCTURE
GenerateDigitalSignature.java
1. import java.io.*; //input the file data to be signed
2. import java.security.*; //provides methods for signing the data
3. public class GenerateDigitalSignature
4. {
5. public static void main(String args[])
6. {
7. /* Generate a DSA signature */
8. if (args.length != 1)
9. {
10. System.out.println("Usage: nameOfFileToSign");
11. }
12. else try
13. {
14. // the rest of the code goes here
15. }
16. catch (Exception e)
17. {
18. System.err.println("Caught exception " + e.toString());
19. }
20. }
21. }
GENERATING PUBLIC AND PRIVATE KEY
In the previous step, we have generated signature bytes. In this step, we will save both
signature and public keys in two separate files so that it can share with someone.
Saving Signature
We will save the signature in a file named sig by using the following code.
1. //saving signature
2. FileOutputStream sigfos = new FileOutputStream("sig"); //saving
signature in the file sig
3. sigfos.write(realSig); //writes in the file
4. sigfos.close(); //closes the file
Saving Public Key
Here, we will save the encoded public key. We get the encoded key by using the
getEncoded() method. It returns the encoded byte. We will store the same bytes in a file.
1. //saving public key
2. byte[] key = pub.getEncoded(); //getting encoded key in bytes
3. FileOutputStream keyfos = new FileOutputStream("publickey"); //file
name in which key will store
4. keyfos.write(key); //writes in the file
5. keyfos.close(); //closes the file
COMPILE AND RUN THE PROGRAM
After completing all the above steps, we get the following source code.
GenerateDigitalSignature.javimport java.io.*;
Remember: Do not forget to specify the file name to be signed. We have used the file
Program:
import java.security.*;
public class GenerateDigitalSignature
{
public static void main(String args[])
{
/* Generate a DSA signature */
if (args.length != 1)
{
System.out.println("Usage: nameOfFileToSign");
}
else try
{
/* Generate a key pair */
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA", "SUN");
SecureRandom random = SecureRandom.getInstance("SHA1PRNG", "SUN");
keyGen.initialize(1024, random);
KeyPair pair = keyGen.generateKeyPair();
PrivateKey priv = pair.getPrivate();
PublicKey pub = pair.getPublic();
/* Create a Signature object and initialize it with the private key */
Signature dsa = Signature.getInstance("SHA1withDSA", "SUN");
dsa.initSign(priv);
/* Update and sign the data */
FileInputStream fis = new FileInputStream("F:\\Digital Signature Demo\\digital.txt");
BufferedInputStream bufin = new BufferedInputStream(fis);
byte[] buffer = new byte[1024];
int len;
while (bufin.available() != 0)
{
len = bufin.read(buffer);
dsa.update(buffer, 0, len);
};
bufin.close();
/* Now that all the data to be signed has been read in,
generate a signature for it */
byte[] realSig = dsa.sign();
/* Save the signature in a file */
FileOutputStream sigfos = new FileOutputStream("F:\\Digital Signature
Demo\\signature.txt");
sigfos.write(realSig);
sigfos.close();
/* Save the public key in a file */
byte[] key = pub.getEncoded();
FileOutputStream keyfos = new FileOutputStream("F:\\Digital Signature
Demo\\publickey.txt");
keyfos.write(key);
keyfos.close();
}
catch (Exception e)
{
System.err.println("Caught exception " + e.toString());
}
};
}
Output:
When we execute the program, it generates two files named publickey.txt and signature.txt
files at the specified location.
💠 signature.txt
We see that both files have encrypted data that cannot be read by humans
11. Installation And Study of Various parameters of Firewall
Aim: Installation And Study of Various parameters of Firewall
Theory:
Firewall:
A firewall can be defined as a special type of network security device or a software program
that monitors and filters incoming and outgoing network traffic based on a defined set of
security rules. It acts as a barrier between internal private networks and external sources
(such as the public Internet).
The primary purpose of a firewall is to allow non-threatening traffic and prevent malicious or
unwanted data traffic for protecting the computer from viruses and attacks. A firewall is a
cybersecurity tool that filters network traffic and helps users block malicious software from
accessing the Internet in infected computers.
Avoid using too wide a range of ports. If dynamic ports are used, firewalls sometimes offer
inspection policies to securely allow them through.
THEORY:
OPENSSL:
It also provides a set of tools for managing digital certificates, which are
used to establish the identity of parties in a communication and to facilitate secure key
exchange.
PWGEN COMMAND : T HE PWGEN COMMAND COMPUTES THE HASH OF A PASSWORD TYPED AT RUN -
TIME OR THE HASH OF EACH PASSWORD IN A LIST. THE PASSWORD LIST IS TAKEN FROM THE
NAMED FILE FOR OPTION - IN FILE , FROM STDIN FOR OPTION
-stdin, or from the command line, or from the terminal otherwise.
PROCEDURE:
4.To Install openssl in kali linux use below command. command: ( apt install openssl )
5.Use rand command to generate password.
command: ( pwgen 12 10 )
OUTPUT:
RESULT:
THEOY
:
As you all knows Kali Linux is one the most popular pentesting operating used
having more than 600+ inbuilt hacking/attacking tools pre-installed in it.
PROCEDURE :
After downloading, you can simply run the pentbox by typing “./pentbox.rb” from
pentbox1.8 folder. Command:”./pentbox.rb”
Which you can easily perform with PentBox as follows:
1.Cryptography Tools
2.Network Tools
3.Web
4.IP Grabber
5.Geolocation IP
6.Mass Attack
7.License and contact
8.Exit
To use Cryptography Tools, just type “1” and it will shows another 4 options such as
“Base64Encoder/Decoder“, “Multi-Digest“, “Hash Password Cracker” and “Secure
Password Generator“.
You can use any of the option depending upon your need.
Now we have Network Tools in option no. 2 through which you can
perform “Net Dos Tester“, “TCP port scanner“, “Honeypot“, “Fuzzer“, “DNS and
Host gathering” and “Mac address geolocation“.
Now you can see there are two options, through which you can
configure your honeypot.
You can choose any of the option but for easy and for newbies users,
you can choose Fast Auto Configuration. As you can see, the honeypot is started
in above screenshot.
As you can see, your honeypot will monitor all activities on PORT 80
only, but if you want to monitor some activities on some other port, you can
choose second Manual Configuration option.
OUTPUT:
Result : Hence, I have learned how to setup a honeypot and monitor it over the network
14.WORKING WITH NET STUMBLER TO PERFORM WIRELESS AUDITON A
ROUTER
Aim: To perform wireless audit on an access point or a router and decrypt WEP
and WPA (Net Stumbles).
INTRODUCTION:
NET STUMBLER:
Net Stumbler (Network Stumbles) is one of the Wi -Fi hacking tool which
only compatible with windows, this tool also a freeware. With I his
program, we can search for wireless network which open and infiltrate the
network. Its having some compatibility and network adapter issues. Net
Stumbler is a tool for Windows that allows you io detect Wireless Local
Area Networks (W LA Ns) using 802.1 lb, 802.11a and 802.1 lg. It runs
on Microsoft Windows operating systems from Windows 2000 to Windows
XP. A trimmed -down version called Mini Stumbler is available for the
handheld Windows CE operating system.
It has many uses:
PROCEDURE:
STEP-7: THE NEXT COLUMN DISPLAYS THE ACCESS POINTS SERVICE SET IDENTIFIER{SS
ID] WHICH IS
useful to crack the password.
STEP-8: To decrypt use Wireshark tool by selecting Edit G preferences IEEE 802 1.1.
SCREENSHOTS:
ADDING KEYS : WIRELESS T OOLBAR
If the system is having the Window's version of Wireshark and have an AerCap
adapter. then we can add decryption keys using the wireless toolbar. If the
toolbar isn't visible. you can show' it by selecting Vie w' G Wireless Toolbar.
Click on the Decryption Keys button on the toolbar
A THIS WILL OPEN THE DECRYPTION KEY MANAGEMENT WINDOW . AS SHOWN IN THE
WINDOW YOU CAN SELECT BETWEEN THREE DECRYPTION MODES : NONE, W IRESHARK
AND DRIVER:
RESULT : Thus the wireless audit on an access point or a router and decrypt WEP and
WPA (Net Stumbler) was done successfully
15.To practice on NAYAN, GYN, CHAKRA, DARPAN S3.
Theory :
1) NAYAN :
NAYAN (Network Abhigan niYantran) - End point authentication and access control
solution
NAYAN addresses the access control and authentication requirements of a local area
network. NAYAN controls the access to different network services at the end system level,
protecting internal network from rapidly propagating threats and network misuse. NAYAN
unifies End System Authentication, Desktop Firewall with Centralized Administration,
Automatic Policy Updating and Role Based Access Control.
The primary objective of NAYAN is to ease the Enforcement of Network Access Control
Policies at the end systems in the network. NAYAN having the feature Centralized &
Remote Administration helps the administrator, control access to network services and to
monitor from anywhere in the network. NAYAN supports Automatic Policy
Updating feature, which time-to-time pushes policies specific to each end system. NAYAN
has a unique way of authenticating an end system based on the Machine
Fingerprint generated from various system parameters CPU, OS, Hard disk, Network and
RAM details. NAYAN blocks port scanning and also unwanted traffic flowing across end
systems. Role Based Access Control ensures that only authorized personnel have access
to configuration and personal information. Policies for accessing the network services are
defined based on protocols (TCP, UDP, and ICMP), Source and Destination IP and ports,
Roles assigned to the users and time of effect. A Desktop Firewall component of NAYAN
enforces the Network Access Control policies at every end system. Network usage can be
monitored by the NACS log, and the access to the end systems can be reviewed at every
end system using the Activity log.
Key features :
Signature based attack Detection and prevention
DoS/DDoS Detection
Flood Detection
Reconnaissance Detection
Real-time Traffic Monitoring
Traffic Anomaly Detection
Flow Based Analysis
Comprehensive Threat Analysis
Alert and Attack Analysis
Chakra is a powerful, flexible and feature rich network based dynamic firewall solution. Apart
from having regular firewall features like traffic filtering, Chakra also provides unique
functionalities like dynamic rule generation through network traffic monitoring, analysis and
alert correlation. Chakra collects, analyze and correlate the outputs from multiple network
monitoring sources like SNMP, network flow and IDS to generate dynamic firewall rules.
Chakra can generate and configure firewall rules automatically for attack which change the
traffic pattern of network such as DoS, DDoS, flood etc. It is capable to generate flexible
reports related to traffic trend, security events and alerts. Chakra provides the flexibility and
control over firewall for monitoring, configuration and management in critical attack scenarios
through an interactive web based interface.
4) DARPAN S3(Series 3) :
The Network Management System (DARPAN S3 NMS) is a policy based autonomic network
and cloud management suite of solutions for heterogeneous multi-vendor IP networks and
developed is based on ITU -T recommended FCAPS Model which includes the following
areas:
a) Fault management
b) Configuration management
c) Accounting management
d) Performance management
e) Security management