Program Security1
Program Security1
Program Security
Inadvertent
Validation error (incomplete or inconsistent)
e.g., incomplete or inconsistent input data
Domain error
e.g., using a variable value outside of its domain
Serialization and aliasing
serialization – e.g., in DBMSs or OSs
aliasing - one variable or some reference, when changed, has an
indirect (usually unexpected) effect on some other data
Inadequate ID and authentication
Boundary condition violation
Other exploitable logic errors
Non malicious program errors
• Bacteria
• Worms
• Logic Bombs • Viruses
Kinds of malicious code
• Malicious code or a rogue program is the general name
for unanticipated or undesired effects in programs or
program parts, caused by an agent intent on damage.
• Agent is the writer of the program or the person who
causes its distribution.
• Virus is a program that can replicate itself and pass onto
other non malicious programs. A hidden, self-replicating
section of computer software, usually malicious logic, that
propagates by infecting (i.e., inserting a copy of itself into and
becoming part of) another program. A virus cannot run by
itself; it requires that its host program be run to make the
virus active.
• Virus can be: transient or resident
Transient virus has a life that depends on the life of its
host.
Resident virus located itself in the memory and will be
active in the system even after the attached program ends.
• Trojan Horse
A computer program that appears to have a useful
function, but also has a hidden and potentially malicious
function that evades security mechanisms, sometimes by
exploiting legitimate authorizations of a system entity
that invokes the program
• Trojan horse gets installed along with an infected
legitimate program.
Effects of a Trojan horse:
• Deleting, editing files.
• Transmitting files to intruders.
• Installing malicious code that can gain network access.
• Privilege elevation attacks etc.
1.Appended Viruses
• Appends to program. Often virus code precedes
the program code execution by running its code
before the 1st program instruction in executable
file.
• Executes whenever program gets executed.
2. Surrounding viruses
• Surrounds program
• Executes before and after infected program
• Intercepts its input/output
• Erases its tracks
• The “after” part might be used to mask virus
existence.
• For example, a virus writer might want to prevent
the virus from being detected. If the virus is stored on
disk, its presence will be given away by its file name,
or its size will affect the amount of space used on the
disk. The virus writer might arrange for the virus to attach
itself to the program that constructs the listing of files on the
disk. If the virus regains control after the listing
program has generated the listing but before the
listing is displayed or printed, the virus could
eliminate its entry from the listing and falsify space
counts so that it appears not to exist.
3. Integrating and replacing viruses
Integrates into program code
• Spread within infected programs
(Replacing) virus V gains control over target
program T by:
• Overwriting T on hard disk
OR
• Changing pointer to T with pointer to V
OS has File Directory
File Directory has an entry that points to file with
code for T
Virus replaces pointer to T’s file with pointer to
V’s file
In both cases actions of V replace actions of T
when user executes what she thinks is “T”
Integrating and
replacing viruses
Document virus-one form of integrated
virus
• Spreads via picture, document, spreadsheet, slide
presentation, database.
• E.g., via .jpg, via MS Office documents .doc, .xls, .pptetc.
• It is implemented within a formatted document, such as a
written document, a database, a slide presentation, or a
spreadsheet.
• These documents are highly structured files that contain
both data (words or numbers) and commands (such as
formulas, formatting controls, links).
• Commands are part of rich programming language.
• Attacker uses these command portions to integrate his
virus code with the document.
• Ordinary user just sees the plain document but not the
virus code embedded in commands portion.
Characteristics of a “Virus”
• Hard to detect
• Not easily destroyed or deactivated
• Spreads infection widely
• Can re-infect programs
• Easy to create
• Machine and OS independent
Homes for viruses
• Most viruses are passed through e-mails or
drive-by-downloads.
• Attackers lure the victims to open the
emails / click the malicious links that enable
drive-by-download.
• Ways for virus to take control over program:
Overwriting the complete program
Changing the pointer to point to a virus
code instead of program on the disk.
• One-time execution: majority of the viruses
today execute only once, spreading their
effect in that once execution.
Boot sector viruses