home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
VIRUS
/
TBAV503.ZIP
/
TBUTIL.DOC
< prev
next >
Wrap
Text File
|
1992-12-29
|
20KB
|
661 lines
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
Table of Contents
1. INTRODUCTION...................................... 2
1.1. Purpose of TbUtil........................... 2
2. USAGE OF THE PROGRAM.............................. 3
2.1. System requirements......................... 3
2.2. Program invocation.......................... 3
2.3. Command line options........................ 3
2.3.1. immunize ............................. 3
2.3.2. store ................................ 4
2.3.3. compare .............................. 4
2.3.4. restore .............................. 4
2.4. Examples:................................... 4
2.5. Using the anti-virus partition.............. 5
3. THE THUNDERBYTE PARTITION CODE.................... 7
3.1. What is a partition?........................ 7
3.2. What is a partition table?.................. 7
3.3. The partition code.......................... 7
4. MISCELLANOUS INFORMATION......................... 10
4.1. Exit codes................................. 10
4.2. Recommendations............................ 10
4.3. DOS Label.................................. 10
Page i
Page 1
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
1. INTRODUCTION
1.1. Purpose of TbUtil
TbUtil has been developed as a tool to provide a defense against
partition table and bootsector viruses.
- It can save the partition table, bootsector and CMOS data area
to a file.
- It can compare and restore the partition table, bootsector and
CMOS data area after an (virus) accident.
- It can remove a partition table virus without having to
low-level format the hard disk, even if there is no backup of
the partition table.
- It can create a partition table that has some first-line virus
defense built-in.
Unlike most file viruses, partition table viruses are hard to
remove. The only solution is to low-level format the hard disk and
to make a new partition table, or to make use of undocumented DOS
commands.
TbUtil makes a backup of the partition table and bootsector, and
this backup can be used to compare and restore the original
partition table and bootsector once they are infected. You don't
have to format your disk anymore to get rid of a partition table or
bootsector virus. The program can also restore the CMOS
configuration.
If your partition table is damaged and you don't have a backup of
it, TbUtil will try to create a new partition table, avoiding the
need of a low-level format.
Another important feature is that you can use TbUtil to replace the
partition table code with it's own code which is more resistant
against viruses. The TbUtil partition code will be executed before
the bootsector gains control, so it is able to check the bootsector
in a clean environment. Once the bootsector is executed it is
difficult to check it, because the virus is already resident in
memory and can fool every protection. Instead of booting from a
clean DOS diskette just to inspect the bootsector, the TbUtil
partition code performs a CRC calculation on the bootsector just
before control is passed to it. If the bootsector has been modified
the TbUtil partition code will warn you about this. The TbUtil
partition code also checks the RAM layout and informs you when it
is changed. It does this every time you boot from your hard disk.
Page 2
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
2. USAGE OF THE PROGRAM
2.1. System requirements
TbUtil should work on any machine with a working hard disk, and
with any DOS version. The program requires only about 64Kb of free
RAM to execute.
2.2. Program invocation
The use of the program is very easy: just run TbUtil without
parameters to get a help screen.
The syntax:
TBUTIL <option> [=<filename>]
2.3. Command line options
It is possible to specify options on the command line. TbUtil
recognizes option-characters and option-words. The words are
easier to remember, and they will be used in this manual for
convenience.
optionword parameter short explanation
---------- --------- ---- -------------------------------------
immunize [=<filename>] i =Immunize / clean partition table
store [=<filename>] s =store disk information into data file
compare [=<filename>] c =compare disk information with data file
restore [=<filename>] r =restore disk information from data file
All options accept a parameter specifying the filename of the
TbUtil data file. The default filename is TBUTIL.DAT and the
file will be created or used in the current directory.
2.3.1. immunize (i)
This is a very powerful option, it can be used to clean an
infected partition table if there is no TbUtil data file, and it
replaces the existing partition table code by a new partition
routine that has some virus detection capabilities. The original
partition code will be saved in a file. You have to run TbUtil
from a floppy drive or you have to specify the name of the file
(the specified drive should be a diskette drive) to store the
original partition code. For more information about the
new partition code see the next chapter.
If the original partition table is completely damaged and can not
be used to built a new one, TbUtil will search the entire disk for
Page 3
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
information about the original disk layout. TbUtil will also search
for TbUtil data files on the hard disk. It is however recommended
to store the data file on a diskette, but it is a good idea to keep
a copy of it on the hard disk. Just in case!
2.3.2. store (s)
This option stores the partition table, bootsector and CMOS data
area into the TbUtil data file. Also some additional information
will be stored in the file to make sure TbUtil will recognize
this PC as the owner of the partition table and bootsector. This is
neccesary because restoring the partition table from another PC to
your PC will destroy all your data at once!
TbUtil will ask you to enter a meaningful description of the
machine. Enter something like "AT 12MHz, 4Mb, room 12, Mr. Smith".
You do NOT have to remember it, TbUtil will display it on the
screen when comparing or restoring, but it helps you to verify that
the data file belongs to the machine.
It is also possible to check the comment from the DOS command
prompt. Enter:
"Type TbUtil.Dat"
This will show the comment of the TbUtil.Dat file (without any
other garbage being displayed).
2.3.3. compare (c)
This option enables you to check that everything is still Ok. If
you specify this option TbUtil will compare the information in
the TbUtil data file against the partition table, bootsector and
CMOS data area. It will also show the comment stored in the data
file. And of course, if you use this option you will also be sure
that the TbUtil data file is still readable.
2.3.4. restore (r)
This option enables you to restore the partition table, bootsector,
and CMOS data area. It will ask you to confirm that the data file
belongs to the current machine. Finally it will restore the
partition table, bootsector of the partition to be used to boot,
and the CMOS data area.
2.4. Examples:
TbUtil store
TbUtil s
TbUtil s = A:TbUtil.Dat
Page 4
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
TbUtil store = A:TbUtil.Dat
TbUtil compare = A:TbUtil.Dat
TbUtil restore = A:TbUtil.Dat
TbUtil immunize = A:\TbUtil.Org
Type A:TbUtil.Dat
2.5. Using the anti-virus partition.
If you install the Thunderbyte partition code (TbUtil immunize),
you will see the following while booting a clean system:
Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
Checking bootsector CRC -> OK!
Checking available RAM -> OK!
Checking INT 13h -> OK!
If there is a virus in the bootsector or partition table you will
see this:
Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
Checking bootsector CRC -> OK!
Checking available RAM -> Failed!
System might be infected. Continue? (N/Y)
If your system configuration changes, i.e. you update your DOS
version, or change the amount of memory, you need to update the
information stored in the immune partition too. You can do this
with the command "TbUtil immunize".
Some other messages that can be displayed are:
Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
No system.
There was no active partition on the disk. If you have used the DOS
program FDISK to define a new partition, it is likely that you
forgot to make one partition "active". Use FDISK to correct the
problem. If this message appears and you did not run a disk
partitioner like FDISK, the partition table is damaged. Restore the
partition code with TbUtil, or use FDISK to create a new partition
table. Beware, the latter will wipe out all data on the disk.
Note that this message is not TbUtil specific, all partition table
routines contain messages like this. If this message appears it is
Page 5
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
never the fault of TbUtil.
Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
Disk error.
The partition code tried to read the bootsector but the BIOS
returned an error. The disk is probably defective.
Page 6
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
3. THE THUNDERBYTE PARTITION CODE.
3.1. What is a partition?
A partition is a logical drive on a hard disk. One physical hard
disk can contain mulitple DOS partitions. Every DOS partition has
its own drive ID (C: D: E:).
3.2. What is a partition table?
How does the system know about the disk lay-out? How does the
system know where a partition starts and ends?
This is defined by the partition table. The partition table contains
the start and end cylinder of every partition. The partition table
also carries information about the operating system of a partition
and which partition should be used to boot. The partition table is
always located at the first sector of the hard disk.
3.3. The partition code
The first sector of the hard disk contains the partition table, but
it also contains a piece of code. This code will be called by the
BIOS boot-routine of the machine. It is the first piece of non-BIOS
code that will be executed. The partition code normally interprets
the partition table, and determines which partition should be used
to boot. It reads the bootsector of the bootable partition and
transfers control to it. The bootsector invokes the DOS hidden
files and the system fires up.
Since the partition code does not do very much and is a very small
routine (about 80 bytes) you will never notice that it is there and
is executed every time you boot.
However, there are some viruses which overwrite the existing
partition table or bootsector, and while performing the normal boot
procedure, the code remains resident in memory and infects every
diskette. When there is a virus in a file, you can easily get rid
of the virus by deleting the infected file. However, the partition
table can not be deleted, and the only thing a user can do is to
low-level format the hard disk and to re-partition it, take their
chances with undocumented DOS commands, or to use TbUtil (or a
similar product) to restore the original partition table.
Anyway, it is often difficult to detect a partition or
bootsector virus, since the virus is already resident in memory
when DOS and eventually an anti-virus product fires up. Like any
other memory resident program, a virus can do anything. The virus
intercepts the BIOS calls, and if an anti-virus product (a scanner
or checksummer) wants to read the bootsector in order to inspect
Page 7
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
it, the virus intercepts the BIOS request, and supplies the program
with an unaltered copy of the original bootsector stored somewhere
on the disk, instead of the infected bootsector. This means that a
well-designed bootsector virus can hide itself completely from
anti-virus products. To detect the virus, you have to be sure the
virus is not resident in memory. There are only two possibilities
to achieve this:
- By booting from a clean DOS diskette (the virus is not executed
and not resident in memory and can not prevent the anti-virus
program to read it)
- By executing a piece of software that is executed before the
bootsector gains control. The only software that is executed
before the bootsector gains control is the machine BIOS and
additional hardware (like Thunderbyte) and the partition code...
Except for hardware immunizers (like Thunderbyte) only the
partition code will be executed before the bootsector gains
control, so only a routine in the partition code can safely check
the bootsector while booting from the harddisk.
This consideration has lead to the development of the Thunderbyte
anti-virus partition code. The Thunderbyte anti-virus code performs
the normal tasks of the partition code, but it also has some
additional routines, which check the CRC (a sophisticated sort of
checksum) of the bootsector, the amount of free RAM, and the
location of the INT 13h handler.
Smart users will have noticed that we changed our subject from
partition viruses to bootsector viruses. The bootsector can be
checked completely by the partition code, but how about the
partition code itself? The answer is that it is not possible to
check the partition code accurately. This can only be done by
hardware like the Thunderbyte add-on card. However, we have
built-in some additional tools to detect partition table viruses.
To know how they work additional information about partition
viruses is required.
A partition virus that wants to hide itself has to remain resident
in memory and has to intercept all attempts to read the partition
code. Since the partition code is normally removed from memory as
soon as DOS fires up, the partition virus has to 1) allocate some
memory to remain resident. The virus also has to intercept all
requests to read the partition code in order to hide itself, so it
has to 2) hook the BIOS INT 13h call. After the virus is memory
resident, the virus reads the original partition code and transfers
control to it. For the user nothing has changed...
When installing the Thunderbyte partition code, TbUtil determines
the amount of RAM at system startup and it calculates the CRC of
the bootsector of the bootable harddisk partition. Both values are
Page 8
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
stored in the partition code.
If there is a virus in the bootsector the CRC does not match
anymore, and the partition code will notify the user of this. If
the partition code has been overwritten by a virus, and the virus
has installed itself in memory before invoking the Thunderbyte
partition code, the amount of available RAM has been decreased.
The Thunderbyte partition code will notify the user about the
unexepected RAM decrease. Finally, the partition code will check
whether INT 13h points to ROM or RAM. Usually, the partition code
is the first piece of software being executed, so INT 13h should
point to ROM. If it points to RAM it means that another piece of
software has been executed before the Thunderbyte partition gained
control, and it is likely that it is a virus. If the virus did not
hook INT 13h, it would be possible to detect the virus with a
normal virus scanner or checksummer. Anyway, if INT 13h points to
RAM, the Thunderbyte partition code will notify the user of this.
Page 9
TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
4. MISCELLANOUS INFORMATION
4.1. Exit codes
TbUtil terminates with one of the following exit codes:
Errorlevel 1 when option 'compare' fails or an error occurs.
Errorlevel 0 when everything was okay.
4.2. Recommendations
Since the PC is completely inaccessable to DOS if the partition
table gets damaged, it is HIGHLY RECOMMENDED to store both the
TbUtil data file and the program TbUtil.Exe itself on a diskette!
It is not nice if the partition table is destroyed, and the only
solution to the problem resides on the same inaccessable disk...
If you own more than one PC, create one TbUtil diskette with all
TbUtil data files of all your PC's on it. Just execute "TbUtil
store = a:TbUtil.<number>" on every PC's. The number specifies
the number (or even name) of the PC.
Do NOT automatically invoke TbUtil from within the autoexec.bat
file with the 'store' option set. If you do this, the data file will
be overwritten by the virus immediately after the disk gets
infected. However, if you - for some reason - want to use the
'store' option without being prompted for the comment, use DOS
redirection to add a standard comment. For example:
TbUtil store < A:\Comment.Dat
4.3. DOS Label
DOS 5.00 and above store the disk label not only in the root
directory but also in the bootsector!
This means that if you change the label of the disk using the DOS
'label' command TbUtil will report that the bootsector has been
changed!
Make a new copy of the bootsector and/or replace the Thunderbyte
partition code.
Page 10