CCNA Security online course

Hacking Methodology: Attack Lifecycle and Defensive Countermeasures

Learn the defensive hacking methodology lifecycle: footprinting, scanning, enumeration, compromise, privilege escalation, persistence, concealment, and security controls.

Hacking methodology is a conceptual sequence of activities commonly associated with reconnaissance, targeting, compromise, expansion of access, persistence, and concealment. It helps security teams understand attacker behavior and place controls at several points in the attack lifecycle.

Real-world incidents do not always follow one fixed sequence. An attacker may return to an earlier phase, skip a phase, or perform several activities at the same time. The lifecycle is therefore a planning and analysis model, not a guaranteed script.

Attack Lifecycle Overview

A typical lifecycle progresses from information gathering toward technical discovery, unauthorized access, expanded control, concealment, and continued access. Intelligence gathered in one phase informs decisions in later phases. For example, public technology information may guide which exposed services defenders should review, while service details may reveal identity or configuration risks.

Phase: Footprinting

Primary objective: Build an initial picture of the organization and its public presence.

Information or outcome sought: Domains, personnel, technologies, public documentation, and exposed assets.

Defender visibility: Often limited when sources are public and interaction is passive.

Core controls: Attack-surface management, public exposure reviews, information-minimization policies, and asset inventories.

Phase: Scanning

Primary objective: Identify reachable hosts, ports, services, and technical characteristics.

Information or outcome sought: Active addresses, exposed services, probable platforms, and reachable facilities or systems.

Defender visibility: Firewall, IDS/IPS, endpoint, DNS, flow, and other network telemetry may record the activity.

Core controls: Firewall policy, segmentation, exposure validation, service reduction, and alerting.

Phase: Enumeration

Primary objective: Extract detailed information from discovered services.

Information or outcome sought: Users, shares, names, configurations, policies, versions, and directory details.

Defender visibility: Authentication, directory, service, and application logs can reveal unusual queries or access.

Core controls: Authentication, authorization, service hardening, restricted disclosure, and monitoring.

Phase: System compromise

Primary objective: Obtain unauthorized access to an account, application, device, or resource.

Information or outcome sought: An initial foothold.

Defender visibility: Vulnerability, endpoint, authentication, application, and network events may provide indicators.

Core controls: Patching, secure baselines, strong authentication, segmentation, and vulnerability remediation.

Phase: Privilege escalation and lateral movement

Primary objective: Gain greater permissions or reach additional systems.

Information or outcome sought: Administrative capability, sensitive resources, or broader network access.

Defender visibility: Privileged actions, credential use, process activity, and east-west traffic.

Core controls: Least privilege, credential protection, access reviews, segmentation, and privileged-access monitoring.

Phase: Backdoors and persistence

Primary objective: Maintain access over time or after a restart or change.

Information or outcome sought: A reliable unauthorized access mechanism.

Defender visibility: Startup, service, account, endpoint, and outbound-connection telemetry.

Core controls: Endpoint monitoring, application allowlisting, account auditing, egress controls, and eradication procedures.

Phase: Covering tracks

Primary objective: Conceal activity or reduce available evidence.

Information or outcome sought: Delayed detection and a more difficult investigation.

Defender visibility: Missing events, altered records, time inconsistencies, and log-integrity alerts.

Core controls: Centralized protected logging, synchronized clocks, immutable retention, audit trails, and incident response.

Defenders should not rely on a single perimeter device. A firewall may limit scanning, but identity controls can constrain compromise, endpoint monitoring can detect persistence, and centralized logs can preserve evidence if local records are altered.

Footprinting

Footprinting is preliminary information gathering about a target, often through passive or low-interaction sources. The objective is to identify an organization's public presence, technology clues, personnel information, and potentially exposed assets.

Representative sources include:

  • Domain-registration lookup information, commonly associated with WHOIS, subject to privacy controls.
  • Search-engine results and publicly indexed pages.
  • Public job postings that mention products, platforms, or operating environments.
  • Public documentation, support pages, presentations, and contact information.
  • Network-related records, including domain names and publicly available DNS information.
  • Technology fingerprints revealed by public applications, headers, certificates, or documentation.

Passive reconnaissance is information gathering designed to avoid or minimize direct interaction with the target. Minimizing interaction can reduce the chance of early detection, although public-source activity may still leave records with third-party providers.

Excessive public disclosure increases the attack surface: the collection of exposed systems, services, identities, information, and entry points that may be targeted. A defensive public-exposure review should identify unnecessary details and remove or restrict them where business needs allow.

Defensive example: public exposure review

A security team reviews its own domains, published contact information, recruitment postings, documentation, and externally visible technology references. It compares those findings with approved assets and removes disclosures that are not needed.

Scanning

Scanning uses gathered intelligence to identify reachable hosts, services, and likely points of exposure. Unlike passive footprinting, scanning commonly sends traffic to target systems and therefore creates greater defender visibility.

  • Host discovery: determining which addresses appear active. A ping sweep is one host-discovery activity intended to identify active addresses in a range.
  • Port and service discovery: determining which network ports appear reachable. A port scan is a network discovery activity used to identify exposed or reachable ports.
  • Operating-system identification: inferring a device's operating system or platform from observable characteristics.
  • Physical or environmental observation: reviewing publicly observable facilities, entrances, equipment locations, or environmental clues that may affect security.

Firewalls, IDS/IPS platforms, endpoint tools, flow records, DNS telemetry, and application logs may show scanning through repeated connection attempts, unusual source patterns, or access to services that are not normally used.

Defensive example: authorized external assessment

Within a documented scope and maintenance window, an organization validates which approved internet-facing services are reachable and compares the results with its asset inventory. Unexpected exposure is investigated rather than assumed to be authorized.

Enumeration

Enumeration is the detailed extraction of information from discovered systems and services. Scanning may identify that a service is available; enumeration examines what that service reveals, such as users, shares, names, configurations, policies, or directory data.

Service or protocol: SNMP

Examples of exposed information: Device names, interfaces, status, topology, or configuration details.

Defensive configuration goals: Restrict access to authorized management networks, use secure configurations, and avoid weak or default community settings.

Monitoring considerations: Alert on unexpected management queries and access from untrusted sources.

Service or protocol: LDAP

Examples of exposed information: Directory names, groups, attributes, and account-related details.

Defensive configuration goals: Require appropriate authentication and authorization and limit directory responses.

Monitoring considerations: Review unusual query volume, source systems, and access to sensitive attributes.

Service or protocol: UNIX/Linux services

Examples of exposed information: Service banners, shares, account names, or configuration clues.

Defensive configuration goals: Disable unnecessary services, harden permissions, and restrict administrative interfaces.

Monitoring considerations: Monitor service access, authentication failures, and unexpected administrative connections.

Service or protocol: NTP

Examples of exposed information: Time-service behavior, reachable peers, or network relationships.

Defensive configuration goals: Permit synchronization only from approved sources and maintain consistent time architecture.

Monitoring considerations: Investigate unexpected peers and time changes.

Service or protocol: SMTP

Examples of exposed information: Mail-server identity, recipient-validation behavior, or routing details.

Defensive configuration goals: Limit unnecessary disclosure and enforce mail-service authentication and relay restrictions.

Monitoring considerations: Review unusual connection patterns, authentication failures, and relay attempts.

Service or protocol: DNS

Examples of exposed information: Hostnames, records, namespaces, and infrastructure relationships.

Defensive configuration goals: Publish only required records and restrict internal data to authorized resolvers or users.

Monitoring considerations: Monitor abnormal query volume, zone-transfer requests, and unexpected sources.

DNS enumeration is the collection and analysis of domain-name information, such as names and records, to understand an organization's public namespace. Administrators should ensure that public DNS contains only information intended for public use.

System Compromise

System compromise is unauthorized access to or control over a system, account, application, or resource. At a conceptual level, compromise may result from vulnerable software, insecure configurations, weak authentication, exposed services, or social engineering.

Defensive priorities include:

  • Maintain a risk-based patch and vulnerability-management process.
  • Use secure configuration baselines and remove default or unnecessary functionality.
  • Enforce strong authentication, especially for remote and administrative access.
  • Segment networks so that one compromised system does not provide unrestricted access to others.
  • Remediate validated weaknesses and verify that fixes are effective.

Security teams should analyze compromise indicators without turning an assessment into an exploitation exercise. Authorized testing must define what systems may be tested, which techniques are permitted, how disruption will be avoided, and how findings will be reported.

Privilege Escalation and Lateral Movement

Privilege escalation means obtaining permissions beyond those originally granted to an account or process. Vertical escalation is movement from a standard user to an administrator or other higher-privileged identity. Lateral movement is using access to reach additional systems or accounts; it may occur without increasing privileges on the original host.

Least privilege means granting only the minimum access needed for authorized tasks. Credential protection, regular access reviews, timely patching, separation of administrative accounts, and privileged-access monitoring reduce the opportunity for escalation.

Detection example

An endpoint-monitoring alert identifies a standard account attempting an unusual privileged action. The security team verifies the user, source host, timing, and authorization; reviews related identity and endpoint events; and removes unsafe permissions if the action was not approved.

Backdoors and Persistence

A backdoor is an unauthorized mechanism that enables future access outside normal authentication or administration processes. Persistence is the capability to maintain unauthorized access over time or after a restart, credential change, or other system event.

Legitimate remote-administration software is not automatically a backdoor. The distinction depends on authorization, ownership, approved configuration, business purpose, and monitoring. An unapproved remote-access component, unexpected account, or unknown service requires investigation.

Defensive detection and response include:

  • Monitor endpoints for unexpected startup items, scheduled activity, services, and configuration changes.
  • Review accounts regularly and disable unused or unapproved identities.
  • Use application allowlisting where appropriate.
  • Monitor network egress and unexpected remote-access connections.
  • Isolate affected systems when malicious persistence is suspected.
  • Remove the unauthorized mechanism, remediate its root cause, reset affected credentials, and validate recovery.

Covering Tracks and Log Integrity

Covering tracks describes attempts to hide or manipulate evidence of unauthorized activity. This may include altering, deleting, or suppressing audit records. The loss of evidence delays detection, weakens confidence in timelines, and complicates investigation and recovery.

Log tampering is unauthorized alteration, deletion, or suppression of audit records. Defenders should centralize logs, protect log storage and permissions, synchronize clocks with NTP, retain audit trails for an appropriate period, and use immutable or access-controlled retention where feasible.

Alert on unexpected logging changes, stopped collection agents, missing event sequences, time shifts, and attempts to modify audit configuration. A local logging failure should not destroy the investigation record when centralized systems retain the original events.

Defensive example: audit-log integrity incident

A system reports missing local audit events while centralized logs retain the original records. Investigators compare both sources, preserve evidence, verify time synchronization and retention, and follow the incident-response process if tampering is plausible.

Footprinting, Scanning, and Enumeration Comparison

Activity: Footprinting

Direct interaction: None or minimal; often uses public or passive sources.

Typical output: Public domains, people, technologies, documentation, and possible assets.

Potential impact: Increased attacker understanding and a larger apparent attack surface.

Defensive response: Review public disclosures, maintain an external inventory, and remove unnecessary information.

Activity: Scanning

Direct interaction: Active traffic is commonly sent to hosts or services.

Typical output: Reachable hosts, ports, services, and probable platforms.

Potential impact: Identification of exposed or weakly controlled entry points.

Defensive response: Restrict exposure, monitor network telemetry, and compare approved services with observed exposure.

Activity: Enumeration

Direct interaction: Active interaction with identified services to obtain details.

Typical output: Users, shares, names, policies, configurations, and directory information.

Potential impact: Actionable intelligence for targeting identities, services, or resources.

Defensive response: Require authentication, restrict disclosure, harden services, and review service-access logs.

Risk and Countermeasure Definition

Risk analysis connects each phase to what could go wrong, what may be observable, and which controls are appropriate. Preventative controls reduce the likelihood of an event. Detective controls identify suspicious activity. Corrective controls contain the event, remove its cause, and restore trustworthy operation.

Phase: Compromise

Attacker objective: Obtain an initial foothold through a weakness or deceptive interaction.

Indicators: Exploit-related alerts, unusual authentication, unexpected process activity, or suspicious application behavior.

Preventative controls: Patching, hardened configurations, strong authentication, segmentation, and vulnerability remediation.

Detection and response: Endpoint and network monitoring, containment, credential resets, eradication, and recovery.

Phase: Privilege escalation

Attacker objective: Gain greater permissions or access to more systems.

Indicators: Unusual privileged actions, new administrator membership, abnormal credential use, or unexpected east-west traffic.

Preventative controls: Least privilege, access reviews, separate administrative identities, patching, and credential protection.

Detection and response: Privileged-access alerts, identity investigation, account restriction, and scope analysis.

Phase: Concealment

Attacker objective: Delay discovery or weaken the evidence trail.

Indicators: Missing events, altered records, disabled logging, or inconsistent timestamps.

Preventative controls: Centralized collection, protected storage, synchronized clocks, and restricted log administration.

Detection and response: Log-integrity alerts, evidence preservation, timeline reconstruction, and incident response.

Phase: Persistence

Attacker objective: Retain unauthorized access after changes or restarts.

Indicators: Unknown accounts, services, startup entries, remote-access tools, or unexpected outbound connections.

Preventative controls: Application allowlisting, account governance, egress controls, endpoint hardening, and change management.

Detection and response: Endpoint review, host isolation, eradication, credential rotation, and recurrence monitoring.

Security Guidelines and Operational Response

  • Maintain accurate inventories of hosts, services, software, identities, owners, and approved exposure.
  • Patch systems according to risk and remove unnecessary services, accounts, and network paths.
  • Use strong authentication and enforce least privilege for users, applications, and administrators.
  • Segment networks and restrict administrative access to approved paths and management networks.
  • Use secure management protocols and restrict SNMP access to authorized systems.
  • Limit directory, DNS, SMTP, and other service disclosures to authorized users and networks.
  • Centralize logs, protect retention, synchronize clocks, and monitor collection health.
  • Investigate suspicious account creation, permission changes, configuration changes, and privileged actions.
  • Maintain an incident-response process covering identification, containment, eradication, recovery, and lessons learned.
  • Use backups and recovery testing to reduce the impact of compromise and persistence.

Security policies define acceptable use, authorization boundaries, data-handling requirements, and escalation paths. Documentation records scope, ownership, approvals, test windows, expected results, and remediation decisions. Together, these controls make security assessments lawful, repeatable, and useful.

Troubleshooting Defensive Findings

Unexpected externally reachable service

Likely causes include an unapproved firewall rule, an untracked system, a default service, or incorrect network exposure. Confirm asset ownership and business purpose, compare the service with inventory and change records, restrict or remove unnecessary access, and review connection logs.

Excessive information returned by a network service

Default configuration, anonymous access, broad permissions, or unnecessary features may be responsible. Identify the disclosed data and its audience, then apply authentication, authorization, filtering, or service hardening. Reassess exposure after the change.

Unexpected privileged account activity

Possible causes include misconfigured permissions, compromised credentials, unapproved administration, or an escalation attempt. Validate the user, source host, timing, and authorization; review identity, endpoint, and network logs; and remove excessive privileges or rotate credentials when compromise is suspected.

Missing or altered local logs

Log rotation, storage failure, incorrect time settings, misconfiguration, or tampering may explain the problem. Compare local records with centralized logs, verify retention and access controls, check time synchronization, preserve evidence, and follow incident-response procedures.

Unknown remote-access software, service, or account

This may be unauthorized persistence, shadow IT, incomplete inventory, or a legitimate tool deployed without documentation. Confirm authorization and ownership. If malicious activity is suspected, isolate affected systems, review approved endpoint data, remove unauthorized access, remediate the root cause, and monitor for recurrence.

Exam-Relevant Notes

  • Footprinting is generally early information gathering and may be passive; scanning commonly sends traffic; enumeration extracts detailed information from discovered services.
  • A port scan identifies reachable ports, while enumeration seeks details such as users, shares, names, or configuration.
  • Privilege escalation is increased permission; lateral movement is access to additional systems or resources.
  • Least privilege limits the damage available to an account or process.
  • Centralized, protected logs and synchronized clocks support detection and investigation when local evidence is missing.
  • Persistence is continued unauthorized access; a backdoor is an unauthorized mechanism that enables such access.
  • Controls should interrupt the lifecycle at multiple points: reduce exposure, harden services, constrain identities, monitor endpoints and networks, and maintain response and recovery capabilities.

For related study, review basic security terms, risk and countermeasure definition, IT security guidelines, management-plane protection, control-plane protection, and AAA and access control.