home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / VXAVTOOL.ZIP / EXEC-VIR.ZIP / GOATEXEC.ZIP / GOAT.DOC < prev    next >
Encoding:
Text File  |  1997-04-03  |  59.8 KB  |  1,217 lines

  1.   ┌───────────────────────────┐
  2.   │  ╔══╗  ╔══╗  ╔══╗  ╔═╦═╗  │                 Utility for
  3.   │  ║     ║  ║  ╔══╣    ║    │                 antivirus
  4.   │  ║ ═╦  ║  ║  ║  ║    ║    │                 researchers
  5.   │  ╚══╝  ╚══╝  ╚══╚═  ═╩═   │                 
  6. ┌─┴───────────────────────────┴───────────────────────────────────────┐
  7. │                                                                     │
  8. │               GOAT File Creator Package, Version 4.2                │
  9. │                   (c) MIG, Igor G. Muttik, 1997                     │
  10. │                                                                     │
  11. └─────────────────────────────────────────────────────────────────────┘
  12.  
  13.                 ┌──────────────────────────────────────┐
  14.                 │ NEW - CREATION OF NE-EXE AND PE-EXE  │
  15.                 │ FILES FOR WINDOWS 3.x AND WINDOWS 95 │
  16.                 └──────────────────────────────────────┘
  17.  
  18.   ┌───────┐
  19.   │PURPOSE│
  20. ──┴───────┴───────────────────────────────────────────────────────────────────
  21.  
  22.         GOAT package is a tool for the antivirus researchers.
  23.  
  24.         The GOAT file generator produces executable victim file(s)
  25.         (COM, EXE or SYS), typically called "sacrificial goat file(s)".
  26.         These output files are used as baits for the viruses.
  27.  
  28.         The purpose of the programs can be explained using the
  29.         following diagram:
  30.  
  31.  
  32.       ╔══════════╗      ┌──────────────────────┐
  33.       ║ Goats    ╟────┬─┤ You need a goat file │       ┌─────────────────┐
  34.       ║ creation ║    │ │ with some special    ├───────┤ use GOAT.COM in │
  35.       ║ task     ║    │ │ internal structure.  │       │ "just-one-file" │
  36.       ╚══════════╝    │ └──────────────────────┘       │ mode            │
  37.                       │                                └─────────────────┘
  38.                       │ ┌─────────────────────────┐
  39.                       │ │ You need a series of    │    ┌─────────────────┐
  40.                       ├─┤ goat files of different ├────┤ use GOAT.COM in │
  41.                       │ │ sizes.                  │    │ "series" mode   │
  42.                       │ └─────────────────────────┘    └─────────────────┘
  43.                       │
  44.                       │ ┌─────────────────────────┐
  45.                       │ │ You need a set of files │    ┌─────────────────┐
  46.                       ├─┤ of the same size with   ├────┤ use GOATSET.BAT │
  47.                       │ │ the different contents. │    └─────────────────┘
  48.                       │ └─────────────────────────┘
  49.                       │
  50.                       │ ┌──────────────────────────┐
  51.                       │ │ You need many identical  │  ┌─────────────────────┐
  52.                       ├─┤ samples to infect them   ├──┤ use GOAT.COM in     │
  53.                       │ │ with the polymorphic     │  │ "zillions-of-files" │
  54.                       │ │ virus.                   │  │ mode                │
  55.                       │ └──────────────────────────┘  └─────────────────────┘
  56.                       │
  57.                       │ ┌──────────────────────────┐
  58.                       │ │ You need many different  │  ┌─────────────────────┐
  59.                       └─┤ samples to infect them   ├──┤ use GOAT.COM in     │
  60.                         │ with the polymorphic     │  │ "zillions-of-files" │
  61.                         │ virus.                   │  │ mode with /U switch │
  62.                         └──────────────────────────┘  └─────────────────────┘
  63.  
  64.  
  65.         Using GOAT.COM you can manually select the size, the name
  66.         of a sacrificial goat file and vary its internals to meet
  67.         the criteria, which the virus uses when deciding "to infect
  68.         or not to infect" the victim file. You can enter the size
  69.         of a sacrificial goat file in any of given formats: decimal,
  70.         hexadecimal or in kilobytes. Size of the victim files can
  71.         be as small as 2 bytes and as much as many gigabytes (it is
  72.         a 32-bit variable). GOAT.COM is very flexible - it can create
  73.         COM, EXE, SYS(COM) and SYS(EXE) files, NE-EXE, PE-EXE with
  74.         code at the beginning, in the middle, or at the very end of
  75.         the goat file. Files can be filled with zeroes, NOPs, two
  76.         types of pattern or even filled with random garbage. You
  77.         can add stack segment for the EXE files, vary header size,
  78.         and ... many other options are available.
  79.  
  80.         "Series" mode is intended to create a series of bait files
  81.         with linearly increasing length. Length increase step is
  82.         changeable.
  83.  
  84.         In "zillions-of-files" mode GOAT.COM can create unlimited (you
  85.         will just run out of disk space long before) number of files.
  86.         Then you can infect this set of files with a polymorphic virus
  87.         to test its behavior and properties. This mode is turned on if
  88.         '+' (plus) or /Fnnn or /D[nnn] is given in the command line.
  89.  
  90.         GOATSET.BAT produces some sort of "a standard set" of files
  91.         of the same size. These files are different (internal contents
  92.         or attribute are variable). GOATSET.BAT needs GOAT.COM for the
  93.         execution. GOAT.COM should be located in the current directory,
  94.         or it should be accessible via PATH environment variable.
  95.         The "standard set" of goat files may help you to find out
  96.         which files are prefered by the virus (ex.: virus may infect
  97.         only COM files starting with JMP). Checking "a standard set"
  98.         after virus attack, you can easily understand which files
  99.         are infectable.
  100.  
  101.         A small batch file RUN-ALL.BAT will help you to run (i.e., infect,
  102.         if you have a resident virus active) all generated bait files.
  103.         Text of RUN-ALL.BAT is self-explanatory.
  104.  
  105.         Using GOAT.INI file you can change default behaviour of GOAT.COM
  106.         to better meet your requirements.
  107.  
  108.  
  109.   ┌────────┐
  110.   │EXAMPLES│
  111. ──┴────────┴──────────────────────────────────────────────────────────────────
  112.  
  113.         Examine the following examples with comments:
  114.  
  115.         ───────────────────────── "just-one-file" mode ────────────────────
  116.  
  117.         GOAT /?                  // gives help screen
  118.         GOAT 2 c:\bait.com       // create 2-byte file C:\BAIT.COM
  119.         GOAT 100k                // create 100k file GOAT000.EXE
  120.         GOAT 10 /b/j             // make short COM file with code at the
  121.                                     bottom, without JMP instruction
  122.         GOAT 34 /e2              // create EXE file with 32-byte header
  123.         GOAT 8k /e100h           // create long EXE header (100h=256para=4k)
  124.         GOAT 200 /e10/9          // create EXE file with a 160-bytes header
  125.                                  // and fill the file with NOPs
  126.         GOAT 570 /e/b/j          // make EXE with a standard 512-byte header,
  127.                                     place code at bottom and avoid JMP
  128.         GOAT 4000 /iE5h          // make 4000 bytes COM file, fill with E5h
  129.         GOAT 8k/r/t62            // make 8k COM file with readonly attribute
  130.                                     and seconds field in timestamp = 62 sec
  131.         GOAT 30000 t.exe         // create 30000 bytes file T.EXE, but
  132.                                     with internal COM structure, i.e.,
  133.                                     without EXE header
  134.         GOAT 30000 t.exe /e      // create 30000 bytes file T.EXE,
  135.                                     with standard 512 bytes 'MZ'-header
  136.         GOAT 2000h /e            // create 8192 bytes file GOAT000.EXE
  137.         GOAT 512k /#20h/w        // create 512k NE-EXE file GOAT000.EXE with
  138.                                     20h relocation entries in the EXE header
  139.         GOAT 1k /r7              // make 1k Hidden/System/Readonly COM file
  140.         GOAT 300k /e40h/o/j/9    // make 300k EXE file, not overlaid, without
  141.                                     JMP, filled with NOPs with 1k EXE header
  142.         GOAT 300k /e40h/o/j/9/b  // same, but code at bottom of file
  143.         GOAT 300k /p/t18h        // make 300k EXE file and fill it with
  144.                                     00, 01, 02, ... pattern, set seconds
  145.                                     in the file timestamp = 18h = 24
  146.         GOAT 1k /n               // make 1k COM file, filled with random bytes
  147.         GOAT 1k /u               // make 1k COM file, different from above
  148.         GOAT 1k /y               // make 1k SYS device driver
  149.         GOAT 1k /y/e             // make 1k SYS-EXE device driver
  150.         GOAT 1k /e/k1k           // make 2k EXE file with 1k STACK segment
  151.         GOAT 1k /e/k810h         // make 3088 bytes EXE file, code segment
  152.                                     will take 1024 bytes, stack - 2064, and
  153.                                     SP=810h, CS:IP=FFF0:100
  154.         GOAT 1k /e /k810h /M512  // make 3088 bytes EXE file, code segment
  155.                                     will take 1024 bytes, stack - 2064, and
  156.                                     SP=810h, CS:IP=0:0
  157.  
  158.  
  159.         ────────────────────────── "series" mode ──────────────────────────
  160.  
  161.         GOAT 1000-65000 1000     // create 65 COM files
  162.         GOAT 1000-65000 1000 /E  // create 65 EXE files
  163.         GOAT 600-1600 100 /E/L   // create 10 EXE files and assign them
  164.                                  // a previous year's timestamp
  165.         GOAT 1k-66k 32k /b/9     // create 3 files. First two will be COM
  166.                                     files with 1k and 33k size, last will
  167.                                     be EXE file. Names assigned: GOAT000.COM,
  168.                                     GOAT001.COM and GOAT002.EXE. Code
  169.                                     located at bottom, filled with NOPs
  170.         GOAT 1000h-2000h 200h    // create 9 files: GOAT000.COM (size=
  171.                                     4096) .. GOAT008.COM (size=8192)
  172.         GOAT 50k-60k 10h /e2/b/v // create many EXE files with 32 byte EXE-
  173.                                     header, code at bottom. All will have
  174.                                     SS=CS, SP=IP
  175.         GOAT 1024k-16384k 1024k  // create 16 files, all EXE. Will
  176.                                     probably result in "Not enough disk
  177.                                     space" error, because files will take
  178.                                     >120MB in total
  179.         GOAT 100-1000 100/m50/p2 // make 10 COM files with JMP to the code
  180.                                     located at byte 50, word-pattern filled
  181.         GOAT 1k-10k 1k /y/e      // make 10 SYS device drivers, organized as
  182.                                     EXE files with 512-bytes header
  183.  
  184.  
  185.         ────────────────────────── "zillions-of-files" mode ───────────────
  186.  
  187.         GOAT 100 +               // make 500 100-byte COM files in 10 dirs
  188.         GOAT 1k /D               // make 500 1k COM files in the current dir
  189.         GOAT 1000 /F400/D5/Q65   // create 2000 COM files of size 1000
  190.                                     in five directories - DIRAAA...DIRAAE
  191.                                     Names are GOATAAA.COM .. GOATCJJ.COM
  192.         GOAT 12345h /E2/B/9/D1   // create 500 files. Files will be EXE,
  193.                                     74165 bytes in size, with short EXE
  194.                                     header, NOPs filled, code will be
  195.                                     placed at the end of the files. Names
  196.                                     assigned: GOAT000.COM .. GOAT999.COM
  197.                                     All in one subdirectory - DIR000
  198.         GOAT 2000 /F10000/D1000  // create 10 millions of 2000-byte files
  199.                                     in 1000 directories
  200.  
  201.  
  202.         ────────────────────────── "test-set" mode ────────────────────────
  203.  
  204.         GOATSET 1024             // create 52 different files. Twelve
  205.                                     COM files, 34 EXE files and 6 SYS files
  206.                                     (2 nornal SYS and 4 SYS-EXE).
  207.                                     See GOATSET.LOG for the report.
  208.         GOATSET 30k              // create 52 files. See GOATSET.LOG
  209.                                     for the report.
  210.  
  211.  
  212.         ────────────────────────── "running goats" ────────────────────────
  213.  
  214.         RUN-ALL                  // run all generated GOAT???.COM and
  215.                                     GOAT???.EXE files
  216.  
  217.  
  218.   ┌─────────────────┐
  219.   │USAGE OF PROGRAM │
  220. ──┴─────────────────┴─────────────────────────────────────────────────────────
  221.  
  222.         You can see the correct usage of all programs, specifying the
  223.         "help" command line switch "/h" (or /?):
  224.  
  225.         GOAT /h
  226.         GOATSET /h
  227.  
  228.         Printout of GOAT.COM's help screen is given below:
  229.  
  230. ┌────────────────────────────────────────────────────────────────────────────
  231. │GOAT  -  Version 4.2  -  (C) MIG, 1997
  232. │Usage: GOAT  Size [Filename]  [/switches]               - "just-one-file"
  233. │       GOAT  StartSize EndSize [Increment]  [/switches] - "series mode"
  234. │       GOAT  Size  [+] [/D[nnn]] [/Fnnn]  [/switches]   - "zillions-of-files"
  235. │Size - dec, hex or kbytes (Ex.: 1000, 65530, FE00h, 31k, 512K, 2048k)
  236. │If [Filename] is not given creates GOAT000, GOAT001...
  237. │Switches:                               /N[nnnn] RND filled (nnnn = seed)
  238. │  /Annnn   set SYS driver Attribute     /P,/P2   use byte or word pattern
  239. │  /B       code at Bottom               /Qnn     use char 'nn' instead of '0'
  240. │  /D[nnnn] Directories (default = 10)   /R[nn]   make file Readonly/Hidden/Sys
  241. │  /E[nnn]  EXE file (nn = header size)  /Tnn     seT seconds = nn (<63, even)
  242. │  /Fnnnn   Files in dir (default = 500) /U       Unique RND fill
  243. │  /Gnn     use 'nn' as NOP replacement  /W[nnnn] Make NE header at offset nnnn
  244. │  /Inn     fIll byte = nn (/9 for NOP)  /X[nn]   replace E9 00 00 with 'nn's
  245. │  /J       no JMP at code start         /Y       create device driver (SYS)
  246. │  /Knnnn   add STACK seg of nnnn size   /Z       use 'ZM' EXE header
  247. │  /L[nnnn] set year = nnnn (/L = oLd)   /#[nnn]  put nnn EXE relocations
  248. │  /Mnnnn   put code at offset 'nnnn'    /!       Make PE executable (Win-95).
  249.  
  250.         The square brackets denote optional parameters.
  251.  
  252.  
  253.   ┌────────┐
  254.   │SWITCHES│
  255. ──┴────────┴──────────────────────────────────────────────────────────────────
  256.  
  257.         Short reference of all available switches is given below in
  258.         the alphabetical order.
  259.  
  260.         Note that any switches having a parameter could be entered either
  261.         in decimal or hexadecimal notation (ex., /i100 or /iE5h).
  262.  
  263.  
  264.         /Annnn  - set SYS device Attribute (default=0C853h). Have no sense
  265.                   without /Y switch. (May be placed in the INI file to
  266.                   change default device driver attribute.)
  267.  
  268.         /B      - place code at bottom of file (default is at start)
  269.  
  270.         /C[n]   - set GOAT.COM selfcheck level (by default equals to 2,
  271.                   the highest) (/C means /C0, i.e., no checks at all)
  272.  
  273.         /D[nnnn]- create maximum nnnn subdirectories (default=10)
  274.                   /D (or /D0) means make goat files in current directory.
  275.                   (this switch turns on "zillions-of-files" mode if it was
  276.                   given from the command line)
  277.  
  278.         /E[nn]  - create EXE file (if size > 65280 - done automatically)
  279.                   If nn is given file will have an EXE header of
  280.                   nn paragraphs long (just /E will produce standard
  281.                   512-bytes EXE header). Header size is limited to
  282.                   about 32k.
  283.  
  284.         /Fnnnn  - create maximum nnnn files in a subdirectory (default=500)
  285.                   (this switch turns on "zillions-of-files" mode if it was
  286.                   given from the command line)
  287.  
  288.         /Gnn    - use nn byte instead of NOP (when, say, /J/B are used)
  289.                   /Gnn should be used with *caution* - bad selection of nn
  290.                   will produce goats which hang when executed. This switch
  291.                   is useful when included in the INI file. See also /X.
  292.  
  293.         /H, /?  - Help screen
  294.  
  295.         /Inn    - use fill byte nn instead of standard zero-fill
  296.                   (ex., /i100 or /iE5h)
  297.  
  298.         /J      - remove JMP at code start (by default it is present)
  299.  
  300.         /Knnnn  - add nnnn bytes of STACK segment to the bottom of executable
  301.                   file (stack segment is filled with 'STACK' string by default)
  302.                   Can be placed in the INI file. Parameter /K given in the
  303.                   command line can supress /Knnnn definition given in the
  304.                   INI file.
  305.  
  306.         /L[nnnn]- assigns year 'nnnn' to a created goat file(s). If given
  307.                   without number (just /L) - assigns previous year (say,
  308.                   if current year is 1996 goat will get year 1995).
  309.                   Please note that /L switch affects both the timestamp
  310.                   of the file and the timestamp embedded in the PE-header.
  311.  
  312.         /Mnnnn  - place code in the middle of the file exactly at offset
  313.                   nnnn (nnnn can be in the range 0..filesize, even when
  314.                   the file is >64k).
  315.  
  316.         /N[nnnn]- fill goat file with pseudorandom bytes. The parameter
  317.                   (if given) is a random number generator seed.
  318.                   RNG uses multiplicative congruental method with
  319.                   2**32 period.
  320.  
  321.         /O      - do not make long EXE (>256K) with internal overlay structure
  322.                   This option affects only EXE files longer than 256k.
  323.                   By default such EXE goats get number of pages in the EXE
  324.                   header like in a 256k EXE file (i.e. the rest of the file
  325.                   is not loaded in memory when the file is executed).
  326.  
  327.         /P[n]   - fill free file space with pattern. Switch /P or /P1 means
  328.                   byte pattern, while /P2 - word pattern. Byte pattern looks
  329.                   like is - 00, 01, .. FE, FF, 00, ..  Word pattern is -
  330.                   0000, 0001, ...FFFF, 0000. Both types of patterns
  331.                   are "anchored" to the location (i.e., byte pattern at,
  332.                   say, offset 2BCE will be CE CF D0 D1...; word pattern at
  333.                   the same location will be CE 2B D0 2B D2 2B...).
  334.  
  335.         /Qnn    - use char 'nn' (ex., 65='A') instead of '0' when naming goat
  336.                   files (ex., /Q65 will do: GOATAAA.COM, GOATAAB.COM,...)
  337.  
  338.         /R[nn]  - setting nn in range 1..7 you can produce any combination
  339.                   of Readonly/Hidden/System attributes (/R or /R1 sets
  340.                   Readonly bit, /R2 - Hidden, /R4 - System).
  341.  
  342.         /S      - turn off selfchecking of the created goat file. Also
  343.                   makes goat code a bit shorter (about 80 bytes instead
  344.                   of 286). See also switch /7.
  345.  
  346.         /Tnn    - set timestamp seconds field = nn. DOS stores the seconds
  347.                   of the file creation in the rounded to the closest even
  348.                   value. So odd values are not allowed. Seconds field
  349.                   should be in the range 0..62 and even (ex., 0, 1Eh, 62,...)
  350.  
  351.         /U      - guarantees that contents of each generated file is unique
  352.                   (fills file with random bytes and and do not reset random
  353.                   generator before creation of each file).
  354.  
  355.                   However, if you make a set of files (in "series mode" or
  356.                   "zillions-of-files mode") many times - you will get an
  357.                   identical set every time (as the same seed produces the
  358.                   same pseudorandom sequence). In "just-one-file" mode PC
  359.                   clock is used to give a seed for pseudorandom generator
  360.                   and therefore you will get unreproducible garbage
  361.                   filling for each goat.
  362.  
  363.         /V      - set SS:SP equal to CS:IP
  364.  
  365.         /W[nnnn]- make NE-EXE file. By default NE-EXE header will be
  366.                   located at offset 400h. The offset value is rounded
  367.                   to the closest 32-bit boundary. NE-EXE header should
  368.                   be in the first 64k of the EXE file, so offset limits
  369.                   are [40..FF8C] (but it shouldn't also overlap with the
  370.                   code or with relocations, if any). See also /2 switch.
  371.  
  372.         /X[nn]  - kills E9 00 00 and replaces it with given bytes.
  373.                   Switch /X without parameter is useful only when the
  374.                   code is not at the goat file start (/B or /Mnnnn were
  375.                   used). Otherwise it has the same effect as just /J.
  376.  
  377.                   /Xnn should be used with *caution* - bad selection of nn
  378.                   might produce goats which hang when executed.
  379.  
  380.                   If there are values patched in the body of the program
  381.                   where [90 90 90] was - they are used in the first place.
  382.  
  383.         /Y      - create device driver (SYS file). May be combined with
  384.                   /E to make SYS-EXE files.
  385.  
  386.         /Z      - make 'ZM' EXE header instead of 'MZ'.
  387.  
  388.         /2      - merely changes target OS in the NE-EXE header to OS/2
  389.                   (default is Windows). Can be specified twice to get
  390.                   "unknown" target OS. 
  391.  
  392.                   For PE executables increases OS MAJOR, USER MAJOR
  393.                   and SUBSYS MAJOR fields (defaults are, 1, 0 and 3,
  394.                   respectively). Can be placed in the INI file.
  395.  
  396.         /9      - fill free file space with NOPs (default - with zeroes)
  397.                   (it is just a shortcut for /i90h).
  398.  
  399.         /7      - enables beeping when selfcheck fails (works both for
  400.                   selfcheck of GOAT.COM generator and for produced goat
  401.                   files which have selfchecking code).
  402.  
  403.         /#[nnnn]- specifies the number of dummy relocation entries in
  404.                   the EXE header. Relocation make happy a couple
  405.                   of viruses, which refuse to infect goats with no
  406.                   relocations. Relocations are dummy - they do not
  407.                   affect the goat code. If the code of the goat is
  408.                   at the file start (just after EXE header), then
  409.                   relocations will affect bytes just after the goat
  410.                   code (after B4 4C CD 21). If code is at file end (/B),
  411.                   or in the middle (/Mnnnn), then relocations are made
  412.                   to the bytes just after file end (or to the stack
  413.                   area if it's present). Switch /# without parameter
  414.                   can suppress /#nnn definition given in the INI file.
  415.                   For normal EXE files relocations start at 1Ch, for
  416.                   Windows NE/PE executables - at offset 40h.
  417.  
  418.         /!      - Make PE-executable file. By default PE-header will
  419.                   be at offset 100h. Any generated PE executable has
  420.                   exactly 5 sections (CODE, .icode, DATA, .idata and
  421.                   .reloc). Option /! also sets size of the EXE header
  422.                   to 40h bytes (use /Ennnn to change if you wish).
  423.                   See also /2 switch.
  424.  
  425.  
  426.         The switches in the command line (like /E) give you the control
  427.         over the victim creation. You can place the code at the beginning
  428.         of the goat file or at the bottom. You can select the filling
  429.         byte (00, 090h or even pattern), the presence of JMP at the code
  430.         start. You can force creation of EXE file. You can even change
  431.         size of EXE header and control values loaded in SS and SP. You
  432.         can prohibit the creation of overlaid EXE files, etc. Most of
  433.         the command line switches can be applied simultaneously.
  434.  
  435.         Value, specified in the switch /Mnnnn (nnnn is 32-bit value
  436.         and you may use "k" and "h" modifiers), has the following
  437.         limitations:
  438.  
  439.                 for EXE: (header size) < nnnn < size-286 (no /S)
  440.                 for EXE: (header size) < nnnn < size-78  (with /S)
  441.                 for COM              3 < nnnn < size-2
  442.  
  443.         If some switches are conflicting (say, "GOAT 1000 /P0/P2", where
  444.         /P0 - byte pattern and /P2 - word pattern), - the last is used
  445.         (same applies to the switches in the INI file).
  446.  
  447.         Some combinations of switches are not allowed. For example, you
  448.         cannot set /J, /B and /P for any COM file simultaneously (if
  449.         code is at bottom and no JMP is present - pattern will appear
  450.         as a code at CS:100).
  451.  
  452.         Switch /Knnnn adds stack segment at the bottom of the file
  453.         (always EXE). Size of the stack segment is limited:
  454.  
  455.                 16 < nnnn < 65536
  456.  
  457.         Please avoid small and odd values in /K, because when the goat
  458.         file created with such an odd stack is run it could easily hang
  459.         a computer or cause "Exception #13" (QEMM frequent warning),
  460.         when SP goes through the stack segment boundary (i.e., half
  461.         of word is written at SS:0000 and other half - at SS:FFFF).
  462.  
  463.         Note, that the size specified in /Knnnn is added to the main
  464.         size of the file (i.e., GOAT 1k /k1k will produce 2048 bytes
  465.         EXE file). If the main size of the file does not end on the
  466.         paragraph boundary (i.e., main size is not divisible with 16) -
  467.         stack segment will start on the first paragraph after the end
  468.         of the main file size.
  469.  
  470.         Switches /Fnnn and /Dnnn given in the command line automatically
  471.         turns the program into a "zillions-of-files" mode (or use '+').
  472.         You can specify the desired number of files and subdirectories
  473.         to create. By default, 10 subdirectories with 500 files in each
  474.         are created. Note, that if any directory already exists (say,
  475.         DIR004), it will be simply skipped and no new files will be
  476.         created inside.
  477.  
  478.         If you specify just /D switch this will allow creation of
  479.         zillions-of-files in the current directory (same as /D0).
  480.  
  481.  
  482.   ┌────────┐
  483.   │INI FILE│
  484. ──┴────────┴──────────────────────────────────────────────────────────────────
  485.  
  486.         You may like to put your preferences (signature, switches,
  487.         filename templates, etc.) into a separate file - GOAT.INI
  488.         Use any text editor to create or modify INI file.
  489.  
  490.         Note that not all switches are suitable for placing in the
  491.         INI file as some of them are "direct-action". They immediately
  492.         force certain mode of operation: say, if you place /E in the
  493.         INI file you will no longer be able to create goats of COM
  494.         type. Here is the list of switches suitable for INI file
  495.         (although, the last five are not very useful in the INI):
  496.  
  497.                 # 2 7 9 A C D F G I K L N O P Q S X  and  J R T U V
  498.  
  499.         The following are not suitable for the INI file (not
  500.         mentioning /? or /H switches):
  501.  
  502.                 ! B E M W Y Z
  503.  
  504.         The sample INI file is given below:
  505.     ┌─────────────────────────────────────────────────────────────────────
  506.     │;
  507.     │; sample INI file
  508.     │;
  509.     │Motto="Antivirus test file."       ;all output bait files will carry
  510.     │                                   ;this string.
  511.     │files=BAIT             ;files will be BAIT000.COM, BAIT001.COM, ...
  512.     │dirs=HEAP              ;directories created - HEAP000, HEAP001, HEAP002
  513.     │STACKfill="*MYSTACK"   ;fill stack with '*MYSTACK*MYSTACK*MYSTACK'
  514.     │SYSnames="DRIVERXX"    ;this string is inserted into SYS header.
  515.     │Switches=/F800/D15     ;make 15 dirs, 800 files in each. 12000 in total.
  516.     │Switches=/L            ;always put previous year in a goat timestamp
  517.     │Switches=/iF6h         ;always fill free file space with 0F6h byte
  518.     │Switches=/g40h         ;use INC AX instead of NOP
  519.     │Switches=/q65          ;use GOATAAA..GOATJJJ instead of GOAT000..GOAT999
  520.     │Switches=/O            ;never make overlaid EXE files
  521.     │Switches=/K200h        ;if EXE - always add 512 bytes stack at eof
  522.     │
  523.  
  524.         GOAT.INI may be located in the current directory or in the path
  525.         of started GOAT.COM. The first location has priority over the
  526.         second. GOAT.INI may not exist. In that case program uses
  527.         built-in defaults.
  528.  
  529.         The following statements are allowed in the INI file:
  530.  
  531.         Motto=             ;defines signature for all created goat files
  532.                            ;(not present on default)
  533.         files=             ;filename template for GOAT.COM (default=GOAT)
  534.                            ;it can be empty (ex., files=)
  535.         dirs=              ;directories template for zillions-of-file mode
  536.                            ;it can be empty (ex., dirs=)
  537.         STACKfill=         ;stack fill string (default=STACK)
  538.         SYSname=           ;driver name (default=GOATXXXX)
  539.         Switches=          ;any switches you like (multiple lines allowed)
  540.  
  541.         Any comments may be added after a semicolon.
  542.  
  543.         Filename template (files=) and dir template (dir=) can be
  544.         empty (this will make all letters of the name variable:
  545.         000-999 or whatever was defined by /Qnn).
  546.  
  547.         Motto string, defined in the INI file appears in the created
  548.         goat COM file immediately after JMP (if any) or after the goat
  549.         code (if no JMP). In the EXE file it appears after the goat
  550.         code, if code is at the start. If space at the beginning is
  551.         free (ex., /B or /Mnnnn switch moved goat code away from the
  552.         beginning) - motto will appear at the EXE file start (after
  553.         the EXE header). Motto string is limited to 64 symbols. To
  554.         include spaces in the motto string use quotes. Note, that
  555.         /J/B and /J/Mnnnn switch combinations supress motto in the
  556.         goat file.
  557.  
  558.         Switches /F and /D given in the INI file just modify the
  559.         built-in default values for the number of files and directories,
  560.         created in "zillions-of-file" mode. This does not turn on
  561.         this mode. To do so you will need to specify '+' (plus)
  562.         in a command line explicitely.
  563.  
  564.         Filename and subdirectory templates are limited to 5 symbols,
  565.         because programs always add '000' and then start incrementing
  566.         this number until it becomes '999' (or 'AAA' ...'JJJ' if you,
  567.         say, redefined the naming with /Q65 switch). Dot is not
  568.         allowed in the template. Any string exceeding the limit
  569.         of 5 symbols will give the error message:
  570.  
  571.                 "Error in the INI file line #xxx"
  572.  
  573.         The processing will be aborted. The same error will appear if
  574.         you give any wrong switch (say, /@) or parameter value (say,
  575.         /T68 or /i500).
  576.  
  577.         Stack fill string is limited to 32 symbols (you can use
  578.         even unprintable characters, like ASCII 01, etc.).
  579.  
  580.         The strings may be quoted. To enter a quote itself - duplicate
  581.         it inside the quoted string - ex. "File is ""readonly"""
  582.         will be converted to a string: 'File is "readonly"'.
  583.  
  584.         Driver name, defined using "SYSname=", is limited to 8 symbols.
  585.         This name is right-padded with 'X' symbols, if name has less
  586.         than eight symbols.
  587.  
  588.         Note that any INI file switch settings is overridden by
  589.         command line switches.
  590.  
  591.  
  592.   ┌────────────────┐
  593.   │SIZE LIMITATIONS│
  594. ──┴────────────────┴──────────────────────────────────────────────────────────
  595.  
  596.         By default GOAT.COM produces sacrificial file of COM type.
  597.         This applies to any given size, which meet the following
  598.         criterion:
  599.  
  600.                2 < Size_of_COM < 65280
  601.  
  602.         The magic number 65280 is a maximum size of COM file, which
  603.         should fit in a segment size (64k) taking off PSP size (256):
  604.         65536 - 256 = 65280.
  605.  
  606.         When placing the code at the bottom of the COM file having
  607.         size about 64K, code may lay too close to SS:SP (for COM
  608.         files: SS=CS, SP=FFFE) and the program may hang your system
  609.         when run, because stack might overwrite the code.
  610.         Therefore, if the spacing between IP and SP is less than
  611.         64 bytes, the goat generation is aborted and the goat file
  612.         is not created (You will see a warning - "Goat IP will be
  613.         too close to SP. Abort!"). If you absolutely need such a
  614.         file - use switch /Mnnnn to place code at the very bottom
  615.         of your file. With /M switch the test is not performed,
  616.         because if you specify some value in /M switch you probably
  617.         understand what you are doing!
  618.  
  619.         When the size specified in the command line is greater than
  620.         65280 (or equal to), EXE file is generated automatically (you
  621.         do not need to write /E switch explicitly). Such a file will
  622.         have an EXE header in the beginning. Because of the presence
  623.         of EXE header, the size limitations are the following:
  624.  
  625.               513 < Size_of_EXE < free_disk_space (with /E switch)
  626.                33 < Size_of_EXE < free_disk_space (with /E2 switch)
  627.  
  628.         When you need to create EXE file shorter than 65280 bytes,
  629.         use /E (or /Z) command line switch explicitely.
  630.  
  631.         When creating a series of bait files in a "series" mode,
  632.         the size can exceed 65280 bytes limit at some point. All
  633.         files longer than 65280 will be automatically turned to
  634.         default EXE files (i.e., with a standard 512 bytes 'MZ'
  635.         header) and file extension will change to .EXE.
  636.  
  637.  
  638.   ┌─────────────────────────────────┐
  639.   │BAIT FILES INTERNALS AND PRINTOUT│
  640. ──┴─────────────────────────────────┴─────────────────────────────────────────
  641.  
  642.         The sacrificial goat file itself contains a small program,
  643.         which displays its type (COM, EXE or SYS), size in hexadecimal
  644.         and in decimal (only when goat file is of enough size, i.e.,
  645.         space for code itself is at least 74 bytes).
  646.  
  647.         Sacrificial goat file consists of the two parts: the small
  648.         portion of code (of fixed size, always being 2 bytes or 74
  649.         bytes) and a block of zeroes, NOPs or pattern of variable
  650.         size (00..FF, 0000...FFFE or random pattern). Zeroes (NOPs
  651.         or pattern) take all space of the file, free from the code.
  652.         EXE files have additionally an EXE-header. Non-used part of
  653.         the EXE header is always filled with zeroes. SYS files have
  654.         SYS header, strategy and interrupt routines in addition to
  655.         the code given below.
  656.  
  657.         Two types of code can be placed into the victim file (COM/EXE).
  658.         They are given in the table:
  659.         ┌───┬────────────────────────────────────┬───────────┬───────────┐
  660.         │ # │ Code                               │ Size, dec │ Size, hex │
  661.         ├───┼────────────────────────────────────┼───────────┼───────────┤
  662.         │ 1 │ int 20h                            │      2    │     2     │
  663.         ├───┼────────────────────────────────────┼───────────┼───────────┤
  664.         │ 2 │ This code just prints message      │    ~80    │   ~50h    │
  665.         │   │ with the file type/switches/size   │           │           │
  666.         ├───┼────────────────────────────────────┼───────────┼───────────┤
  667.         │ 3 │ This code apart from printing      │   ~256    │  ~100h    │
  668.         │   │ a message selfchecks the size      │           │           │
  669.         │   │ of host goat file and reports      │           │           │
  670.         │   │ the size changes (if any)          │           │           │
  671.         └───┴────────────────────────────────────┴───────────┴───────────┘
  672.  
  673.  
  674.         Dots (/....) in the message printed by the goat file are replaced
  675.         with 4 last command line switch letters. Any switches specified
  676.         in the INI file are not included. All command line switches
  677.         modify this field (namely - ABGIJKLMNOPRTUVWXZ!#279). Switches
  678.         that change the mode of GOAT.COM operation (namely - CDEFQY)
  679.         are not reflected. Switches /E,/Y are not reflected because
  680.         file extension (EXE) or printout (SYS) is itself an obvious
  681.         indication.
  682.  
  683.         The output of a sample goat file (the size of the sample was
  684.         100 bytes and command-line switch /B was given) will be
  685.         the following:
  686.  
  687.         "Goat file (COM/b..). Size=00000064h/0000000100d bytes."
  688.  
  689.         File type (COM/EXE/SYS), real numbers and switch letters
  690.         (if any) are inserted into the goat file message at the
  691.         moment of creation.
  692.  
  693.  
  694.   ┌───────────┐
  695.   │BAIT NAMING│
  696. ──┴───────────┴───────────────────────────────────────────────────────────────
  697.  
  698.         Usually GOAT.COM generator creates output sacrificial files in
  699.         the following order: GOAT000.COM, GOAT001.COM, GOAT002.COM, etc.
  700.         The same applies to EXE files, and the order is ascending:
  701.         GOAT000.EXE, GOAT001.EXE, GOAT002.EXE, etc. If some file in
  702.         a row (say GOAT050.COM or GOAT050.EXE) already exist - the
  703.         next file number is selected automatically (it will be
  704.         GOAT051.COM or GOAT051.EXE). This does not apply to SYS
  705.         files (i.e., GOAT000.COM and GOAT000.SYS are allowed).
  706.         This naming strategy is used to give some freedom to
  707.         companion viruses.
  708.  
  709.         Switch /Qnn is used to make it more difficult to virus-
  710.         writers to build viruses which avoid infecting the goat
  711.         files using the presense of digits in the filename.
  712.         If, say, you specify /Q65 in a command line (or in the
  713.         INI file) all generated goats will have 'AAA', 'AAB', 'AAC'...
  714.         instead of '000', '001', '002'... You can use any char
  715.         if its ASCII code is in the range [33; 126], but note that
  716.         some characters are not allowed by DOS (like ":\><|/.").
  717.         Such characters will be simply skipped.
  718.  
  719.         GOATSET.BAT produces 52 files of the same size. There will
  720.         be 12 COM, 34 EXE, 2 SYS and 4 SYS-EXE files. GOATSET.LOG
  721.         is created after each start of GOATSET.BAT. Inspect this
  722.         log file (GOATSET.LOG) file in order to get the report about
  723.         the internal structure of generated files, the error messages,
  724.         etc.
  725.  
  726.         Note, that definitions, given in the INI file may change
  727.         default file (and sudbirectories) naming.
  728.  
  729.  
  730.   ┌──────────┐
  731.   │EXE HEADER│
  732. ──┴──────────┴────────────────────────────────────────────────────────────────
  733.  
  734.         By default, EXE header is 512 bytes in size. You can change
  735.         EXE header size using /E switch with parameter. For example,
  736.         /E2 produces shortest possible 32-byte EXE header. Size of
  737.         EXE header is limited to about 32k.
  738.  
  739.         By default, EXE header starts with 'MZ' signature. Use /Z
  740.         switch to make 'ZM'.
  741.  
  742.         When the sacrificial file is less than 256K bytes, the
  743.         first two fields (pages and remainder in the last page)
  744.         are assigned according to the real file size. But when
  745.         code is placed at the beginning of bait file and when
  746.         the limit of 256K is exceeded, the number of pages is set
  747.         to 2 (EXE header size plus code size) and code on the last
  748.         page is set to 64 bytes. This technique makes an "overlaid"
  749.         EXE file. It is absolutely needed to enable execution of
  750.         files bigger than the amount of free conventional memory
  751.         (say, for execution of a 700K file or a 10MB file).
  752.         Switch /O does not affect the internals of EXE files
  753.         smaller than 256K.
  754.  
  755.         If you specify /B switch (or /Mnnnn or /Knnnn switches),
  756.         the overlay creation mode is automatically turned off
  757.         (same as if you write /O in the command line). Otherwise,
  758.         the code (or stack) will be unaccessible and such a file
  759.         will not run (DOS will give error message, when attempting
  760.         to start such a file).
  761.  
  762.         If you need a goat file with, say SS:SP equal to 400:1234,
  763.         use one of the following calls:
  764.  
  765.                 GOAT 4200h /K1234h
  766.                 GOAT 4020h /K1234h /E2
  767.  
  768.         Value of SP=1234h is obvious. To calculate file size take
  769.         needed SS, multiply it on 10h (to convert paragraphs into
  770.         bytes) and add 200h (bytes in standard header) or 20h (for
  771.         short EXE header).
  772.  
  773.  
  774.   ┌──────────────┐
  775.   │DEVICE DRIVERS│
  776. ──┴──────────────┴────────────────────────────────────────────────────────────
  777.  
  778.         To create device driver (SYS) file use switch /Y. Device driver
  779.         file can be in two formats - simple driver (a'la COM file) and
  780.         EXE-file driver (with EXE header, a'la SMARTDRV.EXE or SETVER.EXE).
  781.         Files of the first format can only be invoked from CONFIG.SYS and
  782.         they will print message "Goat file (SYS). Size=..." when DOS
  783.         requests an initialization of the driver. Second format (SYS&EXE)
  784.         can be placed in the CONFIG.SYS and can also be invoked from the
  785.         DOS command line as a normal EXE file. In both cases this driver
  786.         file prints the same message.
  787.  
  788.         Minimal size of the device driver is around 150 bytes (including
  789.         SYS header). For EXE drivers this limit increases (it should
  790.         include additionally the size of the EXE header).
  791.  
  792.         Note that device drivers, being simultaneously an EXE files, has
  793.         a "(SYS)" type designator inside, but are always named as .EXE
  794.         files (to enable execution from the command line as a normal
  795.         executable file). Such files can exceed 64K only if device
  796.         driver routine is placed in the first segment of the goat file
  797.         (because pointers to Strategy and Interrupt routines in the
  798.         driver header are limited to 16-bits). So, a command
  799.         "GOAT 70k /y/b" is illegal, but "GOAT 70k /y/m63k" is OK.
  800.  
  801.         Default device driver attribute is set to 0C853h (most usable
  802.         bits are set). You can vary attribyte with /Annnn switch (or
  803.         even place this witch setting into the INI file to override
  804.         default setting).
  805.  
  806.  
  807.   ┌──────────┐
  808.   │ERRORLEVEL│
  809. ──┴──────────┴────────────────────────────────────────────────────────────────
  810.  
  811.         GOAT.COM returns ERRORLEVEL=0 after the successful operation.
  812.  
  813.         GOAT.COM returns ERRORLEVEL=1, when  output victim file was
  814.         not created or if the current operation failed (say, no more
  815.         space when creating zillions-of-files). The error message
  816.         will be printed.
  817.  
  818.         GOAT.COM returns ERRORLEVEL=2 when user pressed Ctrl-Break
  819.         (this feature is used in batch file GOATSET.BAT).
  820.  
  821.         GOAT.COM returns ERRORLEVEL=3 when selfchecking has failed
  822.         (Note, that /C switch turns off selfchecking).
  823.  
  824.  
  825.   ┌───────────────────────────────┐
  826.   │SELFCHECKING OF GENERATED GOATS│
  827. ──┴───────────────────────────────┴───────────────────────────────────────────
  828.  
  829.         Generated goat files (except SYS files) check their own size
  830.         by default (this option works only under DOS 3.0 or later).
  831.         If goat file has been changed - the difference is reported
  832.         both in decimal and hexadecimal notation:
  833.  
  834.                 Goat file (COM/....). Size=00002710h/0000010000d bytes.
  835.                 Size change=0CDAh/03290d.
  836.  
  837.         If size change is more than 64k - the goat file will print
  838.         question marks instead of digits:
  839.  
  840.                 Goat file (EXE/....). Size=00002710h/0000010000d bytes.
  841.                 Size change=????h/?????d.
  842.  
  843.         If you wish size change report might be accompanied by a PC
  844.         speaker's BEEP. Use switch /7 to activate this option.
  845.  
  846.         Note that not all infections will be reported - file system
  847.         infectors (like DIR-II, Byway) will not be detected. Cavity
  848.         viruses (like BootEXE, Zerohunt) and companion viruses (like
  849.         Gold Bug, Little Brother, HLLC) will be missed too. Most
  850.         of the others are caught without problems (please let me
  851.         know if you find any).
  852.  
  853.         To suppress the selfchecking code use switch /S. For example
  854.         this may be needed to create shorter goats, as selfchecking
  855.         code is long enough.
  856.  
  857.         Goat file returns ERRORLEVEL=0 if selfcheck was OK and
  858.         non-zero if selfcheck failed.
  859.  
  860.  
  861.   ┌────────────────────────┐
  862.   │SELFCHECKING OF GOAT.COM│
  863. ──┴────────────────────────┴──────────────────────────────────────────────────
  864.  
  865.         GOAT.COM program checks its own health. Selfchecking has three
  866.         levels (selectable with /Cn switch):
  867.  
  868.                 0 - no checks
  869.                 1 - check of the file disk image
  870.                     (includes file time stamp and COM extension)
  871.                 2 - check of the file disk image and
  872.                     of the file size (default level)
  873.  
  874.         If the checksum of the file on disk is invalid you will
  875.         see a warning after program termination:
  876.  
  877.                 "GOAT.COM  altered!
  878.                  Size change=00001000h/000004096d bytes."
  879.  
  880.         If you need to turn off file contents checking - use switch
  881.         /C0 (or simply /C).
  882.  
  883.         Therefore, do not try to pack GOAT.COM with PKLITE or
  884.         similar compressors. That will result in the "GOAT.COM
  885.         altered!" report.
  886.  
  887.         If program file extension is not COM you will see (if switch
  888.         /C is not specified):
  889.  
  890.                 "GOAT.COM  altered by companion virus!"
  891.  
  892.         All selfchecking is automatically turned off (same as /C0) for
  893.         DOS versions prior to 3.00 (because the location of the original
  894.         file on disk cannot be found).
  895.  
  896.  
  897.   ┌─────────────────┐
  898.   │PATCHING GOAT.COM│
  899. ──┴─────────────────┴─────────────────────────────────────────────────────────
  900.  
  901.         This paragraph is for experienced users only! Do not try
  902.         to modify GOAT.COM if you do not 100% understand what is
  903.         written below.
  904.  
  905.         Although the core of the GOAT.COM program is protected from
  906.         modification (partial checksumming of GOAT.COM file is done),
  907.         you can patch the program to better meet your requirements
  908.         because data area near the end of the file is not checksummed.
  909.         When doing any of descibed modifications to GOAT.COM preserve
  910.         the original timestamp of the file - it is checked too. (For
  911.         example, you can use HIEW to modify the file without touching
  912.         the timestamp.)
  913.  
  914.         Near the eof you can see the code of the created GOAT files
  915.         (starting with bytes E9 00 00 E8 ...), its messages ("Goat
  916.         file (COM)" and "bytes." You see also image of the EXE header
  917.         (4D 5A ...), SYS file code (56 E8 00 00 ...) and NOPS (90 90 90)
  918.         replacing the jump (E9 00 00) when you specify /J switch.
  919.  
  920.         You can patch these areas to make GOAT more unique. That's
  921.         worth doing because some viruses may start trying to
  922.         recognize the goats produced by this package and will
  923.         refuse to infect them. For example, you can set your own
  924.         MINALLOC, MAXALLOC, CHKSUM fields in the EXE header.
  925.         You might like to change 90 90 90 to any reasonable and
  926.         appropriate processor commands (like ex., MOV/INC/ROR/etc.)
  927.         But still you will have to fit into 3 bytes only!
  928.  
  929.         You can also modify "Goat file " string to whatever you
  930.         want. This will change the message your goats are
  931.         printing when executed. And again - the size of this
  932.         string should be preserved.
  933.  
  934.  
  935.   ┌──────────────┐
  936.   │AUTHENTICATION│
  937. ──┴──────────────┴────────────────────────────────────────────────────────────
  938.  
  939.         If you have PGP program installed on your machine you can
  940.         check the authenticity of GOAT.COM file.
  941.  
  942.         I include below my PGP public key. It can be used to check
  943.         the validity of GOAT.COM (even for future versions).
  944.  
  945. -----BEGIN PGP PUBLIC KEY BLOCK-----
  946. Version: 2.6.3i
  947.  
  948. mQCNAiz3uywAAAEEAKRvzeHdrUT1tlgIbpPoVmI51qiDctKIKGlY82cLCsnKs3Mh
  949. c0d73bjprJqpgFGy/DmLARJj15FcnTjwT2lS4DCBX/+Um3PMZTUpoDDcHwV+LbC+
  950. CfUf/4vupkjdhqIt8LzFwoPYaPH0wG6Wh3WJpaqYkRsgPQMagzqaFa593YhRAAUR
  951. tCNJZ29yIEcuIE11dHRpayA8bWlnQGx0LnBoeXMubXN1LnN1PokAlQMFEDL/TBE6
  952. mhWufd2IUQEBRIUD/0hZPyvKyKn7kmyJ2k9JPyAOAzjMjM6UHGpLx3A1XaF2R0ia
  953. amkYfm1xCHYsp82wmBhyROImpE7DurU1k/KmxuMPS8UifxsE3NkwUnc1NRH7VOvc
  954. lH/Pa9nfQ/lItMQNEcr9DQOYmCl3uI+taXW4Wog43spFyCNNLWti3aHgMGBetCNJ
  955. Z29yIEcuIE11dHRpayA8TUlHQGx0LnBoeXMubXN1LnN1PokAlQMFEDLmEDdQK/tU
  956. ud7FuQEB6AYD+waV+Ji92OWh22mnZdoBsdPXEbkRCh2J0+KTCqtFtZ6GdNBSxaFi
  957. 4wpPgqkxlMIwDtRZLU/dl+NSKzhk45EDU5f6blM5OnhC32b1BlnFY99jzfsM4xAT
  958. aVDWnCn+zhnshIcU8elTgz1p/y3GJhGyxCw9lEAa26XBWtSSdmS/SpygiQCVAwUQ
  959. MW0uxDqaFa593YhRAQE/HgP/dc+nrly5FKbpEF5vLN/5WvKt2JXGoY2Y3/UdZBCT
  960. HQr5BKMGhnvwnArdagi+fgdHhzNgsrxp1n5FT5piyzwsKBSQOAw5YCgpNqpwD5XN
  961. /XiMjXgEkSJiST1didLrelHw8xmE96VjWDFvtdy/q0QAjjkLNLNWxoyvg+tYIkxa
  962. Gg2JAJUCBRAs+z1cMIAgxAYM3PEBAQbGA/9sIuNXpUhhk0j+oSc5s8+xHBVwxa9B
  963. 9Atu926CoxavNrzXjQMvSS0pKcszuH2ZkLto0FGs5X7+8DGtfMi01K/yHRxHlsFJ
  964. vrChfv/Qm8ADCUCkl12Fz5uR2Nd11LcR+iqmuS5U5kByxGnUsPAKErVdqSPpPVAW
  965. cGJiTsrONyTwNokAlQIFEC7bAyY2VpfGMt2Y2QEBjTAEAJGSlkFtC2zHN4IDKQKb
  966. g+4aFiOmBfclfTv64PgXPmkTL8IAZ10HZYKm75H6+zZ+/9j5ZgLQeUz+GEq+qJXH
  967. MigNIdHbIRwi4ny9SFMi+oyzA78GMqJtUkUAg+RXziQC4xxf9GE+8PXq7b17dsb8
  968. 5WzlX9HC4IOyYJ3cN5XnVsIFiQCVAgUQLXMOD5qVRRb01TllAQGZJwQAw0qxT4HC
  969. iGF+oYdXnwGuFj5xHCvMgk+V199LMn7kNOpIbmdOK6vLaa/pDDHkyMnaPlTOSlsG
  970. QwWqJjodnIXFs7NglYfRlN9zfKQcV9zoMxhWBmjpdkL2CJsq13Rh0ttLnHVSQZCW
  971. timEMBfN6xAFQIWFZJDSE+fgkwTK9Sk4XHW0HjxJZ29yLk11dHRpa0B1ay5kcnNv
  972. bG9tb24uY29tPokAlQMFEDL/SUI6mhWufd2IUQEBWEwD/3w60OlWajPMgqaKEue8
  973. tGB5W4jBanWamRxQvTGJDT8+e1FSOiC+flIPyHRtJxDBvnbFqjG7Ls4H7bE8NjXk
  974. fO2nL2anYefQyN+hXm5ninbWq2lRQJjJQrUn03EszwyBIfmqMMLejxfVHIiIMdcG
  975. 76datnxIhFdEOuTrDQ0dCBKTtBU8bWlnQG1pZy5waHlzLm1zdS5zdT6JAJUDBRAy
  976. 5g9mOpoVrn3diFEBAa8NA/9keCujOMshcp9JoO73X6OWBaajHoTCZfdC14SaBSkH
  977. 22zafIWtEZSF2mCoKt3TGdNHoZnNZOjQ1yfPdm9bUO4pfw43+XT5mxyo0RDnMa8d
  978. rkc4pMJ2qvorz+HR/Ed4lo5E+RhoUXfVazivLPTPUaCDzSKttEkenZ+7AWcZqOhT
  979. MbQVPGlnb3JAZGlhbC5waXBleC5jb20+iQCVAwUQMuYOozqaFa593YhRAQHYwwP8
  980. DeRVwKVaNPcgULB8Wx3Ag1gnLSV5sm6Jm59pck9+5Unbe+tFgCzeWSBK+qzHjFau
  981. yAgVvmkqOWf/7ioEnLW7XGhDA1bI0mYYkNLvXlKlXCDqIVVegyOZsjw3B6Q8IhUp
  982. 1SxwZlC9CvgodEiDZwnHC+h2GgSRnYkfHt4wJIzHBUk=
  983. =bfzJ
  984. -----END PGP PUBLIC KEY BLOCK-----
  985.  
  986.         Provided PGP key has some signatures of well-known antivirus
  987.         people but if none is recognized - feel free to contact me to
  988.         check the validity of this public key). You can also try
  989.         "finger mig@mig.phys.msu.su" to get my PGP key. First, add
  990.         my public key to your PGP keyring:
  991.  
  992.                 PGP -KA GOAT.DOC
  993.  
  994.         To check the validity of GOAT.COM use the following command:
  995.  
  996.                 PGP GOAT.ASC GOAT.COM
  997.  
  998.  
  999.   ┌────────────────────────┐
  1000.   │VERSIONS ON THE INTERNET│
  1001. ──┴────────────────────────┴──────────────────────────────────────────────────
  1002.  
  1003.         I would be happy to send the latest version of GOAT package
  1004.         to everybody who needs it. Do not hesitate to contact me
  1005.         personally via Email. Copies of the program are available
  1006.         on Simtel, Garbo and their mirrors worldwide. You can
  1007.         usually download the latest copy from:
  1008.  
  1009.         ftp://ftp.informatik.uni-hamburg.de/pub/soft/virus/progs/tools/goat42.zip
  1010.  
  1011.  
  1012.  
  1013.   ┌───────┐
  1014.   │HISTORY│
  1015. ──┴───────┴───────────────────────────────────────────────────────────────────
  1016.  
  1017.        Version 4.2 -  A bug with /Qnn switch was fixed. The bug
  1018.                       demonstrated itself only when more than 10
  1019.                       files were created in one subdirectory.
  1020.  
  1021.        Version 4.1 -  DOC file was slightly rewritten - false alarm of
  1022.                       McAfee SCAN was found ("STRAT.486" - see below
  1023.                       "BUGS" section).
  1024.  
  1025.        Version 4.0 -  All programs were joined into one - GOAT.COM.
  1026.                       Goat file output changed - now it includes the
  1027.                       printout of switches used when created this file.
  1028.                       All limitations on the number of files (used to
  1029.                       be 1000) were removed (now, after 000...999 go
  1030.                       AAA...ZZZ, etc.). New switches introduced - /Qnn,
  1031.                       /Gnn, /L, /!, /#, /7. Redefined switches - /W, /X,
  1032.                       /S. Parameter added to switches /Enn, /Rnn.
  1033.                       Goat code is now able to selfcheck the goat file.
  1034.                       GOAT.COM now checks its own size/checksum and
  1035.                       reports the change (if any).
  1036.  
  1037.        Version 3.1 -  Some small improvements were made: programs
  1038.                       now do not report "Your PC might be infected"
  1039.                       under Novell. New switch /U introduced. Switch
  1040.                       /D behaviour was improved. And, finally, EXE header
  1041.                       now contains 1C as an offset of relocation entries
  1042.                       list (although the list itself is empty; helps to
  1043.                       handle a couple of viruses, which need non-zero
  1044.                       word in 001C).
  1045.                       No bugs were reported for more than a year since
  1046.                       release of 3.0 so no fixes were needed.
  1047.  
  1048.        Version 3.0 -  Goat file contents changed - the string,
  1049.                       indicating type of goat file, added to the
  1050.                       printed message (COM/EXE/SYS).
  1051.                       Device driver creation mode added: switches
  1052.                       /Y (make SYS file) and /Annnn (set device
  1053.                       attribute) appeared. "SYSname=" definition
  1054.                       added to the INI file processor (this name
  1055.                       appears in the SYS file header).
  1056.                       Help screen redesigned - now switches are
  1057.                       listed in the alphabetical order.
  1058.                       FLOCK.COM, when running on an almost full drive
  1059.                       entered very long loop - corrected.
  1060.                       GOATSET.BAT creates now 6 device driver files.
  1061.  
  1062.        Version 2.1 -  Motto string added to the INI file.
  1063.                       INI file processor allows quoted strings now
  1064.                       in the "Motto=" and "STACKfill=" definitions.
  1065.                       New switches /N[nnnn] (random fill with
  1066.                       possible seed definition) and /X (supress
  1067.                       Motto string defined in the INI file) added.
  1068.                       GOAT.INI was not found by FLOCK and GOATS
  1069.                       thru path, fixed.
  1070.  
  1071.        Version 2.01 - Some portion of code (common to GOAT, GOATS
  1072.                       and FLOCK, version >1.5) alerted F-Prot (it
  1073.                       reported "Probably new variant of BootEXE").
  1074.                       I rewrote it in order to avoid this false alarm.
  1075.  
  1076.         Version 2.0 - INI file processing added.
  1077.                       FLOCK.COM appeared instead of FLOCK.BAT.
  1078.                       FLOCK.COM switches /F (# of files in dir)
  1079.                       and /D (max # of subdirectories) appeared.
  1080.                       Selfchecking level added (switch /Cn).
  1081.                       Switches /O and /V do not force EXE now
  1082.                       (to allow including /O, /V into INI file).
  1083.                       Word pattern (/W) fixup corrected.
  1084.                       GOATSET operation (when GOAT.COM selfcheck
  1085.                       fails) was corrected.
  1086.  
  1087.         Version 1.6 - Switches /K, /M, /W, /C, /I added.
  1088.                       Many enhancements in the code were made.
  1089.                       Selfchecking is double now (in-memory copy
  1090.                       and file on disk), check for companion virus
  1091.                       infection added. Rare conflict of /R and /T
  1092.                       switches fixed. Removing of non-fully created
  1093.                       readonly files fixed.
  1094.  
  1095.         Version 1.5 - Switch /P (pattern fill) added.
  1096.                       Selfchecking of timestamp added.
  1097.                       /J/B/E or /J/B/S forced NOP-filling
  1098.                       for EXE files, corrected.
  1099.                       When making a series of files with GOATS.COM
  1100.                       on 5 (and 67) byte boundary, additional JMP
  1101.                       appeared even with /J switch, corrected.
  1102.  
  1103.         Version 1.4 - File numeration changed, it is common
  1104.                       for EXE and COM files now. Ex., if GOAT000.COM
  1105.                       exist, created EXE file will be GOAT001.EXE
  1106.                       (to give some freedom to companion viruses).
  1107.  
  1108.         Version 1.3 - Added switch /Tnn. Bug with attribute
  1109.                       in GOATS fixed (always set 0000, even
  1110.                       with /R switch). When modified, GOATS.COM
  1111.                       reported "GOAT.COM probably infected!",
  1112.                       corrected. Minalloc field in EXE header
  1113.                       changed to zero (ver. <1.3 always set 20h).
  1114.  
  1115.         Version 1.2 - DOC file written. BAT files FLOCK and
  1116.                       GOATSET added. Decimal printout of goat
  1117.                       file size added. Added rotating symbol
  1118.                       "|" (when creating goat files longer
  1119.                       than 64k). Selfchecking added.
  1120.  
  1121.         Version 1.1 - Many switches added (/S,/O,/B,/J,/Z,/V,/9,/R).
  1122.  
  1123.         Version 1.0 - First version, without documentation,
  1124.                       supported only switch /E. No decimal
  1125.                       size in the printout of goat files.
  1126.  
  1127.  
  1128.   ┌────┐
  1129.   │BUGS│
  1130. ──┴────┴──────────────────────────────────────────────────────────────────────
  1131.  
  1132.         All EXE files >=1024k, created with /O and /E2 switches
  1133.         (short header, not overlaid) hang old DOS versions (<5.0)
  1134.         upon execution. For a very similar file with normal 512-
  1135.         bytes header, DOS behaves normally. It reports "Program
  1136.         too big to fit in memory" or "Cannot execute GOAT000.EXE".
  1137.         This DOS bug is no longer present in DOS 5.0 and 6.0.
  1138.         Old DOS versions were obviously confused with such a strange
  1139.         goat file (the file without overlaid structure and greater
  1140.         than 640K cannot fit into DOS memory and have no real sense).
  1141.         DOS should report a load error, because a load size is
  1142.         definitely >640K. Unfortunately it hangs instead.
  1143.  
  1144.         One known bug: if EXE file generated is longer than 1MB and
  1145.         code is at bottom (ex., 1025k /e/b) - CS:IP will be assigned
  1146.         incorrectly. But I do not feel like correcting this as DOS
  1147.         cannot load/execute such files anyway.
  1148.  
  1149.         Some versions of McAfee SCAN (at least 2.5.2 dated September
  1150.         1996) produce a false alarm ("Found the STRAT.486 virus") in
  1151.         all SYS files created using GOAT package and in the GOAT.COM
  1152.         generator itself (versions 3.x and 4.x). The alarm is caused by
  1153.         the code responsible for creation of the SYS files. This has
  1154.         been reported to McAfee and fixed in November 1996 release
  1155.         2.5.2 of McAfee SCAN.
  1156.  
  1157.  
  1158.   ┌───────────────┐
  1159.   │ACNOWLEDGEMENTS│
  1160. ──┴───────────────┴───────────────────────────────────────────────────────────
  1161.  
  1162.         I am greatly acknowledged to Frans Veldman (Esass, the Netherlands).
  1163.         Discussions of some aspects of a goat file generation were very
  1164.         fruitful. I also got some useful suggestions from Igor Danilov
  1165.         (Sald, St.Petersburg) and Vesselin Bontchev (FSI, Iceland).
  1166.  
  1167.         I benefited from the usage of HIEW.EXE (Hacker's View)
  1168.         program by Eugene Suslikov. HIEW.EXE, being the viewer of
  1169.         an executable files, is very useful for the examination of
  1170.         the contents of goat files. I recommend HIEW for all users of
  1171.         GOAT package. Try the following Internet URLs to get a copy:
  1172.  
  1173.         http://palantiri.spb.su/English/Misc/GSS/toolsoft/hiew.html
  1174.         http://www.kiarchive.ru:8098/msdos/sys/hack_tools/
  1175.         ftp://ftp.cdrom.com/.2/dresden/edit/hiew524.zip
  1176.  
  1177.  
  1178.   ┌──────┐
  1179.   │FLAMES│
  1180. ──┴──────┴────────────────────────────────────────────────────────────────────
  1181.  
  1182.         Send flames, questions, etc. directly to the author
  1183.         (preferably via Email).
  1184.  
  1185.         All ideas, comments and corrections will be appreciated.
  1186.  
  1187.         Sorry for possible errors in this manual - English
  1188.         is not my native language.
  1189.  
  1190.  
  1191.   ┌──────┐
  1192.   │AUTHOR│
  1193. ──┴──────┴────────────────────────────────────────────────────────────────────
  1194.  
  1195.         Dr. Igor G. Muttik
  1196.         Virus Laboratory
  1197.         Dr Solomon's Software Ltd.
  1198.         Alton House, Gatehouse Way
  1199.         Aylesbury, Bucks, HP19 3XU
  1200.         United Kingdom
  1201.  
  1202.         Email addresses : Igor.Muttik@uk.drsolomon.com
  1203.                           MIG@uk.drsolomon.com
  1204.                           igor@dial.pipex.com
  1205.                           MIG@mig.phys.msu.su
  1206.                           MIG@lt.phys.msu.su
  1207.                           MIG@sands.co.uk
  1208.  
  1209.         Phone: +44 1296 318700 ext.2756
  1210.         Fax:   +44 1296 318734
  1211.  
  1212.