UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 9.9 Free with a free account
Antivirus Software
Introduction to Operating Systems · Chapter 9: Computer Security and Threat PreventionSection 9.9 · lesson 77 of 838 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Introduction to Operating Systems.
Lesson complete
Earn the 3 college credits for Introduction to Operating Systems
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Virtualization Concepts →← User Access ControlNext lesson: Virtualization Concepts →
A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →
In this lesson
How antivirus finds malware with signatures, heuristics, and behavior.
- Explain how signature-based detection matches file hashes
- Compare signature, heuristic, and behavioral detection
- Distinguish false positives from false negatives and explain quarantine
- Describe the limits of antivirus and why updates matter
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (1,083 words). Read along, or search it.
Opening Analogy
An Airport Bag Scanner for Files
At an airport, every bag rolls through a scanner. A guard checks the screen for shapes on a list of banned items, and also watches for anything that simply looks wrong. A flagged bag is set aside, not thrown away, and a person opens it to decide. Antivirus software does the same with your files. It's a very useful guard. But it's only one guard.
Overview
Scans, Real-Time Protection, and Three Methods
Antivirus software, also called anti-malware, looks for malicious code, such as the viruses, worms, trojans, and ransomware of lesson 9.1. Then it blocks or removes it. It works in two ways. A scan goes through files on demand, or on a schedule. Real-time protection checks each file as it's opened, downloaded, or run, so a bad file is caught at the door. To decide whether a file is bad, it uses three main methods, often together. A signature check holds a photo album of known troublemakers. A heuristic check judges suspicious looks. And a behavioral check watches what a program actually does. Even a Mac has one built in. Apple calls it XProtect, and it detects malware by signature.
Signatures
Fingerprints of Known Malware
Start with signatures. A signature is something that identifies one known piece of malware. The simplest kind is the file's hash: a fingerprint made by running its bytes through a function like SHA-256, which lesson 9.8 used for passwords. The antivirus company keeps a huge list of fingerprints of malware it has already seen. To scan a file, compute its fingerprint, and look it up. A match means known bad. Real products also match byte patterns shared by a whole family of malware. But the exact hash shows the principle most clearly.
Code Walkthrough
A Tiny Signature Scanner in Python
Here's a tiny signature scanner in Python. It only uses harmless text files that it creates for itself, in a temporary folder. Line seven is the list: one known-bad fingerprint, with a made-up name, Pretend Cookie Thief. Line fourteen is the pretend bad program. It's just text, but its fingerprint is the one on the list. And line sixteen is the very same text, with one exclamation mark added. The last loop fingerprints each file with SHA-256, looks it up, and prints the first twelve characters, and a verdict.
Program Output
One Exclamation Mark Slips Past
Run it. The recipe and the orders aren't on the list, so they're clean. invoice.exe matches the stored fingerprint, and is flagged as Pretend Cookie Thief. But invoice2, one exclamation mark different, gets a completely different fingerprint, and it's reported clean. That's the weakness of exact signatures, in one picture. A tiny change slips past a list that only knows the old version.
Quick Check
Renaming Does Not Hide a File
Quick check. Change line twelve, so orders.csv holds exactly the same text as invoice.exe. Its name and extension stay the same. Run the scan again. What happens to orders.csv? Pause, and predict. It's flagged too. The scanner fingerprints the bytes inside a file. The name and the extension never enter the hash. Same bytes, same fingerprint, same verdict. So renaming a known bad file doesn't hide it from a signature.
Code Proof
Same Bytes, Same Verdict
Here's the proof. Change line twelve, and scan again. orders.csv now shows invoice.exe's fingerprint, and the same verdict.
Heuristics and Behavior
Judging Looks and Watching Actions
Because signatures only know the past, antivirus adds guesses about the present. Heuristic detection looks at a file's structure and instructions, and scores traits that malware often has, such as code that scrambles itself to hide, or asks to start with every boot. A high score gets the file flagged, even if nobody has ever seen it before. Behavioral detection watches a program while it runs. A word processor that suddenly opens thousands of documents and rewrites each one looks a lot like ransomware. So the tool stops it. To watch behavior safely, many products first run a suspicious file inside a sandbox, from lesson 9.7: a fenced test area where it can do no real harm.
Quarantine
False Positives and False Negatives
When a file is flagged, the tool usually doesn't delete it right away. It moves it to quarantine: a locked folder where the file can't be opened or run, but can still be restored. Why not delete it at once? Because detection can be wrong. A false positive is a harmless file wrongly flagged as bad, like a rare tool that touches many files. A false negative is the reverse: a bad file that slips through as clean. Tuning a detector trades one against the other. Stricter rules catch more threats, and also raise more false alarms.
Quick Check
New Spyware Reported Clean
Quick check. Ivy looks after the computers at a school. A brand-new spyware app reaches a school laptop before any antivirus company has studied it. The scanner checks it, and reports it clean. What kind of result is that? Pause, and decide. A false negative: a bad file that slipped through as clean. A false positive is the opposite: a harmless file flagged. And nothing was quarantined, because nothing was flagged. New malware like this is exactly why heuristics, behavior watching, and fast updates matter.
Limits
Keep Signatures and Engine Updated
New malware appears all the time, and a signature can exist only after someone has found and studied a sample. So antivirus keeps two things current: its signature database, with new fingerprints arriving often, usually every day, and its engine, the detection code itself. An antivirus that hasn't updated for weeks is like a guard whose photo album is a month old: faithful, but blind to everything new. And know its limits. It can't install a patch you skipped, stop you typing a password into a fake site, or replace your backups. A clean result means: not on my list, and nothing suspicious so far. It doesn't mean proved harmless. Antivirus is the first line of defense, not the only one.
Real Example
A Quarantined Macro Restored
Sam, who runs a small online bakery, once found that the antivirus had flagged Sam's own price-list macro, and quarantined it. Ivy opened the quarantine list, saw it was Sam's file, restored it, and added it to the tool's allowed list. A week later, the same tool stopped a real fake invoice, because its signatures had updated overnight. Ivy's rule for Sam: keep it updating, and never click delete without looking. And run only one full antivirus at a time, since two can get in each other's way.
Key Takeaways
Detection Methods Reviewed
To recap. Signatures match known fingerprints: fast, but blind to new or changed files. Heuristics judge how a file looks, and behavioral checks watch what it does, often inside a sandbox. Quarantine keeps a flagged file out of reach, but restorable, because false positives happen. And keep the signatures and engine updated. A clean result isn't proof of safety.
About Introduction to Operating Systems at UPI Study
Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: Linux vs Operating Systems
Why take it here
Why students take Introduction to Operating Systems with UPI Study
Where the credit goes
Universities that work with NCCRS
Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Antivirus Software
How does signature-based antivirus detection work?
What is the difference between heuristic and behavioral detection?
What is the difference between a false positive and a false negative in antivirus?
Is antivirus software enough to keep a computer safe?
About the Introduction to Operating Systems course
How many college credits is Introduction to Operating Systems?
How much does Introduction to Operating Systems cost and what is included?
Which universities accept UPI Study credits?
How long does Introduction to Operating Systems take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Introduction to Operating Systems.
83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →