Penetration Testing and Ethical Hacking

Chapter 7
Network, Service, and Endpoint Security Testing

Diploma in Cyber security
Penetration Testing and Ethical Hacking   •   Diploma

Network, Service, and Endpoint Security Testing

Introduction

Network and endpoint security testing examines whether an organisation’s infrastructure can resist unauthorised access, misuse, disruption, and data loss. It extends beyond identifying open ports. A professional assessment considers how network architecture, exposed services, operating-system settings, endpoint controls, remote-access technologies, patching practices, authentication mechanisms, and administrative interfaces combine to create or reduce risk.

The purpose of testing is not to damage systems or obtain information for its own sake. It is to provide authorised, evidence-based assurance about security controls and to help an organisation prioritise corrective action. Testing must therefore be planned, proportionate, reproducible, and governed by written authorisation.

A useful security-testing model is:

  1. Identify the authorised scope and rules of engagement.
  2. Discover assets and services without exceeding agreed limits.
  3. Validate security conditions using the least intrusive suitable method.
  4. Assess business impact and exploitability.
  5. Report evidence, risk, and remediation.
  6. Retest corrections and close the assessment cycle.

Learning Objectives

By the end of this chapter, a learner should be able to:

  • explain the relationship between network exposure, services, endpoints, and security risk;
  • plan an authorised network and endpoint assessment;
  • evaluate common network services and exposed administration interfaces;
  • assess operating-system configuration, patching, segmentation, and remote access;
  • review endpoint protection and password-security controls;
  • distinguish vulnerability evidence from confirmed business impact;
  • document findings professionally and recommend proportionate controls; and
  • recognise ethical, legal, safety, and operational limitations of testing.

1. The Scope of Network and Endpoint Testing

A network is a collection of connected systems and communication paths. A service is a software function made available through a protocol, commonly using a network port. An endpoint is a device that participates in the environment, such as a workstation, server, laptop, virtual machine, mobile device, or specialised appliance.

Security testing should consider four related layers:

LayerTypical questionsExamples of evidence
Network architectureCan users or systems reach assets they do not need?VLANs, firewall rules, routes, trust zones
ServicesAre unnecessary or weakly configured services exposed?Service inventory, protocol versions, access controls
Operating systemIs the host securely configured and maintained?Patch status, local policies, logging, hardening settings
Endpoint controlsCan malware, stolen credentials, or unauthorised devices operate?EDR status, disk encryption, application control

Testing is often divided into external testing, which examines internet-facing assets, and internal testing, which examines systems reachable from an internal network or a defined user position. A third category, assumed-breach testing, begins with a controlled foothold or ordinary user account and evaluates containment. Each approach answers different questions and must not be treated as interchangeable.

Rules of Engagement

Before testing begins, written approval should identify:

  • the legal entity authorising the work;
  • IP ranges, domains, cloud accounts, applications, and devices in scope;
  • excluded systems and sensitive operations;
  • permitted test times and maintenance windows;
  • allowed techniques and prohibited actions;
  • source addresses used by testers;
  • emergency contacts and stop conditions;
  • data-handling, retention, and destruction requirements; and
  • reporting and retesting arrangements.

A scan of an address range is not automatically authorised merely because the range is owned by the organisation. Cloud providers, internet service providers, managed service providers, and third parties may require separate approval.

2. A Methodical Assessment Process

2.1 Asset Discovery and Classification

The quality of a security assessment depends on knowing what exists. Asset discovery may use approved inventories, configuration-management databases, cloud consoles, DNS records, firewall rules, endpoint-management platforms, and carefully controlled network observation. Discovery should record ownership, business function, location, operating system, sensitivity, availability requirements, and support contact.

An asset that is not known cannot be patched, monitored, or included reliably in risk decisions. Conversely, an unverified asset record can cause testers to scan an abandoned or third-party system. Discovery therefore requires validation with system owners.

2.2 Service Enumeration

Service enumeration identifies listening ports, protocols, software products, versions, certificates, authentication methods, and administrative interfaces. The objective is not simply to produce a long port list; it is to determine whether each service is necessary, appropriately restricted, securely configured, and maintained.

Common examples include:

  • web services using HTTP or HTTPS;
  • secure remote administration such as SSH or remote desktop services;
  • file-sharing services such as SMB or SFTP;
  • directory and authentication services such as LDAP, Kerberos, and RADIUS;
  • database services;
  • email services;
  • DNS and network-management services; and
  • virtualisation, storage, backup, and cloud-management interfaces.

Service identification should be validated because banners may be hidden, altered, or inaccurate. A reported product version is an indicator, not conclusive proof of vulnerability.

2.3 Validation Rather Than Assumption

A professional tester confirms findings using safe evidence. For example, a suspected obsolete service may be validated through a package inventory, authenticated configuration review, vendor-supported version check, or maintenance record. A suspected weak cipher may be confirmed through a controlled protocol negotiation test. A suspected missing patch should be checked against the host’s update records and the vendor’s advisory.

Testing should avoid destructive proof when non-destructive evidence is sufficient. Demonstrating that a database can be accessed with an unauthorised account is usually enough; altering or extracting production data is not justified merely to make a report more dramatic.

3. Assessing Common Network Services

Web Services

Web-facing services should be assessed for secure transport, authentication, authorisation, session management, patching, administrative exposure, and information disclosure. Important checks include:

  • whether sensitive traffic is protected by current TLS configurations;
  • whether insecure HTTP access is redirected or rejected where appropriate;
  • whether certificates are valid, correctly scoped, and monitored for expiry;
  • whether administrative paths are restricted by network location and strong authentication;
  • whether default pages, diagnostic interfaces, backups, and directory listings are exposed; and
  • whether server headers reveal unnecessary implementation details.

A web service may be technically available but still appropriately protected. Availability alone is not a vulnerability.

File and Printer Services

File-sharing services require particular attention because they often expose confidential information and support lateral movement. Assessment should examine share permissions, anonymous access, guest accounts, legacy protocols, signing or encryption settings, service-account privileges, and logging. Access should be tested with accounts representing realistic user roles rather than only a highly privileged account.

The principle of least privilege requires that users receive only the access necessary for their role. Both share-level and file-system permissions must be considered because the effective permission may be the more restrictive or, depending on the platform, the interaction may be complex.

Remote Administration Services

Remote administration interfaces include SSH, remote desktop, web consoles, hypervisor management, network-device management, and cloud control planes. These interfaces are high-value targets because compromise can provide broad control.

A review should examine:

  • network restriction to management zones or approved jump hosts;
  • multi-factor authentication;
  • strong cryptographic settings;
  • named accounts rather than shared administrator accounts;
  • privileged-access management and just-in-time access;
  • session recording or command logging where appropriate;
  • lockout and rate-limiting controls;
  • administrative service exposure to the public internet; and
  • emergency access procedures.

Management interfaces should not be exposed publicly unless there is a compelling, documented requirement and strong compensating controls.

Directory, DNS, and Authentication Services

Directory services frequently support identity, access control, and device management. Testing should examine anonymous queries, excessive group membership, stale accounts, weak delegation, insecure protocol use, and separation between ordinary and administrative identities.

DNS should be assessed for unauthorised zone transfers, inappropriate recursion, misleading records, and exposure of internal naming information. Testing must be careful because DNS changes can disrupt availability. Configuration review and controlled queries are preferable to unapproved modifications.

4. Operating-System Configuration and Patching

Secure Configuration

Operating-system hardening reduces attack surface and limits the consequences of compromise. Relevant controls include:

  • removal or disabling of unnecessary services;
  • secure local and domain password policies;
  • restriction of administrator privileges;
  • host-based firewall configuration;
  • secure remote logging;
  • time synchronisation;
  • protected boot and firmware settings;
  • application allow-listing where feasible;
  • endpoint detection and response;
  • secure file and registry permissions; and
  • encryption of sensitive storage.

Hardening must be balanced against operational requirements. Disabling a service without understanding dependencies can cause outages. A secure baseline should therefore be documented, tested, version-controlled, and approved by system owners.

Patch Management

Patch assessment considers more than whether an update exists. It should examine asset coverage, severity-based prioritisation, testing, deployment speed, exceptions, verification, and unsupported software.

A practical patch lifecycle is:

  1. identify affected assets and software;
  2. determine applicability and exposure;
  3. prioritise according to severity, exploitability, asset importance, and exposure;
  4. test the update;
  5. deploy through managed processes;
  6. verify installation; and
  7. document exceptions with an expiry date and compensating controls.

A vulnerability identifier or severity score does not automatically determine business risk. A moderately scored issue on an internet-facing identity server may deserve greater urgency than a high-scored issue on an isolated test system. Risk decisions should combine technical and business context.

Unsupported Systems

An unsupported operating system no longer receives ordinary security updates from its vendor. Compensating controls may include isolation, application restriction, virtual patching, enhanced monitoring, and restricted administrative access. These controls reduce risk but do not make the system equivalent to a supported platform. Replacement or upgrade should remain the strategic objective.

5. Network Segmentation and Trust Boundaries

Segmentation separates systems into zones with controlled communication paths. Examples include internet-facing, user, server, development, guest, operational-technology, backup, and management zones.

Segmentation should be assessed from realistic starting positions. A tester may be provided with an ordinary workstation, a guest-network connection, or a controlled user account. The assessment asks whether the starting position can reach systems beyond its business need and whether firewall rules enforce the intended trust boundary.

A segmentation review should compare:

  • documented architecture with observed routes;
  • intended policy with actual firewall rules;
  • user access with role requirements;
  • management paths with approved administration sources; and
  • backup and recovery networks with production access.

Segmentation is not equivalent to merely using VLANs. A VLAN without correctly configured routing and filtering may provide little isolation. Similarly, a firewall rule that allows broad access to an entire address range may undermine a carefully designed zone model.

Layered network segmentation and controlled access InternetUntrusted zone PerimeterFirewall / proxy User zoneWorkstations Server zoneCritical services ManagementJump host / PAM Each arrow represents an explicitly authorised communication path
Layered network segmentation showing internet, user, server, and management zones
Figure: Layered network segmentation showing internet, user, server, and management zones

Figure: Segmentation creates controlled trust boundaries; it is effective only when communication paths are explicitly restricted and monitored.

6. Endpoint Security Controls

Endpoint testing evaluates whether devices can be managed, monitored, and protected consistently. Important controls include:

  • centrally managed anti-malware or EDR;
  • current signatures and sensor health;
  • host firewall enforcement;
  • disk encryption and secure key recovery;
  • secure configuration baselines;
  • removal of local administrator rights;
  • control of removable media;
  • application and script restrictions;
  • automatic screen locking;
  • secure backup and recovery; and
  • central collection of security events.

Testing should include control health, not merely control presence. An EDR agent may be installed but inactive, outdated, excluded from critical directories, or unable to communicate with its management platform. Evidence should include status records, policy configuration, representative endpoint checks, and alert-handling procedures.

Endpoint testing also examines resilience against stolen credentials. A device with encrypted storage, strong boot protection, limited privilege, and rapid revocation procedures presents a substantially smaller risk than an unmanaged device with cached administrator credentials.

7. Password and Authentication Security

Password-security testing must be carefully authorised because password guessing can lock accounts, generate alerts, or affect availability. The preferred approach is configuration review and controlled validation using test accounts or approved password-audit processes.

Important controls include:

  • minimum length and appropriate composition guidance;
  • screening against common and compromised passwords;
  • multi-factor authentication for privileged and remote access;
  • protection against online guessing through throttling or risk-based controls;
  • secure password storage using approved salted, adaptive password hashing;
  • elimination of default and shared credentials;
  • secure recovery and reset procedures;
  • prevention of unnecessary password reuse; and
  • prompt disabling of leavers and dormant accounts.

Length is generally more valuable than arbitrary complexity rules, but organisational policy must reflect system capability and risk. Password controls should be assessed together with multi-factor authentication, privilege management, monitoring, and recovery processes.

A password audit must never involve collecting unnecessary plaintext passwords. If an approved audit requires password-verifier analysis, access must be limited, encrypted, logged, and destroyed according to the rules of engagement.

8. Risk Interpretation and Reporting

A finding should be supported by four elements:

  1. Condition: what was observed.
  2. Evidence: how it was verified.
  3. Consequence: what could happen and to which assets.
  4. Recommendation: what should be changed and how improvement can be verified.

A useful risk model is qualitative rather than falsely precise. A finding may be rated by considering likelihood, impact, exposure, exploitability, affected assets, and existing controls. If a numerical model is used, the organisation must define its scale consistently. For example, a simple qualitative matrix may classify risk as high when both likelihood and impact are high, but the matrix should not be presented as an objective measurement of loss.

Reports should distinguish:

  • an exposed service from a vulnerable service;
  • a vulnerability from an exploit demonstration;
  • a technical weakness from confirmed compromise; and
  • a recommended improvement from a mandatory compliance requirement.

Reports should avoid publishing sensitive credentials, personal data, or exploit material that is unnecessary for remediation. Findings should be prioritised so that system owners can act rather than merely receive an inventory of problems.

9. Illustrative Case Study: Northbridge Health Services

Background

Northbridge Health Services is an illustrative organisation operating clinics, a central data centre, and a remote-work programme. An authorised internal assessment begins from a standard employee workstation. The engagement excludes medical-production changes, denial-of-service testing, and access to patient records.

Problem

Management believes that network segmentation and endpoint protection prevent ordinary workstations from reaching critical systems. The organisation also wants assurance that remote administration is restricted and that patch exceptions are controlled.

Analysis

The assessment identifies four conditions:

  • a legacy file-sharing service is reachable from the user network;
  • a server-management console accepts connections from a broad internal subnet rather than only from the management zone;
  • several laptops report healthy endpoint agents, but a number have not checked in for more than thirty days; and
  • an unsupported server is covered by a documented exception, but the exception has no expiry date or named owner.

No patient data is accessed. The file-sharing condition is validated using a test account with limited permissions. The management-console condition is confirmed through firewall-rule review and a controlled connection attempt. Endpoint status is verified against the management platform.

Approach and Solution

The organisation takes the following actions:

  1. restricts file-sharing traffic to approved application paths and disables the legacy protocol where dependencies permit;
  2. limits management-console access to the management network and requires multi-factor authentication;
  3. quarantines or remediates endpoints that have stopped reporting;
  4. replaces the unsupported server and records a time-bound interim exception; and
  5. creates a monthly review of segmentation rules, patch exceptions, and endpoint health.

Outcome

A retest confirms that ordinary workstations can no longer reach the management console and that the legacy protocol is unavailable from the user zone. Previously inactive endpoint agents are restored or the devices are removed from trusted access. The organisation now has owners and deadlines for remaining exceptions.

Learning Points

The case demonstrates that security is a system property. A healthy endpoint agent does not compensate for broad management access, and a segmented architecture does not compensate for unmanaged endpoints. Evidence from configuration, controlled validation, and operational records is stronger than assumptions based on design diagrams alone.

10. Challenges, Limitations, and Professional Practice

Testing can produce incomplete results. Asset inventories may be inaccurate, network monitoring may block probes, virtual systems may change rapidly, and vulnerability scanners may generate false positives or false negatives. Authenticated testing usually provides better configuration evidence than unauthenticated testing, but it also requires careful credential protection.

Cloud and hybrid environments create additional complications. Responsibility may be divided between the cloud provider, the customer, and managed service partners. A tester must understand the shared-responsibility model and obtain provider approval where required.

Testing can also disrupt systems. Rate limits, maintenance windows, safe test accounts, backup verification, and stop conditions reduce operational risk. When an assessment identifies an actively exploitable weakness, the tester should follow the escalation procedure rather than independently expanding access.

Ethically, testers must preserve confidentiality, integrity, and availability. They should collect the minimum data necessary, avoid curiosity-driven access, protect evidence, disclose findings only to authorised recipients, and report uncertainty honestly. Legally, unauthorised scanning or credential testing may constitute unlawful access even when the tester believes the activity is educational or harmless.

11. Contemporary Developments

Modern environments increasingly use zero-trust principles, identity-aware access, cloud management planes, software-defined networks, and continuous endpoint telemetry. These developments change testing priorities. The question is less often “Is the device inside the network?” and more often “Is this identity, device, application, and transaction authorised for this resource at this time?”

Automation and artificial intelligence can assist with asset correlation, anomaly detection, configuration comparison, and report drafting. However, automated conclusions require human validation. AI may misidentify a service, misunderstand a compensating control, or expose sensitive assessment data if used with an unapproved platform. Organisations should define data-handling rules, require review of generated output, and retain accountability with qualified professionals.

Best-Practice Checklist

A diploma-level practitioner should be able to apply the following checklist:

  • obtain written authorisation and define scope;
  • establish safe testing windows, contacts, and stop conditions;
  • build and validate an asset and service inventory;
  • assess exposed services and management interfaces;
  • review segmentation from realistic user positions;
  • verify patching, unsupported systems, and exception governance;
  • evaluate endpoint protection health rather than installation alone;
  • review password, multi-factor, privilege, and account-lifecycle controls;
  • collect minimal, reproducible evidence;
  • rate findings using technical and business context;
  • protect assessment data; and
  • retest remediation and record residual risk.

Chapter Summary

Network, service, and endpoint security testing provides assurance about whether infrastructure is exposed, appropriately configured, maintained, monitored, and resilient. Effective work begins with authorisation and scope, continues through asset discovery and safe service validation, and ends with evidence-based reporting and retesting.

The chapter examined common services, remote administration, operating-system hardening, patch management, unsupported systems, segmentation, endpoint controls, and password security. It emphasised that service exposure is not automatically a vulnerability, that scanner output requires validation, and that risk depends on business context as well as technical severity. The illustrative case showed how broad management access, inactive endpoint agents, legacy protocols, and unmanaged patch exceptions can combine to undermine an otherwise sound architecture.

Professional testing is constrained by law, ethics, safety, privacy, and operational continuity. Its value lies not in the number of findings but in the accuracy of evidence, clarity of recommendations, and measurable reduction of risk.

Key Terms

Asset: A device, service, data store, account, or other resource requiring protection.

Attack surface: The collection of reachable conditions through which a system might be attacked.

Endpoint: A device that connects to or participates in a network.

Enumeration: The systematic identification of services, protocols, versions, and configuration details.

External assessment: Testing conducted from outside an organisation’s trusted environment.

Hardening: Reducing unnecessary functionality and applying secure configuration settings.

Least privilege: Providing only the access required to perform an authorised task.

Management interface: A service used to administer a device, application, platform, or cloud resource.

Multi-factor authentication: Authentication requiring two or more independent factor types.

Patch exception: A formally approved temporary decision not to apply an available update.

Penetration test: An authorised assessment that evaluates security by simulating defined attack behaviours.

Remote administration: Management of a system from a separate device or network location.

Risk: The potential for harm arising from the likelihood and impact of a threat exploiting a weakness.

Segmentation: Dividing a network into controlled zones with restricted communication paths.

Service: A software function made available locally or over a network.

Surface validation: Confirming a suspected security condition using reliable, authorised evidence.

Trust boundary: A point where access assumptions or security controls change.

Vulnerability: A weakness that can contribute to unauthorised access, misuse, disruption, or disclosure.

Review Questions

Short Answer Questions

  1. Why is written authorisation essential before network security testing?
  2. What is the difference between a service being exposed and a service being vulnerable?
  3. Identify four controls that should be reviewed for remote administration.
  4. Why should patch exceptions have owners and expiry dates?
  5. Why is an installed endpoint agent not sufficient evidence of endpoint protection?

Long Answer Questions

  1. Explain a complete process for assessing network services from scope definition through retesting.
  2. Discuss how segmentation, least privilege, and management-zone controls reduce lateral movement.
  3. Compare external, internal, and assumed-breach assessments, including the different questions each answers.
  4. Explain how patching, unsupported systems, and compensating controls should be governed.
  5. Describe the ethical, legal, privacy, and operational responsibilities of a penetration tester.

Analytical / Application Questions

  1. An organisation has a firewall separating its user and server networks, but all user devices can connect to every server port. Analyse the security weakness and propose a safer testing and remediation approach.
  2. A vulnerability scanner reports that a server is running an obsolete web-service version, but the system owner states that vendor backports are installed. What evidence should the tester collect, and how should the finding be reported?
  3. During an authorised assessment, a tester discovers that an endpoint agent is inactive and that the device has local administrator rights. Analyse the combined risk and recommend immediate and longer-term controls.

Multiple Choice Questions with Answers

Question 1

Which activity should occur before conducting an authorised network scan?

A. Collecting production passwords

B. Defining written scope and rules of engagement

C. Disabling endpoint protection

D. Changing firewall rules without approval

Correct Answer: B. Defining written scope and rules of engagement

Question 2

Which statement best describes service enumeration?

A. Destroying unnecessary services

B. Identifying available services, protocols, and related details

C. Guessing all user passwords

D. Replacing an operating system

Correct Answer: B. Identifying available services, protocols, and related details

Question 3

Which control most directly reduces exposure of a remote administration interface?

A. Publishing it on the public internet

B. Allowing access from every internal subnet

C. Restricting it to an approved management zone

D. Using a shared administrator account

Correct Answer: C. Restricting it to an approved management zone

Question 4

Why should scanner findings be validated?

A. Scanners never identify real weaknesses

B. A reported version or condition may be inaccurate or misleading

C. Validation removes the need for authorisation

D. Validation guarantees exploitation

Correct Answer: B. A reported version or condition may be inaccurate or misleading

Question 5

Which statement about network segmentation is correct?

A. A VLAN automatically guarantees isolation

B. Segmentation requires controlled communication paths and effective filtering

C. Segmentation eliminates the need for endpoint security

D. Segmentation means every user can access every server

Correct Answer: B. Segmentation requires controlled communication paths and effective filtering

Question 6

Which is an appropriate approach to password-security testing?

A. Publishing discovered passwords in the report

B. Guessing passwords against production accounts without approval

C. Reviewing configuration and using approved test accounts or audit procedures

D. Disabling multi-factor authentication during testing

Correct Answer: C. Reviewing configuration and using approved test accounts or audit procedures

Question 7

What is the principal purpose of a patch exception?

A. To permanently avoid all security updates

B. To document a temporary, governed decision not to apply an update

C. To hide unsupported systems from management

D. To replace vulnerability verification

Correct Answer: B. To document a temporary, governed decision not to apply an update

Question 8

Which evidence best demonstrates endpoint-control health?

A. A product logo on the desktop

B. An installed but inactive agent

C. Current management status, policy compliance, and recent reporting

D. A user’s belief that protection is enabled

Correct Answer: C. Current management status, policy compliance, and recent reporting

Question 9

Which item belongs in a professional security finding?

A. A dramatic claim without evidence

B. Condition, evidence, consequence, and recommendation

C. Unnecessary confidential data

D. A guarantee that no other risk exists

Correct Answer: B. Condition, evidence, consequence, and recommendation

Question 10

What should a tester do after discovering a potentially disruptive weakness during an authorised test?

A. Continue testing indefinitely

B. Follow the agreed escalation and stop-condition procedure

C. Delete the affected system

D. Share the result publicly first

Correct Answer: B. Follow the agreed escalation and stop-condition procedure

Penetration Testing and Ethical Hacking
Chapter 7 of 15