Sub topic 9
Windows Defender Antivirus, Windows Firewall, and UAC
This chapter covers three built-in Windows protections: Microsoft Defender Antivirus, Windows Defender Firewall, and User Account Control (UAC). It assumes you know the Windows desktop and Settings app, basic networking terms such as IP address, port, and router, and the difference between a standard user and an administrator. You should also know the malware types from the earlier malware chapter.
The three tools cover different layers. Antivirus inspects files and behavior on the host. The firewall filters network traffic. UAC limits what a process can do with administrator rights. On the A+ exam, most questions ask you to pick the right tool for a symptom, or to find a misconfiguration.
Microsoft Defender Antivirus
Microsoft Defender Antivirus is the antimalware engine included with Windows 10 and 11. It runs by default unless another antivirus product registers itself with Windows Security Center. When a third-party product is active, Defender switches to a passive state, so two real-time scanners do not conflict.
Main protection features
- Real-time protection scans files as they are opened, copied, or run. Turning it off is a common cause of "my PC got infected" tickets, and Windows turns it back on automatically after a while.
- Cloud-delivered protection sends suspicious file data to Microsoft for fast analysis.
- Tamper protection stops malware and users from changing Defender settings, such as disabling real-time protection.
- Controlled folder access is anti-ransomware protection. It blocks untrusted programs from changing files in protected folders such as Documents.
- Definition updates deliver new malware signatures. A signature is a pattern that identifies known malware. Old definitions miss new threats.
Scan types
| Scan type | What it checks | When to use it |
|---|---|---|
| Quick scan | Locations where malware commonly hides | Routine checks, first response to a suspected infection |
| Full scan | Every file and running program on the drive | After a confirmed infection or on a system you do not trust |
| Custom scan | Folders or drives you choose | A USB drive or a downloaded folder |
| Microsoft Defender Offline scan | Runs before Windows loads | Malware that hides from scans while Windows is running, such as rootkits |
You can start a quick scan from an elevated PowerShell session:
Start-MpScan -ScanType QuickScanThe related Update-MpSignature cmdlet refreshes definitions, and Get-MpComputerStatus shows whether real-time protection is on and when definitions were last updated.
Quarantine and exclusions
When Defender finds a threat, it can quarantine the file. Quarantine moves the file to a protected location where it cannot run. You can later restore it or remove it permanently. An exclusion tells Defender to skip a file, folder, or process. Exclusions are useful for a trusted application that causes false positives, but each one is a blind spot that malware can use. Keep them few and specific.
Windows Defender Firewall
A firewall allows or blocks network traffic based on rules. Windows Defender Firewall is a host-based, stateful firewall. Host-based means it runs on the computer itself, not on a router. Stateful means it tracks connections, so a reply to a request you sent is allowed back in without a separate rule.
Network profiles
Windows applies a different rule set depending on the network type.
- Domain applies when the computer is connected to its Active Directory domain network.
- Private applies to trusted networks such as a home network.
- Public applies to untrusted networks such as a café or hotel. It is the most restrictive.
If a laptop is set to Private on a public Wi-Fi network, it exposes more services than it should. Changing the network to Public is a standard fix.
Rules
Rules are either inbound (traffic coming to the computer) or outbound (traffic leaving it). By default, inbound traffic is blocked unless a rule allows it, and outbound traffic is allowed unless a rule blocks it. A rule can match a program, a port, a protocol, or an address.
To allow an app through the firewall, use Windows Security, then Firewall & network protection, then Allow an app through firewall. For fine control, open Windows Defender Firewall with Advanced Security (wf.msc).
The following command makes sure the firewall is on for all three profiles:
netsh advfirewall set allprofiles state onRun it from an elevated command prompt. Disabling the firewall to "test whether it is the problem" is acceptable only briefly, and it must be turned back on afterward.
Firewall troubleshooting
A typical ticket: a user cannot reach a shared folder or Remote Desktop on a PC. Check these items in order:
- Is the firewall on for the active profile?
- Does an inbound rule allow the service (File and Printer Sharing, Remote Desktop)?
- Is the network profile correct for the current location?
- Is the rule scoped to the right program, port, and remote address?
Adding a rule for the specific port is better than turning the firewall off.
User Account Control (UAC)
UAC limits the damage that a running program can do. Even when an administrator signs in, Windows gives that session a standard-user token by default. When a task needs administrator rights, UAC shows a prompt. That process then runs with a full administrator token. This is called elevation.
Two kinds of prompt
- Consent prompt: shown to administrators. They click Yes or No.
- Credential prompt: shown to standard users. They must enter an administrator's username and password.
The prompt appears on the secure desktop, a dimmed screen that other programs cannot interact with. This stops malware from clicking Yes on the user's behalf.
UAC levels
The UAC slider has four settings.
| Level | Behavior |
|---|---|
| Always notify | Prompts for system changes and when programs change Windows settings |
| Notify only when apps try to make changes (default) | Prompts for program changes, not for your own changes to Windows settings |
| Same as default, but do not dim the desktop | Prompts without the secure desktop, which is less safe |
| Never notify | No prompts. This effectively turns UAC off and is not recommended |
You can also run a program elevated on purpose by right-clicking it and choosing Run as administrator. Commands such as Start-MpScan need an elevated PowerShell window. A message such as "Access is denied" or "requires elevation" is the clue.
How the three tools work together
A user downloads a file that contains malware. Defender scans it as it is saved and quarantines it if a signature matches. If the user runs a program that tries to change system files, UAC asks for permission. If the program then tries to send data out or listen for a remote attacker, the firewall can block the connection. No single layer is perfect, so each one covers gaps in the others.
Common errors and gotchas
- Two antivirus products installed. Running two real-time scanners slows the PC and causes conflicts. Use one.
- Real-time protection off. Check Windows Security for a warning, and review whether malware or a user turned it off.
- Out-of-date definitions. A scan with old signatures misses new malware. Update before you scan.
- Firewall disabled "temporarily." Confirm it is back on with
netsh advfirewall show allprofiles. - Wrong network profile. A Public network set as Private weakens the firewall.
- Confusing UAC with permissions. UAC controls elevation. NTFS permissions control file access. A user with UAC elevation can still be denied access to a file by NTFS.
- Treating the firewall as antivirus. A firewall does not scan files. A permitted program can still carry malware.
Exercise
A technician finds a laptop with UAC set to "Never notify" and the firewall turned off for the Public profile. The user says the prompts were annoying. Name the risk of each setting and how you would fix it.
Show answer
With UAC off, programs can change the system with no prompt, so malware can gain administrator rights easily. Move the slider back to the default level. With the Public firewall profile off, the laptop accepts unsolicited inbound traffic on untrusted networks. Turn the firewall on with netsh advfirewall set allprofiles state on and add a specific allow rule for any app that truly needs one.
Exercise
A user reports that Defender quick scans find nothing, but the PC still shows pop-ups and runs slowly. A rootkit is suspected. Which Defender option is most appropriate, and why?
Show answer
Run a Microsoft Defender Offline scan. It runs before Windows loads, so malware that hides from scans while the operating system is running cannot conceal itself. Update definitions first, then follow the malware removal process.