IT Support & Help Desk Fundamentals Module 13 – Security and remote support
Remove malware and recover a PC or Mac
Follow a safe malware-removal procedure, clean browser hijacks, find persistence, decide when to reimage, and hand a device to the security team.
What you will learn
- Follow a safe malware-removal procedure from the first symptom to user education
- Identify browser hijacks, site-notification spam, rogue extensions and proxy changes and reverse each one
- Compare a device's start-up listing with a known-good one to find persistence entries
- Decide when to stop cleaning and reimage a PC or Mac
- Report a suspected infection to the security team and keep the evidence they will need
Before you start
What you’ll learn · Before you start
What you will learn
- Follow a safe malware-removal procedure from the first symptom to user education
- Identify browser hijacks, site-notification spam, rogue extensions and proxy changes and reverse each one
- Compare a device's start-up listing with a known-good one to find persistence entries
- Decide when to stop cleaning and reimage a PC or Mac
- Report a suspected infection to the security team and keep the evidence they will need
Before you start
On this page
A sample reception PC comes with three symptoms at once: the browser opens on a search page the user never set, the start-up list has a program nobody recognises, and the clock loses a few minutes a day. One of the three has an ordinary explanation and the others do not, so you cannot close the ticket with a quick scan and a reboot. The order of the next hour is the lesson: confirm what you see, isolate the device from the network, find what keeps bringing the infection back, clean a browser down to its home page and extensions, and recognise the moment to stop cleaning and reimage. The step that costs least and is skipped most is the note written as you go, which keeps the security team’s evidence instead of wiping it.
Confirm each symptom before the removal starts
CompTIA’s A+ Core 2 objective 3.4 lists the signs an infected PC often shows: desktop alerts and unwanted notifications, false alerts about antivirus protection, files that are missing, renamed or cannot be opened, failed operating-system updates and a network the PC cannot reach, and in the browser random pop-ups, certificate warnings, redirection and slow pages. Most of these can also be caused by something ordinary, so the first step of a removal is to tell the two apart on the ticket in front of you.
The reception PC in the opening shows three signs. Walk them through this table before touching anything:
| Symptom the user reports | An ordinary cause to rule out | A sign that points at malware |
|---|---|---|
| Pop-ups and extra tabs appear while browsing | A browser extension the user installed; a site whose notifications they accepted | New extensions nobody installed, pop-ups on the Windows desktop (not inside a browser), redirects from safe addresses |
| The home page or search engine has changed | A new browser version resetting the default; a work policy | Changes that come back after a reset, a search engine the user has never seen, extensions that will not uninstall |
| Programs run slowly, fans run hard | A disk nearly full; a background update; a sync that is catching up | High CPU use on a process without a window; the slowness survives a restart with no apps open |
| The clock loses a few minutes a day | A low CMOS battery on an old desktop; an NTP server unreachable | Rarely a sign on its own: fix the battery or the time service as a separate fault |
| Antivirus is off | A second antivirus installed; the user paused it | Antivirus turns itself off after you turn it on, with tamper protection enabled, and nothing explains it |
| The PC asks for a ransom to decrypt files | Nothing ordinary explains a ransom note | ransomware: Malware that encrypts the files on a device so they cannot be used, then demands a ransom for decryption. Many groups also steal the data first and threaten to publish it. More in “Restore files and recover data safely”: files renamed with an added extension, a text file in every folder, shadow copies deleted |
Three symptoms in a row that have no ordinary explanation count as a working theory of infection, and the removal starts. One symptom with an ordinary cause is fixed in that ordinary way first; the ticket then says that the user’s other complaints went with it, or did not. The troubleshooting method lesson’s rule still applies: ask what changed, test one thing at a time, and keep a reversible step before a destructive one.
A scan is not a diagnosis
Wrong: run a full scan on every PC that is “slow”. Right: confirm which symptoms have no ordinary cause and decide whether this ticket is a removal at all. A full scan on an uninfected PC costs hours and finds nothing.
Checkpoint
Check: Confirm each symptom before the removal starts
The order of removal keeps the fix short and the evidence intact
Objective 2.6 of the same CompTIA document gives the steps a technician follows for a known or suspected infection, and this track teaches them in the order below, in its own words, with one branch no other list draws clearly: the step where cleaning stops and reimage takes over. Isolate the device before scanning, because malware with network access can call home, download new parts and spread to other devices on the same subnet; a scan after isolation sees what is already there and nothing new.
The drawing shows the whole scene; its 10 steps are listed below.
Every step as text
- Verify. Three symptoms in a row that have no ordinary cause count as a working theory of infection. The ticket says what each is and when it started.
- Isolate. Pull the cable, turn Wi-Fi off in Settings and keep the PC on. The device cannot call home or reach other devices on the subnet, and memory is kept for the security team.
- Restore off. On Windows Home only, turn System Restore off so an infected system file inside a saved restore point is not brought back later. Turn it on again at the end.
- Scan. Update the security intelligence, then start the right scan. Defender Offline restarts the PC and scans from outside Windows, which is the next step when a quick scan finds the same thing twice.
- Trust gone?. A rootkit, a boot-sector change, ransomware or an unknown administrator account ends the cleaning here. The scan took the picture it needed; the reimage is the recovery.
- Clean persistence. Remove start-up entries, scheduled tasks, services, hosts-file lines and proxy changes the scans found. Autoruns lists every place Windows starts a program from in one view.
- Scan again. A second scan from clean intelligence confirms that nothing new appears after persistence has gone. If the same thing comes back and nothing outside the device explains it, cleaning stops and reimage starts.
- Reinfection?. A detection that returns within a day of a clean scan, with no new user action and no source outside the device, is the branch to reimage. The PC is not trusted again by trying one more scan.
- Restore on. Turn System Restore back on and create a fresh restore point from the clean device. The device now has one saved baseline nobody can roll back past.
- Educate. Close the ticket with a short note the user keeps: what they saw, what you did, and what to watch for next time. A sentence beats a form.
The small decisions along the way are the ones that get skipped and go wrong:
- Isolate the right way. Unplug the network cable, turn off Wi-Fi in Settings (not with the hardware switch, which many users have never used), and keep the PC powered on. A shutdown destroys evidence in memory the security team may want.
- Turn off System Restore: A Windows tool that rolls back system files and settings to an earlier restore point without touching personal files. It reaches back further than the 3 days of point-in-time restore. More in “Fix boot problems: WinRE, Safe Mode, Recovery” on Windows Home. The feature keeps snapshots of system files, called A saved copy of system files and settings that Windows System Restore can go back to; infected files inside one are restored with it, so System Restore is turned off during a cleanup., and an infected system file inside a restore point will come back if someone later rolls back to it. Turning the feature off deletes the stored restore points. Turn it back on at the end and create a fresh restore point.
- Scan with updated signatures. Microsoft Defender’s security intelligence is checked, and updated, in Windows Security’s Protection updates page; the windows security settings lesson shows how to read it. A scan with intelligence that is nine days old misses this week’s threats.
- Use the right scan. The windows-security-settings lesson teaches when a quick scan, a full scan, a custom scan or Microsoft Defender Offline scan: A Microsoft Defender scan that restarts the PC and runs from a trusted environment outside the normal Windows kernel, to find malware that hides from a running Windows. It takes about 15 minutes. More in “Windows Security: Defender, firewall, BitLocker” is the right one; this lesson reuses those rules and adds one: when a quick scan removes a threat and the same threat comes back a day later, the next scan is the offline one. Reboot into safe mode: A start that loads only a limited set of files and drivers, to show whether default settings and basic drivers cause a problem. Windows and macOS both have one, reached differently. More in “Fix boot problems: WinRE, Safe Mode, Recovery” for a scan whose findings a running Windows keeps protecting from removal.
- Reimage when in doubt. The next section lists the signs that make this the only safe choice. The branch to reimage is a step, not a failure of the technician’s effort.
- Educate the user. Close the ticket with a short note that names what the user saw, what to watch for next time and what to do if they see it. Threats users face is the lesson they can read.
Keep the evidence
Write down times and actions as they happen (the moment you isolated, each scan’s result and the file names it removed). Do not wipe or “clean up” the device before the security team decides it is a case for them. Deleting the Recycle Bin, the Downloads folder and the browser cache is a mistake many removals end on; it loses what an investigation needs. Security incidents, evidence and privacy duties is the lesson that goes further.
Checkpoint
Check: The order of removal
Persistence is what brings an infection back
Malware stays through a reboot by registering itself with the operating system in a way the user does not see: The ways malware arranges to run again after a reboot, a sign-in or a scan: start-up entries, scheduled tasks, services, a changed hosts file or proxy, login items, background items and configuration profiles.. Finding every place a device starts programs from is the difference between removal and reinfection the next morning. The places are short and the same on every Windows PC, and reading them against a A list of the start-up items, scheduled tasks, services and settings a healthy device of this fleet carries; new entries that are not on it are the ones a technician reads first. turns the question into pass or fail:
- Start-up items: programs set to run when the user signs in. Task Manager’s Startup apps tab is one view; the more complete one is Microsoft’s own Sysinternals A Microsoft Sysinternals tool that lists every place Windows starts a program from: Run keys, Startup folders, scheduled tasks, services, drivers, Explorer add-ons, codecs and more., which lists every registered start-up place.
- A Windows feature, managed in Task Scheduler, that runs a program when a time, an event or a sign-in matches a trigger; a common persistence trick is to add a task that runs a program every hour.:
Task Scheduler, read as the signed-in administrator. A task created by malware often runs every hour from a path
under the user’s
AppData\Local\Tempfolder. - Services:
services.msc. A service that starts automatically, runs under a system account and points at a random-looking name in a Users folder is a stop point. - The hosts file: A plain text file on a device whose entries win over every DNS lookup for the names they list. On Linux and macOS it is /etc/hosts; on Windows it is under System32\drivers\etc\hosts. More in “DNS for support: resolve, flush and fix names”:
C:\Windows\System32\drivers\etc\hosts. Changes here redirect well-known names (banking sites, antivirus update servers) to another address, which no browser setting then shows. - The proxy server: A server that sits between a device and the internet, forwarding requests and often caching or inspecting traffic. Browsers consult the system settings or a PAC file to find it. More in “VPNs, proxies, file shares and remote work”: Internet Options or Settings > Network & internet > Proxy. A proxy that was blank the day before means every page the user opens now travels through a server they do not own.
Autoruns beats the Startup tab
Task Manager’s Startup apps tab shows only the Run keys and Startup folders a user can edit. Autoruns reads every place Windows starts a program from (services, drivers, codecs, Explorer add-ons, Winlogon notifiers), so an entry the Startup tab cannot see is still a line of Autoruns.
On macOS the places are a little different: login item: An app, document, folder or server connection that opens when a user logs in, listed under Open at Login in System Settings, General, Login Items & Extensions. More in “macOS apps, Gatekeeper and software updates” and background item: Part of an app allowed to do work while the app is not open, such as checking for updates or syncing, listed under App Background Activity in Login Items & Extensions. More in “macOS apps, Gatekeeper and software updates” listed in System Settings > General > Login Items & Extensions, and configuration profile: A bundle of settings that a device management server sends to a device, such as Wi-Fi, VPN, mail accounts, certificates and restrictions. More in “MDM, BYOD and lost or stolen devices” listed in System Settings > General > Device Management. Apple’s “Protecting against malware in macOS” page describes Apple's built-in anti-malware component in macOS: it checks apps for known malicious content when they are first run or changed, and Apple updates its signatures without a system update. as the layer that compares launched apps with a signature list Apple maintains, and Gatekeeper: The macOS check that runs when downloaded software first opens: it must come from an identified developer, be notarised by Apple and be unaltered, and the user confirms the first open. More in “macOS apps, Gatekeeper and software updates” as the layer that checks their signatures and notarisation. The profiles list is where to look when a browser setting cannot be changed back: an organisation’s management server, or a rogue profile a user accepted, holds that setting.
The program below reads an invented start-up listing of a sample reception PC (its start-up entries, scheduled tasks, hosts-file lines and proxy setting; names and addresses are reserved for documentation) and compares each entry with a known-good baseline. Each finding is printed with the reason, so a technician pastes the six lines straight into the ticket. The second listing is the cleaned PC; it prints no finding.
"""Compare a device's start-up listing with a known-good baseline.
The listings in this file are invented for the lesson. The names and
addresses come from the reserved documentation ranges of RFC 2606
(example domains) and RFC 5737 (documentation IPv4 ranges), not from
any real malware or real website.
"""
TEMP_FOLDER_HINTS = (
r"\AppData\Local\Temp",
r"\Windows\Temp",
r"\AppData\Roaming\Temp",
"/tmp/",
"/var/folders/",
)
WELL_KNOWN_NAMES = {
"www.bank.example.com",
"update.microsoft.com",
"download.windowsupdate.com",
"www.example.com",
}
def path_of(entry):
"""Return the path or trigger string of an entry, or an empty string."""
return entry.get("path") or entry.get("trigger") or ""
def suspicious_entries(listing, baseline):
"""Return the suspicious entries of one listing against the baseline.
Order of findings:
1. an entry missing from the baseline (start-up and scheduled tasks),
2. a program in a user-writable temporary folder,
3. a hosts line that redirects a well-known name elsewhere,
4. a proxy where the baseline has none.
"""
out = []
seen = ("startup", "scheduled_tasks")
for group in seen:
baseline_names = {entry["name"] for entry in baseline.get(group, [])}
for entry in listing.get(group, []):
if entry["name"] not in baseline_names:
out.append(f"Unknown {group} entry: {entry['name']}")
for group in seen:
for entry in listing.get(group, []):
where = path_of(entry)
if any(hint in where for hint in TEMP_FOLDER_HINTS):
out.append(f"Program in a user-writable temp folder: {entry['name']}")
for line in listing.get("hosts", []):
if line["name"] in WELL_KNOWN_NAMES:
out.append(f"Hosts line redirecting {line['name']} to {line['ip']}")
proxy = listing.get("proxy") or {}
base_proxy = baseline.get("proxy") or {}
if proxy.get("enabled") and not base_proxy.get("enabled"):
out.append(f"Proxy where baseline has none: server {proxy.get('server', '')}")
return out
BASELINE = {
"startup": [
{"name": "OneDrive", "path": r"%LocalAppData%\Microsoft\OneDrive\OneDrive.exe"},
{"name": "Teams", "path": r"%ProgramFiles%\Microsoft\Teams\current\Teams.exe"},
],
"scheduled_tasks": [
{"name": "MicrosoftEdgeUpdateTaskMachineCore", "trigger": "every 1 hour"},
],
"hosts": [],
"proxy": {"enabled": False, "server": ""},
}
WEAK = {
"startup": [
{"name": "OneDrive", "path": r"%LocalAppData%\Microsoft\OneDrive\OneDrive.exe"},
{"name": "Teams", "path": r"%ProgramFiles%\Microsoft\Teams\current\Teams.exe"},
{"name": "UpdateHelper", "path": r"C:\Users\reception\AppData\Local\Temp\uh.exe"},
],
"scheduled_tasks": [
{"name": "MicrosoftEdgeUpdateTaskMachineCore", "trigger": "every 1 hour"},
{"name": "SyncCheck", "trigger": r"every 1 hour, runs C:\Users\reception\AppData\Local\Temp\sync.exe"},
],
"hosts": [
{"name": "www.bank.example.com", "ip": "192.0.2.44"},
],
"proxy": {"enabled": True, "server": "192.0.2.44:8080"},
}
CLEANED = {
"startup": [
{"name": "OneDrive", "path": r"%LocalAppData%\Microsoft\OneDrive\OneDrive.exe"},
{"name": "Teams", "path": r"%ProgramFiles%\Microsoft\Teams\current\Teams.exe"},
],
"scheduled_tasks": [
{"name": "MicrosoftEdgeUpdateTaskMachineCore", "trigger": "every 1 hour"},
],
"hosts": [],
"proxy": {"enabled": False, "server": ""},
}
for label, listing in (("WEAK", WEAK), ("CLEANED", CLEANED)):
found = suspicious_entries(listing, BASELINE)
verdict = "fails the baseline" if found else "matches the baseline"
print(f"{label} listing: {len(found)} finding(s), {verdict}")
for note in found:
print(f" - {note}")
print() Output
WEAK listing: 6 finding(s), fails the baseline - Unknown startup entry: UpdateHelper - Unknown scheduled_tasks entry: SyncCheck - Program in a user-writable temp folder: UpdateHelper - Program in a user-writable temp folder: SyncCheck - Hosts line redirecting www.bank.example.com to 192.0.2.44 - Proxy where baseline has none: server 192.0.2.44:8080 CLEANED listing: 0 finding(s), matches the baseline
Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 persistence_hunt.py
Runs on this device, in your browser. The first run downloads Python (about 13.5 MB), which is kept for the next runs.
Your run, in this browser
The weak listing fails the baseline on six lines: two entries that are not on the baseline (a start-up program
and a scheduled task), two more because both run from a user-writable temp folder under AppData\Local\Temp, a
hosts line that redirects a well-known bank name to an address in the documentation range of RFC 5737, and a proxy
where there was none. The cleaned listing meets every line of the baseline and prints no finding, which is the
state the ticket closes on.
Change one line and run it again
Press Edit, change the weak listing’s "proxy": {"enabled": True, "server": "192.0.2.44:8080"} to
"proxy": {"enabled": False, "server": ""}, then run it. Predict the new count and which finding goes before you
press Run.
Checkpoint
Check: Persistence places and the baseline
A browser clean-up reverses what a hijack can change
A Malware or an unwanted browser extension that changes a browser's home page, search engine, new-tab page or added search providers so a user is sent to pages they did not choose. and a user who accepted every site’s notification request leave almost the same traces. Fix both with the same steps, in order, so the browser ends on the home page and search engine the organisation wants:
The drawing shows the whole scene; its 6 steps are listed below.
Every step as text
- Extensions first. Open the extensions page. Remove every add-on the user did not install, and every add-on the user does not use. A hijacker that lives in an extension outlasts a reset of the pages it changed.
- Site notifications. Open the site permissions. Remove notification grants for sites the user does not recognise or use. The desktop banners stop with the grant, no infection to clean.
- Home page. Open the start-up and home page settings. Set the organisation's intranet page or a search page the user wants. A page that returns after this step is set from another place, not from this one.
- Search engine. Open the address-bar search settings. Remove search engines the user does not use and set the default to one of the browser's own. An added search engine is where a redirect to a lookalike page lives.
- Proxy and PAC. Open the network and proxy settings. Confirm there is no proxy and no PAC file, unless the organisation has set one. A proxy address that nobody set means every page the user opens travels through someone else's server.
- Reset last. If a setting the four steps changed comes back, open the browser reset. It puts the start-up page, the new-tab page, the search engine, pinned tabs and the extensions back to their defaults and clears cookies; bookmarks, history and saved passwords stay, and nothing is uninstalled.
Each step maps to one place a browser setting can be changed. Google’s “Reset Chrome settings to default” page
lists what a reset puts back: the default search engine, the home page and start-up tabs, the new-tab page, pinned
tabs, content settings such as site permissions, cookies and site data, and extensions and themes. Saved bookmarks
and passwords stay. Microsoft Edge has a reset of its own at edge://settings/reset, and Microsoft’s Edge
troubleshooting page says what it does: bookmarks, history and saved passwords are kept, while pinned tabs, the
start-up page, the search engine and extensions go back to their defaults. A reset is the fifth step, not the first;
opening it on a browser whose extensions are still untouched throws out the user’s settings and leaves the extension
to switch itself back on.
A reset does not uninstall anything
Both pages describe a reset as putting settings back, not as removing software. The extension is still installed after a reset, so an extension the user turns on again, or a sync that turns it on for them, sets the home page back. Removing the extension is its own step, and it comes first for that reason.
A A one-off permission that lets a site send a browser notification to a user's desktop; a site that was granted it keeps sending until it is removed from the site permissions list. is the easy case to miss. A user who clicked “Allow” on a notification request a year ago sees the site’s banners on their desktop every morning, with no browser window open. The per-site lists are Privacy, search, and services > Site permissions > All sites in Edge, Privacy and security > Site Settings > Notifications in Chrome, and Settings > Websites > Notifications in Safari. Remove the sites the user does not want, or set their Notifications to Block. The symptom often ends there, with no infection to clean.
Removing an extension and leaving the proxy
Wrong: uninstall the obvious extension and close the ticket. Right: run the five steps every time, because a PAC file: Proxy auto-config file: a JavaScript file whose FindProxyForURL function returns DIRECT or a proxy address for every URL, so the device knows which traffic to send where. More in “VPNs, proxies, file shares and remote work” or a proxy address that the extension set stays after the extension is gone, and the next page the user opens still travels through someone else’s server.
Checkpoint
Check: Browser clean-up in order
Stop and reimage when trust is gone
Some findings end the removal before the scans finish, because cleaning cannot prove the device is trustworthy again. The reimage: Writing a prepared system image over a PC's disk so that it returns to the organisation's standard build. Local data is replaced, so what must be kept is backed up before. More in “Reset, reimage or repair: choose and do it” decision is a step of the procedure, not an escalation of effort: it is cheaper than two more days of scans that each find nothing new. CISA’s #StopRansomware Guide asks responders to take a system image and a memory capture of a sample of affected devices for the investigation, and then to rebuild systems from pre-configured standard images, the most important services first.
Four findings mean the removal stops and reimage is the next step:
- A Malware that runs with kernel-level privileges, often as a signed driver, and hides its files, processes and network use from the running operating system; scans inside Windows cannot see or remove it. or a A changed boot sector or UEFI firmware component that runs before Windows starts, and so loads before any anti-malware driver; found and removed only with offline tools or firmware recovery.: a kernel-mode component or firmware-level change that scans running inside Windows cannot see or remove.
- A ransomware incident where files are encrypted, including a wiper: the device may work, but every file it holds is suspect, and the images belong to the security team’s investigation.
- Reinfection after a clean removal: the same detection returns within a day on the same device after a full scan removed it, without a clear source outside the PC.
- Any sign that credentials, administrator accounts or persistence places have been touched: an administrator account the user does not know, a service running under one, scheduled tasks or start-up entries that come back after they are removed.
Weigh the three courses with the table below. The ticket’s own answers to its three questions pick the course.
Answer the questions above: the table then marks what fits your case and says why the rest does not.
| Course | Time it takes | Trust after it ends | User data kept | User keeps working |
|---|---|---|---|---|
| Clean in place What the course is: remove what the scan found and move on | Good Minutes to an hour when nothing else turns up | Mixed Enough for an ordinary finding; not for a kernel-level one | Good Files and settings stay; only the detected items go | Good Yes; the user keeps working during the second scan |
| Scan offline What the course is: restart and scan from outside Windows | Mixed About 15 minutes plus the restart | Good Scans from outside Windows; malware that hides from it is seen | Good Files kept; only the detected items go to quarantine | Poor No; the PC restarts and the user cannot use it for the scan |
| Reimage What the course is: wipe and install from a known-good image | Poor Hours; a managed image is faster than a built-from-scratch install | Good Highest; the device starts from a known-good source | Mixed System files replaced; user data from a trusted backup | Poor No; the user is on another PC for the day |
How the answers decide
- “Does the finding touch kernel-level persistence, credentials or administrator accounts?” Yes: a rootkit, boot-sector change or unknown admin account: rules out Clean in place and Scan offline. Kernel-level or credential findings cannot be proved removed by a scan; the device starts from a known-good image.
- “Did the same detection come back within a day of a clean removal?” Yes; it came back after a quick-scan removal: rules out Clean in place and adds a caveat to Scan offline. A detection that returns within a day may hide from a running Windows. The offline scan is the next step; a second return with no source outside the device is the reimage branch.
- “Does the user need this device within the hour?” Yes; during the day and “Does the finding touch kernel-level persistence, credentials or administrator accounts?” An ordinary start-up or scheduled task: adds a caveat to Reimage. Reimage holds the PC out of use for hours. Clean in place or an offline scan at a quiet moment fits a busy user.
- “Does the finding touch kernel-level persistence, credentials or administrator accounts?” An ordinary start-up or scheduled task and “Did the same detection come back within a day of a clean removal?” No; nothing has been removed yet: adds a caveat to Reimage. An ordinary finding on its first appearance is cleaned in place; reimage is kept for later rounds.
Key idea
A device counts as recovered only when trust is restored, not when the current scan is clean: the trust comes from the known-good source the device was imaged from, or from a full offline scan that follows every persistence place in the lesson’s list.
Checkpoint
Check: When to stop and reimage
In an organisation, isolate through the security tooling and hand over
A small office may run only Microsoft Defender; a larger one usually runs an Endpoint detection and response: a security product that records what each managed device does, raises alerts a security operations centre reviews, and lets analysts isolate or investigate a device from a console. tool, often as part of a wider Extended detection and response: a security product that joins the signals of endpoints, identity, email and cloud services into one view, so an analyst sees a chain of related alerts rather than one at a time. platform, or outsources the alerts to a Managed detection and response: a service that watches an organisation's security alerts and acts on them, so a small team does not have to run its own security operations centre. provider that reads them for the organisation. On those devices the help desk’s job changes: the fastest contain step is the console’s own, not a cable the user pulls.
Microsoft’s “Take response actions on a device” page describes a A console action in an endpoint detection and response tool, such as Microsoft Defender for Endpoint, that cuts a device off from the network except for a limited set of security traffic, so an analyst can look at it without the device communicating further. action in Microsoft Defender for Endpoint that cuts the device off from the network while it stays connected to the Defender service, and that can keep Outlook and Microsoft Teams working so the analyst can still reach the user. Other platforms have the same action under different names. The order on a managed device is:
| Step | Who does it, on a managed device |
|---|---|
| Isolate | The security console (preferred) or the help desk, with the cable or Wi-Fi off |
| Hand over | Ticket to the security operations centre with times, user, device, what the user saw and what you did |
| Preserve | Do not run scans, do not wipe, do not sign out the user; the analyst decides when and what to scan |
| Communicate | Tell the user that security is in; set the expectation for the next contact |
| Help after | Reimage, restore from backup, educate; close with the analyst, not alone |
What goes in the hand-over is the evidence of the lesson so far: the symptoms the user reported with the time of day, the six findings the baseline check printed, the browser settings the user noticed changing, and the file names a scan reported. “An A fact that points at an infection or an incident, written so another technician can test for it on another device: a file name and path, a hash, a scheduled task name, a domain name, an IP address. on this ticket” is better than “a few odd things on this PC”.
A quarantine is not a removal
A A protected folder where an anti-malware program moves a detected file, so the file is unreachable but can be restored if the detection turns out to be wrong. Not the same as the macOS download mark, which Apple calls the quarantine attribute. is the folder Defender or another anti-malware program moves a detected file into. The file is not running anywhere, but it is still on the device, and emptying the folder destroys evidence an analyst may want. Leave the quarantine as it is until the security team decides.
Checkpoint
Check: Isolate through the security tooling
Phones follow their own short procedure
A phone that behaves oddly after a sideloaded app or an accepted “mobile management” profile answers to a shorter list. Read the right page in Settings before anything is removed:
| Platform | Where the stray thing lives | What the user is asked to do |
|---|---|---|
| Android | Safe mode first, then the recently downloaded apps | Restart normally, then remove recent apps one at a time |
| iPhone or iPad | Settings > General > VPN & Device Management | Tap the unrecognised profile and remove it, after the enrolment check |
On Android, Google’s page on finding problem apps with safe mode gives the order. Restart the phone in safe mode (the buttons differ between makers, so the maker’s support site has the steps), use it for a while and see whether the problem goes away. If it does, an app is the likely cause: restart normally, then remove recently downloaded apps one at a time, the unknown one first, restarting after each, until the problem stops. A phone whose problem stays in safe mode does not have an app problem, and that is a case for the organisation’s mobile device management or a factory reset.
On an iPhone or iPad, Apple’s “Install or remove configuration profiles on iPhone” page says where installed profiles are listed: Settings > General > VPN & Device Management. The same page warns what removal costs, which is the sentence to read to the user first: deleting a profile also deletes the settings, apps and data that came with it. A profile managed by an organisation stays until the organisation removes it (that is its point), so the help desk checks whether the device is enrolled in a work mobile device management: Software that enrols phones, tablets and computers, sends them settings and apps, checks them against a security policy and can lock or wipe them remotely. Microsoft Intune is one example. More in “MDM, BYOD and lost or stolen devices” service before anything is pulled off. The MDM, BYOD and lost devices lesson covers that path.
Side-loaded apps on iOS
An iPhone does not install apps from outside the App Store or an organisation’s device-management service in the usual way. A website or email that offers an “install app” link that reaches an unexpected profile prompt is a social-engineering attempt, not a feature. Threats users face is the lesson that recognises it.
Checkpoint
Check: Phone removal
Practise: list the suspicious entries in a start-up listing
The exercise turns the baseline check into a function a help desk ticket system could call every morning. It receives one device’s start-up listing and the fleet’s baseline, and returns the suspicious entries in a fixed order, so a shared counter PC checked at two shift handovers gets a ticket that reads the same both times. Try the sample tests against this lesson’s weak and cleaned listings first, plus a few variants: an entry whose path is a user-writable temporary folder, a hosts line that redirects a well-known name to another address, a proxy where the baseline has none, and a proxy the baseline itself sets, which is not a finding.
Exercise · Medium · Python
List the suspicious entries in a start-up listing
Write suspicious_entries(listing, baseline) so that it returns the suspicious entries in one device's start-up listing, as a list of short strings a technician can paste into a ticket, in a fixed order.
listing and baseline are dicts with the same shape:
startup: a list of{"name": str, "path": str}entries that run at sign-in.scheduled_tasks: a list of{"name": str, "trigger": str}entries scheduled to run.hosts: a list of{"name": str, "ip": str}lines of the hosts file (empty when there are none).proxy:{"enabled": bool, "server": str}; an unset key orenabled: Falsemeans no proxy.
The baseline lists the entries, tasks, hosts lines and proxy state that are expected on a healthy device.
Return a list with one string per finding, in this order:
- Every start-up entry whose
nameis not inbaseline["startup"], as"Unknown startup entry: NAME". - Every scheduled task whose
nameis not inbaseline["scheduled_tasks"], as"Unknown scheduled_tasks entry: NAME". - Every start-up entry whose
pathcontains a user-writable temp folder, as"Program in a user-writable temp folder: NAME". The hints to look for are inTEMP_FOLDER_HINTSin the starter:\AppData\Local\Temp,\Windows\Temp,\AppData\Roaming\Temp,/tmp/and/var/folders/. - Every scheduled task whose
triggercontains the same hints, with the same wording. - Every hosts line whose
nameis a well-known name the lesson lists (bank sites, Microsoft update servers), as"Hosts line redirecting NAME to IP". The starter holds that list asWELL_KNOWN_NAMES. - When
listing["proxy"]["enabled"]is true and the baseline's proxy is not enabled, as"Proxy where baseline has none: server SERVER".
A device that meets the whole baseline returns an empty list. The sample tests cover the lesson's weak and cleaned listings, each rule on its own, and the case where one entry matches two rules.
Starter code · suspicious_entries.py
# The hints a path or a trigger is checked against, and the names a hosts line
# must not be allowed to redirect. Both lists are given to you; the function is yours.
TEMP_FOLDER_HINTS = (
r"\AppData\Local\Temp",
r"\Windows\Temp",
r"\AppData\Roaming\Temp",
"/tmp/",
"/var/folders/",
)
WELL_KNOWN_NAMES = {
"www.bank.example.com",
"update.microsoft.com",
"download.windowsupdate.com",
"www.example.com",
}
def suspicious_entries(listing, baseline):
"""Return the suspicious entries of one listing against the baseline, in a fixed order."""
return [] The sample tests · test_suspicious_entries.py
from suspicious_entries import suspicious_entries
BASELINE = {
"startup": [
{"name": "OneDrive", "path": r"%LocalAppData%\Microsoft\OneDrive\OneDrive.exe"},
{"name": "Teams", "path": r"%ProgramFiles%\Microsoft\Teams\current\Teams.exe"},
],
"scheduled_tasks": [
{"name": "MicrosoftEdgeUpdateTaskMachineCore", "trigger": "every 1 hour"},
],
"hosts": [],
"proxy": {"enabled": False, "server": ""},
}
CLEANED = {
"startup": [
{"name": "OneDrive", "path": r"%LocalAppData%\Microsoft\OneDrive\OneDrive.exe"},
{"name": "Teams", "path": r"%ProgramFiles%\Microsoft\Teams\current\Teams.exe"},
],
"scheduled_tasks": [
{"name": "MicrosoftEdgeUpdateTaskMachineCore", "trigger": "every 1 hour"},
],
"hosts": [],
"proxy": {"enabled": False, "server": ""},
}
WEAK = {
"startup": [
{"name": "OneDrive", "path": r"%LocalAppData%\Microsoft\OneDrive\OneDrive.exe"},
{"name": "Teams", "path": r"%ProgramFiles%\Microsoft\Teams\current\Teams.exe"},
{"name": "UpdateHelper", "path": r"C:\Users\reception\AppData\Local\Temp\uh.exe"},
],
"scheduled_tasks": [
{"name": "MicrosoftEdgeUpdateTaskMachineCore", "trigger": "every 1 hour"},
{"name": "SyncCheck", "trigger": r"every 1 hour, runs C:\Users\reception\AppData\Local\Temp\sync.exe"},
],
"hosts": [
{"name": "www.bank.example.com", "ip": "192.0.2.44"},
],
"proxy": {"enabled": True, "server": "192.0.2.44:8080"},
}
def test_cleaned_listing_has_no_finding():
assert suspicious_entries(CLEANED, BASELINE) == []
def test_weak_listing_lists_every_rule_in_order():
assert suspicious_entries(WEAK, BASELINE) == [
"Unknown startup entry: UpdateHelper",
"Unknown scheduled_tasks entry: SyncCheck",
"Program in a user-writable temp folder: UpdateHelper",
"Program in a user-writable temp folder: SyncCheck",
"Hosts line redirecting www.bank.example.com to 192.0.2.44",
"Proxy where baseline has none: server 192.0.2.44:8080",
]
def test_unknown_entry_from_a_safe_path_is_still_flagged():
listing = dict(CLEANED)
listing["startup"] = CLEANED["startup"] + [
{"name": "VendorHelper", "path": r"%ProgramFiles%\Vendor\VendorHelper.exe"},
]
assert suspicious_entries(listing, BASELINE) == ["Unknown startup entry: VendorHelper"]
def test_temp_folder_catches_a_task_whose_trigger_names_the_folder():
listing = dict(CLEANED)
listing["scheduled_tasks"] = CLEANED["scheduled_tasks"] + [
{"name": "SyncCheck", "trigger": r"every 1 hour, runs C:\Users\x\AppData\Local\Temp\s.exe"},
]
assert suspicious_entries(listing, BASELINE) == [
"Unknown scheduled_tasks entry: SyncCheck",
"Program in a user-writable temp folder: SyncCheck",
]
def test_hosts_line_for_a_well_known_name_is_a_finding():
listing = dict(CLEANED, hosts=[{"name": "update.microsoft.com", "ip": "198.51.100.7"}])
assert suspicious_entries(listing, BASELINE) == [
"Hosts line redirecting update.microsoft.com to 198.51.100.7",
]
def test_hosts_line_for_an_unknown_name_is_not_a_finding():
listing = dict(CLEANED, hosts=[{"name": "internal.corp.example", "ip": "10.0.0.5"}])
assert suspicious_entries(listing, BASELINE) == []
def test_proxy_disabled_matches_the_baseline():
listing = dict(CLEANED, proxy={"enabled": False, "server": "203.0.113.1:8080"})
assert suspicious_entries(listing, BASELINE) == []
def test_proxy_enabled_is_a_finding_when_the_baseline_has_none():
listing = dict(CLEANED, proxy={"enabled": True, "server": "203.0.113.1:8080"})
assert suspicious_entries(listing, BASELINE) == [
"Proxy where baseline has none: server 203.0.113.1:8080",
]
def test_missing_proxy_key_counts_as_off():
listing = {k: v for k, v in CLEANED.items() if k != "proxy"}
assert suspicious_entries(listing, BASELINE) == []
def test_proxy_the_baseline_also_sets_is_not_a_finding():
office_proxy = {"enabled": True, "server": "proxy.example.com:8080"}
baseline = dict(BASELINE, proxy=office_proxy)
listing = dict(CLEANED, proxy=dict(office_proxy))
assert suspicious_entries(listing, baseline) == [] A hint
Start with an empty list and work through the four kinds of finding in order, appending a string for each one, so the final order follows your if statements. For the first and second rule, build a set of the baseline's name values first and check each listing entry against it; a name missing from that set is the finding. For the temp-folder rule, loop over the entries and use any(hint in where for hint in TEMP_FOLDER_HINTS) on the entry's path or trigger, whichever it has. The hosts rule tests each line's name against WELL_KNOWN_NAMES. The proxy rule reads .get("enabled", False) on both sides, so a missing key counts as off.
Results of the sample tests
| Test | Result | Details |
|---|
What your code printed
The sample tests run on this device, in your browser (Pyodide): nothing is sent to mysmartcopilot.com. The first run downloads Python (about 13.5 MB), which is kept for the next runs. A check in your browser is feedback for you, not proof that the code is right for every input.
Practice that adapts to you
Practise this lesson
14 questions about 7 ideas of this lesson. Each answer is explained at once, and what you get right is kept in this browser.
Interview questions
Warm-up (fresher): A user says their PC “feels infected”. Why do you isolate the device from the network before you run any scan?
Isolation sets a boundary around the problem. Many kinds of malware have active network parts: they call home for new instructions, download more parts, or scan the subnet for other devices they can reach. A scan on a connected device sees what is on it now, which can be less than before the scan ran and more a minute later. Pulling the cable, or turning off Wi-Fi in Settings, stops that movement without destroying the evidence a shutdown would. Memory, running processes and open files stay, which the security team may want to look at. Isolation is also protection for other devices on the same subnet: a tool that scans for shared folders stops reaching them. So the sequence is observe, isolate, scan, decide.
Two harder tickets sit in the queue. One is a shared counter PC whose morning scan reports the same detection it reported yesterday, after two full scans and an offline run have each already removed it. The other is a Mac that came back from a reimage, whose only backup was written while it was still infected, and whose user wants their apps, settings and files on it today. Decide your own first move on each before you open the row.
Model answers open with any pass: ₹79 for 1 week ($2.99), one payment that never renews.
-
Mid to senior
A shared counter PC shows the same detection every morning. Two full scans and a Microsoft Defender Offline run have each removed it; no new user action explains it. The same user folder is on three other PCs on the same subnet. Where do you look next, and in what order?
-
Mid to senior
A staff Mac was reimaged after a confirmed infection. The only backup is a Time Machine disk written while the Mac was still infected, and the user wants their apps, settings and files back today. How do you bring the data back without bringing the persistence back?
Flashcards · 7 cards
Recall it, then check
Say the answer to yourself before you look: recalling it is what makes it stick.
-
A user thinks their slow PC is infected. What do you check first?
Each symptom against an ordinary cause, so a slow PC with a full disk is not treated as an infection, while three unexplained signs together are not waved away as probably fine.
-
Why isolate a possibly infected device before any scan runs?
Much malware calls home, downloads more parts or scans the subnet for other devices. Taking the device off the network sets a boundary, so the scan meets a fixed picture rather than a moving one.
-
What is the order of a malware removal?
Observe, isolate, scan with updated signatures, find and remove persistence, clean the browser, and reimage when trust is gone, writing down times and actions as they happen.
-
Where does persistence hide, and what turns the check into pass or fail?
In start-up items, scheduled tasks, services, the hosts file, the proxy, login and background items and configuration profiles. A known-good baseline turns each check into pass or fail.
-
In what order is a hijacked browser cleaned?
Extensions, then site notifications, the home page and search engine, then proxy settings, and only then a reset, so the user's work is kept and the hijacker's is not.
-
Which findings end the cleaning and start a reimage?
A rootkit, a boot-sector change, ransomware, reinfection after a clean removal, and anything that touched credentials. A managed device is isolated through the security console and handed to the security operations centre.
-
When does a device count as recovered from malware?
When trust is restored, not when the latest scan is clean: through the known-good image it was rebuilt from, or a full offline scan that follows every persistence place.
Key takeaways
- Confirm each symptom against an ordinary cause first, so a slow PC with a full disk is not treated as an infection and three unexplained signs together are not treated as “probably fine”.
- The order is observe, isolate, scan with updated signatures, find and remove persistence, clean the browser, and reimage when trust is gone; writing down times and actions as they happen is a step, not an afterthought.
- Persistence survives a reboot by registering with the system; a known-good baseline turns the check into pass or fail across start-up items, scheduled tasks, services, the hosts file, the proxy, login and background items and configuration profiles.
- A browser clean-up goes extensions, site notifications, home page and search engine, proxy settings, and only then a reset, so the user’s work is kept and the hijacker’s work is not.
- A rootkit, a boot-sector change, ransomware, reinfection after a clean removal and anything that touched credentials end the cleaning and start the reimage; a managed device is isolated through the security console and handed to the security operations centre with the evidence already written down.
References
- Microsoft Defender Antivirus in Windows overview (Microsoft)
- Microsoft Defender Offline scan in Windows (Microsoft)
- Fix high CPU or memory usage in Microsoft Edge (reset Edge settings) (Microsoft)
- Manage website notifications in Microsoft Edge (Microsoft)
- Change Websites settings in Safari on Mac (Apple)
- Use a proxy server in Windows (Microsoft)
- How to reset the Hosts file back to the default (Microsoft)
- Reset Chrome settings to default (Google)
- Autoruns for Windows (Sysinternals) (Microsoft)
- Protecting against malware in macOS (XProtect) (Apple)
- Use configuration profiles to standardize settings on Mac computers (Apple)
- Change Login Items & Extensions settings on Mac (Apple)
- Install or remove configuration profiles on iPhone (Apple)
- Find problem apps by rebooting to safe mode on Android (Google)
- Take response actions on a device in Microsoft Defender for Endpoint (Microsoft)
- #StopRansomware Guide (Cybersecurity and Infrastructure Security Agency)
- CompTIA A+ Core 2 (220-1202) exam objectives (CompTIA)
Related tools
Report a problem with this lesson
Kept only in this browser. Your Learn progress