Pentest, vulnerability scan, red team: what is the difference
A vulnerability scan automatically looks for known vulnerabilities, while a pentest is an authorised simulated attack with manual exploitation. A pentest proves the real impact, whereas a scan gives many false positives. A red team is a longer operation with a concrete goal that also checks whether the defending team notices and stops the attack, so scanner output does not replace a pentest.
A team says: "We run a scanner every month, so we do not need a pentest". That mixes up two different things. The terms worth telling apart:
Vulnerability scan — an automatic search for known vulnerabilities and bad settings. Fast and cheap, but with many false positives;
Vulnerability assessment — a scan plus analysis of the results and priorities, not necessarily with exploitation;
Penetration test — an authorized simulated attack: people with tools and manual analysis exploit weaknesses to prove the real impact;
Red team — a longer operation with a concrete goal (reach certain data) and stealthy actions; it also checks whether the defending team (blue team) notices and stops the attack;
Bug bounty — a programme where independent researchers are rewarded for confirmed findings within the scope;
BAS (breach and attack simulation) — platforms that regularly replay known attack techniques and show where defences do not see them.
By how much is known about the system: black box (nothing, like an outside attacker), grey box (partly: test accounts, API documentation), white box (everything: code, architecture). Grey box is a common compromise: more effective than black box and faster than white box.
Example. A scanner reports "possible IDOR" in /orders/{id}. A pentester logs in with two accounts, substitutes another user's id and shows that any order can be read. The confirmation and the description of the impact are what a scanner does not give.
Common mistakes: passing scanner output off as a pentest report; trusting red "Critical" labels without checking; ordering a red team where basic findings are still open.
Short interview answer: "A scanner automatically lists potential vulnerabilities, a pentest adds manual analysis and proves the impact by exploitation, and a red team also tests detection and response".
Authorization, scope and rules of engagement: testing legally
A legal test starts with written authorisation from the system owner, a clearly defined scope and rules of engagement. The scope sets domains, IPs, applications, roles and time windows, and the rules set allowed techniques, an emergency contact and how a critical finding is reported. On finding real data or a host out of scope, stop, copy nothing and notify the contact person.
A curious colleague finds a SQL injection on the company website and "just checks what happens". Without permission this can be a criminal offence, even with good intentions. So documents come first.
What must exist before the first request:
Written authorization from the system owner (for the cloud and third-party services, with their rules taken into account);
Scope — which domains, IPs, applications, roles and time windows may be tested, and what is out of scope (third-party SaaS, the payment gateway, production data of other parties);
Rules of engagement — allowed techniques (DoS, social engineering, changing data), an emergency contact, how a critical finding is reported;
environment: where possible, staging with test data is tested.
What to do on meeting real data. Suppose an injection in production showed a table with personal data. The right move: stop, do not copy or change the data, record minimal evidence (for example the row count or a masked value) and immediately tell the contact person. Dumping "the whole table as proof" is a mistake.
A host outside the scope. Found a neighbouring service that also looks vulnerable? Do not touch it, inform the customer and agree on extending the scope in writing. "It belongs to the same client" is not permission.
Common mistakes: a verbal agreement; assuming public reachability allows testing; running an aggressive scan in production at peak time; keeping found data longer than needed.
Short interview answer: "I do not start without written authorization, scope and rules of engagement; if I leave the scope or see real data, I stop and notify the contact person".
Pentest phases, methodologies and where QA fits
A pentest runs in phases once authorisation and scope are agreed: recon, scanning and enumeration, exploitation, post-exploitation, reporting and retest. PTES describes the phases from agreements to the report, OWASP WSTG is a web testing methodology, and the Top 10 is only a risk ranking. A QA Engineer does not replace a pentester but adds negative access scenarios and takes part in threat modelling.
A typical pentest is not random attempts but a sequence of phases that starts once authorization and scope are agreed (pre-engagement):
Reconnaissance — collecting open information: domains, subdomains, technologies, employees;
Scanning and enumeration — open ports, services, versions, endpoints, parameters;
Exploitation — checking that a weakness can really be used, within the rules of engagement;
Post-exploitation — what can be done next with the access obtained (moving deeper, reaching data) and how dangerous that is;
Retest — checking after fixes that findings are closed and the fix created no new problems.
Methodologies and standards:PTES (Penetration Testing Execution Standard) — phases from agreements to the report; OWASP WSTG — a web application testing methodology with test cases by category (while the OWASP Top 10 is only a risk ranking, not a methodology); NIST SP 800-115 — a technical guide to security testing; OSSTMM — a methodology for measuring operational security.
Where QA fits. A QA Engineer does not replace a pentester but shifts security left:
negative access scenarios in regression: another user's id, a role without rights, an expired token;
checks of input handling, output encoding, security headers, error messages;
taking part in threat modelling: STRIDE — Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege; for each data flow the question "what can go wrong here?";
retesting fixes for findings like ordinary defects.
Example. Before releasing a new profile form, QA adds scenarios: another user's id in the request, HTML in the name field, a very long value. Two of them find defects before the pentest.
Mistakes: confusing the OWASP Top 10 with a methodology; starting with exploitation without enumeration; skipping the retest.
Short answer: "Six phases from recon to retest; QA adds security checks to ordinary testing and takes part in threat modelling".
Scope in practice: a signature exists but the boundaries are unclear
A signed contract is not yet a scope: permission comes from whoever is responsible for the asset. The contract covers only what the client has the right to authorise. Before starting, establish who owns each host, domain or building and who else may react to the test (guards, SOC, provider). On-site testing needs an authorization letter with names, dates, addresses and a contact who can confirm it.
Pentest · Basics
You hold a signed contract for a test. May you enter any facility the contract mentions?
In September 2019 two specialists of the company Coalfire were detained at night in a courthouse in Dallas County, Iowa. They were doing a physical security test under a contract with the state judicial branch. The county sheriff said the county was responsible for the building and that they had gone beyond the contract. The charges were later dropped, and state judicial branch officials said they had not expected physical testing outside business hours. But the arrest and the legal process had already happened. This lesson is about why a "signed paper" is not yet a scope.
Mechanism: permission comes from whoever is responsible for the asset. A contract is valid only for what the customer has the right to dispose of. If the asset belongs to another party (a county, a cloud provider, a SaaS, a partner), the customer's signature does not cover it. So before the start three things are checked:
Who owns each host, domain and building on the list (domain registries, contracts, cloud accounts);
Who else may react to the test: security guards, police, the SOC, the provider. They must know or be on the exclusion list;
How to prove permission on site: an authorization letter with the testers' names, dates, addresses and the phone number of a person who can confirm it.
Who signed what
Figure 1. Permission must come from whoever is truly responsible for the asset, not only from whoever signed the contract.
Example: a vague clause and a precise one. The same clause before and after clarification.
A scope clause in a contract
Typical
"The security of the customer's building is tested"
No addresses, no doors, no word on night work or who is informed. Everyone reads it their own way.
Better
A list of addresses, a time window, allowed actions, contacts
A written confirmation from every owner, an emergency phone and a rule: if guards or police stop the tester, the test stops.
Figure 2. The same clause before and after clarification.
Limits and alternatives. Even a perfect letter does not guarantee that a patrol or a guard will read it. That is why physical tests agree on a duty contact who confirms the permission by phone. Online tests work the same way: the client warns its SOC and hosting provider if their rules require it. Some cloud providers publish their own testing policies: these are read separately from the contract.
Common mistakes:
treating one person's signature as permission for everything that "looks like the client": the asset may belong to another party;
having no letter and no confirmation contact on hand: the on-site test ends with the police;
leaving third-party things off the exclusion list: SaaS, the payment gateway, partners' data;
extending the scope verbally "since we are here": a written change can be shown, words cannot.
Check yourself
The contract is signed by the CEO, but a server on the list runs in a partner's cloud account. What do you do before the test?
Answer
Ask for written confirmation from the account owner, or exclude the server from the scope. The CEO's signature does not give the right to touch someone else's asset.
Guards stop you during a test. Which documents should you have at hand?
Answer
An authorization letter with names, dates and addresses, and the phone number of an authorized person who will confirm the test. Without the second item the letter proves little.
Related lessons: "Authorization, scope and rules of engagement: testing legally", "Pentest phases, methodologies and where QA fits".
In an interview.Junior: I do not start without written authorization and a clear scope, and if I step outside it I stop and notify the contact person. Middle/Senior: I separately check who owns each asset: the customer's signature does not cover someone else's. In the Coalfire case in Iowa the contract was with the state while the county was responsible for the building, so physical tests need agreed on-site contacts and an authorization letter.
A legal lab: where to practise and how to isolate it
Practise legally on deliberately vulnerable applications built for learning: PortSwigger Web Security Academy, OWASP Juice Shop and DVWA. Juice Shop and DVWA are run by you and isolated: the port is bound to 127.0.0.1 only, never exposed to the network or put on a public server, and the container is stopped after practice. Someone else's public site is not permission to train.
Pentest · Basics
How do you learn to break applications and stay out of jail? Where do you get a "victim"?
A beginner read about SQL injection and decided to "try it on some site". That is exactly the mistake from the earlier lessons: without the owner's permission such a test is illegal. The right answer is simple: learn on deliberately vulnerable applications that were made for this and that you run yourself. This lesson covers three sources of practice and how to set up a lab that harms nobody.
Three legal sources (the whole course uses them):
PortSwigger Web Security Academy — free online labs by topic (SQL injection, XSS, CSRF, SSRF, access control and more). Nothing to install: a lab opens in the browser, and some need Burp Suite (the free Community Edition is enough for most);
OWASP Juice Shop — a vulnerable online shop that tracks completed challenges. Runs locally;
DVWA (Damn Vulnerable Web Application) — a classic training application with difficulty levels (low … impossible). Runs locally.
Isolation mechanism. A deliberately vulnerable application is dangerous if someone else reaches it. So the rules are simple: listen only on 127.0.0.1, do not open the port to the network, do not put it on a public server (the DVWA README forbids this explicitly), and stop the container after practice. A Docker container adds one more layer: your files and keys are not inside it.
A lab on your computer
Figure 1. Only 127.0.0.1 listens: you alone can see the vulnerable application.
Example: starting Juice Shop. The command from the project README:
docker run --rm -p 127.0.0.1:3000:3000 \
bkimminich/juice-shop
The shop opens at http://localhost:3000. The 127.0.0.1: prefix in the port mapping binds the container to your machine only. Without it the port may listen on all interfaces. DVWA is started with docker compose up -d (address http://localhost:4280), the default login is admin / password.
How to practise. Pick a topic in the Academy, read the description, try it yourself and only then look at the hint. Then repeat the same in Juice Shop through Burp: this trains the "request → hypothesis → check" loop.
A real example. When Log4Shell (CVE-2021-44228) appeared in December 2021, researchers published a deliberately vulnerable application (Spring Boot with Log4j 2.14.1) so it could be reproduced safely. Its author directly advises running it in an isolated environment, preferably a virtual machine. This is how a legal lab works: a vulnerability is studied where it harms nobody.
Limits. A lab teaches mechanics, but everything in it is simplified: no WAF, noise, limits or complex business logic. After the training exercises you move on to your own team's applications or test environments, with written permission.
Common mistakes:
"practising" on someone else's site because "it is public": that is not permission;
running DVWA or Juice Shop on a VPS in an open network: scanners will find it;
copying other people's exploits without reading them: they sometimes contain malicious code (run only code you understand);
thinking a lab equals a real test: a real one has a scope, permission and a report.
Check yourself
Why does the Juice Shop command say 127.0.0.1:3000:3000 and not just 3000:3000?
Answer
Without the address the port may listen on all interfaces and other devices on the network can see the application. With the prefix only your machine can reach it.
Related lessons: "Authorization, scope and rules of engagement: testing legally", "Burp Suite and ZAP: the main capabilities".
In an interview.Junior: I practise on PortSwigger Academy, Juice Shop and DVWA: deliberately vulnerable applications that I run locally. Middle/Senior: I isolate the lab: the container listens only on 127.0.0.1, nothing is exposed to the internet, and I stop it after the session. Real systems need written permission and a scope.