Skip to content

Types of penetration testing: internal, external and access levels

There is no such thing as the best pentest in the abstract. The right format depends on what you want to find out and on the scenario you need to simulate.

Reading time
13 min
Published

Anyone about to hire a penetration test soon finds out that the word pentest covers very different kinds of work. Testing the internal network by simulating a malicious employee is one thing; testing the web application exposed on the internet is another, with its own goal, technique and cost. If you pick the wrong type, you end up with a report that does not answer the question that made you hire the test in the first place.

To keep your bearings, it helps to sort the types of pentest along three axes: the position of the simulated attacker (internal or external), the level of access and information the tester receives (black, gray or white box) and the target (application, API, network, cloud). With these axes clear, it gets easier to define a scope that answers your goal and to compare proposals that look the same at first glance but cover different things.

Internal and external pentests

The first axis is the starting point of the test. In an external pentest, the tester plays the role of an attacker on the internet, with no prior access, trying to compromise whatever is exposed (applications, services and the network edge). The question it answers is how much risk your public surface carries. An internal pentest starts from inside the network and simulates someone who already has some access, whether a malicious employee or an attacker who has already made it past the edge.

Because each one looks at a different risk, the two complement each other. Many companies invest only in the external test and forget that much of the damage in an incident happens after initial access, through lateral movement and privilege escalation inside the network. The internal pentest is what measures how well the environment holds up during that second stage of the attack.

Black, gray and white box

The second axis is how much the tester knows and receives before starting. This level of access affects the realism, the coverage and the cost of the test, and none of the options is best for everything: each one fits a different goal.

  • In black box testing, the tester starts with no privileged information, just as a real external attacker would. More time goes into reconnaissance, but the test faithfully reproduces the scenario of someone who does not know the environment.
  • In gray box testing, the tester receives credentials and some context, the same a regular user would have. It is a middle ground between realism and depth, and it is usually the format that offers the best value for money.
  • In white box testing, the tester gets broad access to documentation, configuration and sometimes the code. This yields the most coverage per hour invested, which is why it is the format to choose when the goal is to find as many flaws as possible.

When to choose each level

It all depends on what you want to learn from the test. If the idea is to measure resistance to an attacker who arrives with nothing, black box makes sense. If the idea is to dig deeper into a critical application within the available budget, gray or white box covers more in less time, because the tester does not spend hours discovering what the company itself could have told them.

Black box has a practical limit: part of the contracted time goes to reconnaissance, and the clock runs the same for everyone. A large target tested in black box on a short deadline tends to end up with whole areas left uncovered, simply because the tester did not have time to get to them. If what you need is confidence in the depth of the analysis, sharing context usually pays off more than preserving the realism of an attacker who knows nothing.

Types by target

The third axis is the target. Each kind of target calls for its own skills and approach, which changes the effort involved and the profile of the people doing the work. So lumping very different targets into a single, poorly defined scope tends to water down the depth of the test across all of them.

  • Web application, focusing on authentication, authorization, injection and business logic
  • API, looking at the REST or GraphQL surface, input validation and access control
  • Internal network, where exposed services, segmentation and lateral movement are what count
  • Cloud environment, with attention to identity, public exposure and privilege escalation
  • Mobile application, which includes the app, its communication with the server and local storage
  • Social engineering, which involves controlled phishing simulations and testing of the human factor

Methodology, scope and authorization

What separates professional work from a legal risk is formalization, and it happens before any testing. A pentest is an activity authorized in writing, with a defined scope and rules of engagement agreed between the parties. Without explicit authorization from someone with the power to grant it, the same techniques stop being a contracted test and become unauthorized access. That is why the authorization document (often called the rules of engagement) is the basis for the whole job.

What to define in the scope

  • Which domains, IP ranges, applications and accounts are included in the test
  • What stays out, such as third-party systems and environments that must not be touched
  • The execution window and the agreed times for the highest-impact actions
  • What kind of action is allowed (active exploitation, for example) and what is expressly forbidden
  • Emergency contacts on both sides, to pause the test if something goes off plan
  • How to handle sensitive data that turns up during the test and which confidentiality rules apply

Note that the authorization has to come from whoever has authority over the assets being tested. If the system is hosted on a third party's cloud, or if the target is a SaaS application, you usually also need the provider's permission, because its contract may restrict security testing. Ignoring this detail exposes the company and the tester to consequences that have nothing to do with the technical result.

Test environment or production

Another scope decision is where the test runs: in production or in a mirrored environment. Production shows reality more faithfully, but it carries the risk of downtime and of side effects on real data. A staging environment reduces that risk, as long as it faithfully matches production (which does not always happen). The choice weighs your tolerance for impact against the fidelity of the alternative environment, and it has to be settled before the work begins.

Recognized standards and methodologies

A test that follows a method tends to be more complete than an improvised one, and it is easier to compare across vendors. Recognized methodologies define phases and a list of what needs to be covered, which lowers the chance that the tester forgets an entire class of flaw. They do not replace the tester's skill, but they raise the minimum level of the work and make it possible to audit coverage.

  • OWASP Testing Guide and OWASP ASVS, for web applications, which provide vulnerability classes and verification levels
  • OWASP API Security Project, focused on the specific surface of APIs
  • PTES, which describes the phases of a penetration test from start to finish
  • NIST SP 800-115, a technical reference for planning and execution
  • MITRE ATT&CK, which standardizes how techniques are described in more adversarial tests

When comparing proposals, ask which methodology guides the work and how coverage will be demonstrated. A proposal that only promises to find vulnerabilities, without describing method and phases, gives little confidence that the whole target will be covered. The final report is also more useful when it ties each finding to a known reference: the internal team understands the nature of the flaw better and can compare results from one cycle to the next.

Red team and the focused test

Many people confuse a pentest with a red team exercise. A pentest has a defined scope and tries to find and prove as many relevant vulnerabilities as possible in a target, within a deadline. A red team pursues a specific objective (reaching critical data, for example) and also tests the company's detection and response capability, often without the defense team knowing about the exercise.

A red team makes sense for more mature organizations, ones that have already fixed the basics and want to put their entire security operation to the test. For most companies, a well-scoped pentest yields more, because it shows the flaws an attacker would exploit first. Moving to a red team before getting the basics right is usually money spent in the wrong place.

Practical checklist

  • Define the goal of the test before choosing the format
  • Decide between an external pentest, an internal one or both
  • Choose the access level: black, gray or white box
  • Define the target clearly (web, API, network, cloud)
  • Do not mix very different targets in a shallow scope
  • Formalize scope and authorization in writing
  • Record the rules of engagement, with windows, contacts and forbidden actions
  • Get authorization from whoever answers for the assets and, when applicable, from the provider
  • Decide whether the test runs in production or in a mirrored environment
  • Ask which recognized methodology guides the work
  • Choose between pentest and red team according to your maturity
  • Require a report with evidence, severity and a retest

Best practices

  • Choose the type of test by the scenario you need to simulate
  • Formalize authorization before any action, with no exceptions
  • Combine external and internal testing to cover both stages of the attack
  • Prefer gray box when you need a balance between realism and depth
  • Scope one target at a time so the analysis is not diluted
  • Work with a recognized methodology, so that coverage can be audited
  • Leave the red team for after the basics are in place
  • Repeat the pentest periodically, because the environment changes

Common mistakes

Starting the test without formal authorization and without a written scope
The activity stops being a contracted test and becomes a legal risk for both parties.
Testing third-party assets without the provider's permission
The provider's contract is breached, whatever the technical result.
Testing only the external surface and forgetting the internal network
Nobody assesses how well the environment holds up against lateral movement.
Asking for black box while expecting maximum coverage
The time spent on reconnaissance comes out of the depth of the analysis.
Mixing many targets in a poorly defined scope
The analysis stays shallow across all of them, and relevant flaws are left out.
Hiring a red team before getting the basics right
You spend a lot before fixing what an attacker would exploit first.

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

What are the types of penetration testing?
The most commonly cited types are split by two criteria. By the level of information the tester receives: black box (none), gray box (partial, such as regular user credentials) and white box (broad access, including documentation or code). By target and starting point: external, internal, web application, API, cloud and social engineering, among others.
What is the difference between an internal and an external pentest?
An external pentest simulates an attacker on the internet, with no prior access, and measures the risk of the exposed surface (public applications and services, for example). An internal pentest starts from inside the network, like someone who already has some access, and measures how well the environment resists lateral movement and privilege escalation. Each one complements the other, because much of the damage in an incident happens after initial access.
Black, gray or white box: which should you choose?
It depends on what you want to find out. Black box simulates an attacker with no information and reproduces the real external scenario, but it spends more time on reconnaissance. Gray box provides credentials and some context; it sits in the middle between realism and depth and usually offers the best value for money. White box gives broad access and yields the most coverage per hour, which makes it the right choice when the goal is to find as many flaws as possible in a critical target.
Are a pentest and a red team the same thing?
No. A pentest has a defined scope and tries to find and prove as many relevant vulnerabilities as possible in a target, within a deadline. A red team pursues a specific objective and also tests the company's detection and response capability, often without the defense team knowing. It makes more sense in mature organizations; most companies gain more by starting with a well-scoped pentest.
Do I need written authorization for a pentest?
Yes. A pentest uses techniques that, without consent, amount to unauthorized access. Written authorization, with scope and rules of engagement, is what makes the work legitimate and protects both parties. It has to come from whoever has authority over the assets being tested. If the target is hosted in the cloud or on a third-party service, you generally also need the provider's permission, since its contract may restrict security testing.
What are the rules of engagement in a pentest?
They are set out in the document that defines how the test will be conducted: which targets are in and which are out, the execution window, the types of action allowed and forbidden, the emergency contacts on both sides and how sensitive data found along the way is handled. This document prevents misunderstandings and settles in advance when and how to pause the test if something goes off plan. If a question comes up later about what was or was not authorized, this is the document both parties will check.
Which pentest methodology should I require?
It depends on the target. For web applications, the OWASP Testing Guide and OWASP ASVS are common references; for APIs, the OWASP API Security Project; for the test as a whole, PTES and NIST SP 800-115 describe phases and good practices. More than the acronym, what you should require is an explicit method and a report that shows coverage. A proposal that describes its method gives more confidence that the whole target will be covered than one that only promises to find flaws.

When to bring in specialist help

GUARDIASEC's penetration testing service helps you define the type of test that fits your goal: external or internal scope, access level and target. The work is manual testing guided by a recognized methodology, and the deliverable includes evidence, prioritization and a retest.

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