# Penetration Testing

A penetration test, colloquially known as a pentest, is an authorized simulated cyberattack on a computer system, performed to evaluate the security of the system; this is not to be confused with a vulnerability assessment. The test is performed to identify weaknesses, including the potential for unauthorized parties to gain access to the system's features and data, as well as strengths, enabling a full risk assessment to be completed. The process typically identifies the target systems and a particular goal, then reviews available information and undertakes various means to attain that goal. A penetration test target may be a white box or a black box. A gray box penetration test is a combination of the two. A penetration test can help identify a system's vulnerabilities to attack and estimate how vulnerable it is. Security issues that the penetration test uncovers should be reported to the system owner.

## Penetration Testing Methodologies

1. Open-Source Security Testing Methodology Manual (OSSTMM)
2. Open Web Application Security Project (OWASP)
   1. OWASP Application Security Verification Standard (ASVS)
   2. OWASP Web Application Security Top 10
   3. OWASP Mobile Top 10
   4. OWASP API Security Top 10
   5. OWASP Top 10 for LLM Applications
   6. OWASP Top 10 Non-Human Identities Risks
3. Penetration Testing Execution Standard
4. Penetration Testing Methodologies and Standards (PTES)
5. Information System Security Assessment Framework (ISSAF)
6. National Institute of Standards and Technology (NIST SP 800-115)
7. The PenTesters Framework (PTF)
8. CREST Guide for Running an Effective Penetration Testing Program

## Three Approaches to Performing a Penetration Test

1. Black box testing
2. White box testing
3. Gray box testing

## Types of Penetration Testing

1. Internal pen testing
2. External pen testing
3. Blind pen testing
4. Double-blind pen testing
5. Network / Cloud / Email
6. Web Application / API / Database
7. Mobile (Android & IOS)
8. Operating Systems (Windows/Linux Servers)
9. IoT/ICS/SCADA
10. Physical

## Penetration Testing Phases

1. **Reconnaissance:** During this first stage, pen testers gather and receive information about the test in areas such as the operating system, source code, and network layout, as well as publicly available information.
2. **Scanning and vulnerability assessment:** This is where the pen tester begins observing the system to identify any potential weak areas to attack. Pen testers can use specific tools designed to aid in this discovery stage.
3. **Exploitation:** During the exploitation phase, the pen tester conducts the attack, looking for vulnerabilities and weaknesses to exploit. It’s essential that the attacker take precautions during this stage not to harm the system.
4. **Reporting:** Reporting and documenting the discoveries during the attack allows the organization to examine its procedures and systems, address any flaws, and make improvements.
5. **Recommendations:** Lastly, the penetration tester can help the organization develop strategies to prevent attacks, making recommendations based on the findings.
