Pentesting Fundamentals
This introductory room lays the conceptual foundations and ethical framework behind penetration testing ("pentesting"). It covers what pentesting is, the importance of ethics and scope, phased methodologies, the testing scopes (black, grey and white box), and closes with a hands-on simulation of a real engagement.
| Platform | TryHackMe |
| Category | Fundamentals |
| Difficulty | Easy |
| Room | Pentesting Fundamentals |
Task 1 — What is penetration testing?
Penetration testing is the ethical, authorized attempt to find vulnerabilities in a system by mimicking the techniques of a malicious attacker. It is essentially a security audit carried out with permission to strengthen an organization's defenses before a real adversary exploits them.
Este room introductorio sienta las bases conceptuales y el marco ético del pentesting (test de intrusión). Recorre qué es el pentesting, la importancia de la ética y el scope, las metodologías por fases, los tipos de caja (black, grey y white box) y cierra con una simulación práctica de un encargo real.
| Plataforma | TryHackMe |
| Categoría | Fundamentals |
| Dificultad | Easy |
| Room | Pentesting Fundamentals |
Task 1 — ¿Qué es el pentesting?
El penetration testing es el intento ético y autorizado de encontrar vulnerabilidades en un sistema imitando las técnicas de un atacante malicioso. Es, en esencia, una auditoría de seguridad realizada con permiso para reforzar las defensas de la organización antes de que un adversario real las explote.
Task 2 — Penetration testing ethics
Before any test begins, the pentester and the client define the Rules of Engagement (ROE), the document that bounds the engagement:
- Permission — the legal authorization to carry out the test.
- Scope — which targets and services are within the allowed reach.
- Rules — the technical boundaries, such as prohibited actions.
In practice, a solid ROE also pins down the testing window (start/end dates and hours), an emergency contact on both sides to halt the engagement if something breaks, and how findings will be reported at the end — details that turn "you have permission" into an engagement that can actually be planned, executed and audited.
Types of hacker
| Type | Description |
|---|---|
| White Hat | Ethical pentesters acting with authorization. |
| Grey Hat | Sometimes beneficial, but may breach laws or ethics. |
| Black Hat | Malicious actors with harmful intent. |
Q: You are given permission to audit a system. What type of hacker are you?
A: White Hat
Q: Stealing data without consent. Which type of hacker?
A: Black Hat
Q: Document that defines the scope and permission of the test.
A: Rules of Engagement
Task 3 — Penetration testing methodologies
A pentest methodology typically follows these stages:
- Information Gathering — collecting public data about the target (OSINT).
- Enumeration / Scanning — identifying live hosts and exposed services.
- Exploitation — leveraging vulnerabilities to gain access.
- Privilege Escalation — expanding access horizontally or vertically.
- Post-Exploitation — pivoting, cleaning up and reporting.
Pentesting frameworks
| Framework | Focus | Pros | Cons |
|---|---|---|---|
| OSSTMM | Networks, telecoms and systems | Very comprehensive | Dense and complex |
| OWASP | Web applications | Simple and actively maintained | No formal accreditation |
| NIST CSF | Organizational security posture | Widely used and detailed | General-purpose, not pentest-focused |
| NCSC CAF | Critical infrastructure and national frameworks | Government-endorsed | Niche, slower adoption |
Each framework comes from a different governing body and suits a different kind of engagement: OSSTMM (Open Source Security Testing Methodology Manual) is maintained by ISECOM; OWASP (Open Web Application Security Project) also publishes the widely used OWASP Testing Guide and Top 10; NIST CSF (Cybersecurity Framework) comes from the US National Institute of Standards and Technology — for the technical mechanics of running a test, NIST separately publishes SP 800-115; and NCSC CAF (Cyber Assessment Framework) is issued by the UK's National Cyber Security Centre, commonly used to assess operators of essential services under the NIS Regulations.
Q: Stage where public information about the target is collected.
A: Information Gathering
Q: Framework aimed at auditing telecommunications networks.
A: OSSTMM
Q: Framework focused on web applications.
A: OWASP
Task 4 — Testing scopes: box types
The scope defines how much knowledge of the target the pentester has before starting:
- Black-Box — no internal knowledge; simulates an external attacker.
- Grey-Box — limited internal insight; better informed than black-box.
- White-Box — full source and configuration access; thorough internal testing.
Q: Test type in which you do not have the source code.
A: Black Box
Q: Test type with full access to the source code.
A: White Box
Task 5 — Practical: ACME penetration test
The final task is a guided simulation over the fictional ACME infrastructure, applying every stage of the methodology you have learned. Completing the exercise yields the flag:
Flag: THM{PENTEST_COMPLETE}
Concept summary
| Task | Topic | Key outcome |
|---|---|---|
| 1 | What is pentesting | Ethical, authorized audit |
| 2 | Ethics & ROE | Authorized, scoped hacking |
| 3 | Methodologies | From recon to reporting |
| 4 | Box types | Different levels of knowledge |
| 5 | Practical | Simulation → THM{PENTEST_COMPLETE} |
Key takeaways
- Pentesting is an ethical, authorized attack whose goal is to strengthen security, not harm it.
- The Rules of Engagement (permission, scope and rules) legally bound every engagement.
- The methodology runs from information gathering through post-exploitation and reporting.
- OSSTMM, OWASP, NIST CSF and NCSC CAF cover different focuses depending on the target.
- The scope (black, grey or white box) drives the strategy and preparation of the test.
Task 2 — Ética del pentesting
Antes de iniciar cualquier prueba, el pentester y el cliente definen unas Rules of Engagement (ROE), el documento que delimita el encargo:
- Permission — la autorización legal para llevar a cabo la prueba.
- Scope — qué objetivos y servicios están dentro del alcance permitido.
- Rules — los límites técnicos, como las acciones prohibidas.
En la práctica, unas ROE bien hechas también fijan la ventana de pruebas (fechas y horas de inicio/fin), un contacto de emergencia por ambas partes para detener el encargo si algo se rompe, y cómo se reportarán los hallazgos al final — detalles que convierten un "tienes permiso" en un encargo realmente planificable, ejecutable y auditable.
Tipos de hacker
| Tipo | Descripción |
|---|---|
| White Hat | Pentesters éticos que actúan con autorización. |
| Grey Hat | A veces son beneficiosos, pero pueden vulnerar leyes o la ética. |
| Black Hat | Actores maliciosos con intención dañina. |
Q: Se te concede permiso para auditar un sistema. ¿Qué tipo de hacker eres?
A: White Hat
Q: Robar datos sin consentimiento. ¿Qué tipo de hacker?
A: Black Hat
Q: Documento que define el alcance y el permiso de la prueba.
A: Rules of Engagement
Task 3 — Metodologías de pentesting
Una metodología de pentesting suele seguir estas fases:
- Information Gathering — recopilar datos públicos del objetivo (OSINT).
- Enumeration / Scanning — identificar hosts vivos y servicios expuestos.
- Exploitation — aprovechar vulnerabilidades para obtener acceso.
- Privilege Escalation — ampliar el acceso de forma horizontal o vertical.
- Post-Exploitation — pivotar, limpiar huellas y elaborar el informe.
Frameworks de pentesting
| Framework | Enfoque | Ventajas | Inconvenientes |
|---|---|---|---|
| OSSTMM | Redes, telecomunicaciones y sistemas | Muy completo | Denso y complejo |
| OWASP | Aplicaciones web | Sencillo y muy mantenido | Sin acreditación formal |
| NIST CSF | Postura de seguridad organizativa | Muy usado y detallado | Genérico, no centrado en pentesting |
| NCSC CAF | Infraestructura crítica y marcos nacionales | Respaldado por gobiernos | De nicho, adopción más lenta |
Cada framework viene de un organismo distinto y encaja con un tipo de encargo diferente: OSSTMM (Open Source Security Testing Methodology Manual) lo mantiene ISECOM; OWASP (Open Web Application Security Project) también publica la muy usada OWASP Testing Guide y el Top 10; NIST CSF (Cybersecurity Framework) proviene del National Institute of Standards and Technology de EE. UU. — para la mecánica técnica de ejecutar una prueba, NIST publica aparte el SP 800-115; y NCSC CAF (Cyber Assessment Framework) lo emite el National Cyber Security Centre del Reino Unido, usado habitualmente para auditar operadores de servicios esenciales bajo las NIS Regulations.
Q: Fase en la que se recopila información pública del objetivo.
A: Information Gathering
Q: Framework orientado a auditar redes de telecomunicaciones.
A: OSSTMM
Q: Framework centrado en aplicaciones web.
A: OWASP
Task 4 — Scopes de prueba: tipos de caja
El scope define cuánto conocimiento del objetivo tiene el pentester antes de empezar:
- Black-Box — sin conocimiento interno; simula un atacante externo.
- Grey-Box — información interna limitada; más informado que el black-box.
- White-Box — acceso total a código y configuración; prueba interna exhaustiva.
Q: Tipo de prueba en la que no dispones del código fuente.
A: Black Box
Q: Tipo de prueba con acceso completo al código fuente.
A: White Box
Task 5 — Práctica: pentest de ACME
La tarea final es una simulación guiada sobre la infraestructura ficticia de ACME, donde se aplican todas las fases de la metodología aprendida. Al completar el ejercicio se obtiene la flag:
Flag: THM{PENTEST_COMPLETE}
Resumen de conceptos
| Task | Tema | Idea clave |
|---|---|---|
| 1 | Qué es el pentesting | Auditoría ética y autorizada |
| 2 | Ética y ROE | Hacking con permiso y alcance definido |
| 3 | Metodologías | Del recon al informe |
| 4 | Tipos de caja | Distintos niveles de conocimiento |
| 5 | Práctica | Simulación → THM{PENTEST_COMPLETE} |
Puntos clave
- El pentesting es un ataque ético y autorizado cuyo fin es reforzar la seguridad, no dañarla.
- Las Rules of Engagement (permiso, scope y reglas) delimitan legalmente cada encargo.
- La metodología va del information gathering a la post-explotación y el informe.
- OSSTMM, OWASP, NIST CSF y NCSC CAF cubren enfoques distintos según el objetivo.
- El scope (black, grey o white box) determina la estrategia y la preparación de la prueba.