QA Interview Hub · Knowledge base · Quizzes · Українська

Penetration Testing

Tools and automation

Burp Suite and ZAP: the main capabilities

Burp Suite and ZAP are proxies between the browser and the server that show every request, header and cookie. Proxy intercepts and changes traffic, Repeater resends a request with changes, Intruder substitutes values from a list, and Collaborator catches out-of-band interactions. In CI the ZAP baseline scan is passive only, while a full scan runs active attacks and needs a separate environment and permission.

A newcomer sees an ordinary form in the browser. A pentester sees the requests under it: all parameters, headers, cookies. For this a proxy standing between the browser and the server is needed.

Burp Suite (PortSwigger):

  • Proxy — intercepts and shows traffic, lets you change a request before it is sent (for HTTPS the Burp certificate is installed in the browser);
  • Repeater — manually repeating a request with changes, the main tool for testing hypotheses;
  • Intruder — automatically substituting values from a list into request positions (iterating ids, fields);
  • Scanner (in Pro) — automatic vulnerability search;
  • Collaborator — an external service for detecting out-of-band interactions (DNS/HTTP) when the response is not visible: blind SSRF, blind injections.

ZAP by Checkmarx — a free open source proxy scanner with a similar set (spider, passive and active scan, fuzzer, automation). For CI there are ready Docker scripts:

  • Baseline scan — a short spider and only passive checks, attacks nothing, fits every PR;
  • Full scan — spider plus active attacks, may change data and load the system; only on a separate test environment and with permission.
docker run -t ghcr.io/zaproxy/zaproxy:stable zap-baseline.py -t https://staging.example.com

Example. In Repeater userId=42 is changed to 43 and someone else's data appears: the IDOR hypothesis is confirmed in a minute.

Mistakes: running an active scan against production; not configuring authentication (the scan sees only the public part); treating "found nothing" as proof of security.

Short answer: "Proxy sees and changes traffic, Repeater tests hypotheses, Intruder automates substitution, Collaborator catches out-of-band; in CI the ZAP baseline is passive, the full scan is active".

nmap, ffuf, sqlmap, Nuclei: recon and verification

Tools split the work: nmap scans ports and service versions, and ffuf brute-forces paths from a wordlist. The sqlmap utility automates finding and exploiting SQL injection, and Nuclei checks known vulnerabilities in bulk from YAML templates. Certificate Transparency logs reveal subdomains, including forgotten ones. Everything is run only against systems you are authorised to test, and the output is verified by hand.

Before checking an application you need to know what exactly is in scope: which hosts, ports, paths. Small specialised utilities do this. All are run only against systems you are authorized to test.

  • nmap — a port and service scanner. Example: nmap -sV -p 1-1000 host checks ports 1–1000 and detects service versions (-sV);
  • ffuf (and dirsearch) — brute-forcing paths and parameters from a wordlist. In ffuf -u https://host/FUZZ -w words.txt the word FUZZ is replaced with lines from the list, and hidden directories are looked for by the response code and size;
  • sqlmap — automates detection and exploitation of SQL injections. It can read and change data, so only with permission, in scope and under the rules of engagement;
  • Nuclei — a scanner built on YAML templates: a template describes a request and a condition in the response, so known vulnerabilities are checked in bulk and repeatably (handy in CI);
  • Certificate Transparency — public logs of issued certificates (for example a search in crt.sh). They reveal a company's subdomains, forgotten ones too, without a single request to its servers.

Example. CT logs revealed old-admin.example.com, missing from the documentation. nmap shows an open port, ffuf the path /backup/, and Nuclei confirms a known misconfiguration. That is how a forgotten subdomain becomes a finding.

Mistakes: running at maximum speed against a fragile environment; taking foreign wordlists and templates without reading them; treating a utility's output as a finding without manual verification.

Short answer: "nmap — ports, ffuf — paths, sqlmap — SQLi, Nuclei — template checks, CT logs — subdomains; everything only in scope".

SAST, DAST, IAST, SCA, SBOM and secrets in CI

SAST analyses code without running it, DAST tests a running application from outside, IAST uses an agent inside, and SCA finds vulnerable dependencies. An SBOM lists components, and secret scanning looks for tokens in code and history. These classes catch different things, so they are combined. A tool's output is a hypothesis to reproduce, and a leaked secret is revoked first.

A team's pipeline is green, yet the release contains a vulnerable library and a token in the repository. Different classes of tools catch different things, so they are combined.

  • SAST — analysis of source code without running it: early and cheap, but without runtime context and with many false positives;
  • DAST — testing a running application from outside, like an attacker; needs no code, sees configuration and behaviour, but comes later and does not point to a line of code;
  • IAST — an agent inside the running application during tests (for example functional ones) sees data flows, so it is more precise;
  • SCA — finding known vulnerabilities in dependencies by their versions;
  • SBOM — a list of the application's components (CycloneDX, SPDX formats): when a new CVE appears, it is quick to see where its library is used;
  • Secret scanning — searching for tokens and keys in code and history.

Working with results. A tool's output is a hypothesis, not a finding. For "High: SQL injection" the request is first reproduced and the impact observed, then a defect is filed. A scanner report is not a pentest report: it has no confirmed exploitation, business impact or logic flaws, which a scanner does not see.

Example: a secret in a commit. An active token is found in a commit five months old. The first step is to revoke and replace the token (it may already have been copied), and only then clean the history if needed. A new commit deleting the file fixes nothing: the token stays in history.

Mistakes: switching everything on and drowning in noise; not tuning thresholds; cleaning history without revoking the secret.

Short answer: "SAST looks at code, DAST at the running application, IAST from inside, SCA at dependencies; results are checked manually, and a leaked secret is revoked first".

Burp and ZAP at work: from an intercepted request to a confirmed finding

Working in Burp or ZAP is a repeatable five-step process: scope, a walk, an interesting request, one changed parameter, evidence. Repeater changes it (in ZAP, the manual request editor). The walk is done as each role separately, and the request picked has an identifier or filter. Intruder or Fuzzer is for lists of values only, at a speed the environment can take. A human judges the logic, not the scanner.

Pentest · Tools

Burp is installed, the browser is set up. Where do you start without drowning in hundreds of requests?

The first run of a proxy is scary: the history grows every second, with hundreds of requests to analytics, fonts and CDNs. A pentester works in order, and the order is the same for Burp Suite and ZAP. It turns "I click and watch" into a repeatable process with evidence.

Mechanism: five steps.

The working loop in a proxy

1 Put only targets in scope2 Walk the app as each role3 Find a request in history4 Change and replay (Repeater)5 Save evidence and impact
Figure 1. The same loop in Burp and ZAP: scope, walk, choose, verify, evidence.
  • Scope. In Burp you set the target scope and stop logging outside it, in ZAP you set a context. Otherwise the proxy collects traffic of third-party services and active checks may hit a host you have no permission for. ZAP has modes: Safe, Protected (attacks only URLs in scope), Standard, ATTACK. For learning, Protected is handier;
  • Walk. Use the application in the browser as each role separately: the history and the site map fill themselves;
  • An interesting request. Pick the ones carrying an identifier, a filter, a URL, a file or a role, because vulnerabilities usually live there;
  • Repeater / Manual Request Editor. Change one parameter at a time and compare the response. For a list of values use Intruder (in ZAP the Fuzzer);
  • Evidence. Save the request and the response, record the impact minimally: without dumping other people's data.

Before → after example in Juice Shop. In the training shop a basket is requested as GET /rest/basket/6 with the user's token. Hypothesis: the server checks only the token, not whose basket it is.

GET /rest/basket/6 HTTP/1.1
Host: localhost:3000
Authorization: Bearer eyJ...

Change 6 to 1 in Repeater and send. If someone else's basket comes back, it is an IDOR (horizontal escalation). A beginner's mistake is to launch Intruder over thousands of ids at once: Repeater proves the same thing in two requests and the enumeration is redundant.

A real case. In 2022 Optus suffered a customer data breach. The Australian regulator ACMA took Optus to court for failing to protect customers' personal information from unauthorised access (Optus said it would defend the case). According to press reports, an API endpoint had an access control flaw: a code change weakened the check, and the fix never reached a forgotten subdomain. This is an example of why APIs are tested directly and not only through the interface.

Limits. The Burp scanner or the ZAP active scan do not replace this loop: they do not know that "someone else's basket" is a violation because they do not understand the logic. The tool helps you get there, the conclusion is human.

Common mistakes:

  • not setting a scope and leaving interception on: the application "hangs" on each request and third-party services land in the log;
  • not configuring authentication: the test sees only the public part;
  • changing several parameters at once and not knowing which one changed the response;
  • running an active scan or Intruder at maximum speed against production.

Check yourself

In Repeater, with a changed id, you got 200 with an empty body {}. Is that an IDOR?

Answer

Not necessarily. An empty body can mean the object exists but has no data, or that the server filtered the fields. Compare with an existing id of another user where data exists, and check the code, length and fields of the response.

In an interview. Junior: I add targets to the scope, walk through the application, change one parameter at a time in Repeater and save the request and response as evidence. Middle/Senior: The tool only helps: I check logic by hand with two accounts, and use Intruder or a fuzzer where a list of values is needed, at a speed the environment can bear.

nmap, ffuf, sqlmap: a recon chain and the limit of automation

nmap, ffuf and sqlmap form a chain of tools, each answering its own question. The first finds open ports and services, the second finds paths and parameters of a web service, the third checks for SQL injection after a manual hypothesis. The output gives only hypotheses that a human verifies, and zero findings does not prove safety. Speed is limited because automation is noisy.

Pentest · Tools

The scanner reported "clean". Does that mean there is nothing to look for?

Two commands were typed in the console and there are no new findings. Another gives a list of 40 "Medium". Only a human decides what is real. This lesson shows how utilities form a chain and where automation ends. All examples are only on hosts you are authorized to test (in a lab that is your local address).

Mechanism: each utility answers its own question.

  • nmap: "which ports and services are open?" — the entry to the chain;
  • ffuf: "which paths and parameters exist on this web service?";
  • sqlmap: "is this parameter really vulnerable to SQL injection?" — only after a manual hypothesis.

The result of the previous step narrows the next one: without a port list there is nowhere to aim ffuf, and sqlmap makes no sense without a parameter found.

nmap -sV -p 1-1000 staging.example.com
ffuf -u https://staging.example.com/FUZZ \
  -w words.txt -mc 200,301 -rate 20
sqlmap -u "https://staging.example.com/search?q=a" \
  --batch --level=1 --risk=1

How to read the output. Below is a shortened example: this is how the result looks on a test host.

PORT    STATE SERVICE VERSION
22/tcp  open  ssh     OpenSSH 8.9
80/tcp  open  http    nginx 1.24
admin   [Status: 301, Size: 169]
backup  [Status: 200, Size: 5120]

A human sees three hypotheses here: an outdated service version (check it against CVEs), the /admin directory (does it need authentication?), a 5 KB file in /backup (does it expose configuration?). None is a finding yet.

What each approach finds

Automation

Known and template-like

Open ports, versions, known CVEs, missing headers, simple injections. Fast and repeatable, but with false positives.

By hand

Logic and chains

Another user's id in a request, skipping a step sequence, combining two small things. Needs product understanding and two accounts.

Figure 1. Both are needed: the first gives breadth, the second depth.

Real cases. Log4Shell (CVE-2021-44228) was checked out-of-band: the payload made the server contact a DNS name controlled by the checker, and the record of that contact was the proof. No visible response is needed. In May 2023 (per CISA) the CL0P group broke into MOVEit Transfer through a SQL injection zero-day. A scanner template finds only the known: a zero-day is first found by people.

Limits. An automatic tool is noisy: ffuf with a thousand requests per second can knock down a fragile staging, sqlmap with high --level and --risk sends dangerous requests and data may change. So the speed is limited (-rate, -t) and sqlmap is first run with minimal settings.

Common mistakes:

  • taking a wordlist from the internet without looking at what is in it;
  • treating "0 findings" as proof of security: the scanner may be unauthenticated or lack a template;
  • putting a tool's output in the report without manual verification;
  • running sqlmap straight to a data dump: the evidence is the fact of the vulnerability, not a table of customers.

Check yourself

ffuf shows many 200 responses of the same 4 KB size. What does it mean and what to do?

Answer

The server seems to return the same page for any path (a soft 404). A filter by code will not help: add a filter by size (-fs 4096 or similar) or by word count and look at the responses that differ.

In an interview. Junior: nmap finds ports, ffuf finds paths, sqlmap checks SQL injection; everything only in scope. Middle/Senior: A tool's output only gives hypotheses that I check by hand; I limit the speed to the environment, and zero-days and logic flaws are found by people, not by templates.