{
  "id": "penetration-testing",
  "title": "Penetration Testing",
  "lang": "en",
  "source_lang": "en",
  "summary": "Penetration testing is an authorized security assessment that uses controlled attacks to establish how weaknesses can compromise systems and organizational assets.",
  "category": "computer-science",
  "subcategory": "networks-security",
  "type": "concept",
  "aliases": [
    "Pen testing",
    "Pentesting",
    "Ethical penetration testing"
  ],
  "generated_at": "2026-11-03",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/penetration-testing/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/penetration-testing/",
      "json": "https://aiwiki.page/zh/penetration-testing.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Penetration testing is an authorized assessment in which testers attempt to circumvent security controls under agreed conditions, using techniques that resemble those available to an attacker. Its purpose is to establish whether weaknesses can be exploited, how those weaknesses interact, and what consequences could follow for an organization. It is a practical component of cybersecurity, concerned with demonstrated attack paths rather than solely with the presence of potentially insecure settings or software.\n\nA penetration test may examine an application, a network, a cloud environment, a device, or a combination of technical and organizational controls. Depending on its scope, it can include attempts to gain unauthorized privileges, cross security boundaries, access designated test information, or evade preventive controls. Authorization, bounded objectives, evidence handling, and safeguards against unintended harm distinguish the activity from unauthorized intrusion.\n\nThe results are necessarily conditional. A test establishes what particular assessors could demonstrate against particular systems, with specified knowledge, resources, and time. It does not certify that no other attack is possible. Its principal outputs are reproducible findings, an explanation of their operational significance, and evidence that supports remediation and subsequent verification."
    },
    {
      "heading": "Purpose, historical development, and related assessments",
      "text": "Penetration testing addresses the difference between a suspected weakness and a demonstrated security failure. A security vulnerability may exist in software, configuration, identity management, or an organizational process. Whether it produces a useful attack depends on additional conditions: network reachability, available privileges, protective controls, and access to valuable resources. Testing investigates those conditions together. For example, an outdated service might be unreachable from an untrusted network, while an apparently minor permissions error could expose sensitive records through an ordinary user account.\n\nThe practice has roots in the security evaluation of time-sharing and military computer systems during the 1960s and 1970s. Early evaluators explored whether users could escape restrictions intended to separate programs, privileges, and classified information. The 1974 report Multics Security Evaluation: Vulnerability Analysis, by Paul Karger and Roger Schell, is an important example of systematic analysis of ways to defeat a computer system’s protection mechanisms. Such work emphasized that a security design had to withstand deliberate attempts to subvert it, not merely operate correctly during normal use.\n\nAs commercial networks and the Internet expanded, the field developed into a specialized service encompassing network infrastructure, web applications, and enterprise identity systems. The growth of online commerce made remotely accessible applications particularly important targets. Later, mobile platforms, cloud services, and distributed identity arrangements expanded the boundaries of an assessment beyond a single organization’s physical network. This development also connected penetration testing more closely with software engineering and operational security management.\n\nSeveral neighboring activities have different primary purposes. A vulnerability assessment systematically identifies and classifies weaknesses, often across a broad estate. It may use scanning and manual review without attempting to demonstrate an attack’s full consequences. Penetration testing generally places greater emphasis on validating exploitability and connecting individual weaknesses into meaningful attack paths. Neither activity is defined simply by whether a particular commercial tool is used.\n\nA red-team exercise usually evaluates an organization’s ability to prevent, detect, and respond to a goal-oriented adversary. It may prioritize stealth and selected objectives rather than comprehensive coverage of vulnerabilities. A security audit evaluates conformity with specified controls or requirements, while a bug bounty program offers rewards for eligible reports under published conditions. These activities can overlap with penetration testing, but their assurance claims differ. A narrowly scoped application test, for example, cannot establish how effectively an organization would detect a prolonged intrusion across its entire environment."
    },
    {
      "heading": "Authorization, scope, and rules of engagement",
      "text": "Authorization is the defining prerequisite for penetration testing. Technical access to a system does not itself establish permission to test it, and permission from one party does not necessarily extend to assets operated by another. An organization may own an application while relying on a hosting provider, payment processor, or external identity service. Each relationship can impose different limits on testing. The relevant agreements therefore identify who can authorize the work and which assets and activities that authorization covers.\n\nA written scope normally specifies target domains, address ranges, applications, accounts, environments, and exclusions. It also identifies the assessment’s objectives: for example, whether an external actor can reach an administrative function, whether one customer can access another customer’s records, or whether a compromised workstation can reach a protected service. These objectives are often derived from a threat model, which describes relevant adversaries, valuable assets, trust boundaries, and plausible routes of attack. Without explicit objectives, a technically busy assessment can produce findings that answer little about the organization’s actual exposure.\n\nThe rules of engagement translate authorization into operational constraints. They define testing windows, approved source addresses, communication channels, escalation procedures, and conditions requiring an immediate stop. Activities that could affect availability—such as resource-exhaustion tests or unusually aggressive scanning—are commonly treated separately. A denial-of-service attack may be relevant to the threat model, but deliberately causing an outage is not necessary or permitted in every assessment. Production systems can also contain fragile devices or undocumented dependencies that make routine-looking probes hazardous.\n\nData handling is equally important. Testers may encounter credentials, personal information, commercial secrets, or regulated records. The engagement can limit collection to a small sample, require masking in reports, prohibit copying certain data, and establish secure storage and deletion arrangements. Privacy obligations apply to the assessment process itself, not only to the vulnerabilities being investigated. A credible demonstration often uses synthetic records or an agreed marker rather than extracting an entire production dataset.\n\nSocial and physical activities require their own boundaries. Social engineering, simulated phishing, entry attempts, or contact with support personnel can involve employees and outside parties who are unaware of the exercise. Agreements may exclude particular populations, locations, communications, or pretexts. An emergency contact must be able to distinguish authorized activity from a real incident without unnecessarily disclosing the exercise to everyone being tested. Authorization is therefore an ongoing governance arrangement: scope changes, unexpected access, and emerging operational risks can require new decisions during the engagement."
    },
    {
      "heading": "Test design and the assessment lifecycle",
      "text": "Penetration tests are commonly described as black-box, white-box, or gray-box assessments. In a black-box test, assessors begin with limited internal information. A white-box test supplies substantial knowledge, potentially including architecture documents, source code, configurations, and privileged test accounts. Gray-box testing provides selected information or access, such as an ordinary user account. These categories describe starting conditions rather than levels of quality. A white-box assessment can examine difficult authorization paths more efficiently, while a black-box assessment can reveal what is discoverable from an outsider’s initial position.\n\nA test usually begins with planning and information gathering. Assessors reconcile the authorized inventory with observed services, application routes, identity relationships, and exposed interfaces. Publicly accessible information and organization-supplied documentation can help establish the environment’s structure. The central analytical task is to identify trust boundaries: points where data, requests, or identities move between components with different privileges or assumptions. A public-facing service, an internal administrative endpoint, and a background processing account may belong to the same application while presenting very different security boundaries.\n\nDiscovery is followed by hypothesis formation and validation. A scanner might suggest that a service has a known weakness, but its identification can be wrong because of customized software, backported patches, or misleading version information. Manual examination establishes whether the relevant conditions actually exist. Conversely, a business-logic flaw may have no recognizable software signature. A purchasing workflow, for instance, can enforce each individual input correctly yet fail to preserve an authorization or pricing rule across a sequence of legitimate operations.\n\nExploitation in this context means demonstrating an unauthorized capability within the agreed scope. That may involve accessing a designated record, executing a harmless action under another identity, or crossing a segmented boundary. Post-exploitation analysis examines what the resulting access permits, but it is not an unrestricted mandate to explore every reachable system. Assessors commonly use the smallest demonstration sufficient to establish impact. Persistence, broad credential collection, and extensive movement between systems may be unnecessary or explicitly prohibited.\n\nThe lifecycle also includes contemporaneous recording, cleanup, reporting, and retesting. Evidence should capture the target, time, prerequisites, actions, and observed result well enough for another qualified person to understand the finding. Temporary accounts, files, configuration changes, or testing components must be accounted for. Retesting then evaluates whether the demonstrated failure has been corrected and whether the correction remains effective under relevant variations. The sequence is iterative rather than rigid: discovering an unexpected identity relationship may send the assessment back to mapping, while a serious operational issue can halt testing before planned validation is complete."
    },
    {
      "heading": "Networks, operating systems, and enterprise identity",
      "text": "Infrastructure testing examines how reachable services, host configuration, and identity relationships combine to permit or restrict access. An external assessment generally begins outside an organization’s trusted environment; an internal assessment begins from a defined internal position, such as a managed workstation or guest network. These are different threat assumptions. Internal access does not necessarily imply unrestricted trust, and a compromised ordinary account can be a more realistic starting condition than either a completely anonymous outsider or an administrator.\n\nNetwork boundaries are tested through observed communication paths rather than documentation alone. A router, firewall, or segmentation policy may be intended to isolate administrative services from user devices, but exceptions and overlapping rules can undermine that separation. Assessors compare expected flows with actual reachability and authorization. Supporting infrastructure such as the Domain Name System can reveal dependencies and naming relationships, although discoverability by itself is not necessarily a vulnerability. The security question is whether information or connectivity enables an unauthorized operation.\n\nAt the host level, testing considers the operating system, installed services, permissions, update state, and handling of privileged operations. An exposed service can provide an initial foothold, while a separate local configuration error can permit privilege escalation. On both Linux and Microsoft Windows, effective access depends on more than a user’s visible account name: group membership, service identities, delegated permissions, stored credentials, and execution context can all matter. Findings therefore need to identify the actual privilege boundary crossed.\n\nEnterprise identity often makes isolated host findings consequential. A centrally managed directory can connect users, machines, applications, and administrative roles. In environments using Active Directory, assessors may examine whether delegated rights or privileged account practices create unintended paths to sensitive administration. The general issue is transitive trust: control over one account or system may grant influence over another. A weakness with little local importance can become critical if it exposes an identity used widely across the organization.\n\nProtective controls also affect the outcome. Multifactor authentication can reduce the usefulness of a stolen password, but the result depends on which services enforce it and how sessions, recovery, and service accounts are handled. Encryption can protect intercepted traffic while leaving authorization errors untouched. Infrastructure findings accordingly distinguish the initial weakness, the conditions enabling further access, and the asset ultimately affected. Testing may also record whether security monitoring noticed the activity, although absence of an alert during a narrowly scoped test does not by itself establish the organization’s overall detection capability."
    },
    {
      "heading": "Web applications, APIs, and business logic",
      "text": "Application penetration testing focuses on how software interprets requests, establishes identity, enforces permissions, and processes data. The World Wide Web introduces several interacting security contexts: the user’s browser, server-side application code, identity providers, databases, and external services. An application can protect its network connections correctly while still allowing a user to perform an unauthorized action. Testing therefore examines behavior at the level of functions, records, and workflows, rather than treating a successful encrypted connection as evidence of application security.\n\nAuthentication establishes an identity; authorization determines what that identity may do. Confusing these functions is a frequent source of defects. An application might require login but fail to check whether the logged-in user owns a requested record. In a multi-user test, assessors compare access using accounts with different roles or organizational affiliations. The important finding is not merely that an identifier can be changed, but that the server accepts a request whose intended access policy should reject it. Administrative interfaces and background actions require the same server-side enforcement as ordinary pages.\n\nInput-processing weaknesses arise when data is interpreted as instructions or trusted structure. SQL injection occurs when untrusted input can alter a database query’s meaning; cross-site scripting causes attacker-controlled content to execute in a browser under an application’s security context. These are distinct mechanisms with different consequences and defenses. Application tests also examine file processing, server-side requests, unsafe object handling, and errors in handling sensitive output. The presence of input characters associated with an attack is not sufficient evidence: the assessment must establish how the application actually interprets them.\n\nAn application programming interface often exposes the same business functions as a user interface, but with different assumptions about clients and message structure. Testing APIs includes object-level authorization, function-level permissions, excessive exposure of fields, and the handling of state-changing requests. A mobile application or browser interface may hide a function without preventing direct requests to it. Session management introduces further boundaries through tokens and the HTTP cookie, while browser protections such as the same-origin policy address only particular classes of cross-origin interaction.\n\nBusiness-logic testing examines rules that generic scanners rarely understand. Examples include whether a refund can exceed a completed payment, whether a workflow can skip required approval, or whether simultaneous requests violate a transaction limit. The defect may involve valid requests submitted in an unexpected order rather than malformed input. Source review and design information can make these problems easier to identify, especially when the relevant invariant spans several services. The evidence must connect the observed behavior to a documented or reasonably established security requirement; unusual behavior alone is not necessarily a vulnerability."
    },
    {
      "heading": "Cloud environments, devices, and emerging targets",
      "text": "Cloud computing changes the location of security boundaries rather than removing them. An assessment may need to examine the provider’s management interface, customer identity policies, application workloads, storage permissions, and network configuration as separate layers. The shared-responsibility model determines which party operates each control, but it does not provide blanket authorization to test the provider’s infrastructure. Provider policies and customer agreements can permit some activities while excluding attacks against other tenants, underlying services, or availability.\n\nCloud permissions are especially important because administrative actions can occur through authenticated API requests rather than interactive access to a server. A workload identity may be able to read a particular storage location, create another resource, or delegate access. Assessors examine whether the granted permissions match the workload’s intended purpose and whether combinations of rights permit unintended actions. Exposure of temporary credentials or instance metadata can be consequential, but its significance depends on reachability, the identity’s permissions, and controls that limit credential use.\n\nVirtualization, containers, and microservices introduce additional boundaries. A virtual machine provides isolation at a different layer from a container sharing its host’s kernel. In a containerized system, security can depend on runtime privileges, mounted resources, orchestration permissions, and service identities. A finding inside one container does not automatically demonstrate control over its host or neighboring workloads. Conversely, an overly privileged management identity may bypass network isolation entirely. Reports need to identify the exact boundary crossed rather than use “container escape” or “cloud compromise” as vague descriptions.\n\nMobile and embedded assessments may combine application analysis with examination of local storage, update mechanisms, communications, and firmware. A smartphone application can expose secrets on the device, mishandle server responses, or rely on client-side restrictions that the server does not enforce. Connected devices can have limited update capabilities and long operational lifetimes. Industrial and safety-critical environments require particularly cautious test design because an interruption can affect physical processes; a representative laboratory system may be more appropriate for intrusive validation than live equipment.\n\nSystems built around a large language model add a different class of boundary problem. Through prompt injection, untrusted content may influence a model’s behavior in ways that conflict with the application’s intended instructions. The security consequence depends on the surrounding system: a text-only demonstration is different from an AI agent that can retrieve confidential records or invoke privileged tools. Assessment must therefore distinguish undesirable model output from an actual violation of data access, tool permissions, or workflow controls. Nondeterministic behavior also complicates reproducibility and requires careful recording of inputs, context, and observed outcomes."
    },
    {
      "heading": "Tools, evidence, risk assessment, and reporting",
      "text": "Penetration testers use tools for service discovery, traffic inspection, configuration analysis, request manipulation, and controlled validation. Nmap is widely associated with network discovery, Wireshark with packet analysis, Burp Suite and OWASP ZAP with web application testing, and Metasploit with exploit validation and related assessment tasks. Their results remain dependent on scope and interpretation. A scanner can miss an endpoint requiring a special workflow, identify a harmless banner as vulnerable software, or fail to recognize that several individually modest weaknesses form a serious attack path.\n\nAutomated testing is particularly useful for repeatable checks across many similar assets. Human analysis is important where the intended policy is contextual, such as whether a financial action requires a second approver or whether an account should access records belonging to another organization. White-box review can complement dynamic testing by exposing unreachable code paths, hidden interfaces, and configuration assumptions. Neither automation nor manual investigation is intrinsically comprehensive; the value lies in matching the technique to the question and documenting what was actually covered.\n\nEvidence connects observations to conclusions. A strong finding describes the affected asset, prerequisites, expected control, observed failure, and demonstrated consequence. Supporting material may include redacted request-and-response pairs, relevant log entries, screenshots, or a minimal proof of concept. Evidence should be sufficiently precise for reproduction without unnecessarily preserving sensitive data or creating a readily reusable intrusion package. Distinguishing observation from inference is essential: reading one designated file establishes that access, while claiming control over every system requires additional evidence.\n\nSeverity ratings provide a prioritization language, but they are not substitutes for context. The Common Vulnerability Scoring System expresses technical severity through defined metrics; version 3.1 was published in 2019 and version 4.0 in 2023. A score is not a direct measurement of an organization’s expected financial loss. Asset value, exposure, compensating controls, and the feasibility of an attack path affect practical risk. Reports often distinguish technical severity from business priority and state any assumptions behind the classification.\n\nA report generally contains an executive-level account of exposure, the engagement’s scope and limitations, technical findings, and remediation information. Related observations may be grouped under a common cause rather than counted as independent failures. Retesting records whether the original demonstration still succeeds, whether the underlying control has changed, and whether relevant variants remain possible. Fixing a single affected endpoint may leave an authorization defect in equivalent endpoints. Conversely, a broad architectural correction can resolve many instances at once. The quality of the result depends less on the number of findings than on their validity, clarity, and usefulness in establishing which security boundaries failed."
    },
    {
      "heading": "Standards, assurance limits, and integration into security programs",
      "text": "Several established publications provide structures for security testing without prescribing one universal procedure. The US National Institute of Standards and Technology published Special Publication 800-115, Technical Guide to Information Security Testing and Assessment, in September 2008. It describes planning, conducting, and analyzing technical assessments, including penetration testing. The OWASP Web Security Testing Guide organizes application-focused testing topics, while the OWASP Application Security Verification Standard expresses security requirements that can inform test coverage. The OWASP Top 10 is an awareness document about major application risk categories, not a complete penetration-testing methodology.\n\nSome industry requirements explicitly incorporate penetration testing. The Payment Card Industry Data Security Standard, or PCI DSS, requires applicable entities to conduct defined internal and external penetration testing and to test relevant segmentation controls. PCI DSS version 4.0 was published in March 2022, followed by version 4.0.1 in June 2024. Its penetration-testing provisions include periodic testing and testing after significant infrastructure or application changes. A compliant engagement must address the applicable requirements and environment; merely commissioning a generic scan does not make it equivalent to a penetration test.\n\nThe assurance obtained from any assessment is bounded by time, scope, access, and system state. An assessor may discover a flaw late in an engagement and lack permission or time to investigate its full implications. An excluded identity provider may be central to the application’s security. A test environment may differ from production in permissions or integrations. These limitations affect interpretation even when the work is technically sound. “No exploitable findings” means no qualifying exploit was demonstrated under the assessment conditions, not that the system has been proved secure.\n\nReproducibility and representativeness are further challenges. Software deployments, access rights, and cloud resources can change during or immediately after testing. Defensive teams may recognize an assessor’s activity more readily than an unfamiliar attacker’s, or testing restrictions may deliberately omit techniques that a real adversary would use. Conversely, supplied credentials and architecture information can give testers advantages that a particular attacker would not initially possess. Neither arrangement is inherently misleading if the starting assumptions and resulting claims are explicit.\n\nPenetration testing is therefore integrated with other forms of assurance rather than treated as their replacement. Formal verification can establish selected properties under explicit models; code review, dependency analysis, configuration checks, and operational monitoring address other failure modes. Testing within continuous delivery can provide frequent feedback, while periodic specialist assessments examine deeper interactions and changed attack paths. Findings can also inform security awareness, architectural requirements, and detection engineering. In mature programs, recurring defects are traced to common causes—such as inconsistent authorization design or unmanaged service identities—so that remediation addresses the process producing the weakness, not only the individual instance exposed during a test."
    }
  ],
  "links": [
    "cybersecurity",
    "security-vulnerability",
    "internet",
    "software-engineering",
    "denial-of-service-attack",
    "data-privacy",
    "social-engineering",
    "phishing",
    "source-code",
    "router",
    "domain-name-system",
    "operating-system",
    "linux",
    "microsoft-windows",
    "multifactor-authentication",
    "encryption",
    "world-wide-web",
    "web-browser",
    "authentication",
    "application-programming-interface",
    "http-cookie",
    "cloud-computing",
    "metadata",
    "virtualization",
    "virtual-machine",
    "smartphone",
    "large-language-model",
    "prompt-injection",
    "ai-agent",
    "common-vulnerability-scoring-system",
    "formal-verification"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}