Vapt Lab Manual Vapt
Vapt Lab Manual Vapt
Program 1:
Objec琀椀ve:
Capture and analyze network tra昀케c to understand data 昀氀ow and iden琀椀fy key network
characteris琀椀cs.
Prerequisites:
1. A computer with Wireshark installed. Wireshark is available for various operating systems.
2. Access to a network with active communication (e.g., internet access, local network, or
virtual lab environment).
Steps:
1. Install Wireshark: If you haven't already, download and install Wireshark on your computer.
You can find the installer for your operating system on the Wireshark website.
2. Start Wireshark: Launch Wireshark on your computer. Note that you might
need administrative privileges to capture packets on some operating systems.
3. Select the Network Interface: Wireshark allows you to choose the network interface for
capturing packets. Select the appropriate interface connected to the network you want to
monitor. For example, if you are connected via Wi-Fi, select the Wi-Fi interface.
4. Start Capturing Packets: Click on the "Start" button in Wireshark to begin capturing packets
on the selected network interface.
5. Generate Network Traffic: To capture network traffic, you need to generate network
activity. Perform various network activities such as browsing websites, sending emails,
pinging other devices, or accessing network resources.
6. Stop Capturing Packets: After performing network activities, stop the packet capture
in Wireshark by clicking the "Stop" button.
7. Analyze Captured Packets: Once the capture is stopped, you will see a list of captured packets
in Wireshark's main window. Each row represents a captured packet, and the columns provide
information about the source and destination addresses, protocols, and other packet details.
8. Apply Filters (Optional): To focus on specific packets of interest, you can use display filters in
Wireshark. Filters allow you to show only packets matching specific criteria, such as source or
destination IP, protocol, or port.
9. Inspect Packet Contents: Select a packet of interest from the list, and Wireshark will display
detailed information about the packet, including the packet header, payload data, and other
relevant details.
10. Analyze Packet Timing and Flow: Use Wireshark's analysis features to examine packet
timing, flow, and potential network issues or anomalies.
11. Save Capture File (Optional): If you want to save the captured packets for further analysis
or documentation, you can save the capture file in a format such as PCAP (Packet Capture).
12. Review and Interpret Results: Review the captured packets, analyze network behavior, and
interpret the results to gain insights into network traffic patterns and characteristics.
VIVA QUESTIONS
4. What are some common metrics measured during network traffic monitoring?
Answer: Common metrics measured during network traffic monitoring include bandwidth
utilization, packet loss rate, latency, traffic volume by protocol, top talkers, and top applications.
Program 2:
DESCRIPTION: Nmap (Network Mapper) is a powerful open-source tool used for network
exploration and security auditing. It can be used to discover hosts (devices) and services running
on a network. Here's a guide on how to perform host and services discovery using Nmap:
If1.you
Install Nmap:
haven't already, download and install Nmap on your system. Nmap is available for
various opera琀椀ng systems, including Windows, Linux, and macOS.
2. Determine
Iden琀椀fy the IP Target IP subnet
range or Range:you want to scan. For example, if you want to scan all devices
in the 192.168.1.0/24 subnet, the IP range is 192.168.1.1-254.
Open a terminal or command prompt and run the following command to perform a basic
3. Basic
host Host Discovery:
discovery using Nmap:
For example:
The -sn option tells Nmap to perform a ping scan to discover live hosts in the specified IP
range.
4. Aggressive Host Discovery: If you want to perform a more aggressive host discovery,
you can use the -Pn option, which skips the host discovery phase and sends probes directly to all
specified targets:
5. Service Discovery: To discover open ports and services running on the discovered
hosts, use the following command:
Replace <target with the IP address of a live host identified in the previous step. The -p-
IP>
option tells Nmap to scan all 65,535 ports on the target.
6. Common Ports Discovery: If you want to scan only common ports (top 1000), use the
following command:
Service Version
7.To determine Detec琀椀on:
the version of services running on open ports, use the -sV op琀椀on:
8. Save Output to a File: You can save the Nmap scan results to a file for later
analysis using the -oN op琀椀on:
9. Timing and Performance Options: Nmap allows you to control the timing
and performance of the scan. By default, Nmap uses the -T4 option, which is a
balanced setting. You can adjust the timing to be more aggressive (e.g., -T5) or
more conservative (e.g., -T3).
VIVA QUESTIONS:
1. What is Nmap?
Answer: Nmap (Network Mapper) is a powerful open-source network scanning tool used for
host discovery, port scanning, service enumeration, and vulnerability assessment.
Program 3:
2. Configure OpenVAS: Once OpenVAS is installed, you need to configure it before using it
for scanning. The main configuration involves setting up administrative credentials and creating
a user account.
4. Log in to OpenVAS: Use the administrator credentials or the user account you created
during the configuration to log in to the OpenVAS web interface.
5. Create a Target: Before starting a scan, you need to define the target. A target can be an
individual host, a range of IP addresses, or an entire network. Click on "Configuration" and then
"Targets" to create a new target.
6. Configure the Scan: Once the target is defined, you can create a scan task. Click on "Scans"
and then "Task Wizard" to start the process. You'll need to provide the target and choose the scan
type (e.g., Full and Fast, Full and Fast Ultimate, etc.).
7. Schedule the Scan (Optional): You can schedule the scan to run at a specific time or set it to
run immediately. You can also configure the frequency of recurring scans if needed.
8. Run the Scan: After configuring the scan, click on "Start" to initiate the scanning process.
9. View Scan Results: Once the scan is completed, you can view the results by clicking on
"Scans" and then selecting the completed scan task. The results will provide detailed information
about the vulnerabilities discovered on the target system.
10. Analyze and Remediate Review the scan results to understand the
Vulnerabilities:
identified vulnerabilities. OpenVAS provides information about the severity of each
vulnerability and potential remediation steps. Prioritize and address the high-risk vulnerabilities
first.
11. Generate OpenVAS allows you to generate reports summarizing the scan results.
Reports:
Click on "Reports" and select the scan report you want to generate. The report can be saved in
various formats, such as PDF or HTML.
12. Review and Rescan: After addressing the vulnerabilities, you may want to perform another
scan to ensure that the fixes were successful and to identify any new issues that may have
emerged.
VIVA QUESTIONS:
1. What is OpenVAS?
Answer: OpenVAS (Open Vulnerability Assessment System) is an open-source vulnerability
scanner that helps identify security weaknesses in networks, systems, and applications.
3. What is the difference between a vulnerability scanner and a penetration testing tool?
Answer: A vulnerability scanner like OpenVAS is used to identify known vulnerabilities and
weaknesses, whereas a penetration testing tool goes a step further by attempting to exploit those
vulnerabilities to assess their potential impact.
Program 4:
DESCRIPTION:
Performing internet penetration testing involves assessing the security of a system by simulating
cyberattacks. It includes identifying vulnerabilities, exploiting them, and providing
recommendations to enhance security. Keep in mind the importance of legal and ethical
considerations when conducting penetration tests.
4a.
Mapping
Description
Objective:
The objective of this lab is to simulate an internal penetration testing scenario, focusing on
mapping the network to identify vulnerabilities and potential security risks.
Nmap: For host discovery, open port identification, and network mapping.
Nessus or OpenVAS: For vulnerability scanning.
Metasploit: For exploitation and post-exploitation.
Lab Phases:
1. Discovery:
Run Nessus or OpenVAS scans on discovered hosts: nessus <target> or openvas <target>
Prioritize vulnerabilities based on severity ratings.
Document identified vulnerabilities for each host.
4. Exploitation:
Scanning
Descriptio
n:
1. Objective:
The primary goal of the scanning phase is to systematically identify and catalog all
active devices and services within the internal network.
2. Network Discovery:
Utilizing tools like arp-scan and netdiscover to discover live hosts on the network.
Understanding the importance of accurate and up-to-date network maps.
3. Network Mapping:
Accurate documentation of scan results, including discovered hosts, services, and vulnerabilities.
Providing a foundation for further exploitation and post-exploitation phases.
9. Interactive Learning:
Reinforcing the importance of conducting scanning activities within the rules of engagement.
Emphasizing ethical behavior and respect for the organization's policies.
11. Integration with Other Phases:
10
Highlighting how scanning sets the stage for subsequent phases like vulnerability
analysis and exploitation.
Emphasizing the iterative nature of penetration testing and the need for continuous testing.
12. Feedback and Improvement:
Penetration testing, also known as ethical hacking, involves assessing the security of computer
systems, networks, or web applications to identify vulnerabilities that could be exploited by
malicious actors.
Gaining unauthorized access through Common Vulnerabilities and Exposures (CVEs) is one
aspect of penetration testing that focuses on leveraging known vulnerabilities to assess the
resilience of a system or network.
1. Objective:
Choose specific CVEs based on the scanning results that are applicable to the target environment.
Utilize publicly available exploits or proof-of-concept code associated with the selected CVEs.
5. Payload Delivery:
11
Ensure that all penetration testing activities adhere to legal and ethical standards.
Obtain proper authorization before conducting any testing.
12. Feedback and Remediation:
Passwords Description:
Internal Penetration Testing involves assessing the security of an organization's internal network,
systems, and applications to identify vulnerabilities that could be exploited by attackers. Sniffing
is one technique used in penetration testing to capture and analyze network traffic, including
sensitive information like passwords. Here's a brief description of sniffing passwords for POP3,
FTP, and Telnet protocols:
12
POP3S (Secure POP3): Uses SSL/TLS encryption for secure email retrieval.
FTPS (File Transfer Protocol Secure): Adds a layer of security to FTP using
SSL/TLS encryption.
SSH (Secure Shell): A secure replacement for Telnet, encrypting the communication
between client and server.
4e.ARP
Poisoning
Description:
Internal penetration testing involves assessing the security of an organization's internal network,
systems, and applications to identify vulnerabilities that could be exploited by malicious actors.
ARP (Address Resolution Protocol) poisoning, also known as ARP spoofing, is a common
technique used in such assessments to exploit weaknesses in the way local networks handle
address resolution.
Address Resolution Protocol (ARP): ARP is a protocol used by network devices to map IP
13
addresses to physical MAC (Media Access Control) addresses. When a device on a local
network wants to communicate with another device, it uses ARP to discover the MAC address
associated with the target's IP address. ARP requests are broadcasted on the local network, and
the device with the corresponding IP address responds with its MAC address.
ARP Poisoning: ARP poisoning involves manipulating the ARP tables on devices within a
local network. The attacker sends false ARP messages to associate their MAC address with
the IP address of another device on the network, diverting traffic intended for that device
through the attacker's system. This allows the attacker to intercept, modify, or drop the traffic,
potentially leading to various types of attacks.
Discovery: The attacker scans the local network to identify IP addresses and
corresponding MAC addresses.
Poisoning: The attacker sends forged ARP messages to update the ARP tables on
targeted devices, associating the attacker's MAC address with the IP addresses of
other devices.
Interception: With the ARP tables manipulated, traffic intended for other devices
now passes through the attacker's system. The attacker can monitor, modify, or block
the traffic as needed.
Purposes of ARP Poisoning in Penetration Testing:
To prevent ARP poisoning attacks, organizations can implement secure practices such as ARP
spoofing detection tools, network segmentation, and the use of protocols like DHCP Snooping
and Dynamic ARP Inspection. Regular security audits and penetration testing help identify and
address vulnerabilities before malicious actors can exploit them.
Description:
Internal penetration testing involves assessing the security of an organization's internal network,
systems, and applications to identify vulnerabilities and weaknesses. DNS (Domain Name
System) poisoning is a type of attack that can be included in the scope of internal penetration
testing. DNS poisoning, also known as DNS spoofing or DNS cache poisoning, involves
14
manipulating the DNS resolution process to redirect legitimate domain names to malicious IP
addresses.
Here's a general overview of how DNS poisoning works and how it might be addressed
during internal penetration testing:
15
Program 5:
Description:
External penetration testing is a cybersecurity practice that involves simulating real-world
cyber-attacks on an organization's external-facing systems to uncover vulnerabilities. The
process includes reconnaissance to gather information, vulnerability assessment to identify
weaknesses, exploitation to test security controls, and post-exploitation analysis. The results are
documented in a comprehensive report that outlines discovered vulnerabilities, their potential
impact, and recommendations for remediation. By proactively identifying and addressing
security flaws, external penetration testing helps organizations strengthen their defenses, protect
sensitive data, and meet compliance requirements. Regular testing and continuous improvement
are essential to staying ahead of evolving cyber threats.
infrastructure Description:
External penetration testing is a security assessment process that simulates real-world cyber-
attacks on an organization's external-facing systems. The goal is to identify vulnerabilities that
could be exploited by malicious actors to gain unauthorized access, disrupt services, or
compromise sensitive informat
Scope Definition:
o Clearly define the scope of the external penetration test, including specific IP
ranges, domains, applications, and network segments to be assessed.
o Identify any out-of-scope assets or systems that should not be tested.
Reconnaissance:
16
17
Description:
External penetration testing involves simulating a cyber-attack on a computer system, network, or
web application from an external perspective to identify vulnerabilities and weaknesses. Creating
a topological map and identifying IP addresses are crucial steps in this process. Here's a general
guide on how to approach these tasks:
1. Reconnaissance:
Network Scanning:
o Use tools like Nmap to discover live hosts and open ports on the target network.
o Conduct ping sweeps to identify live hosts.
Topology Mapping:
o Create a visual representation of the network topology, including routers,
switches, and servers.
3. Service Identification:
Banner Grabbing:
o Use tools like Banner Grab or Telnet to identify the services running on open ports.
4. Vulnerability Assessment:
Phishing:
o Conduct phishing simulations to test the human element and gather
additional information.
7. Documentation:
18
information Description:
Performing external penetration testing involves assessing the security of a system from an
external perspective, often simulating the actions of a malicious actor. However, it's crucial to
note that penetration testing should only be conducted on systems and networks for which you
have explicit authorization.
If you are authorized to conduct external penetration testing and want to gather information about
a domain's IP address, you can use various tools and techniques. One common method is to query
domain registration information. Here are steps you can follow:
WHOIS Lookup:
WHOIS is a protocol used to query databases that store the registered users or assignees of an
Internet resource, such as a domain name, an IP address block, or an autonomous system.
There are online WHOIS lookup tools, as well as command-line options.
19
DNS Resolution:
You can also resolve the domain to its IP address using DNS tools:
or
bashCopy code
location Description:
External penetration testing involves assessing the security of a network or system from an
external perspective, typically simulating the actions of a potential attacker. When specifically
examining the use of IPv6 at a remote location, there are several considerations and steps you
can take to ensure a thorough assessment:
weaknesses and security flaws. Use specialized tools that support IPv6
scanning.
Enumeration and Discovery:
o Enumerate IPv6 addresses and services. Look for open ports, running services,
and any potential misconfigurations.
Security Policy and Configuration Review:
o Review the IPv6-related security policies and configurations on routers,
firewalls, and other network devices. Ensure that security best practices are
followed, and unnecessary services are disabled.
Firewall and ACL Assessment:
o Evaluate the effectiveness of IPv6 firewall rules and Access Control Lists
(ACLs). Check for any overly permissive rules that might expose the network to
unnecessary risks.
Endpoint Security:
o Assess the security posture of individual devices with IPv6 capabilities. This
includes servers, workstations, and other networked equipment.
Traffic Analysis:
o Monitor and analyze IPv6 network traffic for any anomalous patterns or potential
signs of malicious activity.
Penetration Testing:
o Conduct penetration testing exercises to simulate real-world attacks on the
IPv6 infrastructure. This may involve exploiting known vulnerabilities,
attempting privilege escalation, or other attack scenarios.
Security Awareness Training:
o Assess the level of security awareness among the remote location's
personnel. Social engineering tests can be valuable to identify potential
weaknesses in human security practices.
Incident Response Testing:
o Evaluate the effectiveness of the incident response plan for IPv6-related
incidents. This may include testing the detection and response capabilities to
IPv6-specific threats.
Documentation Review:
o Review the documentation related to IPv6 implementation, including any
security guidelines or procedures. Ensure that the best practices are being
followed.
21
Program 6:
Procedure:
scanning Description:
Network Scanning:
o Port Scanning:Identifies open ports and services on a network.
o Host Discovery:Determines active hosts on a network.
o Operating System Detection:Attempts to identify the operating system
running on a target system.
Web Application Scanning:
o Automated Scanning: Uses tools to automatically discover and assess
vulnerabilities in web applications.
o Manual Testing: Involves manual inspection of web applications for
vulnerabilities, often using tools like Burp Suite.
Database Scanning:
o Identifying Database Vulnerabilities: Scans databases for
vulnerabilities, misconfigurations, and weak access controls.
Wireless Network Scanning:
o Wireless Network Discovery:Identifies active wireless networks and access points.
o Encryption Assessment: Assesses the security of wireless network encryption protocols.
Cloud Infrastructure Scanning:
o Cloud Service Configuration Scanning: Checks cloud service configurations for
22
security vulnerabilities.
o Container Scanning: Examines containers for vulnerabilities and misconfigurations.
Host Scanning:
o Operating System and Service Version Scanning:Identifies vulnerabilities
associated with specific operating systems and service versions.
o Credential Scanning: Checks for weak or default credentials on systems.
Compliance Scanning:
o Ensuring Regulatory Compliance: Scans for vulnerabilities that might violate
regulatory compliance standards.
IoT Device Scanning:
o Identifying IoT Vulnerabilities: Scans Internet of Things (IoT) devices for
security weaknesses.
23
24
Program7:
Procedure:
Nessus is a widely used vulnerability scanning tool that helps identify security vulnerabilities in
a network, system, or application. Here is a general guide on how to perform vulnerability
scanning using Nessus:
1. Installation:
Launch Nessus and access the web interface. Typically, you can access it by navigating to
https://localhost:8834 in a web browser.
Log in with the credentials you set during the installation.
3. Create a New Scan:
Nessus uses plugins to perform various types of checks. Choose the plugins or policies
that match your scanning requirements.
Consider compliance checks, malware detection, or specific vulnerability categories.
6. Schedule the Scan:
Save the scan configuration and click "Launch" to start the scan.
8. Review Scan Results:
Once the scan is complete, review the results in the Nessus interface.
Prioritize vulnerabilities based on severity levels.
25
9. Generate Reports:
10. Remediation:
Regular Scanning: Perform regular scans to stay on top of the evolving threat landscape.
Credential Scanning:Provide credentials for authenticated scans to get more accurate results.
Prioritize and Plan Remediation: Focus on addressing high-risk vulnerabilities first.
Review and Customize Policies: Tailor scan policies to your organization's specific needs.
Integrate with Other Tools: Nessus can integrate with other security tools and
platforms for a more comprehensive security strategy.
Stay Informed: Keep track of Nessus updates and security bulletins to ensure the tool
is using the latest vulnerability checks.
26
Program 8 & 9:
Ensure you have Nikto and Burp Suite installed on your machine.
2. Configure Burp Suite:
Open Burp Suite and configure your browser to use Burp as a proxy. Set up an
interception point to analyze and modify HTTP requests and responses.
3. Configure Nikto:
Nikto is a web server scanner that performs comprehensive tests against web servers for
multiple items, including over 6700 potentially dangerous files/programs, checks for
outdated versions of over 1250 servers, and version-specific problems on over 270
servers.
Run Nikto from the command line. For
example: phpCopy code
Replace <target_url> with the URL of the web application you want to assess.
4. Burp Suite Spidering:
Use Burp Suite's Spider tool to crawl the web application. This helps in mapping out the
structure and functionality of the application.
5. Manual Exploration:
Manually navigate through the web application to identify and analyze different functionalities.
6. Burp Suite Active Scanning:
Burp Suite's Active Scanner can automatically scan for a variety of common web
application vulnerabilities such as SQL injection, Cross-Site Scripting (XSS), and
more.
Configure the active scanner with the appropriate settings, including payload options and scope.
7. Review and Analyze Results:
Analyze the results from both Nikto and Burp Suite. Pay attention to identified
vulnerabilities, warnings, and informational findings.
27
If vulnerabilities are found, you may attempt exploitation to verify the risk. However,
ensure you have proper authorization before attempting any exploitation.
9. Documentation:
Document your findings, including identified vulnerabilities, their severity, and potential impact.
10. Reporting:
28
Program 10:
Procedure:
Coding is more than just typing lines of text; it’s about ensuring your web applications are secure. One
crucial aspect of security is protecting your web apps from vulnerabilities. In this blog post, we’ll walk
you through integrating OWASP ZAP (Zed Attack Proxy), a powerful tool for Dynamic Application
OWASP ZAP, also known as the Zed Attack Proxy, is a tool that helps you identify security
vulnerabilities in your web applications. It works by simulating attacks on your web app to uncover
weaknesses that malicious hackers could exploit. In essence, it acts like a security guard for your web
29
GitHub Actions is a feature offered by GitHub, your developer’s best friend, that lets you automate
various tasks in your software development workflow. Think of it as a virtual assistant for your coding
Integrating OWASP ZAP with GitHub Actions is a smart move for several reasons:
1. Continuous Security Testing: By integrating OWASP ZAP into your GitHub Actions workflow,
you can automatically test your web application’s security every time you make changes. This means
you can catch and fix vulnerabilities early in your development process.
2. Realistic Testing: OWASP ZAP simulates real-world attacks, giving you a better understanding of
3. Automatic Feedback: You receive immediate feedback on your web app’s security, making it
Now, let’s dive into the steps of how to set up OWASP ZAP in GitHub Actions.
Before you begin, make sure your web application is up and running, accessible via a URL. OWASP
ZAP will need this URL to test your web app’s security.
30
Let’s identify a test web application for running DAST scan. I ‘ll go to google and I’ll search for the test
vulnerable application. Now this is a test one web application , which is a vulnerable web application
Start by creating a repository for your project in GitHub. Let’s call it “GitHubAction_OWASP-ZAP-
SCAN” After that clone the git repository in local system. Now, create a GitHub Actions workflow file
Git Repository
31
In your GitHub repository, go to “Settings” > “Secrets” and add a secret named git_hub_token with the
GitHub Token
owasp-zap-scan.yml
on: [push]
jobs:
zap_scan:
runs-on: ubuntu-latest
name: Scan the web application
steps:
- name: Checkout
uses: actions/checkout@v2
32
with:
ref: main
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
docker_name: 'owasp/zap2docker-stable'
target: 'http://testphp.vulnweb.com/'
rules_file_name: '.zap/rules.tsv'
cmd_options: '-a'
This workflow triggers an OWASP ZAP scan whenever changes are pushed to the main branch.
1. It specifies that this action should run when there is a “push” event, which typically means when
2. It defines a job named “zap_scan” that will run on a computer running Ubuntu.
3. Inside the job, there are some steps that will be executed in order:
“Checkout” step: This step checks out (or downloads) the latest code from the “main” branch of the
repository.
“ZAP Scan” step: This step uses a tool called OWASP ZAP to scan a web application. Here are the
details:
It uses a specific version of ZAP, which is contained in a Docker container (a sort of isolated
It tells ZAP to use a set of security rules defined in a file named “rules.tsv” located in a folder called
It provides some additional command-line options to ZAP using the “cmd_options” parameter,
In simpler terms, this code sets up an automated security scan for a web application every time there’s a
code update in a GitHub repository. It uses a tool called OWASP ZAP to check for security issues in the
web application, and the results of this scan can help identify and fix potential security problems in the
application.
Commit the workflow file and push it to your GitHub repository. GitHub Actions will automatically run
the workflow, and you can view the scan results to identify any security vulnerabilities in your web app.
git add .
git status
git commit -m "Create owasp-zap-scan.yml"
git push
34
OWASP-ZAP-Scan Job
35
36
37
38
39