Skip to content

Penetration testing methodology: from rules of engagement to retest

Method is what separates a penetration test from a scanner report. This is the structure we use and the public references behind it.

Reading time
14 min
Published

Two pentest proposals with the same price and the same deadline can deliver very different results. The difference rarely lies in the tools, because everyone uses more or less the same ones. It shows up in how much of the work is manual, in how many access profiles are actually tested, in what happens when the tester finds something out of scope and in whether the retest is included or will be quoted later.

Each phase of the methodology produces something concrete and connects to the industry's public references. Knowing this structure has two uses: buyers can evaluate proposals with clear criteria, and internal teams can follow the same path in an assessment of their own.

The approach here is defensive. You will find the classes of flaw we look for, the type of evidence that supports each finding and the risk rating criteria. Step-by-step exploitation technique was left out, because it does not help defenders and it does help people who should not be helped.

Scope and rules of engagement

Nothing starts without formal written authorization. It is what separates a security test from unauthorized access, and this point is not up for negotiation. The document needs to state who authorizes the test, which targets are included, in what window the test takes place and who the point of contact is on each side during execution.

When the target is with a cloud provider, the provider's testing policy also applies. On AWS, most testing of the customer's own resources is allowed without a prior request, with explicit exceptions for denial of service simulation and for some managed services. Check the current policy before closing the scope, because it changes.

What the scope document needs to answer

  • Targets by domain, IP range, cloud account or application, with what is explicitly excluded
  • Access profiles provided and how many users of each profile, when the test is authenticated
  • Execution window and the times when the noisiest activities are allowed
  • Impact limit: what cannot be tested in production and what requires a staging environment
  • Channel and deadline for immediate communication in case of a critical finding or signs of a prior compromise
  • Handling of data found during the test, including personal data
  • Who performs the work and who is its technical lead

A common mistake is defining the scope by the number of URLs. A modern application generates URLs dynamically, and the number says nothing about the effort. In practice, what drives the effort is the number of distinct features, access profiles and flows that move data or money.

Reconnaissance and surface mapping

The reconnaissance phase surveys what exists before deciding where to spend time. In an external test, this includes subdomains, exposed services, technologies in use and public information that helps build the picture. In an authenticated test, it means going through the application with each profile and recording every available function.

The result of this phase is an inventory of the target; the list of vulnerabilities comes later. This inventory is what prevents the most common problem of a poorly done test: finding out later that an entire part of the application was never looked at, because nobody knew it existed. In an external test, the survey starts with commands like these:

surface survey that records what was seen
# exposed services on the authorized target, with version detectionnmap -sV -Pn --top-ports 1000 -oA evidencias/recon-externo alvo.exemplo# current certificate: alternative names reveal forgotten hostsopenssl s_client -connect alvo.exemplo:443 -servername alvo.exemplo </dev/null \  | openssl x509 -noout -text | grep -A1 "Subject Alternative Name"# response headers: stack, cookies and declared policiescurl -sSI https://alvo.exemplo/ | tee evidencias/headers-raiz.txt

Every command executed is logged with date and target (note the -oA in nmap and the tee in curl, which save the output to evidencias/). This log has three uses: reconstructing what was done if something goes wrong in the environment, proving that nothing was run outside the scope and allowing the retest to repeat exactly the same check.

Threat modeling and prioritizing the effort

With the inventory in hand, it is time to distribute the effort. Testing everything at the same depth would be the most expensive and least efficient way to spend the contracted window. The question that guides this split is simple: where would a compromise cause the most damage to the business?

In an e-commerce application, the answer is usually the payment flow, the customer account area and any admin panel. In a multi-tenant platform, it is the boundary between tenants. In an internal HR system, it is access to employees' personal data. The threat model is what defines where manual testing will concentrate.

Where the effort concentrates by type of target
Type of targetMost critical boundaryMost common flaw
Web application with multiple profilesSeparation between profiles and between accountsBroken authorization on direct object references (IDOR)
REST or GraphQL APIInput validation and token scopeObject-level authorization and excessive data exposure
Multi-tenant platformIsolation between tenantsPredictable identifier allowing cross-tenant access
AWS environmentIdentity and public exposureOverly broad permission allowing privilege escalation
Internal networkSegmentation and administrative accessReused credentials and unpatched legacy services

Execution: automated and manual testing play different roles

The automated tool covers volume. It finds outdated components, missing headers, weak TLS configuration and the most obvious injections. It is useful and saves time, but it is also the part of the work that anyone can reproduce with a scanner license.

The part that requires a person is the part that depends on understanding the business. A scanner does not know that changing the order identifier in the request for a duplicate invoice exposes another customer's document, because the request returns 200 in both cases and nothing in the protocol signals an error. Logic flaws, broken authorization and the chaining of smaller flaws into a real attack path are still the territory of manual testing.

  • Authentication: password recovery flow, session expiration, second factor and user enumeration
  • Authorization: horizontal access between accounts with the same profile and vertical access between different profiles
  • Input: injection into queries, commands, templates and deserialization, with manual validation of what the scanner flagged
  • Server-side request forgery (SSRF) and access to instance metadata in cloud environments
  • Business logic: price tampering, negative quantities, skipping steps in multi-screen flows
  • Exposure of sensitive data in responses, logs, error messages and headers

Exploitation is controlled: the goal is to prove that the flaw is real and to measure its impact without causing damage. In practice, the tester stops as soon as the proof is in hand, avoids changing production data and never extracts more information than needed to demonstrate the problem.

Mapping to public references

There is nothing proprietary about the methodology. It rests on public references that any serious vendor uses, and knowing them helps you compare proposals. When the report cites the test identifier in the OWASP WSTG, for example, your team can read the same description straight from the source.

References by test phase
PhasePublic referenceWhat it covers
Scope and planningPTES, pre-engagement sectionsTarget definition, rules of engagement and communication
ReconnaissanceNIST SP 800-115Four-stage structure for technical security assessment
Web application testingOWASP Web Security Testing Guide (WSTG)Test cases identified by code, from configuration to business logic
API testingOWASP API Security Top 10The ten most frequent classes of flaw in programming interfaces
Verification requirementsOWASP ASVSLevel of rigor expected by type of application
Description of adversary techniquesMITRE ATT&CKCommon vocabulary for observed tactics and techniques
Severity ratingCVSS v3.1 and v4.0 (FIRST)Vector and base score, adjusted to the context of the environment

Evidence: what backs up a finding

A finding without evidence is an opinion. And poorly recorded evidence is the most common reason for a development team to dispute a report, which delays the fix and strains the relationship between the parties.

  • Numbered reproduction steps that anyone on the team can follow
  • The relevant request and response, with sensitive data masked in the report
  • A screenshot when the effect is visual, identifying the environment and the date
  • The account or profile used in the test, to tell legitimate access apart from improper access
  • A clear line between what was proven and what is a plausible but untested consequence

The last item on the list matters more than it seems. An honest report separates what was demonstrated from what would be possible. Writing that the flaw gives access to the entire database when access to only one record was proven is the kind of exaggeration that makes a technical team distrust everything else in the document.

Risk rating: CVSS is not the final answer

CVSS gives a base score from the technical characteristics of the flaw. That score works well as a common vocabulary and very poorly as the only prioritization criterion, because it knows nothing about your environment. The same flaw with a 7.5 score can be urgent on a public endpoint and irrelevant on a service reachable only through the administrators' VPN.

That is why the final severity combines three things: the technical score, the real exposure of the asset and the value of what sits behind it. A useful report shows this adjustment in writing, instead of hiding the decision behind a number.

Final severity and suggested remediation deadline
SeverityClassification criterionSuggested deadline
CriticalExploitable without authentication, with access to sensitive data or code executionImmediate fix, reported during the test
HighExploitable with regular user credentials, with impact on data belonging to othersWithin 15 days
MediumRequires a specific condition or delivers limited impactWithin 30 to 60 days
LowIndirect impact, or depends on another flaw to be usefulNext maintenance cycle
InformationalGood practice not adopted, with no demonstrable direct impactBacklog, no deadline

The deadlines in the table are a starting point. Each company adjusts them to the criticality of the system, the release cycle and the team's capacity. What cannot be missing is a deadline written down somewhere before the first finding shows up.

Report and retest

The report has two audiences, with opposite needs. Those who decide on investment need an executive summary that says in a few lines what the risk is and what changes if nothing is done. Those who fix the problems need enough detail to reproduce and solve them. If both are mixed into a single text, neither is served.

The retest closes the cycle. It checks whether the fix resolved the cause and did not introduce new behavior, and it is the only way to turn a list of findings into proven risk reduction. A test without a retest delivers the diagnosis and no confirmation that the treatment worked. Watch out for situations like these:

  • A fix that treats the symptom and not the cause: blocking a specific identifier instead of validating authorization
  • A fix applied to one endpoint and forgotten on the others that share the same defect
  • Validation done only in the browser, with the rule missing on the server side
  • A retest run in a different environment from the one where the flaw was found

Practical checklist

  • Formal written authorization, signed by someone with the power to authorize
  • Scope with targets, exclusions, window and impact limit documented
  • Cloud provider testing policy checked when the target is hosted
  • Immediate communication channel defined for critical findings
  • Access profiles and test credentials delivered through a secure channel
  • Surface inventory recorded before exploitation testing begins
  • Threat model that defines where manual effort concentrates
  • Dated log of the commands and requests executed
  • Evidence for each finding with verifiable reproduction steps
  • Severity justified by the technical score and the environment context
  • Executive summary separate from the technical detail
  • Retest agreed in the contract, with defined deadline and scope
  • Test data destroyed or returned when the work ends

Best practices

  • Set the scope by feature and access profile, not by the number of URLs
  • Ask for credentials for every profile: an authenticated test covers more in less time
  • Agree in advance on what to do if the tester finds signs of a prior compromise
  • Handle critical findings during the test, without waiting for the final report
  • Require the report to separate what was proven from what is a plausible consequence
  • Include the retest in the initial contract instead of quoting it later
  • Keep the report as a controlled document: it is a map of what has not been fixed yet

Common mistakes

Hiring a black box test on a short deadline for a large target
Much of the window goes to reconnaissance, and whole areas of the application end up without coverage, without this showing in the report.
Testing with only one access profile
The most frequent class of flaw in web applications is broken authorization, and it only shows up when you compare what different profiles can reach.
Treating the CVSS score as the prioritization decision
High-score flaws on irrelevant assets eat up the queue while medium-score flaws on exposed systems stay open.
Leaving the retest for a later quote
Without validation of the fix, the cycle ends in a to-do list and the risk reduction is never proven.
Not defining how data found during the test will be handled
Personal data accessed in a proof of concept can remain in the evidence without any retention control, and the test itself ends up creating a data protection problem.

Sources and references

The technical claims in this guide are based on the publications below. If this text and the official source disagree, the official source prevails.

Authorship and review

Cesar Gargiulo

CEO and founder of GUARDIASEC. Technical and editorial lead for the content published in this library.

Published on . Found a technical error? Write to [email protected] and we will correct it and keep a record of the change.

Frequently asked questions

Which pentest methodology does GUARDIASEC follow?
The structure described on this page: scope and formal authorization, reconnaissance and surface inventory, threat modeling, execution with tools and manual testing, evidence recording, risk rating adjusted to context, a two-layer report and retest. Each phase rests on public references such as OWASP WSTG, OWASP ASVS, PTES and NIST SP 800-115, which are listed in the sources at the end.
What is the difference between a methodology and a tool?
A tool is what runs a check. A methodology is what decides which checks to run, in what order, at what depth and what to do with the result. Two vendors with the same scanner deliver very different reports depending on the method, because the part of the work that finds authorization and business logic flaws cannot be automated.
Can the test take the environment down?
It can, and the scope is what manages that risk. Potentially disruptive techniques are excluded by default and only run with explicit authorization, preferably in a staging environment. With an agreed window, a documented impact limit and an open communication channel during execution, the risk stays at a controlled level.
Do I need a black box test for the result to be valid?
No. Black box better simulates an external attacker's lack of knowledge, but it spends part of the window on reconnaissance. When the goal is depth of analysis within a set budget, sharing context and providing credentials for the existing profiles covers more surface in the same time. In other words, the format should follow the question that prompted the test.
How long after the test should the retest happen?
It depends on the remediation deadline agreed for each severity. A common practice is to schedule the retest after the critical and high findings have been addressed, usually between 30 and 60 days after the report is delivered. Too early, and the retest wastes the cycle; too late, and the environment has changed so much that the comparison loses its meaning.

When to bring in specialist help

If the test will assess a system that moves money, stores personal data in volume or supports an operation that cannot stop, scope definition and the impact limit matter as much as the execution. In those cases, carry out the work with someone who has done this kind of test before and can explain why each scope decision was made.

If you are evaluating a provider, describe the environment and the timeline, and we will send you a written proposal. Request a proposal for penetration testing