• Home Accounts
  • Business Accounts
  • Canada/English
  • Deutschland
  • New Zealand
  • South Africa
  • United Kingdom
  • United States
  • Cybersecurity Resources
  • Tips/Articles

What is a Computer Virus and How Can I Protect My Computer?

What is a computer virus.

A computer virus is a malicious piece of computer code designed to spread from device to device. A subset of malware, these self-copying threats are usually designed to damage a device or steal data.

Think of a biological virus – the kind that makes you sick. It’s persistently nasty, keeps you from functioning normally, and often requires something powerful to get rid of it. A computer virus is very similar. Designed to replicate relentlessly, computer viruses infect your programs and files, alter the way your computer operates or stop it from working altogether.

What does a computer virus do?

Some computer viruses are programmed to harm your computer by damaging programs, deleting files, or reformatting the hard drive. Others simply replicate themselves or flood a network with traffic, making it impossible to perform any internet activity. Even less harmful computer viruses can significantly disrupt your system’s performance, sapping computer memory and causing frequent computer crashes.

Are you prepared for today’s attacks? Discover the year’s biggest cyber threats in our annual Threat Report.

In 2013, the botnet virus Gameover ZueS was discovered to use peer-to-peer downloading sites to distribute ransomware and commit banking fraud. While tens of thousands of computer viruses still roam the internet, they have diversified their methods and are now joined by a number of malware variants like worms, Trojans , and ransomware .

How does a computer get a virus?

Even if you’re careful, you can pick up computer viruses through normal Web activities like:  

Sharing music, files, or photos with other users

Visiting an infected website

Opening spam email or an email attachment

Downloading free games, toolbars, media players and other system utilities

Installing mainstream software applications without thoroughly reading license agreements

How do computer viruses spread?

Viruses can be spread several ways, including via networks, discs, email attachments or external storage devices like USB sticks. Since connections between devices were once far more limited than today, early computer viruses were commonly spread through infected floppy disks.

Today, links between internet-enabled devices are for common, providing ample opportunities for viruses to spread. According to the U.S. Cybersecurity and Infrastructure Security Agency, infected email attachments are the most common means of circulating computer viruses. Most, but not all, computer viruses require a user to take some form of action, like enabling “ macros ” or clicking a link, to spread.

What are the symptoms of a computer virus?

Your computer may be infected if you recognize any of these malware symptoms :  

Slow computer performance

Erratic computer behavior

Unexplained data loss

Frequent computer crashes

How are computer viruses removed?

Antiviruses have made great progress in being able to identify and prevent the spread of computer viruses. When a device does become infected, though, installing an antivirus solution is still your best bet for removing it. Once installed, most software will conduct a “scan” for the malicious program. Once located, the antivirus will present options for its removal. If this is not something that can be done automatically, some security vendors offer a technician’s assistance in removing the virus free of charge.

Examples of computer viruses

In 2013, the botnet virus Gameover ZueS was discovered to use peer-to-peer downloading sites to distribute ransomware and commit banking fraud. While tens of thousands of computer viruses still roam the internet, they have diversified their methods and are now joined by several malware variants like:

Worms - A worm is a type of virus that, unlike traditional viruses, usually does not require the action of a user to spread from device to device.

Trojans - As in the myth, a Trojan is a virus that hides within a legitimate-seeming program to spread itself across networks or devices.

Ransomware - Ransomware is a type of malware that encrypts a user’s files and demands a ransom for its return. Ransomware can be, but isn’t necessarily, spread through computer viruses.

Computer virus protection

When you arm yourself with information and resources, you’re wiser about computer security threats and less vulnerable to threat tactics. Take these steps to safeguard your PC with the best computer virus protection:  

Use antivirus protection and a firewall

Get antispyware software

Always keep your antivirus protection and antispyware software up-to-date

Update your operating system regularly

Increase your browser security settings

Avoid questionable Websites

Only download software from sites you trust.

Carefully evaluate free software and file-sharing applications before downloading them.  

Don't open messages from unknown senders

An unprotected computer is like an open door for computer viruses. Firewalls monitor Internet traffic in and out of your computer and hide your PC from online scammers looking for easy targets. Products like Webroot Internet Security Complete and Webroot Antivirus provide complete protection from the two most dangerous threats on the Internet – spyware and computer viruses. They prevent viruses from entering your computer, stand guard at every possible entrance of your computer and fend off any computer virus that tries to open, even the most damaging and devious strains.  

While free antivirus downloads are available, they just can't offer the computer virus help you need to keep up with the continuous onslaught of new strains. Previously undetected forms of polymorphic malware can often do the most damage, so it’s critical to have up-to-the-minute, guaranteed antivirus protection.

2020 Threat Report

Find the right cybersecurity solution for you.

Home & Home Office

computer virus assignment

Welcome back!

Stay protected and renew your subscription before it's too late.

Cyber Readiness Center and Breaking Threat Intelligence: Click here to get the latest recommendations and Threat Research

What Are Computer Viruses?

Computer virus definition.

Chances are you’ve heard how important it is to keep viruses out, but what is a computer virus exactly? A computer virus is a type of malicious software, or malware, that spreads between computers and causes damage to data and software. 

Computer viruses aim to disrupt systems, cause major operational issues, and result in data loss and leakage. A key thing to know about computer viruses is that they are designed to spread across programs and systems. Computer viruses typically attach to an executable host file, which results in their viral codes executing when a file is opened. The code then spreads from the document or software it is attached to via networks, drives, file-sharing programs, or infected email attachments.

Common Signs of Computer Viruses

Chances are you’ve heard how important it is to keep viruses out, but what is a computer virus exactly? A computer virus will more than likely have an adverse effect on the device it resides on and may be discoverable through common signs of performance loss, including:

Speed of System

A computer system running slower than usual is one of the most common signs that the device has a virus. This includes the system itself running slowly, as well as applications and internet speed suffering. If a computer does not have powerful applications or programs installed and is running slowly, then it may be a sign it is infected with a virus.

Pop-up Windows

Unwanted pop-up windows appearing on a computer or in a web browser are a telltale sign of a computer virus. Unwanted pop-ups are a sign of malware, viruses, or  spyware  affecting a device.

Programs Self-executing

If computer programs unexpectedly close by themselves, then it is highly likely that the software has been infected with some form of virus or malware. Another indicator of a virus is when applications fail to load when selected from the Start menu or their desktop icon. Every time that happens, your next step should be to perform a virus scan and remove any files on programs that might not be safe to use.

Accounts Being Logged Out

Some viruses are designed to affect specific applications, which will either cause them to crash or force the user to automatically log out of the service.

Crashing of the Device

System crashes and the computer itself unexpectedly closing down are common indicators of a virus. Computer viruses cause computers to act in a variety of strange ways, which may include opening files by themselves, displaying unusual error messages, or clicking keys at random.

Mass Emails Being Sent from Your Email Account

Computer viruses are commonly spread via email. Hackers can use other people's email accounts to spread malware and carry out wider cyberattacks. Therefore, if an email account has sent emails in the outbox that a user did not send, then this could be a sign of a computer virus.

Changes to Your Homepage

Any unexpected changes to a computer—such as your system’s homepage being amended or any browser settings being updated—are signs that a computer virus may be present on the device.

How Do Computer Viruses Attack and Spread?

In the early days of computers, viruses were spread between devices using floppy disks. Nowadays, viruses can still be spread via hard disks and Universal Serial Bus (USB) devices, but they are more likely to be passed between devices through the internet. 

Computer viruses can be spread via email, with some even capable of hijacking email software to spread themselves. Others may attach to legitimate software, within software packs, or infect code, and other viruses can be downloaded from compromised application stores and infected code repositories. A key feature of any computer virus is it requires a victim to execute its code or payload, which means the host application should be running.

Types of Computer Viruses

There are several types of computer viruses that can infect devices. This section will cover computer virus protections and how to get rid of computer viruses.

Resident Virus

Viruses propagate themselves by infecting applications on a host computer. A resident virus achieves this by infecting applications as they are opened by a user. A non-resident virus is capable of infecting executable files when programs are not running.

Multipartite Virus

A multipartite virus uses multiple methods to infect and spread across computers. It will typically remain in the computer’s memory to infect the hard disk, then spread through and infect more drives by altering the content of applications. This results in performance lag and application memory running low. 

Multipartite viruses can be avoided by not opening attachments from untrusted sources and by installing trusted antivirus software. It can also be prevented by cleaning the boot sector and the computer’s entire disk.

Direct Action

A direct action virus accesses a computer’s main memory and infects all programs, files, and folders located in the autoexec.bat path, before deleting itself. This virus typically alters the performance of a system but is capable of destroying all data on the computer’s hard disk and any USB device attached to it. Direct action viruses can be avoided through the use of antivirus scanners. They are easy to detect, as is restoring infected files.

Browser Hijacker

A browser hijacker manually changes the settings of web browsers, such as replacing the homepage, editing the new tab page, and changing the default search engine. Technically, it is not a virus because it cannot infect files but can be hugely damaging to computer users, who often will not  be able to restore their homepage or search engine. It can also contain adware that causes unwanted pop-ups and advertisements.

Browser hijackers typically attach to free software and malicious applications from unverified websites or app stores, so only use trusted software and reliable antivirus software.

Overwrite Virus

Overwrite viruses are extremely dangerous. They can delete data and replace it with their own file content or code. Once files get infected, they cannot be replaced, and the virus can affect Windows, DOS, Linux, and Apple systems. The only way this virus can be removed is by deleting all of the files it has infected, which could be devastating. The best way to protect against the overwrite virus is to use a trusted antivirus solution and keep it updated.

Web Scripting Virus

A web scripting virus attacks web browser security, enabling a hacker to inject web-pages with malicious code, or client-side scripting. This allows cyber criminals to attack major websites, such as social networking sites, email providers, and any site that enables user input or reviews. Attackers can use the virus to send spam, commit fraudulent activity, and damage server files.

Protecting against web scripting is reliant on deploying real-time web browser protection software, using cookie security, disabling scripts, and using malicious software removal tools.

File Infector

A file infector is one of the most common computer viruses. It overwrites files when they are opened and can quickly spread across systems and networks. It largely affects files with .exe or .com extensions. The best way to avoid file infector viruses is to only download official software and deploy an antivirus solution.

Network Virus

Network viruses are extremely dangerous because they can completely cripple entire computer networks. They are often difficult to discover, as the virus could be hidden within any computer on an infected network. These viruses can easily replicate and spread by using the internet to transfer to devices connected to the network. Trusted, robust antivirus solutions and advanced firewalls are crucial to protecting against network viruses.

Boot Sector Virus

A boot sector virus targets a computer’s master boot record (MBR). The virus injects its code into a hard disk’s partition table, then moves into the main memory when a computer restarts. The presence of the virus is signified by boot-up problems, poor system performance, and the hard disk becoming unable to locate. Most modern computers come with boot sector safeguards that restrict the potential of this type of virus. 

Steps to protecting against a boot sector virus include ensuring disks are write-protected and not starting up a computer with untrusted external drives connected.

Know More About Computer Viruses Through Examples

There are common examples of what computer and internet users believe to be viruses, but are technically incorrect.

Is Trojan a Virus?

A Trojan horse is a type of program that pretends to be something it is not to get onto a device and infect it with malware. Therefore, a  Trojan horse virus  is a virus disguised to look like something it is not. For example, viruses can be hidden within unofficial games, applications, file-sharing sites, and bootlegged movies.

Is a Worm a Virus?

A computer worm is not a virus. Worms do not need a host system and can spread between systems and networks without user action, whereas a virus requires users to execute its code.

Is Ransomware a Virus?

Ransomware is when attackers lock victims out of their system or files and demand a ransom to unlock access. Viruses can be used to carry out ransomware attacks.

Is Rootkit a Virus?

A rootkit is not a virus. Rootkits are software packages that give attackers access to systems. They cannot self-replicate or spread across systems. 

Is a Software Bug a Virus?

"Bug" is a common word used to describe problems with computers, but a software bug is not a virus. A bug is a flaw or mistake in software code, which hackers can exploit to launch a cyberattack or spread  malware .

How To Prevent Your Computer From Viruses

There are several ways to protect your computer from viruses, including:

Use a Trusted Antivirus Product

Trusted computer antivirus products are crucial to  stop malware attacks  and prevent computers from being infected with viruses. These  antivirus concepts  will protect devices from being infected through regular scans and identifying and blocking malware.

Avoid Clicking Pop-up Advertisements

Unwanted pop-up advertisements are more than likely to be linked to computer viruses and malware. Never click on pop-up advertisements because this can lead to inadvertently downloading viruses onto a computer.

Scan Your Email Attachments

A popular way to protect your device from computer viruses is to avoid suspicious email attachments, which are commonly used to spread malware. Computer antivirus solutions can be used to scan email attachments for potential viruses.

Scan the Files That You Download Using File-sharing Programs

File-sharing programs, particularly unofficial sites, are also popular resources for attackers to spread computer viruses. Avoid downloading applications, games, or software from unofficial sites, and always scan files that have been downloaded from any file-sharing program.

How Fortinet Can Help

The Fortinet  antivirus solution  protects organizations from the latest strands of virus, spyware, and other security threats. Its advanced detection engines help users avoid downloading the latest and evolving threats, and prevents viruses from gaining a foothold inside organizations’ networks. The antivirus solution also reduces the threat of data breaches, protects against evolving malware variants, and keeps businesses up to date with regular updates. 

Quick Links

links image 1 139x100

Free Product Demo

Explore key features and capabilities, and experience user interfaces.

resource center icon 139X159

Resource Center

Download from a wide range of educational material and documents.

links image 2 139x121

Free Trials

Test our products and solutions.

contact sales icon 139x85

Contact Sales

Have a question? We're here to help.

CS1130. Transition to OO programming. Fall 2008

Assignment 1 (computer viruses), submit on the cms two weeks into the course monitoring computer viruses, introduction.

Computer viruses are different from computer worms. A virus attaches itself to other programs, while a worm is a self-contained program that is able to spread copies of itself to other computers without attaching itself to other programs.

Did you know that the first computer worm of any consequence was set loose by a Cornell computer science grad student? In November 1988, Robert Morris wrote a worm —not to cause damage but to get an estimate of the size of the internet. He made a big mistake. When the worm reached another computer, it did not check to see whether it was already on that computer but just invaded the computer and sent itself on to other computers. So it spread much much faster than he thought it would. Anywhere from 6,000 to 60,000 computers were infected, and the internet was brought to its knees. Damage was estimated at $10M to $100M. Morris was convicted of violating the 1986 computer fraud and abuse act. He ended up on probation, a hefty fine, and community service. You can read more on Wikipedia. David Gries and Juris Hartmanis, of the Cornell CS Department, were on a Cornell commission that investigated the Morris worm. You can read about it in this article .

Because viruses and worms are so dangerous, people often wish to monitor them in order to help curtail their growth and spreading. Your task in this assignment is to develop a Java class ComputerVirus, which will maintain information about a virus, and a JUnit class ComputerVirusTester to maintain a suite of testcases for ComputerVirus. This assignment will help illustrate how Java’s classes and objects can be used to maintain data about a collection of things –like computer viruses.

Read the whole assignment before starting. Follow the instructions given below in order to complete the assignment as quickly and as efficiently as possible.

If you don't know where to start, if you don't understand testing, if you are lost, SEE SOMEONE IMMEDIATELY —the course instructor, a TA, a consultant. Do not wait. A little one-on-one help can do wonders.

Class ComputerVirus

An instance of class ComputerVirus represents a single computer virus. It has several fields that one might use to describe a computer virus, as well as methods that operate on these fields.  Here are the fields, all of which should be private (you can choose the names of these fields).

Here are some details about these fields.

The Wurmark-D worm (Jan 05) travels as an email attachment. It pretends to be amusing, but it installs itself on your computer and forwards itself to others.

Accompanying the declarations of these fields should be comments that describe what each field means –what it contains.  For example, on the declaration of the field type, state in a comment that the field represents what kinds of computers the virus infects, 'W' for Windows, etc.  The collection of the comments on these fields is called the class invariant . The class describes all legal values for the fields together.

Whenever you write a method (see below), look through the class invariant and convince yourself that class invariant is correct when the method terminates.

ComputerVirus Methods

Class ComputerVirus has the following methods. Pay close attention to the parameters and return values of each method. The descriptions, while informal, are complete.

When you write a constructor body, be sure to set all the fields to appropriate values.

Make sure that the names of your methods match those listed above exactly, including capitalization. The number of parameters and their order must also match. The best way to ensure this is to copy and paste our names. Our testing will expect those method names, so any mismatch will fail during our testing. Parameter names will not be tested —you can change the parameter names if you want.

Each method MUST be preceded by an appropriate specification, or "spec", as a Javadoc comment. The best way to ensure this is to copy and paste. After you have pasted, be sure to do any necessary editing. For example, the spec of a function does not have to say that the function yields a boolean or int or anything else, because that is known from the header of the method.

A precondition should not be tested by the method; it is the responsibility of the caller to ensure that the precondition is met. For example, it is a mistake to call method setPredecessor with null for the predecessor argument. However, in function isOlder , the tests for v1 and v2 not null MUST be made, because that is part of the specification.

It is possible for person v1 to be v2 's predecessor and visa versa, at the same time. We do not check for such strange occurrences.

In writing methods setPredecessor , be careful! If P is becoming the predecessor of this ComputerVirus , then P has one more variation, and its field that contains its number of variations has to be updated accordingly.

Do not use if-statements, and use conditional statement (...? ... : ...) only in function toString . Boolean expressions, using the operators && (AND), || (OR), and ! (NOT), are sufficient to implement the comparison methods.

Function toString

We illustrate the required format of the output of toString with an example and then make some comments. Here is an example of output from function toString :

"W computer virus Superfun. Id 34. Discovered 6/2005. Has 2 variations."

Here are some points about this output.

Class ComputerVirusTester

We require you to build a suite of test cases as you develop class ComputerVirus in a JUnit class ComputerVirusTester . Make sure that your test suite adheres to the following principles:

How to do this assignment

First, remember that if-statement are not allowed. If your assignments has if-statements, you will be asked to revise the assignment and resubmit.

Second, you should develop and test class in a methodologically sound way, which we outline below. If we detect that you did not develop it this, we may ask you to start from scratch and write one of the other alternatives for this assignment.

At each step, make sure all methods are correct before proceeding to the next step. When adding a new method, cut and paste the comment and the header from the assignment handout and then edit the comment. It must have suitable javadoc specifications as well as suitable comments on the field declarations. The assignment will not be accepted for testing until it does.

Other hints and directions

Procedure for submission

You may submit the assignment whenever you wish. We will look at it in several steps.

1. If the field specifications and the javadoc specifications are not appropriate, we will ask you to fix them and resubmit.

2. If the field and javadoc specs are ok, we will look at your test cases. If they are inadequate, we will askyou to fix them and resubmit.

3. If the test cases are adequate, we will test your program. If there are errors, you will be asked to correct them and resubmit.

The assignment will be considered completed when it passes all three steps.

Submitting the assignment

First, at the top of file ComputerVirus.java , put a comment that says that you looked carefully at the specifications produced by clicking the javadoc button and checked that the specifications of methods and the class specification were OK (put this comment after doing what the comments says).

Second, upload files ComputerVirus.java and ComputerVirusTester.java on the CMS. You will be asked to upload Ass1.java and Ass1Tester.java . Don't worry about this; just upload files ComputerVirus.java and ComputerVirusTester.java .

Make sure you submit .java files. do not submit a file with the extension/suffix .java~. It will help to set the preferences in your operating system so that extensions always appear.

virus (computer virus)

A computer virus is malicious code that replicates by copying itself to another program, computer boot sector or document and changes how a computer works. A virus spreads between systems after some type of human intervention. Viruses replicate by creating their own files on an infected system, attaching themselves to a legitimate program, infecting a computer's boot process or infecting user documents. The virus requires someone to knowingly or unknowingly spread the infection. In contrast, a computer worm is standalone programming that does not require human interaction to spread. Viruses and worms are two examples of malware, a broad category that includes any type of malicious code.

A virus can be spread when a user opens an email attachment, runs an executable file, visits an infected website or views an infected website advertisement, known as malvertising . It can also be spread through infected removable storage devices, such as Universal Serial Bus (USB) drives. Once a virus has infected the host, it can infect other system software or resources, modify or disable core functions or applications, and copy, delete or encrypt data. Some viruses begin replicating as soon as they infect the host, while other viruses will lie dormant until a specific trigger causes malicious code to be executed by the device or system.

Many viruses also include evasion or obfuscation capabilities designed to bypass modern antivirus and antimalware software and other security defenses. The rise of polymorphic malware development, which can dynamically change its code as it spreads, has made viruses more difficult to detect and identify.

Types of computer viruses

File infectors. Some file infector viruses attach themselves to program files, usually selected COM or EXE files. Others can infect any program for which execution is requested, including SYS, OVL, PRG and MNU files. When the infected program is loaded, the virus is loaded as well. Other file infector viruses arrive as wholly contained programs or scripts sent as an attachment to an email note.

Macro viruses. These viruses specifically target macro language commands in applications such as Microsoft Word and other programs. In Word, macros are saved sequences for commands or keystrokes that are embedded in the documents. Macro viruses, or scripting viruses, can add their malicious code to the legitimate macro sequences in a Word file. Microsoft disabled macros by default in more recent versions of Word; as a result, hackers have used social engineering schemes to convince targeted users to enable macros and launch the virus.

Overwrite viruses. Some viruses are designed specifically to destroy a file or application's data. After infecting a system, an overwrite virus begins overwriting files with its own code. These viruses can target specific files or applications or systematically overwrite all files on an infected device. An overwrite virus can install new code in files and applications that programs them to spread the virus to additional files, applications and systems.

Polymorphic viruses. A polymorphic virus is a type of malware that has the ability to change or apply updates to its underlying code without changing its basic functions or features. This process helps a virus evade detection from many antimalware and threat detection products that rely on identifying signatures of malware; once a polymorphic virus's signature is identified by a security product, the virus can then alter itself so it will no longer be detected using that signature.

Resident viruses. This type of virus embeds itself in the memory of a system. The original virus program isn't needed to infect new files or applications. Even if the original virus is deleted, the version stored in memory can be activated when the operating system (OS) loads a specific application or service. Resident viruses are problematic because they can evade antivirus and antimalware software by hiding in the system's random access memory (RAM).

Rootkit viruses. A rootkit virus is a type of malware that installs an unauthorized rootkit on an infected system, giving attackers full control of the system with the ability to fundamentally modify or disable functions and programs. Rootkit viruses were designed to bypass antivirus software, which typically scanned only applications and files. More recent versions of major antivirus and antimalware programs include rootkit scanning to identify and mitigate these types of viruses.

System or boot sector viruses. These viruses infect executable code found in certain system areas on a disk. They attach to the disk OS (DOS) boot sector on diskettes and USB thumb drives or the master boot record (MBR) on hard disks. In a typical attack scenario, the victim receives a storage device that contains a boot disk virus. When the victim's OS is running, files on the external storage device can infect the system; rebooting the system will trigger the boot disk virus. An infected storage device connected to a computer can modify or even replace the existing boot code on the infected system so that, when the system is booted next, the virus will be loaded and run immediately as part of the MBR. Boot viruses are less common now as today's devices rely less on physical storage media.

7 different types of computer viruses

How does a computer virus spread?

The distinguishing characteristic of a virus is it spreads from system to system after a user takes some action that either intentionally or accidentally facilitates that spread. This spread is known as virus propagation , and there are many different techniques viruses can use to propagate between systems. The simplest example occurs when a virus is contained within an executable file that a user downloads from the internet, receives in an email message or copies from a removable storage device. As soon as the user executes that file, the virus springs into action, running malicious code that infects the user's system.

Other viruses can spread through more complex mechanisms. In those cases, a virus running on an infected system may take action to begin its own propagation. For example, a virus might copy itself to all removable media installed on a system, attach itself to email messages sent to a user's contacts or copy itself to shared file servers. In those cases, the lines become blurred between viruses, which require human assistance to spread, and worms, which spread on their own by exploiting vulnerabilities. The key difference is the virus will always require a human to take an action that enables that final step in the propagation process, while a worm does not require this human assistance.

Viruses can also spread between systems without ever writing data to disk, making them more difficult to detect with virus protection and virus removal mechanisms. These fileless viruses are often launched when a user visits an infected website and then run completely within the target system's memory, carrying out their malicious payload and then disappearing without a trace.

How do computer viruses attack?

Virus propagation is only half the equation. Once a virus gains a foothold on a newly infected system, it begins to carry out whatever exploit the virus author designed it to perform. This is the payload delivery process, where the virus attacks the target system. Depending on the techniques the virus uses and the privileges of the user who created the infection, the virus may be able to take any action it desires on the target system. This is one of the main reasons that security professionals encourage organizations to follow the principle of least privilege ( POLP ) and not grant users administrative rights on their own systems. This type of access can magnify the damage caused by a virus.

The payload a virus carries may violate one or more of the principles of cybersecurity: confidentiality, integrity and availability ( CIA triad ). Confidentiality attacks seek to locate sensitive information stored on the target system and share it with the attacker. For example, a virus might search the local hard drive (HD) for Social Security numbers, credit card numbers and passwords, and then funnel those back to the attacker. Integrity attacks seek to make unauthorized modifications or deletions of information stored on the system. For example, a virus might delete files stored on a system or make unauthorized modifications to the OS to avoid detection. Availability attacks seek to deprive the legitimate user access to the system or the information it contains. For example, ransomware is a type of virus that encrypts information on the user's HD, preventing legitimate access. It then demands the payment of a ransom in exchange for the decryption key.

Viruses may also join a system to a botnet, placing it under the control of the attacker. Systems joined to botnets are commonly used to conduct distributed denial of service (DDoS) attacks against websites and other systems.

How do you prevent computer viruses?

The following measures can help you prevent a virus infection:

What are signs you may be infected with a computer virus?

The following are indications that your computer might be infected by a virus:

How do you remove a computer virus?

In the event your personal computer (PC) becomes infected with a virus, you can take the following steps to remove it:

History of computer viruses

The first known computer virus was developed in 1971 by Robert Thomas, an engineer at BBN Technologies. Known as the Creeper virus, Thomas' experimental program infected mainframes on the Advanced Research Projects Agency Network (ARPANET), displaying the teletype message: "I'm the creeper: Catch me if you can."

The first computer virus to be discovered in the wild was Elk Cloner , which infected Apple II OSes through floppy disks and displayed a humorous message on infected computers. Elk Cloner, which was developed by 15-year-old Richard Skrenta in 1982, was designed as a prank, but it demonstrated how a potentially malicious program could be installed in an Apple computer's memory and prevent users from removing the program.

The term computer virus wasn't used until a year later. Fred Cohen, a graduate student at the University of Southern California (USC), wrote an academic paper titled "Computer Viruses -- Theory and Experiments" and credited his academic advisor and RSA Security co-founder Leonard Adleman with coining the term computer virus in 1983.

Famous computer viruses

Notable examples of early computer viruses include the following:

Continue Reading About virus (computer virus)

Related Terms

Dig deeper on threats and vulnerabilities.

computer virus assignment

Trojan horse


computer worm


blended threat


This SD-WAN vendor comparison chart is a useful starting point to evaluate information about deployment options, pricing, ...

Cisco Live returned as an in-person event this year and customers responded positively, with 16,000 showing up to the Mandalay ...

Use this guide to Cisco Live 2023 -- a five-day in-person and online conference -- to learn about networking trends, including ...

Public, private, hybrid or consortium, each blockchain network has distinct pluses and minuses that largely drive its ideal uses ...

Get the lowdown on the major features, differentiators, strengths and weaknesses of the blockchain platforms getting the most ...

The 2023 trends that are reshaping the risk management landscape include GRC platforms, maturity frameworks, risk appetite ...

IT should understand the differences between UEM, EMM and MDM tools so they can choose the right option for their users. Learn ...

Internet Explorer mode lets users view legacy IE websites not supported by other browsers, which can increase productivity and ...

Implementing MDM in BYOD environments isn't easy. IT should communicate with end users to set expectations about what personal ...

Azure management groups, subscriptions, resource groups and resources are not mutually exclusive. Businesses can -- and often do ...

Amazon CodeGuru reviews code and suggests improvements to users looking to make their code more efficient as well as optimize ...

Establishing sound multi-cloud governance practices can mitigate challenges and enforce security. Review best practices and tools...

Comms tech providers tasked to modernise parts of leading MENA and Asia operator’s existing networks, including deploying new ...

SME lending and savings bank Shawbrook Bank is using a low-code platform from Pegasystems to rewrite outdated business processes

Newham Council plans to set up a ‘data campus’ at East Ham Town Hall to continue the data economy development vision it announced...


What is a Computer Virus? - Definition, Types & Protection

Computer virus definition.

A computer virus we can say is a small software program or a piece of code that is loaded on your computer system while using internet can spread from one computer to another and running without your knowledge. Computer viruses can also replicate and they are man-made. How the replication done in the computer virus? A simple virus that can make copy of itself over and over again and that would be easy to produce. Sometimes a simple virus is very dangerous because it stored in your system available memory and when after some time all the small virus collected it may halt you system. A virus has a capacity to corrupt the files located in you system and it also has a capability to spread the virus via e-mail program and effect the system other email addresses in your online address book. It can also delete everything on your hard disk that would be the worst case scenario. A virus can also affect your system security. In 1987, A virus infect ARPANET, then the Defense department and other universities using large network, many antivirus programs become available. Such programs are invent because they check periodically you system and prevent it from known viruses.

Types of Computer Virus

Types Of Computer Virus

Macro virus

Macro virus infect the file hat are created from some application or programs which are mainly contain macro files like doc, pps, xls, mdb. So basically such virus infect the files with the macros and also templates and document that are contained in the file. These virus hide in documents that are shared through network and e-mail. Macro virus are Relax, bablas, Melissa.A, 097M/Y2K.

Memory Resident Viruses

Resident viruses activated every time the OS runs and end up infecting other opened files. Such virus usually fix themselves inside the computer memory, hide in RAM. Resident viruses are CMJ, meve, randex, mrklunky.

Overwrite Viruses

Overwrite viruses delete the information from the file partially or completely once it infect a file. It infect only the file content may be change all the content but the file location and name remains the same, means doesn’t infect the file name and the location. Overwrite viruses are Trj.Reboot, way, trivial.88.D.

Direct Action Viruses

Direct Action Virus activate when the file containing virus is executed. The virus take no other action unless an infected file is executed again. Most viruses avoid this because this is not so productive, but such virus damage in the past. Direct Action viruses are Vienna Virus.

Directory Virus

Directory virus is also known by cluster virus and file system virus. This can infect the computer’s directory by changing the path by indication the location. Such virus located into the hard disk but affect the entire directory. Directory viruses are die-2 virus.

Web Scripting Virus

Mostly web pages contain complex code to make their web page content interactive so that such code exploit that cause undesirable actions. Such virus originate from browser and web pages. Web Scripting viruses include JS.Fortnight that spread via malicious emails.

Multipartite Virus

This type of virus spread in multiple ways and the taken action depending upon the type of OS installed and presence of certain files. Most of the time this virus try to hide in computer’s memory not to infect the hard disk. Multipartite Viruses are flip, invader and tequila.

Polymorphic Virus

Polymorphic virus encode and encrypt themselves every time they are going to infect the computer system. For that they use different encryption methods and algorithms. Since they use different encryption method each time which is difficult for antivirus to locate and resolve them. Polymorphism viruses are Marburg, tuareg, Satan bug, elkern.

Worm is very similar to a virus having a capability to self-replicate which is leading to negative effect on your system. This consume too much system memory and also affect web servers and network servers. Worm viruses are lovgate.F, sobig.D, trile.C, PSWBugbear.B, Mapson.

Trojans horses

This name comes from a software which is very useful software but later do damage you system after run once. This virus can track the login details of the users who is online. Example as we all know E-banking is very common, so its vulnerability of tracing your login details whenever your PC is working without the support of strong antivirus.

Email Virus

This virus is spread via email, this will hide an email when recipient opens the mail.

Boot Infectors

This virus type will include boot sector and master boot record types. While all the viral codes are separated because they infect the hard disks or the floppy. It include the viruses like the brain virus which is very first wild virus is to be created.

Virus Protection Methods

Protection of virus is well designed software program which is used in infected computer systems to prevent from viruses, worms and Trojan horses. The main purpose of using Virus protection is to remove any malicious software code which is already infect a computer. Most of the virus protection utilities now bundle anti-spyware and anti-malware ability that belong to anti-virus protection. To secure internet that include some additional capabilities like anti-spam, anti-phishing, firewall, optimization of files and file protection.



Disclaimer : The study tools and academic assistance/guidance through online tutoring sessions provided by AssignmentHelp.Net is to help and enable students to compete academically. The website does not provide ghostwriting services and has ZERO TOLERANCE towards misuse of the services. In case any user is found misusing our services, the user's account will be immediately terminated.


In order to continue enjoying our site, we ask that you confirm your identity as a human. Thank you very much for your cooperation.

Computer Virus and its Types

Top Banner

A computer virus is a kind of malicious computer program, which when executed, replicates itself and inserts its own code. When the replication is done, this code infects the other files and program present on your system. 

These computer viruses are present in various types and each of them can infect a device in a different manner. 

In this article, we shall discuss in detail what is a computer virus and what are its different types. Also, we will read on to know what is an Anti-virus and how it can nullify a virus in our computer devices, along with some sample questions from the competitive exam point of view. 

To know more about the Fundamentals of Computer , visit the linked article. 

Apart from being aware of what a computer virus is, this topic is even important for candidates preparing for Government exams. Major competitive exams in the country comprise Computer Knowledge as an integral part of the syllabus and questions based on virus and anti-virus can also be expected in these exams. 

Thus, to excel in the upcoming Govt exams, aspirants must go through this article in detail and carefully study the different types of viruses.

What is a Computer Virus?

A computer virus is a program which can harm our device and files and infect them for no further use. When a virus program is executed, it replicates itself by modifying other computer programs and instead enters its own coding. This code infects a file or program and if it spreads massively, it may ultimately result in crashing of the device. 

Across the world, Computer viruses are a great issue of concern as they can cause billions of dollars’ worth harm to the economy each year. 

Computer Virus - Types of Computer Virus

Since the computer virus only hits the programming of the device, it is not visible. But there are certain indications which can help you analyse that a device is virus-hit. Given below are such signs which may help you identify computer viruses:

The first thing which you might notice in case of virus attack is the speed with which your system shall process. And then gradually other changes can also be observed. 

Types of Computer Virus

Discussed below are the different types of computer viruses:

Government exam aspirants can check the links given below for the detailed section-wise syllabus for the other subjects apart from Computer Awareness:

How To Protect Your Computer from Virus?

The most suitable way of making your computer virus-free is by installing an Anti-virus software. Such software help in removing the viruses from the device and can be installed in a computer via two means:

Further below, we bring to you details as to what anti-virus is and what are its different types along with a few examples.

Moving further, candidates can also refer to the following links to learn more about Computer Knowledge and prepare themselves accordingly:

What is an Anti-Virus?

An anti-virus is a software which comprises programs or set of programs which can detect and remove all the harmful and malicious software from your device. This anti-virus software is designed in a manner that they can search through the files in a computer and determine the files which are heavy or mildly infected by a virus. 

Given below is a list of few of the major antivirus software which is most commonly used:

These are few of the many anti-virus software widely used to remove viruses from a device. 

Sample Questions on Computer Virus and Anti-Virus

As discussed above, Computer Awareness is a common topic for major Government exams and questions based on Computer Virus and Antivirus may also be asked in the exam.

Thus, given below are a few sample computer virus questions and answers for the assistance of aspirants. 

Q 1. Which of the following is not a type of computer virus?

Answer: (4) Trojan

Q 2. Which of these was the first computer virus?

Answer: (1) Creeper

Solution: Creeper was the first-ever computer virus and was an experimental self-replicating virus released in the year 1971.

Q 3. Which of the following is not a source of the virus entering your system?

Answer: (5) All of the above

Q 4. The other name for Non-Resident virus is _________

Answer: (1) Direct Action Virus

Q 5. Which of the following viruses is also known as “Cavity Virus”?

Answer: (2) Space Filler Virus

For more questions to ace the upcoming competitive exams, aspirants can visit the articles given below:

Also, to get the best Preparation Strategy for Competitive exams , candidates can visit the linked article. 

Get the latest exam information and study material at BYJU’S and keep yourself updated. 

Frequently Asked Questions on Computer Virus and its Types

Q 1. what is the definition of a computer virus, q 2. what are the main computer viruses.

Ans. The main types of computer virus are as follows:

Q 3. What is the Creeper Virus?

Q 4. what are the examples of a computer virus.

Ans. Given below are a few examples of a computer virus:

Q 5. How to secure a computer system from a virus attack?

Online Quiz 2023

Leave a Comment Cancel reply

Your Mobile number and Email id will not be published. Required fields are marked *

Request OTP on Voice Call

Post Comment

computer virus assignment

Connect with us for Free Preparation

Get access to free crash courses & video lectures for all government exams..

Register with BYJU'S & Download Free PDFs

Live Support

Related Articles

What is a Computer Virus? Definition, History, Types, Symptoms

A computer virus is a sort of malware that attaches itself to another program and can replicate and propagate once it has been installed on a user’s computer. When a computer changes the way in which it should work normally, it is said to be infected by a virus. This virus may spread from one computer to another. For example, you may receive an email with a harmful attachment, inadvertently open the file, and the computer virus then infects your machine. Or in other words, a harmful software application that is installed without the user’s knowledge/ consent on their computer and then performs some malicious acts is known as a virus. A virus attaches itself to another software, once infected the system, in such a way that the host program’s execution activates the virus’s actions simultaneously. It has the ability to self-replicate itself into other programs or files and infecting them. Computer viruses are harmful but the majority of them engage in malicious activity, such as data destruction.

History of Computer Virus:

Viruses have been infecting various devices for a long term via the Internet or some other medium. The viruses are created with an intention to steal information, completely destroy the device, etc. The “Creeper system, ” the first computer virus, was an experimental self-Multiplying virus launched in 1971. Then, the Rabbit virus came in the mid-1970s and was extremely active and it self-replicated very fast & wrecked the functionality at the same speed. The first PC virus was known as “Elk Cloner” and was built in 1982, by Rich Skrenta. It spread by a floppy disc with a game on it and hooked itself to the Apple II operating system. “Brain,” the first computer virus for MS-DOS, was introduced in 1986. The boot sector of the floppy disc would be overwritten, preventing the computer from booting. It was created by two Pakistani brothers and was intended to be used as a copy protection system. In 1988, the age of catastrophic viruses began. Most viruses were basically joked with humorous names and messages till then. In 1988, “The Morris” was the first virus that propagated widely.

Types of computer virus

What does a computer virus do?

A virus can harm or destroy data, slow down system resources, and log keystrokes, among other things. A virus has the ability to have unexpected or harmful outcomes during this procedure, such as destroying system software by corrupting data. Some computer viruses are designed to damage your computer by destroying files, corrupting applications, or reformatting the hard drive. Even less dangerous computer infections can have a substantial impact on your system’s performance, eating up RAM and triggering frequent crashes. Other viruses may just clone themselves or flood a network with traffic, rendering all internet activity difficult. 

How a computer gets a virus?

Through the following activities you may get your device infected by the virus :

Symptoms of a computer virus?

If your system is infected by the virus, the following symptoms may be seen :

How to remove computer viruses?

To get rid of a computer infection, you have two options:

In the manual approach, online search is usually the first step in this approach. You can be requested to complete a huge list of tasks. To finish the procedure, you’ll need time and maybe some experience.

The simpler approach is to install antivirus. Antivirus software is a program that searches for, detects, prevents, and removes software infections that can harm your computer. Antivirus can also detect and remove other dangerous software such as worms, adware, and other dangers. This software is intended to be used as a preventative measure against cyber dangers, keeping them from entering your computer and causing problems. Antivirus is available for free as well. Anti-virus software that is available for free only provides limited virus protection, whereas premium anti-virus software offers more effective security. For example Avast, Kaspersky, etc.

Sample Question

Question 1. How can you protect your computer system from viruses?

We can use antivirus software to keep your computer safe from viruses. Antivirus software works by comparing the files and programs on your computer to a database of known malware types. It will also monitor computers for the presence of new or undiscovered malware threats, as hackers are constantly generating and propagating new viruses. 

Question 2. Make a list of frequent computer virus infection sources. 

The sources via which you can infect your system with viruses are : 1. Downloading programs/software from the internet. 2. Emails 3. External devices like pen-drives 4. Using an unknown CD to Boot data 5. Bluetooth/ infrared

Question 3. Why is it a good idea to back up data on a regular basis?

Files that have been damaged can be restored by backup.

Question 4. How do computer viruses spread?

Computer viruses are typically propagated by email, file sharing, or CDs or by downloading file(s) from unauthenticated sources. 

Question 5. What is a computer virus?

It is a harmful software application that is installed without the user’s knowledge/ consent on their computer and then performs some malicious acts, is known as a virus. It attaches itself to another software, once infected the system, in such a way that the host program’s execution activates the virus’s actions simultaneously.

Please Login to comment...

Improve your Coding Skills with Practice

Start your coding journey now.


  1. Computer Science Assignment Writing Services

    computer virus assignment

  2. Computer virus assignment Inyzah Pressley.docx

    computer virus assignment

  3. Computer_Virus_assignment.doc

    computer virus assignment

  4. Virus Assignment

    computer virus assignment

  5. Computer virus Assignment Help

    computer virus assignment

  6. Assignment ICT ! Design

    computer virus assignment


  1. Pokemon Version: MissingNo. (Beta 2.0)

  2. M.U.G.E.N

  3. Computer Virus

  4. Computer viruses

  5. computer virus

  6. NPTEL Advanced Computer Architecture Assignment 1 Quiz Answers 2023


  1. What Is A Computer Virus? Virus Protection & More

    A computer virus is a malicious piece of computer code designed to spread from device to device. A subset of malware, these self-copying threats are usually

  2. What are Computer Viruses?

    Computer viruses typically attach to an executable host file, which results in their viral codes executing when a file is opened. The code then spreads from the

  3. Computer Virus

    A computer virus is a type of malware that attaches to another program (like a document), which can replicate and spread after a person first runs it on their

  4. Assignment 1 Computer Viruses

    Sometimes, they can even cause computers to stop working all together. Computer viruses are different from computer worms. A virus attaches itself to other

  5. What is a computer virus?

    A virus spreads between systems after some type of human intervention. Viruses replicate by creating their own files on an infected system, attaching themselves

  6. Computer virus

    A computer virus is a type of computer program that, when executed, replicates itself by modifying other computer programs and inserting its own code into

  7. What is a Computer Virus?

    A computer virus we can say is a small software program or a piece of code that is loaded on your computer system while using internet can spread from one

  8. Types & Examples of Computer Virus

    A computer virus is a type of malicious software, or malware, that infects computers and corrupts their data and software. They are always the

  9. What is Computer Virus?

    A computer virus is a kind of malicious computer program, which when executed, replicates itself and inserts its own code. When the replication is done

  10. What is a Computer Virus? Definition, History, Types, Symptoms

    A computer virus is a sort of malware that attaches itself to another program and can replicate and propagate once it has been installed on