0% found this document useful (0 votes)
344 views57 pages

Kali Linux & DVWA for Security Testing

Uploaded by

ayele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
344 views57 pages

Kali Linux & DVWA for Security Testing

Uploaded by

ayele
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 57

Kali Linux is a Debian-based Linux distribution specifically designed for digital forensics and

penetration testing. It is maintained and funded by Offensive Security1. The name "Kali" is derived
from the Hindu goddess of time and change, symbolizing the fluid nature of the tools included in the
distribution3.
Key Features and Tools

Kali Linux comes pre-loaded with over 600 penetration testing tools, making it an indispensable
resource for cybersecurity professionals, ethical hackers, and enthusiasts 1. Some of the notable
tools include:
 Metasploit: A penetration testing framework.
 Nmap: A network scanner.
 Wireshark: A packet analyzer.
 John the Ripper: A password cracker.
 Aircrack-ng: A suite for testing wireless LANs

What is the Damn Vulnerable Web


Application (DVWA) and why is it
recommended for practicing web
application security testing?
SATURDAY, 05 AUGUST 2023 PUBLISHED IN CYBERSECURITY, EITC/IS/WAPT WEB
APPLICATIONS PENETRATION TESTING, SPIDERING, SPIDERING AND DVWA, EXAMINATION
REVIEW
The Damn Vulnerable Web Application (DVWA) is a deliberately vulnerable web application that is
widely recommended for practicing web application security testing. It is designed to provide a safe
and legal environment where individuals can learn and enhance their skills in identifying and
exploiting vulnerabilities commonly found in web applications. DVWA is an open-source application
that can be installed on a local machine or a virtual machine, making it easily accessible for
educational purposes.
One of the primary reasons why DVWA is highly recommended for practicing web application
security testing is its didactic value. It offers a hands-on approach to learning by allowing users to
interact with a real-world web application that contains various vulnerabilities. By exploiting these
vulnerabilities, users can gain practical experience in understanding the underlying issues and
potential risks associated with them. This practical experience is invaluable in developing the skills
necessary to identify and mitigate vulnerabilities in real web applications.

DVWA covers a wide range of vulnerability types, making it a comprehensive tool for learning. Some
of the vulnerabilities that can be found in DVWA include SQL injection, cross-site scripting (XSS),
command injection, remote file inclusion, and more. Each vulnerability is carefully crafted to simulate
real-world scenarios, ensuring that users are exposed to a diverse set of security issues commonly
encountered in web applications.

By using DVWA, individuals can practice various techniques and methodologies used in web
application security testing. For example, they can use manual testing techniques to identify
vulnerabilities, such as inspecting the source code, analyzing network traffic, and manipulating input
fields. Additionally, they can utilize automated scanning tools to identify potential vulnerabilities and
perform security assessments.

Furthermore, DVWA provides a built-in tutorial and documentation that guides users through the
process of exploiting vulnerabilities. This documentation explains the vulnerabilities in detail,
provides step-by-step instructions on how to exploit them, and offers insights into the potential
impact and mitigation strategies. This comprehensive documentation enhances the learning
experience and ensures that users have access to the necessary resources to understand and
address the vulnerabilities they encounter.

The Damn Vulnerable Web Application (DVWA) is a highly recommended tool for practicing web
application security testing due to its didactic value, comprehensive coverage of vulnerabilities, and
practical approach to learning. By using DVWA, individuals can gain hands-on experience in
identifying and exploiting vulnerabilities commonly found in web applications, thereby enhancing
their skills in web application security testing.

Nmap Scans for Cyber Security and


Penetration Testing
Last Updated : 30 Aug, 2024



Nmap stands for Network Mapper is arguably one of the most


popular s open source security tools employed for network mapping
applications. As one of the primary utilities of the cybersecurity
domain, recon helps the users to scan the hosts and services in the
computer network. Nmap uses the concept whereby it sends
packets to a target and tries to analyze the response as a way of
dealing with the target network. This article will not only discuss
various fundamental techniques of Nmap Scanning and the general
guidelines for conducting network vulnerability scans, but this article
will also explain to you how actually to use Nmap quite efficiently.
What is Nmap?
Nmap stands for Network Mapper which is a free Open source
command-line tool. Nmap is an information-gathering tool used for
recon reconnaissance. It scans hosts and services on a computer
network which means that it sends packets and analyzes the
response. Listed below are the most useful Scans which you can run
with the help of Nmap tools.
How to Use Nmap
Using Nmap is straightforward. Below are some basic steps and
commands to get started with Nmap:
1. Install Nmap: Nmap is available for various operating systems,
including Linux, Windows, and macOS. You can download it from the
official Nmap website.
2. Basic Syntax: The basic syntax for running aIt Nmap scan is:
nmap [Scan Type] [Options] {Target}
 Scan Type: Specifies the type of scan (e.g., TCP, SYN).
 Options: Additional options such as port range or timing options.
 Target: The IP address or domain name of the target.
Nmap Scanning Techniques
1. TCP Scan/TCP Connect Scan:
nmap -sT 192.168.1.12 --top-ports 50
Here:
 -sT is used for TCP Scan.
 –top-ports is used to give top ports which are used to give the
number of ports. Here we give 50 which means the top 50 ports
which are most used in TCP.
 192.168.1.12 is the Destination IP. You can also give the
Destination URL.
This scan is used to scan the TCP ports. It completes the 3-way
handshake process which means the host tries to make a
connection with the target before any communication happens
between the systems.
Metasploit provides a complete framework for building, testing,
and carrying out attacks against sensitive systems, making it a must-
have tool for any organization.
Rapid7’s Metasploit is a valuable penetration testing tool that
is being used for detecting and exploiting vulnerabilities on
target systems.

This article helps you understand the Metasploit program and its
potential, regardless of whether you’ve been a beginner or an
experienced professional.

Go ahead and walk with us into the world of Metasploit.

Table of Contents
 What is Metasploit?
 History
 Is Metasploit Written in Ruby?
 What database does Metasploit use?
 Is Metasploit a tool or framework?
 How many modules are there in Metasploit?
 What is a Metasploit used for?
 What are the tools of Metasploit?
 Does Metasploit use SSH?
 Benefits & Limitations
 Does Metasploit work without the Internet?
 Conclusion

What is Metasploit?
Metasploit is an Open Source Penetration Testing Framework
created by Rapid7 that enables security professionals to
simulate attacks against computer systems, networks, and
applications.
It provides a range of tools and modules which can be utilized to check
the security of the target system, identify vulnerabilities, and use them
to get into the system.

Users can adjust their experiments to a certain environment or set of


goals, expressing flexibility and adaptability.

Within this framework are several predefined vulnerabilities and


payloads and the option to create unique exploits or programs.

Additionally, this tool includes a user-friendly interface that


makes it possible to organize and carry out the testing even
for people with little expertise doing penetration tests.

The tool performs various tasks, such as reconnaissance, exploitation,


and scans.

What Is Wireshark?
Wireshark is a network protocol analyzer, or an application that captures packets
from a network connection, such as from your computer to your home office or the
internet. Packet is the name given to a discrete unit of data in a typical Ethernet
network.

Wireshark is the most often-used packet sniffer in the world. Like any other packet
sniffer, Wireshark does three things:

1. Packet Capture: Wireshark listens to a network connection in real time and


then grabs entire streams of traffic – quite possibly tens of thousands of
packets at a time.
2. Filtering: Wireshark is capable of slicing and dicing all of this random live
data using filters. By applying a filter, you can obtain just the information you
need to see.
3. Visualization: Wireshark, like any good packet sniffer, allows you to dive
right into the very middle of a network packet. It also allows you to visualize
entire conversations and network streams.

What You’ll Be Learning


PowerShell is a command-line interface and scripting language for
task automation and configuration management. In this article, you
will learn the basics of PowerShell along with the commands useful
for any Cybersecurity professional.

Table of Contents

 Basic PowerShell commands and uses


 Files in PowerShell
 Commands to manipulate files
 Commands to import and remove modules in PowerShell
 Commands for daily security tasks
 Remote PowerShell commands
 Conclusion

Basic PowerShell commands and uses


Let’s begin by reviewing some fundamental PowerShell commands
and use cases. These commands are the building blocks to create
scripts that will help automate and review security-related tasks.

(back to table of contents)


Get-Help

To get help or more details for the particular command, you can use
the Get-Help cmdlet with the command that you need help with. For
example, if we run the following:

Get- Help Get-Proces


We will get additional help on a specific command.

You can view a list of all available help topics by typing Get-Help.

(back to top of section)

Cmdlets

We just mentioned cmdlets, but what are they? cmdlets are small,
lightweight PowerShell modules designed to run tasks in place of
traditional commands. Cmdlets will return an output as an object (or
an array of objects) which also allows you to transfer this data to
other cmdlets using pipes.

Cmdlets always contain a verb and a noun separated by a dash. (For


Example: Get-DnsServer or Remove-ADGroup.

Examples of verbs you might see are:

Get: get something Set: define something Start: run


something Stop: stop something New: create something

(back to top of section)

Pipe

A pipe character | is used to pass data from one cmdlet to another.


For example, pipes can be used to sort the output of one cmdlet and
redirect that output to a file. Multiple pipes can be used in tandem
to build more complex actions!

For example, to create a list of running processes on your machine,


and save it to a file, we would use the command below:

Get-Process | Out-File c:\PS\powershell.txt


Learn more in the Out-File docs.

(back to top of section)

Using PowerShell to traverse directories

Commands for changing directories and viewing directory listings


are the same as the Linux command line and Windows command
prompt. Commands such as cd, dir, mkdir,ls, type, etc will still work.

Learn more in the Managing Current Location docs.

(back to top of section)

Aliases
Aliases in PowerShell provide an alternative name for running a
cmdlet. There are several shorthand aliases built-in. For example,
the ls command will generate the same results as Get-ChildItem.

PS C\User\U1D256> ls

Directory: C\User\U1D256>

Mode LastWriteTime Length Name


---- ------------- ------ ----
d----- 11/5/2021 10:37AM .vscode
d-r--- 11/16/2021 8:00AM .Documents
d-r--- 12/17/2021 10:02AM .Downloads

PS C\User\U1D256> Get-ChildItem

Directory: C\User\U1D256>

Mode LastWriteTime Length Name


---- ------------- ------ ----
d----- 11/5/2021 10:37AM .vscode
d-r--- 11/16/2021 8:00AM .Documents
d-r--- 12/17/2021 10:02AM .Downloads

All aliases can be viewed by running the alias command, and specific
aliases can be viewed by specifying them; for example, alias cd. In
the screenshot below we see that the alias for cd is Set-Location.

PS C\User\U1D256> alias cd

Command Type Name Version Source


------------ ---- ------- ------
Alias cd -> Set-Location

(back to top of section)

Files in PowerShell
In this section, we will learn how to:

 Read a file using the Get-Content.


 Create a new file using the Set-Content command.

(back to table of contents)

Reading from a file

Similar to the cat command in Linux, we can use the Get-


Content cmdlet in PowerShell to read the contents of a file. When Get-
Content is run, the contents of the file are read and the result can be
stored in a variable for later use or displayed on the screen.

For example, we can use the command Get-Content /PS/Names.txt to read


the file Names which is saved on a local C Drive in a folder named PS.

PS C:\> Get-Content /PS/Names.txt


Liam Johnson
Olivia Pope
Noah Clark
Emma Michaelson
Oliver Washington
Ava Miller
Elijah Williams
Charlotte Smith
Mohammed White
Jaris Rodriguez

Note: By adding the -TotalCount argument, we can specify how many


lines we would like PowerShell to read from the top.
Get-Content <PATH> -TotalCount 5

Adding -TotalCount 5 shows the top five items in the names.txt file.

PS C:\> Get-Content -TotalCount 5 /PS/Names.txt


Liam Johnson
Olivia Pope
Noah Clark
Emma Michaelson
Oliver Washington

The -Tail argument will do the same but read from the bottom of the
file.

(back to top of section)

Writing content to a file

In addition to reading files, it is possible to write data to files, either


by using the Set-Content command to create and overwrite files or
the Add-Content command to append content to an existing file.

PS C:\> Set-Content - Value "Rachel Rose" -Path /PS/Names.txt


PS C:\> Get-Content /PS/Names.txt
Rachel Rose
PS C:\>

(back to top of section)

Commands to manipulate files


In this section, you will learn how to use PowerShell to manipulate
files.

(back to table of contents)


Convert-To

Structured data types can be converted into different formats using


PowerShell cmdlets; for example, from .txt to .csv. Some common
ConvertTo commands in PowerShell are:
 ConvertTo-Csv
 ConvertTo-Html
 ConvertTo-Json
 ConvertTo-Xml

Here are some additional Reading on Convert commands

(back to top of section)


Convert-From

Alternatively, the Convert-From command creates objects from


different formats using variable-length strings that are generated by
the ConvertTo cmdlets. Some common Convert-From commands in
PowerShell are:
 ConvertFrom-Csv
 ConvertFrom-Json
 ConvertFrom-Markdown
 `ConvertFrom-StringData

For example, the ConvertTo-Json cmdlet allows you to convert an object


into a JSON-formatted string. The properties are converted to field
names, the field values are converted to property values, and the
methods are removed.

PS C:\Users> Get-Date

Thursday, December 30, 2021, 8:16:10 AM

PS C:\Users> Get-Date | ConverTo-Json


{
"value": "\/Date(1640870187485)\/",
"DisplayHint": 2,
"DateTime": "Thursday, December 30, 2021, 8:16:27 AM"
}
PS C:\Users> Get-Date | ConverTo-Json | ConvertFrom-Json

value DisplayHint DateTime


----- ----------- --------
12/30/2021 1:16:41 PM 2 Thursday, December 30, 2021, 8:16:41 AM

(back to top of section)

Creating files and folders

We create items in PowerShell using the New-Item command.

Example: This command creates the new folder C:\temp\Test Folder


New-Item -Path 'C:\temp\Test Folder' -ItemType Directory

Example: This command creates the new empty file C:\temp\New


Folder\file.txt

New-Item -Path 'C:\temp\Test Folder\file.txt' -ItemType File

(back to top of section)

Commands to import and remove modules in


PowerShell
In this section, you will learn how to use PowerShell Modules.
Modules provide the capability to group like functions together.
There are a number of built-in modules and additional modules can
be installed or will appear on top of other modules.

In PowerShell, a module is considered a package that contains


various functions, workflows, and variables that can operate as a
small program.

For additional information, check out the Microsoft Documentation


on modules.

(back to table of contents)

PowerShell Gallery

The PowerShell Gallery is a repository for sharing useful PowerShell


scripts and modules, some items are created by Microsoft and some
are created by the PowerShell community.

Browse the PowerShell Gallery for modules you’ll want to install


here.

(back to top of section)

Viewing modules

Using the Get-Module cmdlet will list currently loaded modules on a


computer. Using the -ListAvailable option with this command will also
allow you to view all modules that are available for use but not yet
imported on the computer.

The -ListAvailable option can also be used when a specific module has
been provided to list all the available functions for that module.

(back to top of section)

Importing modules

Modules need to be imported to your local PowerShell session before


the cmdlets and functions from that module can be used. Modules
can be loaded into the current PowerShell session by using
the Import-Module cmdlet and specifying the module either by name (-
Name) or by path (-Path).

Example: If you needed to import the PKI PowerShell module, which


is used in digital certificates to protect sensitive public key
infrastructure data, you would use this comment:

Import-Module -Name PKI

(back to top of section)

Installing modules

If a module is not listed as available, then the module can be


installed from a repository, such as the PowerShell Gallery, or from
another repository using the -InstallModule cmdlet.

(back to top of section)

Removing modules

When you need to remove a module, the commands that the


module added are deleted from the session. This is useful when
creating your own modules as you may need to remove and re-
import a module when you make changes to it.

Example: We would remove the PKI module using the command:

Remove-Module -Name PKI


(back to top of section)

Commands for daily security tasks


In this section, you will learn some of the most common PowerShell
security commands that are used by every Cybersecurity
professional today. You should be familiar with these common
commands used for troubleshooting well-known cyberattacks in the
industry today.

(back to table of contents)

Get-ExecutionPolicy and Set-ExecutionPolicy

You can create and execute PowerShell scripts, however, Microsoft


has disabled scripting by default in an effort to prevent malicious
code from executing in a PowerShell environment. You can use
the Get-ExecutionPolicy to check which execution policy is enforced prior
to running a script and then use the Set-ExecutionPolicy command to
change the level of security if needed.

There are four levels of security associated with the Set-


ExecutionPolicy command:

 Unrestricted: This removes all restrictions from the execution


policy.
 Restricted: This is the default execution policy and only
allows commands to be entered interactively. PowerShell
scripts are not allowed to run.
 All Signed: If the execution policy is set to All Signed, scripts will
be allowed to run if they are signed by a trusted publisher.
 Remote Signed: If the execution policy is set to Remote Signed,
PowerShell scripts that have been created locally will be
allowed to run. Scripts created remotely will be allowed to run
if they are signed by a trusted publisher.

(back to top of section)


Get-Service
This command provides a list of every service that is currently
installed on your system.

If you suspect a particular service is worth checking out for security


reasons, we can append the –Name argument, and this will allow you
to see the state of the service on the machine.

PS C:\Users\U1D256> Get-Service

Status Name Display Name


------ ---- ------------
Running BFE Base Filtering System
Stopped BITS Background Intelligent Transfer Ser...
Running camsvc Capability Access Manager Service
...

(back to top of section)


Get-Process

Unlike the Get-Service command in PowerShell, which displays a list of


the different system services, the Get-Process command can display a
list of every process the system currently runs. This command can
also be used to query processes running on a remote machine
or server.

PS C:\Users\U1D256> Get-Process

Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName


------- ------ ----- ----- ------ -- -- -----------
3071 138 359840 354688 25248 0 A180AG
1001 52 52820 65824 1,557.13 8732 1 A180RS
...

(back to top of section)


Stop-Process

This is the complementary command to Get-Process. If you suspect


that a malicious or unwanted process is running on your local
machine or remote server, running Stop-Process -Name or Stop-Process -
Id will terminate the running process.

For example, if you wanted to find the owner of a running process


on a machine, try this script:

PS C:\Users\U1D256> Get-Process pwsh -IncludeUserName

Handles WS(K) CPU(s) Id UserName ProcessName


------- ----- ------ -- -------- -----------
782 132080 2.08 2188 DOMAIN01\user01 pwsh

(back to top of section)


Get-EventLog

Being able to read logs from the local machine is important. Event
logs are an important part of fault diagnosis or incident response.

PowerShell can be used to parse your computer’s event logs using


the Get-EventLog command. By default, it will query the local machine;
however, it can also be used to query logs from remote connections.

For additional reading, check out the Microsoft document on Get-


EventLog.

(back to top of section)


Get-ADUser

The Get-ADUser cmdlet gets a specified user object or performs a


search to get multiple user objects. This cmdlet retrieves a default
set of user object properties. To retrieve additional properties use
the -Properties parameter.

Security teams such as Identity Access Management Teams and


Identity Governance Teams heavily leverage this command.

Example: This command gets all of the properties of the user with
the SAM account name Nicole Scott.

PS C:\Users\U1D256>Get-ADUser -Identity NicoleScott -Properties *


Surname : Scott
Name : Nicole Scott
UserPrincipalName :
GivenName : Nicole
Enabled : False
SamAccountName : NicoleScott
ObjectClass : user
SID : S-1-5-21-2889043008-4136710315-2444824263-3544
ObjectGUID : e1418d64-096c-4cb0-b903-ebb66562d99d
DistinguishedName : CN=Nicole
Scott,OU=NorthAmerica,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM

(back to top of section)

DNS lookups

DNS attacks remain one of the top attacks that Cybersecurity


professionals will have to troubleshoot today. The DNS service is a
well known attack vector for hackers today.

We can look up the DNS entry for a host using the command:

Resolve-DnsName -Name "Hostname"

By appending the -server switch, followed by a DNS server’s IP


address, we can perform a DNS resolve request against a specific
server to verify resolution is working properly.

The Get-DnsClient cmdlet lets you check the DNS client information for
a device. It indicates what DNS servers are being used by the device
to perform address resolutions as configured on multiple adapters.

The Set-DnsClientServerAddress cmdlet allows for specified DNS servers to


be added to the network configuration.

Here are some additional DNS PowerShell Commands

(back to top of section)


Ping devices locally or remotely

The Test-NetConnection cmdlet allows us to test network connectivity on


the LAN and WAN.

For example, the command Test-NetConnection -ComputerName "Hostname or


IP" performs a ping which determines if network connectivity
between the local device and the target computer or domain exists.

This is a useful command for a security professional executing a


DDoS attack.

(back to top of section)


Get-NetIPConfiguration

The Get-NetIPConfiguration cmdlet gets network configurations, including


usable interfaces, IP addresses, and DNS servers. This is helpful for
any cybersecurity professional who needs to troubleshoot and
identify any rogue IP addresses on the network.

(back to top of section)

Testing network connection

The Test-NetConnection cmdlet shows diagnostic information for a


connection. It supports ping tests, TCP tests, route tracing, and
route selection diagnostics. Depending on the parameters, the
output can include the DNS lookup results, a list of IP interfaces,
IPsec rules, route/source address selection results, and/or
confirmation of connection establishment.

Port security attacks are very prevalent today. If we want to verify if


a port is open on our machine or server we could run this command:

Test-NetConnection -ComputerName 127.0.0.1 -Port 4000

(back to top of section)

Remote PowerShell commands


Windows PowerShell remoting lets you run any Windows PowerShell
command on one or more remote computers. You can establish
persistent connections, start interactive sessions, and run scripts on
remote computers. The remote computer must be configured for
remote management.

Read more about remove PowerShell commands here.

(back to table of contents)

Start a session

To start an interactive session with a single remote computer, use


the Enter-PSSession cmdlet. For example, to start an interactive
session with the Server01 remote computer, use the following
command:

Enter-PSSession Server01

To end the interactive session, use the following command:

Exit-PSSession

(back to top of section)

Run a script

To run a script on remote computers, use the -FilePath parameter


from the Invoke-Command cmdlet. The script must be accessible by
your local computer. The results are returned to your local
computer.

Example: The following command runs the GetActiveAccounts.ps1 script


on the remote computers, Server11, and Server12.

Invoke-Command -ComputerName Server11, Server12 -FilePath c:\Scripts\


GetActiveAccounts.ps1
Windows Firewall overview
Windows Firewall is a security feature that helps to protect your device by
filtering network traffic that enters and exits your device. This traffic can be
filtered based on several criteria, including source and destination IP
address, IP protocol, or source and destination port number. Windows
Firewall can be configured to block or allow network traffic based on the
services and applications that are installed on your device. This allows you to
restrict network traffic to only those applications and services that are
explicitly allowed to communicate on the network.

Windows Firewall is a host-based firewall that is included with the operating


system and enabled by default on all Windows editions.

Windows Firewall supports Internet Protocol security (IPsec), which you can
use to require authentication from any device that is attempting to
communicate with your device. When authentication is required, devices that
can't be authenticated as a trusted device can't communicate with your
device. You can use IPsec to require that certain network traffic is encrypted
to prevent it from being read by network packet analyzers that could be
attached to the network by a malicious user.

Windows Firewall also works with Network Location Awareness so that it can apply security
settings appropriate to the types of networks to which the device is connected. For example,
Windows Firewall can apply the public network profile when the device is connected a coffee
shop wi-fi, and the private network profile when the device is connected to the home network.
This allows you to apply more restrictive settings to public networks to help keep your device
secure.

Practical applications
Windows Firewall offers several benefits to address your organization's
network security challenges:

 Reduced risk of network security threats: By reducing the attack surface


of a device, Windows Firewall provides an additional layer of defense to
the defense-in-depth model. This increases manageability and
decreases the likelihood of a successful attack
 Protection of sensitive data and intellectual property: Windows Firewall
integrates with IPsec to provide a simple way to enforce authenticated,
end-to-end network communications. This allows for scalable, tiered
access to trusted network resources, helping to enforce data integrity
and, if necessary, protect data confidentiality
 Extended value of existing investments: Windows Firewall is a host-
based firewall included with the operating system, so no additional
hardware or software is required. It's also designed to complement
existing non-Microsoft network security solutions through a documented
API

Penetration types

Nmap Scans for Cyber Security and


Penetration Testing


Nmap stands for Network Mapper is arguably one of the most


popular s open source security tools employed for network mapping
applications. As one of the primary utilities of the cybersecurity
domain, recon helps the users to scan the hosts and services in the
computer network. Nmap uses the concept whereby it sends
packets to a target and tries to analyze the response as a way of
dealing with the target network. This article will not only discuss
various fundamental techniques of Nmap Scanning and the general
guidelines for conducting network vulnerability scans, but this article
will also explain to you how actually to use Nmap quite efficiently.
What is Nmap?
Nmap stands for Network Mapper which is a free Open source
command-line tool. Nmap is an information-gathering tool used for
recon reconnaissance. It scans hosts and services on a computer
network which means that it sends packets and analyzes the
response. Listed below are the most useful Scans which you can run
with the help of Nmap tools.
Metasploit is a penetration testing framework that helps you find and
exploit vulnerabilities in systems . It is a free and open-source tool that runs
123

on Linux, Windows, and OS X . Metasploit is made up of two main areas: the


3

Framework and the Console . It gives you everything you need from scanners to
3

third-party integrations that you will need throughout an entire penetration testing
lifecycle1
Burp Suite is used for penetration testing by capturing and analyzing each
request to and from the target web application . A penetration tester can
1

configure their internet browser to route traffic through the Burp Suite proxy server,
which acts as a Man In The Middle . Burp Suite allows assessors to generate and
1

confirm clickjacking attacks for potentially vulnerable web pages . It lets you alter
2

all HTTP (S) communications passing through your browser and find hidden attack
surfaces .
2

Wireshark is an essential tool for pentesting thick clients and most things in a Windows
environment. Having a solid understanding of the capabilities can improve the speed and
effectiveness of your pentesting. We will cover a few key functions of Wireshark that come
in handy in penetration tests.

1. CAPTURE VS DISPLAY FILTERS

In most scenarios during a pentest you will be looking for specific traffic. High traffic
networks and applications can overwhelm Wireshark and you with excessive traffic. Using a
capture filter instead of a display filter can remove lots of the traffic you don’t care for and
help find what you’re looking for faster.
Remember these two differences between the two:
Capture filters – completely ignore traffic set by the filter. Display filters – filters existing
captured traffic, opening the filter in a new window.
To create a capture filter click the capture option icon and select the interface you want.
This is usually the interface which shows active traffic in the status graph.
John the Ripper (JtR) is a popular password-cracking tool. John
supports many encryption technologies for Windows and Unix
systems (Mac included).

One remarkable feature of John is that it can autodetect the


encryption for common formats. This will save you a lot of time
in researching the hash formats and finding the correct tool to
crack them.

John is also a dictionary-based tool. This means that it works


with a dictionary of common passwords to compare it with the
hash in hand. Here is a common password list
called rockyou.txt.
While you can use popular wordlists like RockYou, John also
has its own set of wordlists with thousands of common
passwords. This makes John very effective when cracking
systems with weak passwords.

Zed Attack Proxy


 According to 2 sources
Zed Attack Proxy (ZAP) is an open-source penetration testing tool formerly known as
OWASP ZAP. It’s a versatile tool often utilized by penetration testers, bug bounty
hunters, and developers to scan web apps for security risks during the web app testing
process.

OWASP ZAP Tutorial: Compl…


stationx.net
Zed Attack Proxy (ZAP) is a free, open-source penetration testing tool being
maintained under the umbrella of the Open Web Application Security Project (OWASP).
ZAP is designed specifically for testing web applications and is both flexible and
extensible.

OWASP ZAP for beginners. I…


whorse690.medium.com

7 Types of Penetration Testing


Here we’ll cover seven types of penetration tests. As enterprise IT environments have
expanded to include mobile and IoT devices and cloud and edge technology, new types
of tests have emerged to address new risks, but the same general principles and
techniques apply.

Additionally, tests can be internal or external and with or without authentication.


Whatever approach and parameters you set, make sure that expectations are clear
before you start.

While many penetration testing processes begin with reconnaissance, which involves
gathering information on network vulnerabilities and entry points, it’s ideal to begin by
mapping the network. This ensures the entirety of the network and its endpoints are
marked for testing and evaluation.
1. Network tests
Some organizations differentiate internal from external network security tests. External
tests use information that is publicly available and seek to exploit external assets an
organization may hold. On the other hand, internal tests simulate attacks that come
from within. These try to get in the mindset of a malicious inside worker or test how
internal networks manage exploitations, lateral movement and elevation of privileges.

Internal and external network testing is the most common type of test used. If an
attacker can breach a network, the risks are very high. Penetration testers will try to
bypass firewalls, test routers, evade intrusion detection and prevention systems
(IPS/IDS), scan for ports and proxy services, and look for all types of network
vulnerabilities.

Also read: Penetration Testing vs. Vulnerability Testing: An Important Difference

2. Social engineering tests


Social engineering is a technique used by cyber criminals to trick users into giving away
credentials or sensitive information. Attackers usually contact workers, targeting those
with administrative or high-level access via email, calls, social media, and other
approaches.

Most cyberattacks today start with social engineering, phishing, or smishing.


Organizations that want to ensure that their human security is strong will encourage a
security culture and train their workers. But a fundamental component of an effective
human security culture is putting it to the test. While automated phishing tests can help
security teams, penetration testers can go much further and use the same social
engineering tools criminals use.

Penetration testers may run these simulations with prior knowledge of the organization
— or not to make them more realistic. This also allows them to test an organization’s
security team reaction and support during and after a social engineering attack.

3. Web application tests


Web-based applications are critical for the operation of almost every organizations.
Ethical hackers will attempt to discover any vulnerability during web application testing
and make the most of it. The goal of the test is to compromise the web application itself
and report possible consequences of the breach.

Web application tests include web apps, browsers, ActiveX, plugins, Silverlight,
scriptlets, and applets. Languages used in the test include Java, PHP, .NET, and
others. Application programming interfaces (APIs) are also part of this test, along with
XML, MySQL, Oracle, and other connections and systems. If web applications are
mobile, they also need to be tested in their environments.

These tests are complex due to the endpoint and the interactive web applications when
operational and online. Threats are constantly evolving online, and new applications
often use open-source code. This presents several challenges. Code is not always
double-checked for security, and evolving threats continuously find new ways to break
into web applications. Penetration testers have to take into consideration all of these
elements.

See the Top Web Application Firewalls

4. Wireless networks and websites


Companies rely on wireless networks to connect endpoints, IoT devices and more. And
wireless networks have become popular targets for cyber criminals. Penetration testers
will verify wireless encryption protocols, check for beacons, confirm traffic, search for
access points and hotspots, and MAC address spoofing.

Wireless networks are often neglected by security teams and managers who set poor
passwords and permissions. Penetration testers will try to brute force passwords and
prey on misconfigurations. Penetration tests also make sure the system is safe
from denial-of-service (DoS) attacks, where sites are flooded with traffic to force them to
crash.

Finally, as companies embark on digital transformation and modernization, threats to


IoT, sensors, cameras, mobile devices, and other endpoints intensify. Hackers will try to
access critical assets through any of these new points, and the expansion of the digital
surface works in their favor. Therefore, penetration tests that cover wireless security
must be exhaustive.

5. Physical and edge computing tests


Not every threat to a company happens remotely. There are still many attacks that can
be accelerated or only done by physically hacking a device. With the rise of edge
computing, as businesses create data centers closer to their operations, physical
testing has become more relevant.

White hat hackers will test door security systems, access cards, locks, cameras, and
sensors as well as attempt to impersonate personnel. They will also verify how safe
devices, data centers, and edge computer networks are when an attacker can
physically access them. These tests can also be executed with the full knowledge of the
security team or without it.

6. Cloud security tests


Private and public clouds offer many benefits for companies, but they also give cyber
criminals opportunities. Many organizations have business-critical assets in the cloud
that, if breached, can bring their operations to a complete halt. Companies may also
store backups and other important data in these environments.

While cloud vendors offer robust built-in security features, cloud penetration testing has
become a must. Penetration tests on the cloud require advanced notice to the cloud
provider because some areas of the system may be off-limits for white hat hackers.
Cipher explains that penetration testing in the Microsoft Cloud must comply with
the Microsoft Cloud Unified Penetration Testing Rules of Engagement, and while
running a pentest on Amazon Web Services (AWS), organizations must fill out the AWS
Vulnerability — Penetration Testing Request Form.

Cloud penetration tests will examine security, applications and APIs, access, storage,
encryption, virtual machines (VMs), operating systems (OSs) and updates, Secure Shell
(SSH) and Remote Desktop Protocol (RDP) remote administration, and
misconfigurations and passwords.

See the Best Cloud, Container and Data Lake Vulnerability Scanning Tools

7. Red team vs. blue team


Penetration tests often engage in a military-inspired technique, where the red teams act
as attackers and the blue teams respond as the security team. This holistic approach
allows for penetration tests to be realistic and measure not just the weakness,
exploitations, and threats, but also how security teams react.

While some organizations hire experts to act as blue teams, those who have in-house
security teams can use this opportunity to upskill their workers. Security teams can
learn how to respond more rapidly, understand what an actual attack looks like, and
work to shut down the penetration tester before they simulate damage.

There are many variations of red and blue team tests. Blue teams can be given
information about what the attacker will do or have to figure it out as it happens.
Sometimes the blue team is informed of the time of the simulation or penetration test;
other times, they are not. Penetration testers can give insights on how in-house security
teams are responding and offer recommendations to strengthen their actions using this
technique.

Also read:

 Red Team vs Blue Team vs Purple Team: Differences Explained


 How to Implement a Penetration Testing Program in 10 Steps
 Penetration Testing Phases & Steps Explained

Penetration Testing Methods and Approaches


There are three main testing methods or approaches. These are designed for
companies to set priorities, set the scope of their tests — comprehensive or limited —
and manage the time and costs. The three approaches are black, white, and gray box
penetration tests.

Black box penetration tests


Black box penetration tests are the most complex to execute. In these tests, the
organization does not share any information with the pen tester. The tester will have to
identify and map the full network, its system, the OSes, and digital assets as well as the
entire digital attack surface of the company.

Due to their complexity and time-consuming characteristics, black box tests are among
the most expensive. They can take more than a month to complete. Companies choose
this type of test to create the most authentic scenario of how real-world cyberattacks
operate.

White box penetration tests


In a white box test, the organization will share its IT architecture and information with
the penetration tester or vendor, from network maps to credentials. This type of test
commonly establishes priority assets to verify their weaknesses and flaws.

White box tests are also known as crystal or oblique box pen testing. They bring down
the costs of penetration tests and save time. Additionally, they are used when an
organization has already tested other parts of its networks and is looking to verify
specific assets.

Gray box penetration tests


Gray box testing, or translucent box testing, takes place when an organization shares
specific information with white hat hackers trying to exploit the system. Gray box tests
usually attempt to simulate what an attack would be like when a hacker has obtained
information to access the network. Typically, the data shared is login credentials.

To avoid the time and costs of a black box test that includes phishing, gray box tests
give the testers the credentials from the start. These tests also simulate internal attacks.
The goal of this test is not to test authentication security but to understand what can
happen when an attacker is already inside and has breached the perimeter.

How to Determine What Tests to Run


The type of test an organization needs depends on several factors, including what
needs to be tested and whether previous tests have been done as well as budget and
time. It is not recommended to begin shopping for penetration testing services without
having a clear idea of what needs to be tested.

Each type of test is designed for a specific purpose. The first question any organization
needs to ask is what assets are business-critical for their operations. Once the critical
assets and data have been compiled into an inventory, organizations need to look into
where these assets are and how they are connected. Are they internal? Are they online
or in the cloud? How many devices and endpoints can access them?

Knowing what is critical for operations, where it is stored, and how it is interconnected
will define the type of test. Sometimes companies have already conducted exhaustive
tests but are releasing new web applications and services. In this case, they should
consider running white box tests to only test the latest apps. Penetration testers can
also help define the scope of the trials and provide insights into the mindset of a hacker.

Bottom Line: Types of Penetration Testing


Ultimately, the types of penetration tests you choose should reflect your most important
assets and test their most important controls. Well chosen test parameters can give you
the most important information you need — while leaving some budget for the inevitable
cybersecurity improvements a good pentest report will recommend.

It’s essential that penetration tests not just identify weaknesses, security flaws, or
misconfigurations. The best vendors will provide a list of what they discovered, what the
consequences of the exploit could have been, and recommendations to strengthen
security and close the gaps. Penetration tests play a vital role in cybersecurity and have
proven critical for businesses to keep up to date with the ever-evolving global threat
landscape.

Next: See the Best Penetration Testing Tools and the Top Open Source
Penetration Testing Tools

Mobile
Application
Penetration
Testing:
Complete Guide
& Best Practices
The mobile app industry has been booming in recent decades and
shows no sign of stagnation. The market, valued at over $250
billion in 2023, is projected to grow at an impressive CAGR of 14,3%
from 2024 to 2030. However, the industry’s advancement comes
with ever-evolving security risks, requiring businesses to improve
their testing strategies.

That said, detecting potential vulnerabilities in your mobile


application has never been more critical. Without checking whether
your app is resistant to possible attacks, you put yourself at risk of
enormous financial and reputational losses. Luckily, you can avoid
this outcome and strengthen your solution’s security measures
with mobile application penetration testing. This proven security
assessment involves simulated attacks to spot common
vulnerabilities and verify your application’s protection is sufficient.

In this article, Iterasec experts will explain the most common


techniques, methodologies, and best practices for effective mobile
pentesting. Ready? Let’s jump right in!

What is Mobile Application Penetration Testing?

Mobile app penetration testing is a comprehensive security checkup


that aims to discover an iOS or Android application’s most critical
weaknesses by targeting it with imitated attacks.

Thanks to this approach, it’s possible to assess the most significant


components of your solution and see whether your security
practices are effective enough to withstand particular breaches or
cyberattacks. You can also discover whether your app can resist
threats like unauthorized access or functionality manipulation.

With the help of a mobile app pentest, you can determine and
mitigate the most critical security risks and areas an attacker would
most likely target. This information will let you fix issues with your
APIs, features, or authentication methods and take your app’s
security to the next level.

Why Mobile App Pentesting is Important

Before diving into the most compelling reasons to run mobile


application pentesting, let’s examine several eye-opening facts.

 The global average cost of a data breach reached over $4.8 million, as the
latest IBM security report states.

 In the third quarter of 2023 alone, more than 438,000 mobile malware
installation packages were detected.

 Almost 25% of businesses integrating AI-based solutions into their mobile


apps admitted that security, risk, and governance were their most significant
concerns, as Forrester’s 2024 State of Application Security report claims.

So, given the alarming trends in mobile app security, why is


penetration testing vital? Here are the most significant advantages
of conducting such tests:

 Detect vulnerabilities. Your app’s weaknesses may go unnoticed if you


don’t conduct regular checkups. Thanks to penetration testing, it’s possible
to identify vulnerabilities and debug your application proactively, ensuring
that cybercriminals won’t be the first to find gaps in your security system.

 Protect sensitive data. Conducting a thorough pentest is essential if your


app stores sensitive customer data, such as financial or health-related
information. It’s one of the most effective ways to prevent insecure data
storage practices, access control issues, and more.

 Stay compliant. These days, keeping your digital solution compliant with
specific user privacy or security regulations is paramount. Run a penetration
test to check whether your mobile app sticks to GDPR, HIPAA, etc.

 Safeguard API integrations. APIs are among the most common targets of
cybercriminals striving to compromise your system. A mobile app
penetration test will show whether your API integrations have all the required
security measures to prevent unauthorized access to your app’s data and
functionality.

 Earn customer trust. According to a survey, nearly 43% of mobile app


users prioritize security over functionality and convenience. When choosing
an application for their needs, most people must know their private data will
be safe. With a penetration test, you can guarantee your solution is reliable
and trustworthy.

What Can a Mobile App Pentest Detect?

Mobile penetration testing can identify numerous potential


weaknesses. Of course, it mainly depends on the test‘s purpose and
techniques (more on that in a bit). But here, let’s consider the most
common mobile app issues and vulnerabilities you can detect with
the help of penetration testing.
 Unprotected data storage: the potential unauthorized access to
databases containing sensitive user information or financial data

 API vulnerabilities: weak encryption or authentication leading to


functionality manipulation and other security issues

 Deep Links exploitation: vulnerabilities related to insecure deep links


allowing attackers to gain unauthorized access to the application

 Platform-related risks: security flaws specific to a particular mobile app


platform, such as iOS or Android

 Access and permission issues: weaknesses associated with poor intent


management, which may result in functionality manipulation or sensitive
data leakage

 Insecure authentication: compromised passwords and PINs that cause


identity theft, financial loss, and data exposure

 Poor input validation: a critical vulnerability that allows attackers to inject


malicious code and compromise the application’s functionality

With thorough penetration testing, you can prevent these and many
other security vulnerabilities, making your mobile application
persistent in front of the evolving landscape of cyber threats.

Detect various weaknesses and


prevent multiple types of risks
before they becomes a problem.
TALK TO US
Mobile App Penetration Testing Methodology

The methodology required for a result-driven mobile app


penetration test varies depending on your app’s specifics, the
inspected areas, and the chosen approach. However, our experience
shows that a comprehensive mobile application pentest has four
critical stages. Of course, each of them consists of some additional
steps. Plus, there are specific tools, techniques, and frameworks
used throughout every phase.

Pro tip: It’s worth turning to frameworks and guidelines for


consistent and efficient security testing when conducting mobile
application penetration tests. These include the following:

 OWASP Mobile Top 10 — includes the ten most significant mobile app
vulnerabilities.

 OWASP Mobile Application Security Testing Guide (MASTG) —


contains valuable tips, methodologies, and frameworks for mobile app
testing.

 OWASP Mobile Application Security Testing Standard (MASVS) —


provides a framework for mobile app security controls and criteria.

 OWASP Mobile Application Security Cheat Sheet — offers trips and


tricks regarding crucial mobile security practices.

 Mobile Application Security Assessment (MASA) — gives security


guidelines and testing criteria for specialists verifying mobile apps on Google
Play.

 NIAP — categorizes functional and security requirements for mobile


applications.
Now, let’s break down the general mobile app
pentesting methodology:

Step 1. The Discovery Phase

At this stage, the team prepares to conduct a test and collects all
the necessary information about your app. Usually, it involves the
following penetration testing techniques:

Static Analysis of a Mobile App

Checking the app’s source code is one of the initial steps of the
penetration testing process. Static Application Security Testing
(SAST) handles application code review without executing it. If your
app has vulnerabilities like hardcoded credentials, backdoor entries,
or insecure coding practices, specialists can detect them at the
earliest testing stage.

Open-Source Intelligence Assessment

Open-source intelligence (OSINT) involves a detailed analysis of all


publicly available information about a mobile application. The
experts explore everything from social media posts and comments
to developer platforms and forums.

But what does this information have to do with a penetration test?


The thing is that cybercriminals may also gather data about your
application to identify its weakest points and potential target areas.
For example, it’s possible to find a Reddit post where a user
complains about a specific vulnerability or certain functionalities
described on a forum.

Mobile Network Traffic Testing

Before jumping into a mobile app penetration test, it’s a good idea
to check communication protocols and endpoints that may expose
confidential data. Our team analyzes network traffic using different
tools, specially adapted for the unique needs of our clients.

Step 2. Analysis and Evaluation

The next step is the most complex and significant — a team of


security experts analyzes your mobile app on multiple levels to
check its code, architecture, and integrations for possible
vulnerabilities. Here’s a more detailed look at the aspects inspected
and tools used throughout this process.

Static and Dynamic Code Analysis

Once again, a static application security test takes place — but this
time, it’s more detailed and meticulous than during the discovery
phase. Thanks to this approach, testers detect security flaws and
application weaknesses, including SQL injection vulnerabilities and
data storage security issues.

Besides, that’s where dynamic security testing steps in. It verifies


the app’s runtime behavior, allowing specialists to imitate realistic
interactions. Thus, you can see how the app reacts to possible
threats, including the following:
 Input validation problems: Data manipulation or injection attacks become
possible due to unsanitized user input.

 Cross-site scripting: An attacker attaches malicious code to compromise


user-app interactions.

 Inter-Component Communication (ICC) flaws: The application’s


communication with specific components or servers is insecure, opening up
opportunities for unauthorized access.

Architecture Assessment

The application’s architecture covers backend elements, databases,


and authentication mechanisms. Security issues related to these
essential components of your app mean that the whole system can
be compromised. Therefore, it’s crucial to pay extra attention to this
penetration testing stage, which usually addresses the following
vulnerabilities:

 Misconfiguration in security settings: If your backend servers or cloud


lack proper security measures, your app might fall victim to data exposure.

 Faulty authentication and authorization mechanisms: If your


application’s authentication and authorization protocols don’t work correctly,
unauthorized access issues may occur.

 Unprotected data storage: Sensitive customer data requires reliable and


secure storage with solid encryption. Otherwise, it’s easier for cybercriminals
to compromise it.

Reverse Engineering
Reverse engineering is a technique cybersecurity experts and
software developers use to understand how a particular system or
application functions by analyzing it backward from its final form.
In mobile application penetration testing, professionals use reverse
engineering to spot vulnerabilities hidden under the app’s surface.

For instance, this approach is necessary when looking for issues


related to obfuscated code. While developers usually implement
obfuscation to protect the app, it may also hide security flaws.
Besides, reverse engineering is efficient when testers examine
custom libraries and frameworks with specific internal workings.

Analysis of Local Data Storage

If your app stores some data locally on users’ mobile devices, it may
be vulnerable to particular security issues, from sensitive data
exposure to unauthorized access gained through other applications.

Therefore, during mobile pentesting, professionals should examine


whether the app’s data can’t fall into the wrong hands. In particular,
certain information leaves traces (remnants) even after a user
removes it from the device. Testers can spot these traces and check
whether they impact the app’s security with the help of various
penetration testing techniques, such as forensic analysis.

Besides, it’s essential to check whether the mechanisms related


to user privacy (like sandboxing) work properly. This way, you
ensure that nobody can get around them and gain access to the
app’s confidential data.
Inter-Application Communication Checkup

How your application communicates with other apps (in particular,


when exchanging data and interacting through specific
functionality) also impacts its security. Testers should also check
these aspects to see whether data sharing and access don’t
translate into security weaknesses.

One potential vulnerability is insecure or faulty inter-process


communication (IPC). Pentesters should determine whether proper
authorization checks, adequate data transmission, and other crucial
aspects function as expected. In particular, inappropriate access
permissions also pose a significant risk, as they sometimes let an
app access sensitive data from other applications.

Step 3. Exploiting the Application

It’s time to imitate real-world attacks targeted at your mobile


application to see how it reacts to cyber threats. Security experts
usually simulate unique exploits tailored to your application’s
functionality, architecture, and other specifics. Alternatively, it’s
possible to use ready-made tools to “attack” an application striving
to detect and eliminate typical vulnerabilities.

Again, the approach here varies depending on your various factors,


including your application’s type, the data it operates on, and the
hired specialists’ testing approach.
For example, during black box pentesting, experts have no access to
the app’s data, which lets them check whether it’s resistant to
realistic attacks. Meanwhile, gray box testing involves partial access
(such as standard user credentials) to detect internal and external
weaknesses. Finally, with the white box approach, testers gain full
access to the app’s data to conduct a comprehensive system
checkup.

For more details regarding the difference between black box, gray
box, and white box testing, check out our recent blog post on the
topic.

Step 4. Reporting Test Results

When the main part of your mobile app penetration test is complete,
the team that conducted it prepares an in-depth report regarding
the outcomes of their work. Usually, it contains the following details:

 The information regarding the tested application components

 The testing methodology used

 The identified weaknesses with their security levels (such as MAS-L1, MAS-
L2, and MAS-R, according to OWASP Mobile Application Security Verification
Standard)

 The simulated exploits testers have used to showcase vulnerabilities

 Guidelines on how to fix the identified vulnerabilities and improve the


application’s security
Pro tip: Consider running additional mobile pentesting for your app
regularly. This way, you will see whether your fixes have been
effective. Besides, it’s possible to detect and address newly
emerged issues proactively.

Top 8 Best Practices for Mobile Application


Penetration Testing

There is no general-purpose approach to penetration testing for


mobile apps that would fit all possible needs. However, most testing
teams use some valuable techniques and practices to maximize the
effect of application security checkups. Here are some practical tips
and tricks for running a mobile app pentest that hits the mark.

1. Specify Your Pentesting Goals

You should clearly understand what you aim to achieve with


penetration testing. Whether you want to evaluate all the app’s
components or focus on some specific vulnerabilities, such as issues
with architecture or APIs, define it before testing begins. Also, clarify
your security requirements, expected scope of work, and other
nuances.

Web Application Penetration Testing: A


Comprehensive Guide

1. Introduction to Web Application Penetration Testing


1. Overview of the Web Application Penetration Testing Process
2. Tools Used in Web Application Penetration Testing
2. Web Application Basics
1. Overview of Web Application Components
2. Types of Web Applications
3. Web Application Security Concepts
1. The OWASP Top 10 (2021)
2. Authentication and Authorization
3. Session Management
4. Information Gathering and Reconnaissance
1. Gathering Information About the Target Web Application
2. Footprinting and Reconnaissance
3. Scanning and Enumeration
4. Tools Used in Information Gathering and Reconnaissance
5. Exploitation
1. Exploiting Web Application Vulnerabilities
2. Advanced Exploitation Techniques
3. Client-Side Exploitation
4. Tools Used in Exploitation
6. Post-Exploitation
1. Maintaining Access to the Target System
2. Privilege Escalation
3. Covering Tracks
4. Cleaning up after an Attack
7. Reporting and Documentation
1. Reporting Findings
2. Documentation
3. Compliance and Regulations
8. Best Practices
1. Best Practices for Web Application Penetration Testing
2. Ethics and Professionalism
3. Continuous Testing and Improvement
9. More Resources and Tools
1. Information Gathering
2. Scanning
3. Intercepting Proxy
4. Useful Resources and Concepts

Introduction to Web Application Penetration Testing


Web application penetration testing is a process of identifying vulnerabilities and
security weaknesses in web applications, with the aim of improving their overall
security posture. With the increasing reliance on web applications for businesses,
it has become imperative to secure them against potential threats.
What is Web Application Security?

Web application security refers to the measures taken to protect web applications
from cyber-attacks and unauthorized access. It involves implementing various
security measures, such as access control, data encryption, and secure coding
practices, to ensure the confidentiality, integrity, and availability of web
applications.

Why is Web Application Penetration Testing Important?

Web application penetration testing is essential for several reasons. Firstly, it


helps to identify vulnerabilities and security weaknesses in web applications,
which can then be remedied to prevent potential cyber-attacks. Secondly, it helps
businesses to comply with regulatory requirements and standards, such as the
Payment Card Industry Data Security Standard (PCI DSS), which mandates
regular penetration testing of web applications.

Overview of the Web Application Penetration Testing Process

The web application penetration testing process involves several stages,


including:

1. Pre-engagement: This stage involves defining the scope of the penetration


test, identifying the target web application, and obtaining necessary
permissions.
2. Information Gathering: This stage involves gathering information about the
target web application, such as its architecture, functionality, and security
controls.
3. Vulnerability Scanning: This stage involves using automated tools to
identify vulnerabilities and weaknesses in the target web application.
4. Exploitation: This stage involves using manual and automated techniques
to exploit identified vulnerabilities and gain access to the target system.
5. Post-Exploitation: This stage involves maintaining access to the target
system, escalating privileges, and covering tracks.
6. Reporting: This stage involves documenting the findings of the penetration
test and providing recommendations for remediation.

Tools Used in Web Application Penetration Testing

There are several tools used in web application penetration testing, including:

1. Burp Suite: A web application testing toolkit that includes a proxy server,
scanner, and intruder.
2. OWASP ZAP: An open-source web application security scanner.
3. Metasploit: A framework for developing and executing exploits against
target systems.
4. Nmap: A network scanning tool that can also be used for web application
testing.
5. SQLMap: A tool for exploiting SQL injection vulnerabilities in web
applications.

Web Application Basics


Web applications are an integral part of our daily lives, from online shopping to
social media platforms. Understanding the basics of web applications is crucial
for anyone looking to develop, test, or secure them.

Understanding Web Applications

A web application is a software program that is accessed over the internet


through a web browser. It typically consists of a front-end user interface, a back-
end server, and a database. Web applications can be simple, like a form
submission page, or complex, like an e-commerce platform.

Understanding Client-Server Architecture

Web applications use a client-server architecture to enable communication


between the front-end and back-end components. The client is usually a web
browser that sends requests to the server, and the server responds with the
requested data. The server can be either a physical or virtual machine that runs
the back-end software of the web application.

Overview of Web Application Components

A web application typically consists of the following components:

1. Front-end: The user interface of the web application that users interact
with, typically built using HTML, CSS, and JavaScript.
2. Back-end: The server-side logic that processes requests from the front-end
and retrieves data from the database.
3. Database: The repository of data that the web application uses to store
and retrieve information.
4. Middleware: Software that enables communication between the front-end
and back-end components of the web application.

Types of Web Applications


There are several types of web applications, including:

1. Static Web Applications: These web applications serve static content that
is not dynamically generated based on user requests.
2. Dynamic Web Applications: These web applications serve content that is
generated dynamically based on user requests.
3. E-commerce Applications: These web applications enable users to buy
and sell products online.
4. Social Media Applications: These web applications enable users to share
content and interact with each other online.
5. Content Management Systems (CMS): These web applications enable
users to create, manage, and publish content on the internet.

Web Application Security Concepts


Web application security is a critical concern for any organization that has an
online presence. In this section, we will discuss some essential web application
security concepts that every developer, tester, and security professional should
be aware of.

The OWASP Top 10 (2021)

The Open Web Application Security Project (OWASP) is a nonprofit organization


that aims to improve web application security. The OWASP Top 10 is a list of the
most critical web application security risks, as identified by the organization. The
current version of the OWASP Top 10 (2021) includes the following
vulnerabilities:

1. Injection: Injection flaws, such as SQL injection, occur when untrusted data
is sent to an interpreter as part of a command or query. The attacker can
inject malicious code into the application to execute arbitrary commands or
obtain sensitive information.
2. Broken Authentication and Session Management:
Broken authentication and session management flaws occur when an
attacker is able to compromise user credentials or session tokens. This
can allow the attacker to impersonate the user, gain access to sensitive
information, or perform unauthorized actions.
3. Improper Input Validation: Improper input validation occurs when the
application does not properly validate user input, which can lead to
vulnerabilities such as buffer overflows, cross-site scripting (XSS), and
command injection.
4. Insecure Communication: Insecure communication vulnerabilities occur
when sensitive data is transmitted over an insecure channel, such as an
unencrypted HTTP connection. This can allow an attacker to intercept and
read the data.
5. Improper Access Control: Improper access control vulnerabilities occur
when the application does not properly enforce access controls or
implement role-based access control (RBAC) policies. This can allow an
attacker to gain unauthorized access to sensitive resources.
6. Security Misconfiguration: Security misconfiguration occurs when the
application is not properly configured, such as leaving default passwords,
allowing directory listing, or enabling debugging features in a production
environment. This can allow an attacker to exploit these misconfigurations
to gain unauthorized access to the application or sensitive information.
7. Insecure Design and Architecture: Insecure design and architecture flaws
occur when the application is designed in a way that makes it vulnerable to
attacks, such as using outdated security protocols or not properly
segregating sensitive data.
8. Insufficient Logging and Monitoring: Insufficient logging and monitoring
occurs when the application does not properly log or monitor security
events. This can make it difficult to detect and respond to security incidents
or attacks.
9. Server-Side Request Forgery (SSRF): SSRF occurs when an attacker is
able to make the web application server send a request to an external
server. This can allow the attacker to scan internal systems or perform
attacks on external systems.
10. Security Through Obscurity: Security through obscurity occurs when
the application relies on secrecy or complexity to provide security, rather
than using proven security mechanisms. This can make the application
vulnerable to attacks when the obscurity is breached.

Authentication and Authorization

Authentication and authorization are two critical web application security


concepts that are often confused with each other. Authentication refers to the
process of verifying the identity of a user, while authorization refers to the
process of granting or denying access to specific resources based on the user’s
identity and privileges.

Session Management

Session management is another essential web application security concept that


deals with managing user sessions. A session is a period during which a user
interacts with a web application. Session management involves ensuring that
each user’s session is unique, secure, and protected against attacks such as
session hijacking and session fixation.
Information Gathering and Reconnaissance
Information gathering and reconnaissance is the first stage of web application
penetration testing. It involves gathering information about the target web
application and its environment to identify potential vulnerabilities and attack
vectors. In this section, we will discuss the different techniques and tools used in
information gathering and reconnaissance.

Gathering Information About the Target Web Application

The first step in information gathering and reconnaissance is to gather as much


information as possible about the target web application. This includes identifying
the IP address or domain name of the web application, the web server software,
and the underlying operating system. This information can be obtained using
various techniques, such as:

1. Whois Lookup: This technique involves querying a Whois database to


obtain information about the registered owner of the domain name.
2. DNS Enumeration: This technique involves querying DNS servers to obtain
information about the domain name and its associated IP address.
3. Google Hacking: This technique involves using advanced search operators
in Google to obtain information about the target web application, such as
site: and inurl:.

Footprinting and Reconnaissance

Footprinting and reconnaissance involve actively gathering information about the


target web application and its environment. This includes identifying the network
topology, the web server software, the application framework, and the technology
stack used in the web application. The following techniques are commonly used
in footprinting and reconnaissance:

1. Port Scanning: This technique involves scanning the target network to


identify open ports and services.
2. Banner Grabbing: This technique involves capturing the banner
information sent by the web server to identify the web server software and
its version.
3. OS Fingerprinting: This technique involves identifying the underlying
operating system of the target system.

Scanning and Enumeration


Scanning and enumeration involve actively probing the target web application for
vulnerabilities and attack vectors. This includes identifying the web application
components, such as forms, input fields, and cookies, and testing them for
vulnerabilities. The following techniques are commonly used in scanning and
enumeration:

1. Vulnerability Scanners: These are automated tools that scan the target
web application for known vulnerabilities, such as SQL injection and
Cross-Site Scripting (XSS).
2. Web Application Scanners: These are automated tools that scan the target
web application for web application vulnerabilities, such as
broken authentication and session management.

Tools Used in Information Gathering and Reconnaissance

Several tools are used in information gathering and reconnaissance, including:

1. Nmap: A port scanner used to identify open ports and services.


2. Maltego: A reconnaissance tool used to obtain information about the target
web application and its environment.
3. Recon-ng: A reconnaissance framework used to automate the
reconnaissance process.

Exploitation
Exploitation is the process of taking advantage of web application vulnerabilities
to gain unauthorized access to the target system. In this section, we will discuss
the different techniques and tools used in web application exploitation.

Exploiting Web Application Vulnerabilities

Web application vulnerabilities can be exploited in various ways to gain


unauthorized access to the target system. For example, SQL injection
vulnerabilities can be exploited to extract sensitive information from the
database, while Cross-Site Scripting (XSS) vulnerabilities can be exploited to
execute malicious code in the user’s browser. The following are some of the
most common exploitation techniques:

1. SQL Injection: This involves injecting malicious SQL code into the target
web application to gain unauthorized access to the database.
2. Cross-Site Scripting (XSS): This involves injecting malicious JavaScript
code into the target web application to execute arbitrary code in the user’s
browser.
3. Cross-Site Request Forgery (CSRF): This involves tricking the user into
executing an action in the target web application that they did not intend to
perform.

Advanced Exploitation Techniques

Advanced exploitation techniques are used to bypass security controls and gain
unauthorized access to the target system. These techniques require a deep
understanding of web application vulnerabilities and the underlying technology
stack. The following are some of the most commonly used advanced exploitation
techniques:

1. File Inclusion Attacks: This involves including external files into the target
web application to execute arbitrary code.
2. Command Injection Attacks: This involves injecting malicious commands
into the target web application to execute arbitrary commands on the target
system.

Client-Side Exploitation

Client-side exploitation involves exploiting vulnerabilities in the client-side


components of the target web application, such as the user’s browser and
plugins. The following are some of the most common client-side exploitation
techniques:

1. Malicious File Downloads: This involves tricking the user into downloading
a malicious file that contains a virus or other malware.
2. Drive-By Downloads: This involves exploiting a vulnerability in the user’s
browser to automatically download and execute a malicious file without the
user’s knowledge.

Tools Used in Exploitation

Several tools are used in web application exploitation, including:

1. Metasploit: A penetration testing framework that includes a wide range of


exploits for web application vulnerabilities.
2. Burp Suite: A web application testing toolkit that includes a proxy server,
scanner, and intruder for identifying and exploiting web application
vulnerabilities.
3. OWASP ZAP: An open-source web application security scanner that
includes a wide range of exploits for web application vulnerabilities.
Post-Exploitation
Post-exploitation is the stage in web application penetration testing that involves
maintaining access to the target system, escalating privileges, covering tracks,
and cleaning up after an attack. In this section, we will discuss the different
techniques and tools used in post-exploitation.

Maintaining Access to the Target System

Maintaining access to the target system is critical in post-exploitation. Attackers


use various techniques to maintain access to the target system, such as creating
backdoors, installing rootkits, and modifying system files. The following are some
of the most common techniques used in maintaining access:

1. Backdoors: This involves creating a hidden entry point in the target system
that allows the attacker to gain access to the system at a later time.
2. Rootkits: This involves modifying the operating system to hide the
attacker’s presence and maintain access to the target system.

Privilege Escalation

Privilege escalation involves gaining higher privileges on the target system to


perform more advanced attacks or gain access to sensitive data. Attackers use
various techniques to escalate privileges, such as exploiting vulnerabilities in the
operating system or applications, and abusing misconfigured or weakly protected
services. The following are some of the most common techniques used in
privilege escalation:

1. Exploiting Vulnerabilities: This involves exploiting vulnerabilities in the


operating system or applications to escalate privileges.
2. Abusing Misconfigured or Weakly Protected Services: This involves
abusing misconfigured or weakly protected services to escalate privileges.

Covering Tracks

Covering tracks involves removing any evidence of the attacker’s presence on


the target system to avoid detection. Attackers use various techniques to cover
tracks, such as deleting logs, modifying timestamps, and altering file
permissions. The following are some of the most common techniques used in
covering tracks:

1. Deleting Logs: This involves deleting logs that contain evidence of the
attacker’s presence on the target system.
2. Modifying Timestamps: This involves modifying timestamps of files and
directories to conceal the attacker’s activity on the target system.

Cleaning up after an Attack

Cleaning up after an attack involves removing any malicious software or tools


that were installed on the target system during the penetration test. This includes
removing backdoors, rootkits, and any other malicious code that was installed on
the target system. The following are some of the most common techniques used
in cleaning up after an attack:

1. Uninstalling Malicious Software: This involves uninstalling any malicious


software or tools that were installed on the target system during the
penetration test.
2. Restoring System Files: This involves restoring system files that were
modified during the penetration test to their original state.

Reporting and Documentation


Reporting and documentation is the final stage in web application penetration
testing. This stage involves documenting the findings, preparing a report, and
presenting the report to the stakeholders. In this section, we will discuss the
different aspects of reporting and documentation.

Reporting Findings

Reporting findings is an essential aspect of web application penetration testing. It


involves summarizing the vulnerabilities found during the penetration test, the
risks associated with each vulnerability, and the potential impact of each
vulnerability on the target system. The report should also include
recommendations for remediation and mitigation strategies to address the
identified vulnerabilities. The report should be presented in a clear and concise
manner to enable stakeholders to understand the risks and make informed
decisions.

Documentation

Documentation is another essential aspect of web application penetration testing.


It involves documenting the entire penetration testing process, including the
scope of the test, the tools and techniques used, the vulnerabilities identified, and
the remediation and mitigation strategies proposed. Documentation ensures that
the entire process is well-documented, and any issues can be easily traced back
to their source. The documentation should be comprehensive and accessible to
all stakeholders.

Compliance and Regulations

Compliance and regulations play an essential role in web application penetration


testing. Penetration testing should be conducted in compliance with relevant
regulations, such as the Payment Card Industry Data Security Standard (PCI
DSS), the General Data Protection Regulation (GDPR), and the Health Insurance
Portability and Accountability Act (HIPAA). Compliance and regulations ensure
that the penetration testing process is conducted in a controlled and ethical
manner and that the security of the target system is not compromised.

Best Practices
Web application penetration testing involves identifying vulnerabilities and
weaknesses in web applications to improve their security posture. However, to
ensure that the testing process is effective and efficient, certain best practices
must be followed. In this section, we will discuss the best practices for web
application penetration testing.

Best Practices for Web Application Penetration Testing

1. Define the Scope: Defining the scope of the penetration test is critical to
ensure that the testing process is targeted and effective. The scope should
include the objectives of the test, the target systems, and the testing
methodology.
2. Obtain Written Consent: Before conducting a penetration test, it is
essential to obtain written consent from the owner of the target system.
The written consent should outline the scope of the test, the testing
methodology, and the potential risks associated with the test.
3. Use a Methodical Approach: A methodical approach should be used to
ensure that the testing process is consistent and comprehensive. The
approach should include a thorough understanding of the target system,
identifying potential vulnerabilities, testing each vulnerability, and
documenting the findings.
4. Use Proper Tools: Using the right tools is essential to ensure that the
testing process is effective and efficient. Tools such as vulnerability
scanners, network analyzers, and exploit frameworks should be used to
identify and exploit vulnerabilities.
5. Analyze Results: Analyzing the results of the penetration test is critical to
determine the effectiveness of the testing process. The results should be
analyzed to identify the root cause of each vulnerability, the potential
impact of each vulnerability, and the recommended mitigation strategies.

Ethics and Professionalism

Web application penetration testing is a critical process that involves accessing


and testing sensitive systems. As such, it is essential to maintain high ethical
standards and professionalism throughout the testing process. This includes
obtaining written consent, respecting the privacy of the target system, and
ensuring that the testing process does not cause any harm to the target system.

Continuous Testing and Improvement

Web application penetration testing is not a one-time event but an ongoing


process. It is critical to conduct regular testing to identify new vulnerabilities and
weaknesses and improve the security posture of the target system. Additionally,
it is essential to continuously improve the testing process by incorporating new
techniques, tools, and methodologies to ensure that the testing process remains
effective and efficient.

More Resources and Tools


Information Gathering

WhatWeb

Whois

Recon-ng

Eyewitness

Dirb

Go Buster

GoWitness
SubDomain Enumeration

Scanning

Nikto

WPScan

CMSMap

TestSSL – SSL Scan

Wfuzz

Owasp Joomscan

Intercepting Proxy

Burp Suite

Useful Resources and Concepts

HTTP Status Codes

HTML Character Entities

Regular Expressions

Useful Websites
HTTP Protocol

OWASP Testing Checklist

Deserialization

CSP Content Security Policy

CORS

JWT Tokens

Web Sockets

Web Standards

OWASP Top 10

Content Security Policy (CSP) Bypass

File Upload Testing

What is network penetration testing?


Network penetration testing is one type
of penetration testing—or “pen test”—that
specifically targets a company’s entire computer
network through the practice of ethical hacking.
The goal of network penetration testing is to reveal and identify any
vulnerabilities within the organization. This includes doing an in-depth
evaluation of network security measures through external tests and internal
tests, such as web application testing and mock phishing attacks.
Register for the Cost of a Data Breach webinar - This link opens in a new tab
Report
IBM X-Force® Threat Intelligence Index
Gain insights to prepare and respond to cyberattacks with greater speed and
effectiveness.

Get the report


Related content
Subscribe to the Think Newsletter
How does network penetration testing work?

The way network penetration works is that ethical hackers, or red teams, use
hacking tools and techniques to do a mock cyberattack on an organization’s
computer system. The aim is to get behind the organization’s firewall and
gain unauthorized access.

Network penetration testing can include attacking web applications, APIs,


endpoints, and physical controls. Simulated attacks on the operating system
can reveal security weaknesses and show the organization where there are
weak spots.

The fake attacks help security teams uncover pertinent security


vulnerabilities to the network infrastructure. Common threats that can be
tested include a distributed denial of service (DDos) attack, domain name
system (DNS), malware, phishing, and SQL injection.

The testers also use tools to conduct recon and automate the pen testing
process. There are often two types of tests used: internal and external.

Internal network tests: In an internal test, pen testers act as internal


attackers or someone who may be trying to do a malicious act with stolen
credentials. The main purpose of this type of test is to find vulnerabilities a
person or employee might use from within the organization. This is done by
stealing information and abusing privileges to access private or sensitive
data.

External network tests: The external network penetration testing services


are meant to mimic outside attackers trying to break into the network. These
pen testers work to find security issues that are directly connected to the
internet, such as servers, routers, websites, applications, and employee
computers, which are open source risks.
The network penetration testing process
Often a network penetration test follows four
specific steps. The test concludes with a network
pen test report, which is a detailed analysis of
business risks and the risk findings.
1. Gather information and plan
In this first phase, the ethical hackers discuss with key stakeholders what the
overall goal of the testing will be and what vulnerabilities the organization
has identified. Before pen testing a vulnerability assessment should be done.

From there, the pen testers and stakeholders decide which tests to perform
and the success metrics they plan to use. Testers use several different tools
and methodologies to perform the fake attacks, such as port scanning and
network mapping (nmap).

There are three types of test perspective commonly used. Depending on the
organization, these can be used individually or combined.

Black box testing: A ‘black box’ test is conducted from the perspective of
an average hacker with little or no internal knowledge about the network
system. This type of testing would be an external pen test since its goal is to
exploit outward-facing vulnerabilities within the network.

Gray box testing: This type of network penetration test has more of an
internal focus and aims to portray a hacker with access to the internal
system. While also maintaining some of the aspects of an external hacker.
The gray box test aims to be a bad actor within an organization who may
have elevated privileges that are being used in a malicious way.

White box testing: Finally, the white box test is the most intrusive of the
three security testing types. This test is performed to portray an IT specialist
or someone with access to the organization’s source code and all possible
data about the system. This test is typically performed last to test the
integrity of an IT architecture. And further ensure possible hackers and
cyberattacks to the target system are impenetrable.
2. Conduct reconnaissance and discover

In the reconnaissance and discovery phase, pen testers take data from the
reconnaissance to perform live tests and discover the existing vulnerabilities
through tactics, such as social engineering. By using deceptive tools to
manipulate individuals into sharing information, the pen testers hope to find
where the weak spots are located and target those vulnerabilities.

In the discovery step, pen testers may use tools like a port scanner and
vulnerability scanner. The port scanner identifies open ports on a system
where hackers might get in and a vulnerability scanner identifies existing
vulnerabilities on a system.
3. Perform the network penetration test

This next step is to put all the preliminary work that is done up to this point
into action. In this step, the pen testers perform the network penetration
tests by using tools that can exploit scripts or attempt to steal data. The
purpose is to figure out how much damage the ethical hackers can cause
and if they do gain access, determine how long they can stay within the
system.

Pen testers can start by testing one vulnerability at a time but should
perform tests on multiple vulnerabilities to ensure that a broad approach is
taken to address these security risks.
4. Analyze and report information
The final step is to document what network penetration tests were
performed then go over the results of each of those tests and discuss
remediation steps with the information security team. The report details the
entire process from start to finish and identifies the vulnerabilities, evidence,
data, and recommendations for the organization. This report is important for
the business owner to have a full picture of what risks have been identified
and an analysis that further helps them make informed decisions.
Why companies network penetration test
Protect your data
An organization faces many threats and having guardrails on your data is
vital to protecting your business and its sensitive information. A network
penetration test identifies all vulnerabilities and protects your organization’s
data from all possible entry points. While a vulnerability scan can be
beneficial, it is not as extensive of a testing tool and, if anything, should be
used as a supplement to a pen test.
Understand your security controls
By performing pen testing, you have a better understanding of what security
controls are working and which need to be strengthened. The network
penetration testing also gives the organization the ability to analyze its
security posture.
Prevent data breaches
Preemptively analyzing your organization’s network vulnerabilities ensures
that the chances of a data breach are almost eliminated. Pen testing
improves overall security through security assessments
and cybersecurity scans.

You might also like