Lesson 1 of 3 Security Control Testing

Vulnerability Assessment and Penetration Testing

Vulnerability assessments find weaknesses; penetration tests show whether they can be exploited. This lesson explains both, including red, blue and purple team exercises.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish vulnerability assessments from penetration tests.
  • Describe the phases and rules of engagement of a penetration test.
  • Explain red, blue and purple team exercises.

Vulnerability assessment

A vulnerability assessment identifies, quantifies and prioritises known weaknesses without exploiting them. Automated scanners test systems against databases of known vulnerabilities, identified by CVE numbers, and against misconfigurations, scoring findings with the Common Vulnerability Scoring System (CVSS). Credentialed (authenticated) scans log in to systems and find more issues with fewer false positives; uncredentialed scans show what an external attacker sees.

Results are validated to remove false positives and prioritised by severity, whether exploits are known to be used in the wild, asset criticality and exposure. Scanning should run regularly and after significant changes, and scanners themselves must be protected because they hold credentials and detailed knowledge of weaknesses.

CVSS scores need context before they become priorities. A CVSS base score describes the technical severity of a vulnerability in general, such as 9.8 for a remotely exploitable flaw that needs no authentication. It does not know that one affected server is an isolated test machine and another is the internet-facing payment gateway. Effective prioritisation combines the score with whether the vulnerability is being actively exploited, whether the asset is exposed and how critical it is. A medium-severity flaw under active exploitation on an exposed server can deserve faster attention than a critical one on an isolated system.

Scan results also contain errors in both directions. A false positive reports a vulnerability that does not exist, for example because the scanner read a version number but the vendor had back-ported the fix. A false negative misses a real vulnerability, which is common in uncredentialed scans that cannot see installed software. Validation before reporting avoids wasting remediation effort, and credentialed scanning reduces the blind spots.

Scenario questions

Prioritising scan results

Exam skills 6.2.1

Use context to turn scan results into priorities.

Log in to try this activity Interactive activities are free with an account.

Penetration testing

A penetration test simulates a real attack to show whether vulnerabilities can be exploited and what an attacker could achieve. It must have written authorisation from someone with authority over the systems and agreed rules of engagement covering scope, timing, permitted techniques, handling of sensitive data and emergency contacts.

  1. Planning

    Agree objectives, scope, rules of engagement and written authorisation.

  2. Reconnaissance

    Gather information passively and actively about the target.

  3. Scanning and enumeration

    Identify live hosts, services and potential vulnerabilities.

  4. Exploitation

    Attempt to exploit vulnerabilities to gain access.

  5. Post-exploitation

    Escalate privileges, move laterally and demonstrate impact within scope.

  6. Reporting

    Document findings, evidence, risk and remediation advice.

Testers may have no prior knowledge (black box, simulating an outsider), partial knowledge (grey box) or full knowledge including documentation and source code (white box, the most thorough per hour of testing).

The knowledge level is a trade-off between realism and efficiency. A black box test shows what an outsider with no inside information could achieve, but testers spend much of a limited engagement on reconnaissance that a real attacker could take months over. A white box test gives testers architecture diagrams, credentials and code, so they can find deep flaws quickly, though it reflects an insider's view. Grey box testing, such as giving testers an ordinary user account, is a common compromise because it simulates an attacker who has already phished an employee.

The rules of engagement protect both parties. They state which address ranges and applications are in scope, which are explicitly excluded, the testing window, whether denial-of-service or social engineering is permitted, how testers must handle any personal data they encounter and whom to call if they find evidence of a real attacker or cause an outage. Without written authorisation from someone with the authority to grant it, a penetration test is legally indistinguishable from an attack. If systems belong to a third party, such as a hosting provider, that party's permission is needed as well.

Put in order

Penetration test phases

Exam skills 6.2.2

Arrange the phases of a penetration test.

Log in to try this activity Interactive activities are free with an account.

Red, blue and purple teams

In adversary simulation exercises, the red team emulates a realistic attacker, often over weeks and with stealth, to test detection and response as well as prevention. The blue team defends, detects and responds. A purple team exercise has both sides work together openly: the red team executes techniques and the blue team checks and improves detection for each one, which turns testing directly into better defences. A white team often sets rules and referees.

The exercises answer different questions. A penetration test asks "what weaknesses can be exploited in this scope?" and tries to find as many as possible. A red team exercise asks "could a realistic adversary achieve a specific objective, such as reaching the payment database, and would we notice?" and deliberately avoids noisy techniques that a real attacker would avoid. Because the blue team is usually not told in advance, the exercise tests people and processes as well as technology. A purple team session might run 30 techniques in a day, pausing after each so the defenders can check whether an alert fired and write a new detection if it did not.

The following diagram compares what each testing activity shows.

What each testing activity shows. A vulnerability scan lists known weaknesses but does not exploit or chain them. A penetration test exploits and chains weaknesses within an agreed scope to show real impact. A red team exercise pursues an objective as a realistic adversary and also tests whether the blue team detects and responds. All need written authorisation and rules of engagement.
A purple team shares red team findings with defenders as they happen.
Match the pairs

Teams and tests

Exam skills 6.2.2

Match each team or test with what it does.

Log in to try this activity Interactive activities are free with an account.
Worked example

Test or assessment

Management wants to know whether an attacker who phishes one employee could reach the customer database, and whether the security operations centre would notice. Which activity answers this BEST?

A vulnerability scan lists weaknesses but does not show whether they can be chained into access to the database, and it does not test detection. A red team exercise (or an objective-based penetration test) starting from a simulated phishing compromise answers both questions, provided it has written authorisation and clear rules of engagement.

Check yourself

What must be in place before any penetration test begins?

Show answer

Written authorisation from someone with authority over the systems, and agreed rules of engagement.

Exam Tips

Remember for the exam

  • Vulnerability assessments do not exploit; penetration tests do.
  • Never test without written authorisation and rules of engagement.
  • Credentialed scans are more accurate.
  • Purple teaming improves detection collaboratively.