WAS Lab Manual - Full
WAS Lab Manual - Full
WAS Lab Manual - Full
DEPARTMENT OF
ARTIFICIAL INTELLIGENCE AND DATA SCIENCE
- PROGRAM OUTCOMES vi
- SYLLABUS viii
ii
VISION AND MISSION OF THE INSTITUTE
VISION
An Institution of Excellence by imparting quality education and serve as a perennial source of
technical manpower with dynamic professionalism and entrepreneurship having social
responsibility for the progress of the society and nation
MISSION
Panimalar Institute of Technology will strive to emerge as an Institution of Excellence inthe
country by
Providing state-of-the-art infrastructure facilities for designing and developingsolutions
for engineering problems.
Imparting quality education and training through qualified, experienced and committed
members of the faculty.
Inculcating high moral values in the minds of the Students and transforming them into a
well-rounded personality.
Establishing Industry Institute interaction to make students ready for the industrial
environment.
Promoting research based projects/activities in the emerging areas of Engineering &
Technology.
iii
VISION AND MISSION OF THE DEPARTMENT
VISION
To establish a unique standard of quality education by enriching the problem solving
skills that adapt swiftly to the challenges of the society and industry. Producing professionals
who shall be the leaders in technology employing Artificial Intelligence and Data Science
along with core Computer Science.
MISSION
To create an academic environment for higher learning, academic practices and research
endeavours.
To educate the students with latest technologies to update their knowledge in the field of AI
and Data science.
To empower students with knowledge through state-of-art infrastructure and curriculum.
To produce successful professionals to serve the needs of Industry and society.
To produce entrepreneurs in Artificial Intelligence and Data Science through excellence in
education and research.
iv
PROGRAM EDUCATIONAL OBJECTIVES (PEOs)
PEO 1 : To provide graduates with the proficiency to utilize the fundamental knowledge of
basic sciences, mathematics, Artificial Intelligence, data science and statistics to
build systems that require management and analysis of large volume of data.
PEO 2 : To enrich graduates with necessary technical skills to pursue pioneering research in
the field of AI and Data Science and create disruptive and sustainable solutions for
the welfare of ecosystems.
PEO 3 : To enable graduates to think logically, pursue lifelong learning and collaborate with
an ethical attitude in a multidisciplinary team.
PEO 4 : To enable the graduates to design and model AI based solutions to critical problem
domains in the real world.
PEO 5 : To enrich the innovative thoughts and creative ideas of the graduates for effective
contribution towards economy building.
v
PROGRAM OUTCOMES OF THE DEPARTMENT
vi
PROGRAM SPECIFIC OUTCOMES OF THE DEPARTMENT
PSO 1 : Graduates should be able to evolve AI based efficient domain specific processes
for effective decision making in several domains such as business and governance
domains.
PSO 2 : Graduates should be able to arrive at actionable Fore sight, Insight , hind sight
from data for solving business and engineering problems.
PSO 3 : Graduates should be able to create, select and apply the theoretical knowledge of AI
and Data Analytics along with practical industrial tools and techniques to manage
and solve wicked societal problems.
PSO 4 : Graduates should be capable of developing data analytics and data visualization
skills, skills pertaining to knowledge acquisition, knowledge representation and
knowledge engineering, and hence capable of coordinating complex projects
PSO 5 : Graduates should be able to carry out fundamental research to cater the critical
needs of the society through cutting edge technologies of AI.
vii
SYLLABUS
a) GET
b) PUSH
c) POST
d) DELETE
a) SQL injection
OUTCOMES:
CO1: Understanding the basic concepts of web application security and the need for it
CO2: Be acquainted with the process for secure development and deployment of web applications
CO3: Acquire the skill to design and develop Secure Web Applications that use Secure APIs
CO4: Be able to get the importance of carrying out vulnerability assessment and penetration
testing
CO5: Acquire the skill to think like a hacker and to use hackers tool sets
CO4: Apply generative models for data augmentation
CO5: Develop a real world application using suitable deep neural networks
viii
TABLE OF CONTENTS
PAGE NO.
S.NO. TITLE OF THE EXPERIMENTS
1. INSTALLION OF WIRESHARK 1
ix
EX NO : 1 INSTALLATION OF WIRESHARK
What is Wireshark?
Wireshark is an open-source packet analyzer, which is used for education, analysis,
software development, communication protocol development, and network
troubleshooting.
It is used to track the packets so that each one is filtered to meet our specific needs. It is
commonly called as a sniffer, network protocol analyzer, and network analyser.
What is a packet?
A packet is a unit of data which is transmitted over a network between the origin and the
destination. Network packets are small, i.e., maximum 1.5 Kilobytes for Ethernet packets and
64 Kilobytes for IP packets. The data packets in the Wireshark can be viewed online and can be
analyzed offline.
Functionality of Wireshark:
Wireshark is similar to tcpdump in networking. Tcpdump is a common packet analyzer
which allows the user to display other packets and TCP/IP packets, being transmitted and
received over a network attached to the computer. It has a graphic end and some sorting and
filtering functions. Wireshark users can see all the traffic passing through the network.
Step 1: Visit the official Wireshark website using any web browser.
1
Step 2: Click on Download, a new webpage will open with different installers of Wireshark.
Step 3: Downloading of the executable file will start shortly. It is a small 73.69 MB file that
will take some time.
2
Step 4: Now check for the executable file in downloads in your system and run it.
Step 5: It will prompt confirmation to make changes to your system. Click on Yes.
3
Step 7: The next screen will be of License Agreement, click on Noted.
Step 8: This screen is for choosing components, all components are already marked so don’t
change anything just click on the Next button.
4
Step 9: This screen is of choosing shortcuts like start menu or desktop icon along with file
extensions which can be intercepted by Wireshark, tick all boxes and click on Next button.
Step 10: The next screen will be of installing location so choose the drive which will have
sufficient memory space for installation. It needed only a memory space of 223.4 MB.
5
Step 11: Next screen has an option to install Npcap which is used with Wireshark to capture
packets pcap means packet capture so the install option is already checked don’t change
anything and click the next button.
Step 12: Next screen is about USB network capturing so it is one’s choice to use it or not,
click on Install.
6
Step 13: After this installation process will start.
Step 14: This installation will prompt for Npcap installation as already checked so the license
agreement of Npcap will appear to click on the I Agree button.
7
Step 15: Next screen is about different installing options of npcap, don’t do anything click on
Install.
Step 16: After this installation process will start which will take only a minute.
8
Step 17: After this installation process will complete click on the Next button.
9
Step 19: After this installation process of Wireshark will complete click on the Next button.
Step 20: Click on Finish after the installation process of Wireshark is complete.
Wireshark is successfully installed on the system and an icon is created on the desktop as
shown below:
10
Now run the software and see the interface.
11
EX NO: 2 ANALYZE HTTP PROTOCOL IN WIRESHARK
The installed Wireshark can move on to capturing http traffic. Here are the steps to do it:
Wireshark allows you to analyze the traffic inside your network with various tools. If you want
to see what’s going on inside your network or have issues with network traffic or page loading,
you can use Wireshark. It allows you to capture the traffic, so you can understand what the
problem is or send it to support for further assistance. Keep reading this article, and you’ll learn
how to capture http traffic in Wireshark.
12
Installing Wireshark
Installing Wireshark is an easy process. It’s free tool across different platforms, and here is how
you can download and install it:
13
Capturing HTTP Traffic in Wireshark
Now that you’ve installed Wireshark on your computer, we can move on to capturing http traffic.
Here are the steps to do it:
3. Open Wireshark.
14
4. Tap “Capture.”
5. Tap “Interfaces.” You will now see a pop-up window on your screen.
6. Choose the interface. You probably want to analyze the traffic going through your
ethernet driver.
15
7. Once you’ve selected the interface, tap “Start” or tap “Ctrl + E.”
8. Now go back to your browser and visit the URL you want to capture traffic from.
16
9. Once you’re done, stop capturing traffic. Go back to Wireshark and tap “Ctrl + E.”
10. Save the captured traffic. If you have network issues and want to send the captured
traffic to support, save it into a *.pcap format file.
17
Capturing Packets in Wireshark
Besides capturing http traffic, you can capture whatever network data you need in
Wireshark. Here is how you can do this:
1. Open Wireshark.
2. Select the one you’re interested in. If you want, you can analyze multiple network
connections at once by pressing “Shift + Left-click.”
18
3. Now you can start capturing packets. You can do this in several ways: The first one is
by tapping the shark fin icon at the top-left corner. The second one is tapping “Capture”
and then tapping “Start.” The third way to start capturing is by tapping “Ctrl + E.”
While capturing, Wireshark will display all the captured packets in real-time. Once you’re
done capturing packets, you can use the same buttons/shortcuts to stop capturing.
19
EX NO: 3 ANALYZE HTTPS TRAFFIC USING WIRESHARK
One of the main features of HTTPS is that it’s encrypted. While this is an advantage
when you’re shopping online or leaving personal information on a website, it can be a
drawback when you’re tracking to monitor web traffic and analyze your network.
Since HTTPS is encrypted, there’s no way to read it in Wireshark. But you can display
SSL and TLS packets and decrypt them to HTTPS.
1. Open Wireshark and choose what you’d like to capture in the “Capture” menu.
2. In the “Packet List” pane, focus on the “Protocol” column and look for “SSL.”
20
3. Find the SSL or TLS packet you’re interested in and open it.
21
2. Open “Control Panel.”
22
4. Choose “System.”
23
6. Double-check if you’re in the “Advanced” section and press “Environment Variables.”
24
8. Type “SSLKEYLOGFILE” under “Variable name.”
9. Under “Variable value,” enter or browse the path to the log file.
25
10. Press “Ok.”
Configure Wireshark
After you’ve established your browser is logging pre-master keys in the desired location,
it’s time to configure Wireshark. After configuring, Wireshark should be able to use the keys to
decrypt SSL.
26
2. Click on “Preferences.”
3. Expand “Protocols.”
27
Capture and Decrypt Session Keys
Now that you’ve configured everything, it’s time to check whether Wireshark decrypts
SSL. Here’s what you need to do:
28
3. Go to any secure website to get data.
5. Find “Packet byte view” and look at “Decrypted SSL” data. HTML should now be
visible.
29
EX.NO: 4 IDENTIFY THE VULNERABILITIES USING OWASP ZAP TOOL
OWASP ZAP Tool is a free and open-source tool for security testing, and it is easy to use
for penetration testing to find vulnerabilities in web applications. It provides cross-platform
therefore it works on all platforms of OS link Windows, Linux, and Mac. It is reusable, easy to
generate reports as well and easy to use as well.
Automated Scan.
Manual Explore.
Automated Scan:
To start a vulnerability assessment of your web application firstly you need to perform
the automated scan and passive scanning attack functionality. In the Automated Scan option, we
just pass our application URL and click on Attack and its start scanning your application.
To begin with, you need to download and install OWASP ZAP scanner and set it up
correctly. ZAP is platform agnostic so you can install it on Windows, Linux or Mac OS. You
need Java 8+ installed on your Windows or Linux system.
First two options will save your section in your system and the last one will not save the
section on your system. So, I select the third option.
30
Select Automated Scan Option
31
It starts to scan your application.
It captures your application all URI you can see those in the spider tab.
After that it will start performing an active scan and it will try n number of attack methods
on each URL. Like SQL Injection, Cross Site Scripting, Server-Side Code Injection, etc.
You can see the scanned URL list in the active scan tab.
32
Once the active scan finishes you can see vulnerable requests or URLs in the alert tab.
It shows which URLs have a high or low vulnerability, as well as it, gives the solution and
reference links also provided in the right tab
Manual Explore:
In manual explore the need to explore web applications manually that needs to pass the
application URL and click on launch the browser and then need to start exploring the
application. It captures all visited URLs and performs a passive scan on them.
Below steps are mentioned on how to perform the Manual Scan:
Open the Zap Tool.
Select the Manual Explore option.
Enter the URL in the (URL to explore) input box.
Select the browser.
Click on launch browser.
33
It will launch the browser and you can start exploring the application.
It will capture all visited URLs and perform the passive scan on them.
34
Below steps are mentioned on how to perform the Active Scan:
Once manual explore is done open the ZAP Tool.
Expand the site option.
Select your browser URL folder or you can expand that folder and select the individual
HTTP request.
35
Right-click on a folder or Induvial HTTP request.
Select the attack option and click on Active Scan.
Active Scan pop-up Window will appear then click on Start scan.
36
It will start scanning and perform several attack types on each URL request.
37
EX NO: 5 CREATE SIMPLE REST API USING PYTHON FOR SOME
OPERATION
AIM:
To implement a python program using simple REST API for some operations.
GET
GET is one of the most common HTTP methods you’ll use when working with REST
APIs. This method allows you to retrieve resources from a given API. GET is a read-only
operation, so you shouldn’t use it to modify an existing resource.
Program:
import requests
api_url = "https://jsonplaceholder.typicode.com/todos/1"
response = requests.get(api_url)
response.json()
Output:
{'userId': 1, 'id': 1, 'title': 'delectus aut autem', 'completed': False}
response.headers["Content-Type"]
Output:
'application/json; charset=utf-8'
response.status_code
Output:
200
POST:
Requests to POST data to a REST API to create a new resource.
Program:
import requests
api_url = "https://jsonplaceholder.typicode.com/todos"
todo = {"userId": 1, "title": "Buy milk", "completed": False}
response = requests.post(api_url, json=todo)
response.json()
38
Output:
{'userId': 1, 'title': 'Buy milk', 'completed': False, 'id': 201}
PUT
Beyond GET and POST, requests provides support for all the other HTTP methods you
would use with a REST API. The following code sends a PUT request to update an existing
todo with new data. Any data sent with a PUT request will completely replace the existing
values of the todo.
Program:
import requests
api_url = "https://jsonplaceholder.typicode.com/todos/10"
response = requests.get(api_url)
response.json()
todo = {"userId": 1, "title": "Wash car", "completed": True}
response = requests.put(api_url, json=todo)
response.json()
Output:
{'userId': 1, 'title': 'Wash car', 'completed': True, 'id': 10}
PATCH:
Use requests.patch() to modify the value of a specific field on an existing todo. PATCH
differs from PUT in that it doesn’t completely replace the existing resource. It only modifies
the values set in the JSON sent with the request.
Program:
import requests
api_url = "https://jsonplaceholder.typicode.com/todos/10"
todo = {"title": "Mow lawn"}
response = requests.patch(api_url, json=todo)
response.json()
Output:
{'userId': 1, 'id': 10, 'title': 'Mow lawn', 'completed': True}
response.status_code
39
Output:
200
DELETE:
If you want to completely remove a resource, then you use DELETE.
Program:
import requests
api_url = "https://jsonplaceholder.typicode.com/todos/10"
response = requests.delete(api_url)
response.json()
Output:
{}
response.status_code
Output:
200
RESULT
Thus the implementation of python program using REST API was executed successful
40
EX NO: 6 INSTALL BURP SUITE TO DO SQL INJECTION AND XSS
VULNERABILITIES
41
Step 6: Test and Observe Responses:
Replace the legitimate values of the input fields or parameters with the crafted SQL
injection payloads in the intercepted requests. Forward the modified requests to the server and
observe the responses in Burp Suite. Look for anomalies, error messages, or unexpected
behavior indicating a successful SQL injection vulnerability.
<script>alert('XSS')</script>
42
<img src=x onerror=alert('XSS')>
43
EX NO: 7 ATTACK THE WEBSITE USING SOCIAL ENGINEERING METHOD
44
Step 3. Download The Web Page Source.
Depending on whether the web page is statically or dynamically loaded - which is
identified as part of step 2, you'll need to adjust your approach to downloading the web page.
If the web page is statically loaded.
Download the web page by right clicking anywhere on the page and selecting “Save
As”.
45
If the web page is dynamically loaded.
Copy the web page HTML to clipboard by right clicking anywhere on the web page and
clicking “Inspect”.
Under the Elements heading on the Browser Developer Tools, scroll to the top and right
click on the “<html>” HTML object. Select the Copy heading followed by Copy Element
Open your favourite text editor or IDE and copy the HTML contents into an empty page. Then
save this page as a .html filetype (e.g. Password-Manager-Login.html).
46
Step 4. Load Your Copy Of The Web Page.
Load the newly saved copy of the login page in your browser and check to see if the
page loads. If the web page fails to load or presents some form of error message after a few
seconds, then this indicates that there may be a JavaScript function causing the page to fail.
This could be a technique implemented by the service to prevent cloning, but in many
cases it's just an unintended side-effect of cloning. In the case of this Password Manager page,
there is a JavaScript function causing page failure a few seconds after opening.
47
Step 6. Confirm That The Web Page Loads.
After removing the necessary JavaScript functions and confirming the page loads,
check to see if any images, CSS or other objects fail to load.
These are all indicators that certain page objects may have relative file paths within
their respective HTML elements which need replacing. In the case of this Password Manager,
the panel on the right-hand side of the page has failed to load.
Upon re-inspection of the source website, this is because the right-side panel is being
loaded from an iFrame HTML element.
If the web page has an iFrame.
An HTML iFrame is typically loaded from an external source. During the cloning
process, this typically causes iFrame elements to fail due to Cross-Origin-Resource-
Sharing (CORS) related issues.
To remediate an issue such as this, we need to traverse to the iFrame src and then copy
the raw HTML out of this page and save it as another HTML page that we will then
reference in this src.
48
Step 7. Replace HTML Element References.
Once the page is loading as intended with all images and styles being displayed.
Go through each .CSS and image file referenced and ensure these are downloaded to
your local desktop.
Once downloaded, upload these images to a publicly accessible cloud storage location
(e.g. Amazon S3, Azure Blob, CDN service, etc.) and then update the references for
these to point to your copy of these files.
The reason for this is that service providers such as 1Password will often update or
delete image and .CSS files which will negatively impact our hosted phishing websites
if we still point to these locations to load a resource.
49