Study guide

21.2 Cleanup, Restoration, and Artifact Preservation

CompTIA PenTest+ PT0-003

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 Current PT0-003 Exam Facts 1.2 Format, PBQs, Scoring, and Retake Policy 1.3 Recertification, CEUs, and Career Fit

2 Pre-Engagement Planning

2.1 Scope, Rules of Engagement, and Agreements 2.2 Target Selection and Assessment Types 2.3 Shared Responsibility, Legal Authorization, and Ethics

3 Collaboration, Frameworks, and Threat Modeling

3.1 Collaboration, Escalation, and Stakeholder Communication 3.2 Testing Frameworks and Methodologies 3.3 Threat Modeling: STRIDE, DREAD, and OCTAVE

4 Reporting and Remediation

4.1 Penetration Test Report Components 4.2 Findings Analysis and Remediation Recommendations

5 Information Gathering

5.1 Active vs Passive Reconnaissance 5.2 OSINT Sources and Techniques 5.3 DNS, Certificate Transparency, and Search Engine Enumeration 5.4 Network Recon, Protocol Scanning, Sniffing, and Banner Grabbing

6 Enumeration Techniques

6.1 OS Fingerprinting, Service Discovery, and Host Discovery 6.2 DNS, Directory, Share, and Account Enumeration 6.3 Secrets, Permissions, and Wireless Enumeration 6.4 WAF Enumeration, Web Crawling, and Attack Path Mapping

7 Recon Scripting and Tools

7.1 Modifying Bash, Python, and PowerShell for Recon 7.2 Recon and Enumeration Tools

8 Vulnerability Scan Types

8.1 Network, Host, Authenticated, and Wireless Scans 8.2 SAST, DAST, IAST, SCA, IaC, and Mobile Scans 8.3 Container, Secrets, and ICS Vulnerability Assessment 8.4 Core Vulnerability Scanners (Nessus, OpenVAS, Nikto)

9 Scan Analysis and Physical Security

9.1 Specialized Discovery Tools 9.2 Validating Scan, Recon, and Enumeration Results 9.3 Public Exploit Selection and Scripted Validation 9.4 Physical Security Concepts for PenTests

10 Attack Prioritization and Preparation

10.1 Target Prioritization: CVSS, CVE, CWE, and EPSS 10.2 Exploit Selection, Customization, and Attack Documentation

11 Network Attacks

11.1 On-Path, VLAN Hopping, Relay, and Multihomed Hosts 11.2 Default Credentials, Misconfigured Services, Packet Crafting, and Certificate Services

12 Authentication Attacks

12.1 Pass-the-Hash, Pass-the-Ticket, Pass-the-Token, and Kerberos Attacks 12.2 Password Attacks, MFA Fatigue, LDAP Injection, OIDC, and SAML

13 Host-Based Attacks

13.1 Privilege Escalation and Credential Dumping 13.2 Process Injection, Security Bypass, and Host Attack Tools

14 Web Application Attacks

14.1 SQL, Command, XSS, and SSTI Injection 14.2 CSRF, SSRF, Deserialization, IDOR, and Directory Traversal 14.3 LFI/RFI, Web Shells, API Abuse, JWT, and Session Hijacking

15 Cloud Attacks

15.1 IAM Misconfiguration, Metadata Service, and Exposed Storage 15.2 Container Escape, Supply Chain, and Cloud Attack Tools

16 Wireless and Social Engineering

16.1 Wireless Attacks and Tools 16.2 Phishing, Spearphishing, Whaling, Vishing, and Smishing 16.3 Physical Social Engineering and SE Tools

17 Specialized Systems

17.1 Mobile Attacks and AI Prompt/Model Attacks 17.2 OT/ICS, NFC, RFID, and Bluetooth Attacks

18 Attack Scripting and BAS

18.1 PowerShell, Python, and Bash Attack Automation 18.2 Breach and Attack Simulation (Caldera, Infection Monkey, Atomic Red Team)

19 Persistence

19.1 Scheduled Tasks, Services, Accounts, and Shells 19.2 C2, Backdoors, Rootkits, and Security-Control Tampering

20 Lateral Movement

20.1 Pivoting, Relays, and Additional Credential Capture 20.2 Remote Services: SMB, RDP, WinRM, WMI, SSH, and Others 20.3 Lateral Movement Tools and LOLbins

21 Exfiltration and Cleanup

21.1 Staging and Exfiltration 21.2 Cleanup, Restoration, and Artifact Preservation

21.2 Cleanup, Restoration, and Artifact Preservation

Key Takeaways Explain This Topic AI

Cleanup is professional closeout, not anti-forensics against the client; preserve artifacts for the Chapter 4 report before you tear anything down.

Remove persistence, tester-created credentials, and tools that you added — not the customer's backup job, EDR console, or admin binaries they already owned.

Revert your configuration changes (firewall rules, registry, antivirus exclusions) from a change log; do not snapshot-wipe production to 'revert.'

Spin down tester infrastructure such as a C2 VPS and drop buckets; do not terminate the customer's servers.

Securely destroy client data you copied after the retention date; deleting the client's original logs is out-of-scope vandalism, while removing a web shell you uploaded is required.

Last updated: August 2026

Objective 5.4 is cleanup and restoration . This is professional closeout , not anti-forensics to hide from the client. You leave the network as authorized : your persistence, accounts, tools, and attack infrastructure gone; their systems returned to the agreed baseline; proof of what you did saved for the report. The destination of preserved artifacts is the penetration test report in Chapter 4 (objective 1.4). Screenshots, hashes, tester logs, and reproduction notes belong in detailed findings and the attack narrative , under the engagement's documentation specifications . They do not belong on a forgotten C2 disk six months later.

Cleanup is the inverse of Domain 5 work you already did. Persistence (5.1) taught how scheduled tasks, services, accounts, shells, and C2 landed. 5.4 is how that comes out . Staging and exfiltration (5.3) taught how a scoped sample left. 5.4 is how copies in tester custody die when the SoW says they should.

Preserve artifacts first

CompTIA lists preserve artifacts with the cleanup bullets, but the order is preserve before you tear the lab down. If you delete the web shell and then remember you never screenshotted the URL, the finding is a story without evidence. Capture, at minimum:

  • Screenshots of the foothold, the staged sample, and the successful scoped exfil
  • File hashes (SHA-256) of tools you dropped and of the sample you touched
  • Command history, proxy logs, and C2 session metadata from tester systems
  • Hostnames, IP addresses, account names, timestamps, and the change log of what you altered

Those artifacts feed Chapter 4. Then you clean.

Exam trap: reading "preserve artifacts" as "keep the payroll database on a laptop until next year's retest." Preserve proof . The client data you copied is later subject to secure data destruction . Trap two: wiping the C2 virtual private server (VPS) before you export the logs the attack narrative needs. Trap three: putting unredacted payment-card numbers or electronic protected health information in an appendix when a hash and a cropped screenshot already prove access (1.4 legal and ethical reporting).

Remove persistence mechanisms, tester-created credentials, and tools

Remove persistence mechanisms means removing what you installed : scheduled tasks and cron jobs, new services, registry Run keys, startup folders, web shells, reverse-shell callbacks, implants, tester browser extensions, and any security-control tampering you used to stay alive (5.1). Identification: "the tester's cron job still fires after the window." The answer is remove tester persistence. Trap: deleting the customer's nightly backup task because it "looked like persistence." You remove yours . Their legitimate tasks stay.

Remove tester-created credentials is every local user, domain account, API key, SSH key, certificate, service principal, and cloud IAM user you added . Delete or disable them. If you reset a password to get in, coordinate restoration with the client — do not lock production administrators as a cleanup surprise. Trap: leaving a "backup" local Administrator named pt-retest "in case we come back." That is an unauthorized account, not a courtesy. Trap two: disabling the CISO's real account because it is privileged. You did not create it.

Remove tools is binaries, scripts, packed archives, and staging directories you dropped on their hosts — C:\Temp\pt-tools , a Python dropper, a copied scanner build, the encrypted virtual disk you mounted. Delete those paths. Do not "clean" by removing cmd.exe or a Sysinternals binary the customer already owned because you used it as a living-off-the-land binary (5.2). Trap: uninstalling their endpoint-detection console. That is vandalism, not tool removal.

Spin down infrastructure and revert configuration changes

Spin down infrastructure is your attack platform: the C2 VPS, phishing redirectors still running, cloud buckets you used as drops, VPN jump boxes, lab DNS zones, and any cross-account resources you created for 5.3. Terminate the instances. Confirm the public IP addresses are gone. This is infrastructure you brought. Trap: terminating the customer's misconfigured jump host or their production compute because "spin down means virtual machines." Their estate is not your lab.

Revert configuration changes puts your edits back: firewall or security-group rules you opened, registry values you set, audit policy you lowered, antivirus or EDR exclusions you added, a hosts-file redirect, a service you started, an IIS handler you enabled for a shell. Keep a change log during the test so cleanup is a checklist. Identification: "testers added an any/any rule on the lab firewall to pivot." Cleanup removes that rule . Trap: "reverting" by reverting a production virtual machine to a week-old snapshot, wiping a week of their logs. Revert your edits. Do not roll the enterprise.

Secure data destruction — and what you must not destroy

Secure data destruction applies to client data in tester custody : the sample you copied, memory dumps, mailbox extracts, database snippets, and screenshots that hold more personal data than the report needs. After the report is accepted — or on the retention date in the SoW and documentation specifications — destroy tester copies with the method the engagement named: cryptographic wipe of the volume, shred of the encrypted archive, deletion of the cloud drop after you confirm you no longer need it. The nondisclosure agreement already said you do not keep trophies.

What you must not destroy: the client's original logs , EDR telemetry, backups, or security-information and event-management (SIEM) indexes. Deleting those is out-of-scope vandalism , not cleanup. PenTest+ cleanup is restore and disclose . The client is supposed to see what you did, in the Chapter 4 report, and their blue team is supposed to keep their evidence.

Worked contrast on the same IIS host:

You uploaded cmd.aspx . Required: screenshot and hash the shell first , then remove that web shell, revert the handler if you changed it, delete the tester local user, unmount and delete the virtual disk, shred the encrypted payroll sample on your laptop, and spin down the C2 VPS.

You do not purge C:\inetpub\logs , do not clear Security event logs, and do not wipe the SIEM. Those are their artifacts.

  • 5.4 action Applies to Does not apply to
  • Remove persistence Your task, service, web shell, Run key Their backup job
  • Revert configuration Rules, registry, antivirus exclusions you set Snapshotting production "to be sure"
  • Remove credentials Accounts and keys you created The CISO's real directory account
  • Remove tools Binaries and folders you dropped Their existing admin toolset
  • Spin down infrastructure Your C2 VPS, drop bucket, phishing host Their compute and on-premises servers
  • Preserve artifacts Screenshots, hashes, tester logs for Chapter 4 Keeping bulk personal data as a souvenir
  • Secure destruction Client data you copied, after retention Their original logs and backups

When you drill mixed 5.3 and 5.4 stems — which channel, what may leave, what you delete — use the free PenTest+ practice questions and ask whether the object is your implant or their evidence.

Closeout sequence the exam wants

Stop new testing at the window end.

Preserve artifacts (proof for the Chapter 4 report) first .

Remove persistence, tester-created credentials, and tools.

Revert configuration changes from your change log.

Spin down tester infrastructure (C2 VPS and drops).

Securely destroy client data in your possession per the SoW, once the working copy is no longer required for the report.

Do not skip step 2. Do not expand step 6 into their SIEM. Do not treat cleanup as hiding from the security operations center. Exfiltration (5.3) proved impact inside RoE. Cleanup (5.4) is how a professional engagement ends so the only lasting copy of the story is the report the client asked for.

Loading diagram... Preserve artifacts for the report, then remove only tester-owned residue