Antivirus Software, Explained

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

← 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 →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

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.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

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.

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?
Signature-based detection compares files against a list of identifiers for known malware. The simplest signature is a file's hash, such as a SHA-256 fingerprint of its bytes; the scanner computes each file's hash and looks it up. Real products also match byte patterns shared by malware families. Because the hash depends only on the bytes, renaming a file does not hide it from an exact-hash check, but changing one character does.
What is the difference between heuristic and behavioral detection?
Heuristic detection judges a file by its structure and instructions, while behavioral detection watches what a program actually does as it runs. Heuristics score traits common in malware, such as code that scrambles itself or asks to start at every boot. Behavioral checks flag actions like a program suddenly rewriting thousands of documents, which looks like ransomware. Many products first run suspicious files in a sandbox to watch safely.
What is the difference between a false positive and a false negative in antivirus?
A false positive is a harmless file wrongly flagged as malware, while a false negative is a malicious file that slips through as clean. Stricter detection rules catch more threats but also raise more false alarms. That is why antivirus usually moves flagged files to quarantine, a locked folder where they cannot run but can be restored if the alert proves wrong.
Is antivirus software enough to keep a computer safe?
No, antivirus is a first line of defense, not the only one. It cannot install a skipped patch, stop someone typing a password into a fake site, or replace backups. A clean scan means a file is not on the known list and nothing looked suspicious, not that it is proven harmless. Keep its signature database and engine updated, and run only one full antivirus at a time.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

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

Introduction to Operating Systems
3 credits · NCCRS
Enroll →