ANTIAD.DOC

26.9 KB ef2fcbf75911a175…
     ┌──────────┬───────────┐
     │   BBS    ┼           │
     │   ╓───╖  │ ╓         │                   AntiAd
     │   ║   ║  ┼ ║         │
     │   ╟───╢ ╓┼─║ ╓──     │                Version 1.21
     ├┼──╫─┼─╫─╫■─╫─╨┼─╥───┼┤
     │   ╙   ╙ ╙┼─╜ ───╜    │    (c) Copyright 1992-1993 - Stacy Smith
     │          ┼           │
     └──────────┴───────────┘

                                Courtesy of:

                        The Bloom Beacon-Picayune BBS
          Node 1: (804) 525-9760 (USRobotics Courier Dual Standard)
             Node 2: (804) 525-5372 (USRobotics Courier V.32bis)
                             FidoNet 1:276/112
                                  Intelec
                             RoseNet (ID: BB-P)

                                Stacy Smith
                              Route 6 Box 189
                           Forest, Virginia 24551


┌────────────────────┐
│  1. Introduction:  │
└────────────────────┘

AntiAd was developed due to recent developments in BBS ad files and their
associated headaches.  The asinine sysops who insist on putting this excess
baggage into archives at the expense of other sysops' disk space are getting
more creative and annoying.

By slightly modifying their BBS ad file, perhaps adding spaces to the end of
the file or stamping the time and date into the BBS ad, they were previously
undetectable (until the BBS ad was added to a database). Not so with AntiAd.


┌──────────────────────────┐
│  2. Features of AntiAd:  │
└──────────────────────────┘

      ∙ Identifies BBS ads using conventional database algorithms for files
        that are static (such as .EXE files created by TheDraw).  This method
        of detection is extremely fast and 100% accurate.
      ∙ Includes a BBS ads maintenance function so sysops can update their BBS
        ads CRC database in real time.
      ∙ Identifies tiny BBS ads by filename, allowing detection of 0-byte BBS
        ads.
      ∙ Identifies BBS ads using a new keyword algorithm for files that are
        constantly changing.  This method of detection is slower and can be
        less accurate depending upon how well the keywords are selected by the
        sysop.
      ∙ Up to 100 keyword sets of 5 to 10 keywords each can be configured by
        the user. (These are arbitrary limits and can be raised, if necessary;
        they seemed like good starting points).
      ∙ AntiAd can execute another program as a child process, allowing upload
        processors that only execute 1 file checker (virus checker) to use
        AntiAd *and* another file checker.
      ∙ Runs as a file tester in any upload processing utility, such as ULP,
        Ziplab, ExzTest, etc.
      ∙ Detected BBS ads are removed from the files on disk before being
        repacked by the upload processing utility. They may be stored in a
        subdirectory for subsequent review by the user (user-selectable).
      ∙ AntiAd can generate list files to be passed to an archiver, allowing
        removal of BBS ad files without unpacking the archive. This requires
        proper handling by the upload processing utility or batch file.
      ∙ User-selectable process logging to a disk file.
      ∙ Written completely in C for optimal speed, using Microsoft C/C++ 7.0.
      ∙ Lifetime registration; pay ONCE and your registration number will work
        on all future versions!


┌────────────────────────────────────────────────────────┐
│  3. Files Included in the AntiAd Distribution Archive  │
└────────────────────────────────────────────────────────┘

        ANTIAD.EXE      BBS ad detection and removal program.
        ANTIAD.DB       BBS ads database file.
        NAMES.LST       BBS ads name list file.
        ANTIAD.DOC      This file.
        ANTIAD.CFG      Sample configuration file.
        HISTORY.TXT     AntiAd revision history in reverse order.
        REGISTER.FRM    Registration form for AntiAd.
        FILE_ID.DIZ     Internal description file.

When you unzip the distribution archive, you should see my PKZIP authenticity
verification stamp, and a '-AV' after every file in the archive:

        # SSU301    The Bloom Beacon-Picayune BBS

If there are any files missing or added, or the -AV stamp is missing, the
archive has been tampered with. It would be advisable to call my BBS (listed at
the top of this document) for the latest version of AntiAd.


┌───────────────────────────┐
│  4. Program Requirements  │
└───────────────────────────┘

To the best of my knowledge, this program will run on most any machine capable
of running a BBS package. My BBS setup is PCBoard 14.5a/10 running under
DESQview on a LANtastic network, but other sysops that I have been in contact
with have successfully implemented AntiAd on a wide variety of hardware.

AntiAd requires DOS 3.x or later, as it uses DOS SHARE-compatible file reads
and writes.  AntiAd's memory requirements are very small (about 80K or so, plus
the CRC database and keyword memory allocated).  A hard disk is required (and
not very many BBSes don't have them) so it goes without saying (although I did
anyway; someone is bound to ask... <g>).


┌───────────────────┐
│  5. Registration  │
└───────────────────┘

AntiAd is not free; nor is AntiAd is crippled to force registration. AntiAd is
fully functional, and will always remain so. The only variation with the
registered copies is no time delay and beg message.

Why register? Besides a clean conscience, you will get a registration code that
will work for all future versions of AntiAd, and will remove the delay and
message at the end of execution.

The registration fee for your unique code is $10 for non-commercial BBSes. The
registration fee for commercial BBSes, defined if you run your BBS in the
course of a commercial business or for profit, is $20. Other variations are
available; refer to the file REGISTER.FRM for all registration options. Please
print the file REGISTER.FRM and fill it out. You can print out the form by
issuing the following command from the DOS prompt:

        TYPE REGISTER.FRM > PRN


┌───────────────────────────────────────┐
│  6. License, Warranty and Disclaimer  │
└───────────────────────────────────────┘

I'll keep this part short and sweet, and dispense with the legal-ese:

        License: You are allowed to use AntiAd for 30 days, after which you
           must either register AntiAd or stop using it completely. AntiAd
           registration is a license for your use of AntiAd; I retain
           ownership of the software. A single registration applies to a single
           BBS system, regardless of the number of computers used in the
           system. If you run two or more distinct BBS systems on the same
           computer (with different names), you require two or more AntiAd
           registrations. Refer to the registration form for the currect
           pricing structure.

        Warranty: There isn't one. The only thing I'll guarantee is that
           AntiAd will take up disk space, and will disappear when deleted.

        Disclaimer: I'm not responsible for anything bad that happens. AntiAd
           works here, but I cannot be held responsible for it not working on
           your computer or doing any damage to hardware or software.

If these aren't agreeable with you, then the best thing to do is delete AntiAd
right now. I'll do my best to help any user (registered or not) that wants to
use AntiAd, and I'll act on bug reports quickly, but I simply cannot and will
not be responsible for anything bad, like lost data, disk crashes, or whatever
else you can think of.


┌───────────────────┐
│  7. Installation  │
└───────────────────┘

GENERAL INSTALLATION:
─────────────────────
Make a subdirectory on your hard drive. For the purposes of this document,
we'll call it "C:\ANTIAD". Unarchive the AntiAd distribution archive into this
subdirectory. You've more than likely already made it this far, if you're
reading this file. <grin>

The AntiAd system opens a few files at once for various reasons. I would
recommend that you have a minimum of FILES=30 per node in your system
CONFIG.SYS file for a single-node system, since AntiAd is run in conjunction
with your BBS and upload processing software.

If you are running under a network or a multitasking operating system, you
should already have DOS's SHARE.EXE loaded. You must have SHARE loaded in order
to take advantage of the file sharing and locking methods used by the AntiAd
programs to prevent data loss. (If you are running a single-node system without
a multitasker, SHARE is not needed).

Edit the configuration file to suit your needs. Proper configuration will
require you to refer to this section, the previous section and the section
titled "Configuration", which has an in-depth explanation of each configuration
parameter and its function. It would probably be wise to fire up your printer
for this document.

Note that for the AntiAd program, you can obtain a limited program syntax
screen simply by executing the program with the -? (help) parameter.

INSTALLATION INTO YOUR UPLOAD PROCESSOR:
────────────────────────────────────────
AntiAd is designed to operate on a subdirectory of files that have already been
extracted by the upload processor.  The best application for AntiAd is to be
executed as a file test utility, similar to a virus-scanning program, since at
that point in time the files are already extracted from the archive being
processed.  Depending upon how your upload processor operates, the command
lines can be different.

    * NOTE: If your upload processor is limited to 1 file checker, add AntiAd
            into your processor's configuration, and then configure AntiAd to
            execute your file/virus checker using the CHK_CMD_LINE parameter.

If your upload processor executes the file testers from the directory where the
files are located (this is how the ULP programs operates), the command line is
simply:

    D:\ANTIAD\ANTIAD.EXE -Cd:\antiad\antiad.cfg

If your upload processor DOES NOT execute the file testers from the directory
where the files are located, and passes a filespec to the program (this is how
ExzTest works), the command line is:

    D:\ANTIAD\ANTIAD.EXE -Cd:\antiad\antiad.cfg -Pd:\path\*.*

The '-P' parameter defines to AntiAd where to find the files. Note that it will
accept either a path (e.g. 'C:\TEMP\') or a filespec (e.g. 'C:\TEMP\*.*'); in
other words, the "*.*" is superfluous.  Regardless of the filespec, AntiAd will
check all files in the path passed to it.  This is to allow the highest level
of compatibility with all upload processing utilities.

If you find yourself crunched for command-line space in your upload processing
utility, the '-C' may be omitted in favor of using an environment variable
(named "ANTIAD_CFG") to tell AntiAd where to find it's configuration file. To
do this, add the following line to your AUTOEXEC.BAT file:

    set ANTIAD_CFG=c:\antiad\antiad.cfg

while changing the filespec as necessary to match the name and location of your
AntiAd configuration file.

If your upload processing routine is capable of executing a command after each
archive has been processed, you can use the list-file approach to removing BBS
ads from the archive. This will guarantee that the ad files are removed, even
in -AV protected archives. If you call AntiAd with the following command-line:

    ANTIAD.EXE -Cd:\antiad\antiad.cfg -Pd:\path\*.* -Ld:\antiad\ad.lst

You can then execute the following archiver statements to remove the ads from
the compressed archive:

    ARJ d d:\path\archive.arj !d:\antiad\ad.lst
    LHA d d:\path\archive.arj @d:\antiad\ad.lst
    PAK d d:\path\archive.arj @d:\antiad\ad.lst
    PKPAK -d d:\path\archive.zip @d:\antiad\ad.lst
    PKZIP -d d:\path\archive.zip @d:\antiad\ad.lst

Some notes on the list-file approach: if AntiAd finds no BBS ads, it will NOT
create a BBS ads list file and will exit with an errorlevel you define in
NO_AD_ERRLEV in the configuration file. If it finds one or more BBS ads, it
WILL create the file and exit with the errorlevel defined as AD_ERRLEV. (AntiAd
will not run in ULP using list-file mode; use the standard mode of operation
for AntiAd with ULP.)


┌────────────────────┐
│  8. Configuration  │
└────────────────────┘

The sample configuration file included in the distribution archive is heavily
commented, but some additional information is provided below:

REG_CODE
    The registration code EXACTLY as provided to you on your registration
    letter. If this is an unregistered version, comment out this line. Note
    that this is case-sensitive, as the serial number, BBS name and sysop name
    are all encrypted into this code.

BBS_NAME
    The BBS name EXACTLY as provided to you on your registration letter. If
    this is an unregistered version, comment out this lines. Note that this is
    case-sensitive!

SYSOP_NAME
    The sysop name EXACTLY as provided to you on your registration letter. If
    this is an unregistered version, comment out this line. You get the picture
    by now...

LOG_FILE
    All of the AntiAd programs will write process and error information to a
    log file, if desired. This is the path/filename of the log file for AntiAd
    to record its activities. Comment out if you don't want any disk logging.

STORAGE_DIR
    If you want AntiAd to use a specific directory for storage of BBS ads
    detected and removed from archives, enter the full pathname (including the
    trailing backslash). If you do not want the file saved for later
    inspection, comment it out. I would not recommend using a RAM disk, since
    the files would be lost when the system is rebooted or powered down. Note
    that this will default CRC_DISP and KEYWORD_DISP to DELETE.

NO_AD_ERRLEV
    The errorlevel that AntiAd is to return to DOS if no BBS ads were found by
    AntiAd while processing the subdirectory specified. If this parameter or
    the AD_ERRLEV parameter is commented out, then it will default to 0, since
    most upload processors assume non-zero errorlevels to be program execution
    errors, not information. This value must be between 0 and 255, inclusive.

AD_ERRLEV
    The errorlevel that AntiAd is to return to DOS if one or more BBS ads were
    found by AntiAd.

DB_DISP
    This parameter defines how AntiAd dispositions files detected as BBS ads
    via the CRC-32 signature method. If you want AntiAd to delete the ad file,
    enter DELETE or comment the line out; if you want AntiAd to store the ad
    file in the storage directory (and delete it from the archive being
    processed), enter STORE. Note that for STORE to operate correctly, the
    STORAGE_DIR parameter MUST be defined.

NAME_DISP
    This parameter defines how AntiAd dispositions files detected as BBS ads
    via the filename check. If you want AntiAd to delete the ad file, enter
    DELETE; if you want AntiAd to store the ad file, enter STORE or comment the
    line out.

KEYWORD_DISP
    This parameter defines how AntiAd dispositions files detected as BBS ads
    via the keyword algorithm. If you want AntiAd to delete the ad file, enter
    enter DELETE; if you want AntiAd to store the file in the storage directory
    (and delete it from the archive being processed), enter STORE or comment
    the line out.

ADS_DB
    The directory path and name for the BBS ads database. This database can be
    updated by the sysop by using the '-F' parameter of AntiAd (see section 10
    of this document), freeing the sysop from being reliant on me to maintain
    the ads database. If you find a large number of new BBS ad files, please
    upload them to my board for inclusion into my master ads database
    distributed with AntiAd.  This database format is compatible with my
    UpLoadProcessor (ULP) utility's BBS ads database.

NAME_LIST
    The directory path and name for the BBS ads name list file. This is a ASCII
    text file with one 12 character filename per line. Note that no wildcards
    are permitted; this is by design to prevent accidental removal of files by
    specifying something like '*.AD'.

KEYWORDS
    The keyword sets (separated by commas) to search potential BBS ad files
    for. Note that these keywords are case-sensitive! If a potential ad file
    contains ALL of the keywords or phrases, it will be dispositioned as a BBS
    ad. I suggest using the BBS name, area code and exchange, modem brand and
    other key terms in their ads that seem static. Between 5 and 10 keywords
    are allowed per line; one line comprises a keyword set. Furthermore, a
    keyword set line may not be more than 128 characters long. A maximum of 100
    keyword sets may be defined. Note that BBS ad scanning time increases with
    the number of keywords and keyword sets.

CHK_CMD_LINE
    AntiAd is capable of executing another program before returning to the
    upload processor. If this is desired enter the command line to be executed
    by AntiAd, otherwise, comment the line out. Place the variable @FILES@
    where the filespec is to be placed on the command line.
    * NOTE: If this option is used, AntiAd will return the errorlevel returned
            by this program to the upload processor, and will not use the
            NO_AD_ERRLEV or AD_ERRLEV settings. This is done for optimum
            compatibility with all upload processors.


┌──────────────────────────────┐
│  9. Application Information  │
└──────────────────────────────┘

ULP:
────
The correct configuration setup for AntiAd within UpLoadProcessor is to be used
as a file checker is as follows:

    FILE_CHECKER 2                      (or whatever the next number is...)
    FILE_CHK_CMD C:\ANTIAD\ANTIAD -Cc:\antiad\antiad.cfg
    FILE_CHK_ERR 0

In addition, ULP users should disable the integrated BBS ad checking (ADS_CHK
set to NO), since AntiAd is more capable than ULP in detecting and removing BBS
ads. You may also remove the '-C' parameter if you choose to use the
environment variable approach.

EXZTEST:
────────
The following is an excerpt from a message to me from Mike Cocke, outlining how
he has installed AntiAd:

    ======================================================================
    Packet: SALTAIR
      Date: 12-10-92 (16:58)             Number: 7410
      From: MIKE COCKE                   Refer#: 7192
        To: STACY SMITH                   Recvd: NO
      Subj: EXZTEST AND ANTIAD             Conf: (3) Utility
    ----------------------------------------------------------------------
    SS> I have a question regarding ExzTest and ANTI-AD that you may be
    SS> able to answer. Does ExzTest repack the archive after processing?
    SS> Is it selective? Do I need to trigger it in some fashion?

    It repacks the archives if that config option has been set.

    SS> I have a user having a little difficulty with ExzTest and AntiAd,
    SS> and I'm trying to help him. Got a copy of 2.22, and read the docs,
    SS> but that part wasn't clear.

    2.22 has some problems, including a system hanger.  Stop by the Hacker
    Central and grab XZT8MC.ZIP

    SS> Would you be willing to share how you implemented AntiAd into
    SS> ExzTest? I'd like to document it in the AntiAd docs...

    Sure - in a nutshell, set 'rezip secondary archives' to on, and install
    AntiAd as a virus tester.  The key is the first point.  If this isn't
    set, removals won't matter.
    ======================================================================

If you have any further questions, I would suggest contacting Mike Cocke and
getting the most recent version of ExzTest from his board or Salt Air.

ZIPLAB:
───────
Apparently, ZipLab will not support the operation of more than one file checker
automatically. Or at least, how to add more than one is not readily apparent in
the documentation. Therefore, configure AntiAd into ZipLab and your virus
scanner into AntiAd's CHK_CMD_LINE parameter. In this way, ZipLab will call
AntiAd, AntiAd will call your virus checker, and then return to ZipLab.

GENERIC BATCH FILE:
───────────────────
The following generic batch file (modeled after PCBTEST.BAT) will autodetect
the compression format of the archive using ARCID (again, a utility written by
me), unpack the archive, check it for ads, remove any ads found via the
list-file method, scan the files for viruses, and then clean up. It can easily
be expanded and/or modified to suit your needs:

    @Echo off
    cls

    if exist pcbpass.txt del pcbpass.txt
    if exist pcbfail.txt del pcbfail.txt

    d:\arcid\arcid %1 arj lzh zip
    if errorlevel 98 goto UNKNOWN
    if errorlevel 5  goto ZIP_TESTING
    if errorlevel 4  goto PAK_TESTING
    if errorlevel 3  goto LZH_TESTING
    if errorlevel 2  goto ARJ_TESTING
    if errorlevel 1  goto ARC_TESTING

    Echo ERROR: ARCID critical error...please notify sysop! > pcbfail.txt
    exit

    :UNKNOWN
    Echo ERROR: Unknown file format! > pcbfail.txt
    exit

    :ARC_TESTING
    md testing
    cd testing
    pkunpak -r %1
    if not errorlevel 0 goto UNPACK_ERROR
    d:\antiad\antiad -Cd:\antiad\antiad.cfg -Ld:\antiad\ad.lst
    if exist d:\antiad\ad.lst pkunpak -d %1 @d:\antiad\ad.lst
    goto SCAN

    :ARJ_TESTING
    md testing
    cd testing
    arj e -y %1
    if not errorlevel 0 goto UNPACK_ERROR
    d:\antiad\antiad -Cd:\antiad\antiad.cfg -Ld:\antiad\ad.lst
    if exist d:\antiad\ad.lst arj d -y %1 !d:\antiad\ad.lst
    goto SCAN

    :LZH_TESTING
    md testing
    cd testing
    lha e /m1 %1
    if not errorlevel 0 goto UNPACK_ERROR
    d:\antiad\antiad -Cd:\antiad\antiad.cfg -Ld:\antiad\ad.lst
    if exist d:\antiad\ad.lst lha d /m1 %1 @d:\antiad\ad.lst
    goto SCAN

    :PAK_TESTING
    md testing
    cd testing
    pak e /wa %1
    if not errorlevel 0 goto UNPACK_ERROR
    d:\antiad\antiad -Cd:\antiad\antiad.cfg -Ld:\antiad\ad.lst
    if exist d:\antiad\ad.lst pak d %1 @d:\antiad\ad.lst
    goto SCAN

    :ZIP_TESTING
    md testing
    cd testing
    pkunzip -o %1
    if not errorlevel 0 goto UNPACK_ERROR
    d:\antiad\antiad -Cd:\antiad\antiad.cfg -Ld:\antiad\ad.lst
    if exist d:\antiad\ad.lst pkzip -d %1 @d:\antiad\ad.lst
    goto SCAN

    :SCAN
    scan /a /nomem /nopause *.*
    if not errorlevel 0 goto VIRUS_ERROR

    cd ..
    echo y|del testing\*.*
    rd testing
    if exist d:\antiad\ad.lst del d:\antiad\ad.lst
    Echo File passed all tests... > pcbpass.txt
    exit

    :UNPACK_ERROR
    echo y|del testing\*.*
    rd testing
    if exist d:\antiad\ad.lst del d:\antiad\ad.lst
    Echo ERROR: File failed integrity test... > pcbfail.txt
    exit

    :VIRUS_ERROR
    echo y|del testing\*.*
    rd testing
    if exist d:\antiad\ad.lst del d:\antiad\ad.lst
    Echo ERROR: File failed virus test... > pcbfail.txt
    exit


┌────────────────────────┐
│  10. Manual Operation  │
└────────────────────────┘

In order for sysops to be able to 'keep up' with new ads produced by the weenie
sysops who insert the @!&*#%$ things, AntiAd is capable of scanning a BBS ad
file and updating the BBS ads with it's information. Don't worry about
duplication, as part of the process is to purge duplicate BBS ad info. The
command-line syntax for this functions is:

    ANTIAD -Cantiad.cfg -Fbbs.ad

where 'antiad.cfg' is the full path and filename for the AntiAd configuration
file, and 'bbs.ad' is the path and filename for the BBS ad file to be added to
the BBS ads database. I would suggest only adding executable or ANSI BBS ads to
the database, since they are not easily changed by a sysop before insertion
into an archive.

If you have a subdirectory full of BBS ads to add to the database, the
following batch file will automate the procedure:

    for %%f in (c:\temp\*.*) do ANTIAD -Cc:\antiad\antiad.cfg -F%%f

I would greatly appreciate your uploading of any new BBS ad files that you may
collect over time to my BBS so I can update the master listing that I include
with the AntiAd distribution archive. Please refer to the top of this document
for my BBS number.

The latest version of my BBS ads database is included in the distribution
archive. In order to add whatever new BBS ads information that may be
contained, you can merge it with your current BBS database:

    ANTIAD -Cantiad.cfg -Mother.db

where 'antiad.cfg' is the full path and filename for the AntiAd configuration
file, and 'other.db' is the path and filename for the other BBS ads datatbase
to be merged with the master ads database.


┌───────────────┐
│  11. Support  │
└───────────────┘

If you require support for AntiAd, I can be contacted by any of the following
means:

    ∙ Fidonet netmail (node:  1:276/112)
    ∙ Intelec PCBoard conference
    ∙ RoseNet routed mail (system ID:  BB-P)
    ∙ The ULP Support conference (#42) on Salt Air (PCBoard support BBS)
    ∙ The Support conference (#2) on my BBS (listed at the top of this
      document).


┌────────────────────────────┐
│  12. The Future of AntiAd  │
└────────────────────────────┘

AntiAd will be supported as long as I'm in the BBSing business (which will be
quite a while...once it's in your blood, you can never shake it <g>). The
AntiAd system will be rapidly expanding it's features so it will be your first
choice in BBS ad eradicator. Some current plans:

      ∙ Develop a series of keyword sets to allow detection of most, if not
        all, BBS ads.
      ∙ None...any ideas from you guys? Thanks! <g>

If you have any other suggestions, contact me by U.S. snail-mail or on my BBS
at the number at the top of this document.

Thanks for giving AntiAd a try!


┌────────────────────────────────┐
│  Appendix A:  DOS Errorlevels  │
└────────────────────────────────┘

The following is a list of the errorlevels than can be returned by AntiAd:

        Variable    Successful execution
        Variable    Successful execution, BBS ad list file created
        Variable    Successful execution, file checker errorlevel returned
        99          Help screen (executing a program with no or an
                        insufficient number of arguments)
        100         Could not close all open files
        101         Unknown command line parameter
        102         Config file not found
        103         Too many keywords in a keyword set
        104         Too few keywords in a keyword set
        105         Too many keyword sets defined
        106         Keyword set line too long
        110         Unable to allocate heap memory
        111         Unable to open or lock disk logging file
        114         Unable to open BBS ads database file
        115         Invalid filename provided by user on command-line
        116         Invalid path provided by user on command-line
        117         Unable to open BBS ads name list file
        200         Undefined error (internal to AntiAd program)