Basic Pentesting Concepts
Basic Pentesting Concepts
Focus: The focus of a security audit is on examining the overall security posture of an
organization, including its policies, processes, and technical controls.
Outcome: The result of a security audit is a comprehensive report that highlights areas
of compliance, areas for improvement, and recommendations for enhancing security
Vulnerability Assessment
Purpose: A vulnerability assessment is a systematic process of identifying,
quantifying, and prioritizing vulnerabilities in a system or network.
Focus: The primary focus of penetration testing is to actively test the security
defenses of an organization by attempting to exploit weaknesses. It provides insights
into how an attacker might compromise systems and networks.
Black box
testing Methodology: Testers approach black box testing from an external
perspective, treating the system as a "black box" where inputs are
provided, and outputs are observed. Test cases are designed based on
functional specifications, and the goal is to uncover errors or deviations
in the expected behavior without knowledge of the internal code
structure.
Social
Network Web application
engineering
penetration penetration
penetration
testing testing
testing
Wireless
Mobile device Cloud
network
penetration penetration
penetration
testing testing
testing
Network • Identify Vulnerabilities: Discover and assess
weaknesses, misconfigurations, and vulnerabilities in
penetration network devices, servers, and other components.
testing • Evaluate Security Controls: Assess the
effectiveness of security controls such as firewalls,
intrusion detection/prevention systems, and access
controls.
Distributed Man-in-the-
Packet Sniffing
Denial-of-Service Middle (MitM)
(Eavesdropping)
(DDoS) Attack Attack
Worms and
Zero-Day
Malware
Exploits
Propagation
Distributed Denial-of-Service
(DDoS) Attack
Man-in-the-Middle (MitM)
Attack
Packet Sniffing
(Eavesdropping)
Worms and Malware
Propagation
• Brute Force Attack
• Injection Attacks
• Fuzz Testing (Fuzzing)
• Cross-Site Scripting (XSS)
• DDoS (Distributed Denial-of-Service)
• Cross-Site Request Forgery (CSRF)
• X M L External Entity (XXE)
• Path Traversal
• IDOR
• Broken Access Control
Injection
attacks
XSS
Path
Traversal
IDOR
Social engineering
penetration testing
• Social engineering penetration testing is a
cybersecurity practice that assesses an
organization's susceptibility to manipulation and
deceit by simulating various social engineering
attacks. These attacks exploit human psychology to
trick individuals into divulging sensitive
information, providing unauthorized access, or
performing actions that could compromise security.
Social engineering penetration testing helps
organizations identify weaknesses in their human-
centric defenses and implement measures to
mitigate these risks.
Types of social
engineering attacks
• Phishing.
• Whaling.
• Baiting.
• Diversion Theft.
• Pretexting.
Phishing
Whaling
Wireless network
penetration
testing
• Wireless network
penetration testing, also
known as Wi-Fi penetration
testing or wireless security
testing, aims to assess the
security of wireless
networks and identify
potential vulnerabilities
that could be exploited by
unauthorized individuals.
This type of testing helps
organizations ensure the
confidentiality and integrity
of their wireless
communications.
Wifi adapter
Cloud penetration • Cloud penetration testing, also known as
testing cloud security testing or cloud security
assessment, is the process of evaluating
the security of cloud-based
infrastructures, services, and
applications. The objective is to identify
and address vulnerabilities that could be
exploited by attackers to compromise the
confidentiality, integrity, and availability
of data and resources stored in or
processed by cloud environments. Cloud
penetration testing typically involves
assessing the security controls,
configurations, and architecture of cloud
platforms
Common cloud • Inadequate Identity and Access
vulnerabilities Management (IAM)
• Insecure Application
Programming Interfaces (APIs)
• Misconfigured Storage Buckets
• Insecure Object and Data Storage
• Insecure Serverless
Implementations
• Supply Ch a i n Risks
Insecure APIs:
Vulnerabilities in APIs,
including improper
authentication, lack of proper
input validation, and insecure
direct object references.
Inadequate Identity and Access
Management (IAM):
Weaknesses in user authentication,
authorization, and access control
mechanisms can lead to unauthorized
access to cloud resources.
Mobile • Mobile penetration testing, also
penetration known as mobile app security testing
testing or mobile application penetration
testing, involves assessing the
security of mobile applications to
identify and address vulnerabilities
that could be exploited by attackers.
As mobile devices and applications
continue to play a crucial role in
personal and business activities,
ensuring the security of mobile apps
is essential.
Top vulnerabilities:
https://owasp.org/www-project-mobile-top-10/
Operating systems used for
penetration testing
• Kali linux
• Parrot os
• BlackArch Linux
• BackBox
• etc
Important directories in kali linux
• /bin (binaries): This directory contains Linux binaries like the cd and ls command that we
executed earlier.
• /sbin (system binaries): This directory holds system binary files that serve as administrative
commands (like fdisk).
• /dev (devices): This directory contains the device configuration files (like /dev/null ).
• /sys: This is similar to /dev, which contains configurations about devices and drivers.
• /etc (etcetera): This directory contains all the administration system files (like /etc/passwd shows
all the system users in Kali Linux).
• /lib (libraries): This directory hods the shared libraries for the binaries inside /bin and /sbin.
• /proc (processes): This directory contains the processes and kernel information files.
• /lost+found: As in the name, this directory contains the files that have been recovered.
• /mnt (mount): This directory contains the mounted directories (example, a remote file share).
• /media: This directory holds the removable media mounted directories (like DVD).
• /opt (option): This directory is used for add‐on software package installation. It is also used when installing
software by users (example, hacking tools that you download from GitHub).
• /tmp (temporary): This is a temporary folder used temporarily, the holdings are wiped after each reboot. The tmp
folder is a good place to download our tools for privilege escalation once we got a limited shell.
• /usr (user): This directory contains many sub-directories. In fact, /usr/share/ is a folder that we need to memorize
because most of the tools that we use in Kali Linux (like Nmap, Metasploit, etc.) are stored there, and it also
contains the wordlist dictionary files (/usr/share/wordlists).
• /home: This is the home for Kali Linux users (example /home/kali/).
• /srv (serve): This folder contains some data related to system server functionalities (like data for FTP servers).
• /var (variable): This folder contains variable data for databases, logs, and websites. For an example,
/var/www/html/ contains the files for the Apache2 web server.
• /run (runtime): This directory holds runtime system data (like currently logged‐in users).
Linux commands:
• ls - The most frequently used command in Linux to list directories • w ho a mi - Get the active username
• p w d - Print working directory command in Linux • tar - Command to extract and compress files in Linux
• cd - Linux command to navigate through directories • grep - Search for a string within an output
• mkdir - Command used to create directories in Linux • head - Return the specified number of lines from the top
• m v - Move or rename files in Linux • tail - Return the specified number of lines from the bottom
• cp - Similar usage as mv but for copying files in Linux • diff - Find the difference between two files
• rm - Delete files or directories • c mp - Allows you to check if two files are identical
• touch - Create blank/empty files • comm - Combines the functionality of diff and cmp
• cat - Display file contents on the terminal • sort - Linux command to sort the content of a file while outputting
• echo - Print any text that follows the command • unzip - Unzip files in Linux
• m an - Access manual pages for all Linux commands • s s h - Secure Shell command in Linux
• u n am e - Linux command to get basic information about the OS • service - Linux command to start and stop services