• Search Unit Name
  • Search Cornell
  • Instructions
  • Concepts/defs
  • Navigation 6

CS1130. Transition to OO programming. Fall 2008

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

sickcom

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.

virus

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).

  • name (a String )
  • type (a char – 'W' for windows, 'M ' for Mac, and 'L' for the rare Linux virus)
  • month of discovery (an int )
  • year of discovery (an int )
  • predecessor (a ComputerVirus —the name on the tab of folder of a ComputerVirus object from which this one “evolved”)
  • number of variations (an int : the number of known viruses that directly evolved from this one)
  • id number (an int : a number used to reference this ComputerVirus in a database under development)

Here are some details about these fields.

  • The name is a string of characters. It is okay for two viruses to have the same name because some strange happenstance with the media and people who cannot tell the difference between two viruses could lead to two viruses having the same name.
  • The month of discovery is in the range 1..12, representing a month of the year. The year of discovery is something like 1997 or 2005. Do not worry about invalid dates; do not write code that checks whether dates are valid: assume they are valid.
  • The id number is an index into a database. Assume all tags given are unique; do not write code to check whether a virus with a given id number already exists. If a virus hasn’t been assigned an id number yet, this field should contain -1.
  • The predecessor is the name of a ComputerVirus object (manilla folder) on which this virus was based or from which it evolved (computer viruses can evolve too).  It is not a String . The predecessor is null if it is either not known or if this is an original virus.

wurmark virus image

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.

  • Exactly one blank separates each piece of information (including the word “computer” and the word “virus”), and the periods are necessary.
  • The 'W' at the beginning means it is a windows virus. Use 'M' for Mac and 'L' for Linux.
  • The name of the virus follows "computer virus".
  • If the id number is unknown, omit it entirely (in the example above, omit " Id 34.").
  • The predecessor is not described in the output of this function.
  • If the virus has exactly 1 variation, the word "variation" should appear instead of "variations".
  • In writing the body of function toString , do not use if-statements or switches. Instead, use the conditional expression (condition ? expression-1: expression-2) . This is the only place you can use the conditional expression.

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:

  • Every method in your ComputerVirus needs at least one test case in the test suite.
  • The more interesting or complex a method is, the more test cases you should have for it. What makes a method 'interesting' or complex can be the number of interesting combinations of inputs that method can have, the number of different results that the method can have when run several times, the different results that can arise when other methods are called before and after this method, and so on.
  • Here is one important point. If an argument of a method can be null , there should be a test case that has null for that argument.
  • Test each method (or group of methods) carefully before moving on to the rest of the assignment.

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.

  • First, start a new folder on your hard drive that will contain the files for this project. Start every new project in its own folder.
  • Second, write a class ComputerVirus using DrJava. In it, declare the fields in class ComputerVirus , compiling often as you proceed. Write comments that specify what these fields mean.
  • Third, start a new JUnit class, calling it ComputerVirusTester .
  • Fourth, this assignment should properly be done in several parts. For each part, write the methods, write a test procedure in class ComputerVirusTester and add test cases to it for all the methods you wrote, and then test the methods thoroughly. Do not go on to the next group of methods until the ones you are working on are correct. If we determine that you did not follow this way of doing things —for example, you wrote all methods and then tried to test, we may ask you to set this assignment aside and do another instead. Here are the groups of methods.
  • (1) The first constructor and all the getter methods of class ComputerVirus .
  • (2) The second constructor.
  • (3) Function toString .
  • (4) The setter methods.
  • (5) The two comparison methods.

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

  • Do not use if statements.
  • Remember that a string literal is enclosed in double quotation marks and a char literal is enclosed in single quotation marks.
  • Be sure to create the javadoc specification and look at it carefully, to be sure that the methods are specified thoroughly and clearly.

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.

To read this content please select one of the options below:

Please note you do not have access to teaching notes, an introduction to computer viruses: problems and solutions.

Library Hi Tech News

ISSN : 0741-9058

Article publication date: 14 September 2012

The purpose of this paper is to discuss various types of computer viruses, along with their characteristics, working, effects on the computer systems and to suggest measures for detecting the virus infection in a computer system and to elaborate means of prevention.

Design/methodology/approach

The author undertook an extensive study and review of the literature available online and on relevant web sites on the present topic.

A large number of viruses were found during the study, which are causing serious damages to computer systems. The author suggests ways to detect and prevent the different computer viruses.

Research limitations/implications

The research is based on and limited to the study of the relevant literature available on different relevant web sites.

Practical implications

The research will benefit business organizations, business houses, educational institutions and libraries working in fully computerized environments, in detection of viruses and preventing infection of their computer systems.

Social implications

The society will also benefit by attaining knowledge about the different types of computer viruses and the measures of prevention of infection.

Originality/value

There are a number of studies and articles available on the topic but almost all of them appear to be incomplete in the sense that either they discuss only a limited number of known viruses or suggest only limited ways of prevention. The paper has made an attempt to discuss almost all the computer viruses and every possible way of prevention of infection from them.

  • Computer viruses
  • Data security
  • Computer security
  • Information security
  • Security measures

Khan, I. (2012), "An introduction to computer viruses: problems and solutions", Library Hi Tech News , Vol. 29 No. 7, pp. 8-12. https://doi.org/10.1108/07419051211280036

Emerald Group Publishing Limited

Copyright © 2012, Emerald Group Publishing Limited

Related articles

We’re listening — tell us what you think, something didn’t work….

Report bugs here

All feedback is valuable

Please share your general feedback

Join us on our journey

Platform update page.

Visit emeraldpublishing.com/platformupdate to discover the latest news and updates

Questions & More Information

Answers to the most commonly asked questions here

Help | Advanced Search

Computer Science > Cryptography and Security

Title: computer viruses: the abstract theory revisited.

Abstract: Identifying new viral threats, and developing long term defences against current and future computer viruses, requires an understanding of their behaviour, structure and capabilities. This paper aims to advance this understanding by further developing the abstract theory of computer viruses. A method of providing abstract definitions for classes of viruses is presented in this paper, which addresses inadequacies of previous techniques. Formal definitions for some classes of viruses are then provided, which correspond to existing informal definitions. To relate the abstract theory to the real world, the connection between the abstract definitions and concrete virus implementations is examined. The use of the proposed method in studying the fundamental properties of computer viruses is discussed.

Submission history

Access paper:.

  • Other Formats

References & Citations

  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

Bibtex formatted citation.

BibSonomy logo

Bibliographic and Citation Tools

Code, data and media associated with this article, recommenders and search tools.

  • Institution

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .

Academia.edu no longer supports Internet Explorer.

To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to  upgrade your browser .

Enter the email address you signed up with and we'll email you a reset link.

  • We're Hiring!
  • Help Center

paper cover thumbnail

Computer Viruses – from an Annoyance to a Serious Threat

Profile image of murugan paramasivam

Related Papers

Malicious codes are serious threat to our society. The presented work discusses various aspects of technological level, detection, mitigation , identification and Classification of malicious codes. Detection method depicts how various antivirus technologies get used to fight with complex encrypting , decrypting and nature changing virus activities. Antivirus approach consists of waiting for a number of computers to be infected, detecting the virus, designing a solution, delivering and deploying a solution.

computer virus assignment pdf

Vishrut Sharma

In this paper, I will present a broad overview of recent worm attacks starting from the year 2000 through 2011. Some of the most ‘notorious’ worms were discovered during this period including code red, slammer, and conficker. Though this paper does not contain any original research, it is meant to provide malware researchers with well-documented information of some worms that caused havoc during the said period. After sifting through thousands of entries on virus information repositories, I present, in this paper, only those that I considered novel in their approach, primarily from a technical perspective. As a summary to the paper, I have presented a broad overview of trends that I extracted from this raw data and also focussed on the ever increasing destructive potential of worms.

joey maravillas

Eugene H Spafford

Engineering Research Publication and IJEAS

Abstract— The computers viruses have been become a challenge for computer architecture and self organizing system. There has been considerable interest in computer viruses since they first appeared in 1981 and increasing day by day as they have reached epidemic numbers in many personal computer environments. Viruses have been written about as a security problem, as a social problem, and as a possible means of performing useful tasks in a distributed computing environment. However, only recently have some scientists begun to ask if computer viruses are not a form of computer architecture- a self-replicating organism. Simply because computer viruses do not exist as organic molecules may not be sufficient reason to dismiss the classification of this form of “vandalware” as a form of life. This research paper starts with a description of how computer viruses operate and their history, and of the various ways computer viruses are structured. It then examines how viruses meet properties associated with life as defined by some researchers in the area of computer architecture and self organizing systems. The paper concludes with some comments directed towards the definition of artificially “alive” systems and experimentation.

Chris Moses

Ozone layer depletion, is simply the wearing out (reduction) of the amount of ozone in the stratosphere. Unlike pollution, which has many types and causes, Ozone depletion has been pinned down to one major human activity. Causes of Ozone Layer Depletion? Natural causes of depletion of ozone layer: Ozone layer has been found to be affected by certain natural phenomena such as Sunspots and stratospheric winds. But this has been found to cause not more than 1-2% depletion of the ozone layer and the effects are also thought to be only temporary. It is also believed that the major volcanic eruptions (mainly El Chichon in 1983 and and Mt. Pinatubo in 1991) has also contributed towards ozone depletion. Man-made causes of depletion of ozone layer: The main cause for the depletion of ozone is determined as excessive release of chlorine and bromine from man-made compounds such as chlorofluorocarbons (CFCs). CFCs (chlorofluorocarbons), halons, CH 3 CCl 3 (Methyl chloroform), CCl 4 (Carbon tetrachloride), HCFCs (hydro-chlorofluorocarbons), hydrobromofluorocarbons and methyl bromide are found to have direct impact on the depletion of the ozone layer. These are categorized as ozone-depleting substances (ODS). Chlorofluorocarbons are released into the atmosphere due to:

Twin Research and Human Genetics

Margie Wright

We describe the data being collected from the Brisbane Longitudinal Twin Study in Australia as part of the US National Institute on Drug Abuse (NIDA)-funded project, Pathways to Cannabis Use, Abuse and Dependence. The history, recruitment, assessment, and retention of twin families in this project are described in detail, along with preliminary findings and plans for future research. The goal of this NIDA project is to make a significant contribution to the discovery of quantitative trait loci influencing cannabis use disorders. Although the focus is cannabis use, abuse, and dependence in young adults, measures of comorbid illicit drug use disorders are also being collected. In addition, a variety of internalizing and externalizing disorders are being assessed, funded by support from the Australian National Health and Medical Research Council. Because these same twins have participated in numerous twin studies since 1992, future plans will include linking different phenotypes to inv...

Journal of Nursing Management

Geraldine McCarthy

Science & Philosophy

Andrea Laforgia

We present original remarks on some possible applications of classical results of Calculus. Suggestions to the higher schools teachers are also given.

Michael Barzelay

Our Network

  • Computerworld
  • Network World

Josh Fruhlinger

Computer viruses explained: Definition, types, and examples

This malicious software tries to do its damage in the background while your computer still limps along..

CSO  >  What is a computer virus?

Computer virus definition

A computer virus is a form of malicious software that piggybacks onto legitimate application code in order to spread and reproduce itself.

Like other types of malware , a virus is deployed by attackers to damage or take control of a computer. Its name comes from the method by which it infects its targets. A biological virus like HIV or the flu cannot reproduce on its own; it needs to hijack a cell to do that work for it, wreaking havoc on the infected organism in the process. Similarly, a computer virus isn’t itself a standalone program. It’s a code snippet that inserts itself into some other application. When that application runs, it executes the virus code, with results that range from the irritating to the disastrous.

Virus vs. malware vs. trojan vs. worm

Before we continue a brief note on terminology. Malware is a general term for malicious computer code. A virus, as noted, is specifically a kind of malware that infects other applications and can only run when they run. A worm is a malware program that can run, reproduce, and spread on its own , and a Trojan is malware that tricks people into launching it by disguising itself as a useful program or document. You’ll sometimes see virus used indiscriminately to refer to all types of malware, but we’ll be using the more restricted sense in this article.  

What do computer viruses do?

Imagine an application on your computer has been infected by a virus. (We’ll discuss the various ways that might happen in a moment, but for now, let’s just take infection as a given.) How does the virus do its dirty work? Bleeping Computer provides a good high-level overview of how the process works. The general course goes something like this: the infected application executes (usually at the request of the user), and the virus code is loaded into the CPU memory before any of the legitimate code executes.

At this point, the virus propagates itself by infecting other applications on the host computer, inserting its malicious code wherever it can. (A resident virus does this to programs as they open, whereas a non-resident virus can infect executable files even if they aren’t running.) Boot sector viruses use a particularly pernicious technique at this stage: they place their code in the boot sector of the computer’s system disk, ensuring that it will be executed even before the operating system fully loads, making it impossible to run the computer in a “clean” way. (We’ll get into more detail on the different types of computer virus a bit later on.)

Once the virus has its hooks into your computer, it can start executing its payload , which is the term for the part of the virus code that does the dirty work its creators built it for. These can include all sorts of nasty things: Viruses can scan your computer hard drive for banking credentials, log your keystrokes to steal passwords, turn your computer into a zombie that launches a DDoS attack against the hacker’s enemies, or even encrypt your data and demand a bitcoin ransom to restore access . (Other types of malware can have similar payloads.)

How do computer viruses spread?

In the early, pre-internet days, viruses often spread from computer to computer via infected floppy disks. The SCA virus, for instance, spread amongst Amiga users on disks with pirated software . It was mostly harmless, but at one point as many as 40% of Amiga users were infected.

Today, viruses spread via the internet. In most cases, applications that have been infected by virus code are transferred from computer to computer just like any other application. Because many viruses include a logic bomb — code that ensures that the virus’s payload only executes at a specific time or under certain conditions—users or admins may be unaware that their applications are infected and will transfer or install them with impunity. Infected applications might be emailed (inadvertently or deliberately—some viruses actually hijack a computer’s mail software to email out copies of themselves); they could also be downloaded from an infected code repository or compromised app store.

One thing you’ll notice all of these infection vectors have in common is that they require the victim to execute the infected application or code. Remember, a virus can only execute and reproduce if its host application is running! Still, with email such a common malware dispersal method, a question that causes many people anxiety is: Can I get a virus from opening an email? The answer is that you almost certainly can’t simply by opening a message; you have to download and execute an attachment that’s been infected with virus code. That’s why most security pros are so insistent that you be very careful about opening email attachments, and why most email clients and webmail services include virus scanning features by default.

A particularly sneaky way that a virus can infect a computer is if the infected code runs as JavaScript inside a web browser and manages to exploit security holes to infect programs installed locally. Some email clients will execute HTML and JavaScript code embedded in email messages, so strictly speaking, opening such messages could infect your computer with a virus . But most email clients and webmail services have built-in security features that would prevent this from happening, so this isn’t an infection vector that should be one of your primary fears.

Can all devices get viruses?

Virus creators focus their attention on Windows machines because they have a large attack surface and wide installed base. But that doesn’t mean other users should let their guard down. Viruses can afflict Macs, iOS and Android devices, Linux machines, and even IoT gadgets. If it can run code, that code can be infected with a virus.

Types of computer virus

Symantec has a good breakdown on the various types of viruses you might encounter , categorized in different ways. The most important types to know about are:

  • Resident viruses infect programs that are currently executing.
  • Non-resident viruses , by contrast, can infect any executable code, even if it isn’t currently running
  • Boot sector viruses infect the sector of a computer’s startup disk that is read first , so it executes before anything else and is hard to get rid of
  • A macro virus infects macro applications embedded in Microsoft Office or PDF files. Many people who are careful about never opening strange applications forget that these sorts of documents can themselves contain executable code. Don’t let your guard down!
  • A polymorphic virus slightly changes its own source code each time it copies itself to avoid detection from antivirus software.
  • Web scripting viruses execute in JavaScript in the browser and try to infect the computer that way.

Keep in mind that these category schemes are based on different aspects of a virus’s behavior, and so a virus can fall into more than one category. A resident virus could also be polymorphic, for instance.

How to prevent and protect against computer viruses

Antivirus software is the most widely known product in the category of malware protection products. CSO has compiled a list of the top antivirus software for Windows , Android , Linux and macOS , though keep in mind that antivirus isn’t a be-all end-all solution . When it comes to more advanced corporate networks, endpoint security offerings provide defense in depth against malware . They provide not only the signature-based malware detection that you expect from antivirus, but antispyware, personal firewall, application control and other styles of host intrusion prevention. Gartner offers a list of its top picks in this space , which include products from Cylance, CrowdStrike, and Carbon Black.

One thing to keep in mind about viruses is that they generally exploit vulnerabilities in your operating system or application code in order to infect your systems and operate freely; if there are no holes to exploit, you can avoid infection even if you execute virus code. To that end, you’ll want to keep all your systems patched and updated, keeping an inventory of hardware so you know what you need to protect, and performing continuous vulnerability assessments on your infrastructure.

Computer virus symptoms

How can you tell if a virus has slipped past your defenses? With some exceptions, like ransomware, viruses are not keen to alert you that they’ve compromised your computer. Just as a biological virus wants to keep its host alive so it can continue to use it as a vehicle to reproduce and spread, so too does a computer virus attempt to do its damage in the background while your computer still limps along. But there are ways to tell that you’ve been infected. Norton has a good list ; symptoms include:

  • Unusually slow performance
  • Frequent crashes
  • Unknown or unfamiliar programs that start up when you turn on your computer
  • Mass emails being sent from your email account
  • Changes to your homepage or passwords

If you suspect your computer has been infected, a computer virus scan is in order. There are plenty of free services to start you on your exploration: The Safety Detective has a rundown of the best.

Remove computer virus

Once a virus is installed on your computer, the process of removing it is similar to that of removing any other kind of malware—but that isn’t easy. CSO has information on how to remove or otherwise recover from rootkits , ransomware , and cryptojacking . We also have a guide to auditing your Windows registry to figure out how to move forward.

If you’re looking for tools for cleansing your system, Tech Radar has a good roundup of free offerings , which contains some familiar names from the antivirus world along with newcomers like Malwarebytes. And it’s a smart move to always make backups of your files , so that if need be you can recover from a known safe state rather than attempting to extricate virus code from your boot record or pay a ransom to cybercriminals.

Computer virus history

The first true computer virus was Elk Cloner , developed in 1982 by fifteen-year-old Richard Skrenta as a prank. Elk Cloner was an Apple II boot sector virus that could jump from floppy to floppy on computers that had two floppy drives (as many did). Every 50th time an infected game was started, it would display a poem announcing the infection.

Other major viruses in history include:

  • Jerusalem : A DOS virus that lurked on computers, launched on any Friday the 13th, and deleted applications.
  • Melissa : A mass-mailing macro virus that brought the underground virus scene to the mainstream in 1999. It earned its creator 20 months in prison.

But most of the big-name malware you’ve heard of in the 21st century has, strictly speaking, been worms or Trojans, not viruses. That doesn’t mean viruses aren’t out there, however—so be careful what code you execute.

Related content

Intelbroker steals classified data from the europol website, ridding your network of ntlm, cisa inks 68 tech vendors to secure-by-design pledge — but will it matter, google chrome gets a patch for actively exploited zero-day vulnerability, from our editors straight to your inbox.

Josh Fruhlinger

Josh Fruhlinger is a writer and editor who lives in Los Angeles.

More from this author

Social engineering: definition, examples, and techniques, download the zero trust network access (ztna) enterprise buyer’s guide, malware explained: how to prevent, detect and recover from it, pci dss explained: requirements, fines, and steps to compliance, most popular authors.

computer virus assignment pdf

Show me more

Dell data breach exposes data of 49 million customers.

Image

Some strategies for CISOs freaked out by the specter of federal indictments

Image

Strong CIO-CISO relations fuel success at Ally

Image

CSO Executive Sessions: The personality of cybersecurity leaders

Image

CSO Executive Sessions: Geopolitical tensions in the South China Sea - why the private sector should care

Image

CSO Executive Sessions: 2024 International Women's Day special

Image

Sponsored Links

  • Tomorrow’s cybersecurity success starts with next-level innovation today. Join the discussion now to sharpen your focus on risk and resilience.
  • Trending Now
  • Foundational Courses
  • Data Science
  • Practice Problem
  • Machine Learning
  • System Design
  • DevOps Tutorial
  • Ethical Hacking Tutorial

Introduction to Ethical Hacking

  • What is Hacktivism ?
  • Methodology followed by the Hackers
  • Remote Access in Ethical Hacking
  • Kali Linux - Information Gathering Tools
  • ARIN in Ethical Hacking
  • Basic characteristics of Computer Networks

Foot Printing and Reconnaissance

  • What is DNS Footprinting?
  • Footprinting Through Search Engines
  • What is Whois Footprinting?
  • Footprinting Using Social Engineering Method

Scanning Networks

  • What is Credentialed Vulnerability Scan?
  • What are Scanning Attacks?
  • Malware Scan in Ethical Hacking
  • What is Running of a Malware Scan?
  • WAScan - web application security scanner in Kali Linux
  • What is TCP-ACK Scanning?
  • Port Scanning Techniques By Using Nmap
  • What is SYN Scanning?
  • What is UDP Scanning?

Enumeration

  • Cyber Security - Types of Enumeration
  • What is DNS Enumeration?
  • SMTP Enumeration
  • LDAP Enumeration
  • What is NTP Enumeration?
  • What is IPsec Enumeration?
  • What is NetBIOS Enumeration?
  • SNMP Enumeration
  • What is Security Testing in Enumeration?

System Hacking

  • What is System Hacking in Ethical Hacking?
  • What is Windows Hacking ?
  • Importance of Physical Security in Ethical Hacking
  • What is Non-Electronic Password Attack on a System?
  • What is Password Guessing Attack?
  • Credential Stuffing in Ethical Hacking
  • Reverse Brute Force Attack in System Hacking
  • Brute Force Attack
  • What is a Default Password Attack Threat?
  • USB Drop Attack in System Hacking
  • What is Sniffing Attack in System Hacking?
  • How to Prevent Man In the Middle Attack?
  • How To Generate Rainbow Table Using WinRTGen?
  • What is Elcomsoft Distributed Password Recovery?
  • pwdump7 in System Hacking
  • FGDUMP in System Hacking
  • Password Auditing With L0phtcrack 7 Tool
  • What is Salted Password Hashing?
  • How to Hack Wifi Using Aircrack-ng in Termux Without Root?
  • How to Defend Against Password Cracking of Systems?
  • How to Defend Against Wi-Fi Pineapple?
  • What is DLL Hijacking?
  • How to Prevent Privilege Escalation?

Malware Analysis

  • Most Popular Methods Used By Hackers to Spread Ransomware
  • What is Malvertising?
  • How to Find Trojan on Computers?
  • Malwares - Malicious Software
  • What is WannaCry? How does WannaCry ransomware work?
  • Working of Stuxnet Virus
  • CryptoLocker Ransomware Attack
  • What is Zeus Malware?
  • What is SQL Slammer Virus?
  • How to Install Trojan Virus on Any Computer?
  • Different Ways to Remove Trojan Horse Malware
  • How to Defend Against Botnets ?
  • What is Proxy Trojan?
  • What are Banking Trojans?

What is a Computer Virus?

  • Difference between Worms and Virus
  • Port Scanning Attack
  • What is System Integrity Check?
  • Code Emulation Technique For Computer Virus Detection
  • Heuristic Virus
  • How to Prevent Backdoor Attacks?
  • What are Active Sniffing Attacks?
  • What is Protocol Analyzer?
  • What is MAC Spoofing Attack?
  • How to Prevent MAC Flooding?
  • What is Port Stealing?
  • Dynamic Host Configuration Protocol (DHCP)
  • DHCP Starvation Attack
  • What is Rogue DHCP Server Attack?
  • What is ARP Spoofing Attack?
  • How to Prevent DNS Poisoning and Spoofing?
  • DNS Spoofing or DNS Cache poisoning
  • How to Detect Sniffer in Your Network?
  • Mitigation of DHCP Starvation Attack

Social Engineering

  • Social Engineering - The Art of Virtual Exploitation
  • What is Insider Attack?
  • What is an Impersonation Attack?
  • What are Tailgating?
  • How Hackers Use Social Engineering to Get Passwords on Facebook?
  • Pretexting in Social Engineering
  • Credit Card Frauds
  • Active Social Engineering Defense (ASED)
  • Cyber Crime - Identity Theft
  • Penetration Testing - Software Engineering

Denial-of-Service

  • Distributed Denial of Service DDoS attack
  • What are Bandwidth Attacks?
  • HTTP Flood Attack
  • ICMP Flood DDoS Attack
  • Ping Flood Attack
  • What is a Permanent DoS (PDoS) Attack?
  • What is Phlashing?
  • Session Hijacking
  • TCP/IP Hijacking
  • UDP Session Hijacking
  • What are Types of Session Hijacking ?
  • Difference Between Spoofing and Hijacking
  • Application Level Hijacking Using Proxy Hacking
  • Man-in-the-Browser Attack
  • DOM-Based Cookie Manipulation
  • What are Session Replay Attacks?
  • What is Cookie Hijacking?
  • Session Prediction Software Attack
  • Types of Client-Side Attacks
  • Difference Between XSS and SQL Injection
  • How SYN cookies are used to preventing SYN Flood attack
  • IPSec Architecture

Evading IDS,Firewalls,and Honeypots

  • Bypass Firewalls Using SSH
  • What is Bitvise SSH Client?
  • How to Prevent Port Scan Attacks?
  • What is Source Port Randomization For Caching DNS ?
  • Types of Evasion Technique For IDS

Hacking Web Servers

  • Web Threat Shield
  • Web Reputation
  • What is Recursive DNS?
  • Path Traversal Attack and Prevention
  • What is Server Misconfiguration?
  • Web Cache Poisoning
  • How to Brute-Force SSH in Kali Linux?
  • How to Hack a Web Server?
  • Testing For IMAP SMTP Injection
  • Web Parameter Tampering Attack on Web Servers
  • How To Crack Online Web Form Passwords?
  • How to Crack FTP Passwords?
  • Cookie Tampering Techniques
  • What is Input Validation Attack?
  • Ethical Hacking | Footprinting
  • Parsero - Tool for reading the Robots.txt file in Kali Linux
  • What is Credential Harvester Attack ?
  • Script Http-Userdir-Enumeration Method
  • Linux - Metasploit Command
  • Working with Payload Metasploit in Kali Linux
  • What is Code Access Security?
  • CRLF Injection Attack
  • What is Patch Management?

Hacking Web Applications

  • What is Cookie Poisoning?
  • What are Injection Flaws?
  • How to Prevent Broken Access Control?
  • What is Improper Error Handling?
  • What is Log Tampering?
  • OWASP Top 10 Vulnerabilities And Preventions
  • Insecure Cryptographic Storage Vulnerability
  • Web Server and its Types of Attacks
  • Insufficient Transport Layer Protection
  • What is Failure to Restrict URL Access?
  • Session Fixation Attack
  • What is Malicious File Execution?
  • What is CSV Injection?
  • Converting a CVE list to Patch Vulnerabilities
  • What is Arbitrary Code Execution?
  • Malicious Script
  • What is User Privileges in Ethical Hacking ?
  • What is CAPTCHA Attack?
  • What is Banner Grabbing?
  • WhatWaf - Detect And Bypass Web Application Firewalls And Protection Systems
  • User Directed Spidering with Burp
  • What is Attack Surface?
  • What is Authentication Attack?
  • User Enumeration in Ethical Hacking
  • What is SMTP Header Injection?
  • What is Canonicalization Attack?
  • How a Connection String Injection Attack is Performed?
  • What is Connection String Parameter Pollution?
  • Pass-the-Hash (PtH) Attack
  • What is WSDL Attack?
  • Types of SQL Injection (SQLi)

Hacking Wireless Networks

  • Orthogonal Frequency-Division Multiplexing (OFDM)
  • Direct Sequence Spread Spectrum in Wireless Networks
  • Frequency-Hopping Spread Spectrum in Wireless Networks
  • Warchalking in Wireless Networks
  • Types of WiFi Antenna in Wireless Networks
  • Types of Wireless Security Encryption
  • WEP Crack Method in Wireless Networks
  • Bluesnarfing Attack in Wireless Networks
  • BlueSmack Attack in Wireless Networks
  • How To Install Super Bluetooth Hack on Android?
  • Bluebugging in Wireless Networks

Cloud Computing

  • Net-Centric Computing in Cloud Computing
  • Security Issues in Cloud Computing
  • Packet Switched Network (PSN) in Networking
  • What is Parallel File System in Cloud Computing?
  • How To Install AWS CLI - Amazon Simple Notification Service (SNS)?
  • How to Authorize Inbound Traffic For Your Linux Instances?
  • How To Multiple IP Addresses Work in Ethical Hacking?

Cryptography

  • What is Heartbleed Bug in Ethical Hacking ?
  • Email Hijacking
  • What is Hybrid Cryptosystem in Ethical Hacking?

A computer virus is a type of malicious software program (“ malware “) that, when executed, replicates itself by modifying other computer programs and inserting its code. When this replication succeeds , the affected areas are then said to be “ infected “. Viruses can spread to other computers and files when the software or documents they are attached to are transferred from one computer to another using a network , a disk , file-sharing methods , or through infected email attachments.

A computer virus is a type of harmful program . When it runs, it makes copies of itself and adds its code to other programs and files on your computer. These viruses come in different types , and each type can affect your device differently . Simply put, a computer virus changes how your computer works and aims to spread to other computers. It does this by attaching itself to normal programs or documents that can run code, known as macros .

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 can have unexpected or harmful outcomes during this procedure, such as destroying system software by corrupting data. Some viruses are made to mess things up by deleting files , messing up programs , or even wiping out your hard drive completely. Even if they’re not super harmful, viruses can still slow down your computer a lot, using up memory and making it crash often . Others might just make copies of themselves or send so much stuff over the internet that it’s hard to do anything online.

Virus vs. Malware – What is the difference? 

Viruses and malware are often used interchangeably, but they’re not quite the same. Here’s how they differ:

History of Computer Virus

Viruses have been attacking various devices for a long time, spreading through the Internet or other means. They are often created to steal information or completely ruin devices. The first computer virus, called the “ Creeper system ,” appeared in 1971 as an experimental virus that could copy itself. Following that, in the mid-1970s , the “ Rabbit ” virus emerged , which replicated very quickly and caused significant damage at the same pace. The virus known as “ Elk Cloner ” was created in 1982 by Rich Skrenta . It spread through a floppy disk containing a game and attached itself to the Apple II operating system.

The first virus for MS-DOS , called “ Brain ,” appeared in 1986 . It was designed by two Pakistani brothers and overwrote the boot sector of floppy disks , making it impossible for the computer to start. It was originally meant to be a copy protection system. In 1988 , more destructive viruses began to surface. Until then, most viruses were considered pranks with funny names and messages. However, in 1988, “ The Morris ” became the first widely spreading virus.

How To Prevent Your Computer From Viruses?

Keeping your computer safe from viruses is a lot like keeping yourself from catching a cold. Just as you might wash your hands regularly or avoid sick friends, there are simple steps you can take to protect your computer. Here are some easy tips:

1. Install Antivirus Software: Think of antivirus software as your computer’s doctor. It works around the clock to detect and block viruses before they can infect your system. Make sure to keep it updated!

2. Update Regularly: Keep your operating system , software , and apps up to date . Updates often include fixes for security vulnerabilities that viruses could exploit.

3. Be Cautious with Emails and Downloads: Don’t open emails or download attachments from unknown sources. If an email looks suspicious , even if you know the sender, it’s best to delete it.

4. Use Strong Passwords: Protect your accounts with strong , unique passwords . Consider using a password manager to keep track of them all.

5. Backup Your Data: Regularly back up your data to an external drive or cloud storage . If a virus does slip through , you won’t lose everything.

By following these steps, you can help keep your computer virus-free and running smoothly.

How To Remove Computer Viruses?

To remove a computer infection, you can choose from two options:

Do-it-yourself manual approach: This means you try to fix the problem on your own. Usually, you start by searching online for solutions. Then, you might have to do a lot of tasks to clean up your computer . It can take time and might need some experience to finish everything.

Get help from a reliable antivirus product: Another option is to use antivirus software . This software is designed to find and remove viruses from your computer. You just need to install it and let it do its job.

What is 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.

Also Check :

Anti-Virus | Its Benefits and Drawbacks How an Antivirus Works?

Different Types of Computer Virus

Each type has a unique way of infecting and damaging computers. Here are a few examples:

How do computer viruses spread?

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

1. Sharing the data like music , files , and images with each other.

2. If you open a spam email or an attachment in an email that is sent by an unknown person.

3. Downloading the free game s, toolbars , media players, etc.

4. Visiting a malicious website .

5. Installing pirated software (s) etc.

Examples of Computer Viruses

A computer virus is a type of software designed to spread from one computer to another, similar to how a cold spreads between people. Just like a cold virus can make us sick, a computer virus can harm a computer’s performance and security . Here are some common examples of computer viruses:

These examples show how diverse computer viruses can be in their methods of infection and damage. Knowing about them can help you understand the importance of having reliable antivirus software and practicing safe browsing habits.

In conclusion, understanding what a computer virus is and recognizing the dangers it poses is crucial for keeping your data safe. These viruses are designed to infect , replicate , and damage the functioning of computers. Protecting your computer with antivirus software , being cautious with email attachments , and avoiding suspicious websites are essential steps to prevent virus infections. By staying informed and attentive , you can help safeguard your computer from the potential destruction caused by computer viruses.

What is a Computer Virus? – FAQs

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. 

What are 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
Computer viruses are typically propagated by email, file sharing, or CDs or by downloading file(s) from unauthenticated sources. 

What is an Anti-Virus?

An anti-virus is a piece of software that consists of programs or a collection of programs that can detect and remove all unsafe and malicious software from your system. This anti-virus software is created in such a way that it can look through a computer’s files and d etect which files are heavily or moderately infected by a virus.

Please Login to comment...

Similar reads.

  • School Learning
  • School Programming

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

IMAGES

  1. What is a Computer Virus? Read and Discuss.

    computer virus assignment pdf

  2. Unit 15 Assignment

    computer virus assignment pdf

  3. computer assignment 3

    computer virus assignment pdf

  4. Assignment Virus

    computer virus assignment pdf

  5. Assignment 1

    computer virus assignment pdf

  6. English Assignment Papers

    computer virus assignment pdf

VIDEO

  1. Pikachu Windows Worm

  2. Governor IT initiative

  3. Computer Virus

  4. How to make 2 Mac Viruses (Pranks)

  5. Installing 100 Viruses on My Macbook

  6. Animated computer virus

COMMENTS

  1. An introduction to computer viruses: Problems and solutions

    or copy data from computer to computer. viruses can be transmitted via computer. syste ms, an inte rnal network or the. internet. Once a computer system gets. infected with a virus, the data ...

  2. PDF Computer Viruses: an Introduction

    Computer Viruses: an Introduction Author: Horton J and Seberry J Subject: Proceedings of the Twentieth Australasian Computer Science Conference (ACSC'97), Feb. 1997, - Aust. Computer Science Communications, Vol. 19, No. 1 (ed. M. Patel), (1997), 122-131. Created Date: 9/23/2009 3:12:09 PM

  3. PDF An introduction to Computer Viruses

    R. Brown. This thesis is entitled An Analysis of Computer Virus Construction, Proliferation, and Control and is available through the University of Tennessee Library. This paper contains an overview of the computer virus arena that can help the reader to evaluate the threat that computer viruses pose. The extent of this threat can only be

  4. PDF Malware: Malicious Software

    Based on the instructions, the antivirus can determine whether or not the program is malicious, i.e., program contains instruction to delete system files, Execution emulation. Run code in isolated emulation environment. Monitor actions that target file takes. If the actions are harmful, mark as virus.

  5. PDF Computer viruses demystified

    A virus which hides its presence from the computer user and anti-virus programs, usually by trapping interrupt services. Transmission Control Protocol/Internet Protocol. The collective name for the standard internet protocols. computer program with (undesirable) effects that are not described in its specification.

  6. Assignment 1 Computer Viruses

    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.

  7. PDF Computer Viruses

    The results of several experiments with computer viruses are used to demonstrate that viruses are a formidable threat in both normal and high security operating systems. The paths of sharing, transitivity of information flow, and generality of information interpretation are identified as the key properties in the protection from computer ...

  8. An introduction to computer viruses: problems and solutions

    The author suggests ways to detect and prevent the different computer viruses., - The research is based on and limited to the study of the relevant literature available on different relevant web sites., - The research will benefit business organizations, business houses, educational institutions and libraries working in fully computerized ...

  9. PDF Viruses, Trojan Horses, and Worms

    link. You put the VIRUS program into it and it starts dialing phone numbers at random until it connects to another computer with an auto-dial. The VIRUS program then injects itself into the new computer. Or rather, it reprograms the new computer with a VIRUS program of its own and erases itself from the first computer. The second machine then ...

  10. PDF Computers 1989, 21 334-340 SESSION XIII TUTORIAL: COMPUTER VIRUSES

    viruses consume computer resources. For example, a virus might execute a simple loop repetitively on each inter­ rupt from the time-of-dayclock, thereby consuming 50% ofthe computer'scapacity. Another virus might create hidden files that use up disk space. At least one virus has been reported as destroying computer hardware. This virus could ...

  11. (PDF) Computer Viruses, Attacks, and Security Methods

    The paper encompasses the following: 1. Examine the different types of computer virus's distribution platform based on their use. 2. Presenting the virus spread opposition and demonstrate the ...

  12. [1912.06510] Computer Viruses: The Abstract Theory Revisited

    Download PDF Abstract: Identifying new viral threats, and developing long term defences against current and future computer viruses, requires an understanding of their behaviour, structure and capabilities. This paper aims to advance this understanding by further developing the abstract theory of computer viruses. A method of providing abstract definitions for classes of viruses is presented ...

  13. (PDF) Computer Viruses

    A virus is by definition a computer program that spreads or replicates by copying itself. There are many known techniques that can be used by a virus, and viruses appear on many platforms. However, the ability to replicate itself is the common criterion that distinguishes a virus from other kinds of software.

  14. PDF Abstract Theory of Computer Viruses

    Introduce complexity theory and program size theory into the study of computer viruses. As noted earlier, even disseminating viruses may affect the complexity characteristics and size of infected programs and as a result become detectable or harmful. abstract level (see for example [MY]) or a concrete level.

  15. (PDF) Computer viruses

    Computer viruses have been around since the mid 1980s. Over 40,000 different viruses have been cataloged so far and the number of viruses is increasing dramatically. The damage they cause is ...

  16. PDF ap08 cs computerviruses LabExercises solutions

    A computer virus attaches itself to a program or file so it can spread from one computer to another, leaving infections as it travels. Much like human viruses, computer viruses can range in severity; some viruses cause only mildly annoying effects while others can damage your hardware, software, or files. Almost all viruses are attached to an

  17. PDF Robert Slade's GUIDE TO COMPUTER VIRUSES

    A Pathology of Computer Viruses, David Ferbrache 349 The Computer Virus Desk Reference, Chris Feudo 350 The Computer Virus Crisis, 2nd ed., Fites, Johnston, and Kratz 351 Computer Virus Handbook, Harold Joseph Highland 352 Rogue Programs: Viruses, Worms, and Trojan Horses, Lance J. Hoffman, ed. 354 Computer Viruses and Anti-Virus Warfare, Jan ...

  18. Computer viruses explained: Definition, types, and examples

    Computer virus definition. A computer virus is a form of malicious software that piggybacks onto legitimate application code in order to spread and reproduce itself. Like other types of malware, a ...

  19. COMPUTER VIRUS AND TYPES Assignment

    COMPUTER VIRUS AND TYPES assignment.....docx - Free download as Word Doc (.doc / .docx), PDF File (.pdf), Text File (.txt) or read online for free. Scribd is the world's largest social reading and publishing site.

  20. PDF COMPUTER VIRUSES AND ITS MANAGEMENT

    their code to run in the computer. •Viruses spread when the software or documents they get attached to are transferred from one computer to another using a network, a disk, file sharing methods, or through infected e-mail attachments. •Some viruses use different stealth strategies to avoid their detection from anti-virus software.

  21. PDF Computer Viruses UNIT 16 COMPUTER VIRUSES

    16.1 INTRODUCTION. Mr. Vijay Singh, P.A. to Mr. R. Modi was working with his word processor. Suddenly, a ball appeared on his screen and started bouncing from side to side. Mr. Vijay called up the computer manufacturer, who informed him that he had a virus on his machine. Mr. Vijay retorted, "Oh, God!

  22. PDF Viruses, Worms, and Trojan Horses

    You have a computer with an auto-dial phone link. You put the VIRUS program into it and it starts dialing phone numbers at random until it connects to another computer with an auto-dial. The VIRUS program then injects itself into the new computer. Or rather, it reprograms the new computer with a VIRUS program of its own and erases itself from ...

  23. What is a Computer Virus?

    A computer virus is a type of malicious software program ("malware") that, when executed, replicates itself by modifying other computer programs and inserting its code. When this replication succeeds, the affected areas are then said to be "infected". Viruses can spread to other computers and files when the software or documents they ...