Professional Documents
Culture Documents
Experiment 4
Experiment 4
Experiment No. 4
Aim: Study of packet sniffer tools Wireshark: -
a) Observer performance in promiscuous as well as non-promiscuous mode.
b) Show the packets can be traced based on different filters.
Objective: To analyze and implement packet sniffer tools Wireshark.
Software Required: Wireshark
Theory:
Wireshark is the world’s foremost and widely-used network protocol analyzer. It lets
you see what’s happening on your network at a microscopic level and is the de facto
(and often de jure) standard across many commercial and non-profit enterprises,
government agencies, and educational institutions. Wireshark development thrives
thanks to the volunteer contributions of networking experts around the globe and is the
continuation of a project started by Gerald Combs in 1998.
Deep inspection of hundreds of protocols, with more being added all the time
Captured network data can be browsed via a GUI, or via the TTY-mode TShark
utility
Read/write many different capture file formats: tcpdump (libpcap), Pcap NG,
Catapult DCT2000, Cisco Secure IDS iplog, Microsoft Network Monitor, Network
General Sniffer® (compressed and uncompressed), Sniffer® Pro, and NetXray®,
Network Instruments Observer, NetScreen snoop, Novell LANalyzer, RADCOM
WAN/LAN Analyzer, Shomiti/Finisar Surveyor, Tektronix K12xx, Visual Networks
Visual UpTime, WildPackets EtherPeek/TokenPeek/AiroPeek, and many others
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)
K. J. SOMAIYA INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOGY, SION, MUMBAI-400022
Live data can be read from Ethernet, IEEE 802.11, PPP/HDLC, ATM, Bluetooth,
USB, Token Ring, Frame Relay, FDDI, and others (depending on your platform)
Coloring rules can be applied to the packet list for quick, intuitive analysis
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)
K. J. SOMAIYA INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOGY, SION, MUMBAI-400022
}
int modinverse(int e,int N)
{
int x,inv,d;
e=e%N;
for (int x = 1; x < 26; x++)
{
if((e*x)%N == 1)
d=x;
}
if((e*d)%N==1)
{
printf("The value of d is:%d\n",d);
D=d;
}
else
{
printf("Inverse not exist:\n");
}
}
int main()
{
int p,q,m,n,N,e,count;
while(1)
{
printf("Enter two prime numbers:\n");
scanf("%d %d",&p,&q);
prime(p);
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)
K. J. SOMAIYA INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOGY, SION, MUMBAI-400022
prime(q);
if(prime(p)!=1||prime(q)!=1)
{
printf("enter number again because the previous numbers are not prime !!\n");
}
else
{
printf("valid prime numbers\n");
}
n=p*q;
printf("the value of n is :%d\n",n);
N=(p-1)*(q-1);
printf("the value of phi(N) is: %d\n",N);
printf("to calculate the public key(value of e):\n");
int e=2;
while(e<N){
count = gcd(e,N);
if(count==1)
break;
else
e++;
}
printf("The value of e is:%d\n",e);
printf("Enter a message M(plain-text)\n");
scanf("%d",&m);
printf("Now calculate the value of d:\n");
modinverse(e,N);
printf("Public keys are{%d,%d}\n",e,n);
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)
K. J. SOMAIYA INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOGY, SION, MUMBAI-400022
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)
K. J. SOMAIYA INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOGY, SION, MUMBAI-400022
}
int encryption(int e,int m,int n)
{
long value=1,encry;
while (e != 0){
value *= m;
--e;
}
encry=value%n;
printf("the value of encrypted message is :%ld\n",encry);
z=encry;
}
int decryption(int D,int z,int n)
{
long v=1;
int decry;
while(D != 0){
v *= z;
--D;
}
decry=v%n;
printf("the value of decrypted message is :%d\n",decry);
}
int d_sign(int m,int D,int n)
{
long va=1;
int d_sig;
while(D != 0){
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)
K. J. SOMAIYA INSTITUTE OF ENGINEERING AND INFORMATION TECHNOLOGY, SION, MUMBAI-400022
va *= m;
--D;
}
d_sig=va%n;
printf("the value of digital signature is :%d\n",d_sig);
}
DEPARTMENT OF INFORMATION TECHNOLOGY / CLASS- TY / SEM-V / SECURITY LAB / ACADEMIC YEAR-2022-23(ODD) / AAYUSH GALA (14)