home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / TELEGARD / TGSEC14.ZIP / TGSEC14.DOC < prev    next >
Encoding:
Text File  |  1991-06-17  |  24.7 KB  |  475 lines

  1.                      TELEGARD SECURITY SYSTEM v1.4
  2.                      ~~~~~~~~ ~~~~~~~~ ~~~~~~ ~~~~
  3.          Copyright 1991, Scott Raymond.  All Rights Reserved
  4.  
  5.  
  6.                                Credits
  7.                                ~~~~~~~
  8. The Telegard BBS program is copyright 1989,1990, Eric Oman and Martin
  9. Pollard.  All Rights Reserved.
  10.  
  11. The name "Telegard" is a registered trademark of Roy Wilson.
  12.  
  13. The 4DOS COMMAND.COM replacement is copyright 1989,1990, Rex Conn and J.P.
  14. Software.  All Rights Reserved.
  15.  
  16. The name "4DOS" is a registered trademark of J.P. Software.
  17.  
  18. The ZANSI ANSI.SYS replacement is copyright 1986, 1987, Thomas Hanlin III.
  19.  
  20.  
  21.                                 Thanks
  22.                                 ~~~~~~
  23.         I'd like to thank Mikel Beck, Roy Wilson, Kevin Watkins, Paul
  24. Maner, and all the other folks who sent in suggestions.  This was partly a
  25. collaborative effort, as I can't help protect a system against bugs I'm not
  26. aware of.  You were a big help guys, and I really appreciated the input.
  27.  
  28.  
  29.                               Disclaimer
  30.                               ~~~~~~~~~~
  31.         I cannot guarantee that this package will prevent anyone from being
  32. able to gain illegal entry to your computer system.  It is designed to
  33. heavily increase the existing security of your BBS, and attempts to thwart
  34. even the most persistent hackers from damaging your system or stealing
  35. private information from it.  Even so, there will always be some individual
  36. who will try to bypass the protection of this system.  If that happens, I
  37. will do my best to improve this package to close up any loopholes that may
  38. exist.
  39.  
  40.  
  41.                              Introduction
  42.                              ~~~~~~~~~~~~
  43.         In the eight years that I have been involved with bulletin boards,
  44. the main problem I've encountered is the security of the BBS.  User
  45. accounts get hacked out, trojans get uploaded, hard drives get crashed,
  46. private information gets stolen, months of work get destroyed, people's
  47. reputations get tarnished.  I've heard people say that this type of
  48. situation gives the sysop a feeling that he or she has been raped -
  49. violated, abused, tossed aside... and HELPLESS.  Powerless to stop this
  50. from happening.
  51.  
  52.         There had been a rash of instances in my area where Telegard boards
  53. have been hacked, had information stolen, hard drives formatted.  In one
  54. particular instance, a hacker logged on as the sysop and locked him out of
  55. his own system.  This happened not once, but TWICE in one week.  This was
  56. the last straw for me.  I have a low threshold of moral outrage, and I felt
  57. that something had to be done about this situation immediately.  Small
  58. suggestions had popped up here and there on the national Telegard FidoNet
  59. conference, and even I had found out how people managed to upload a
  60. LOGOFF.BAT to the main BBS directory - which I promptly revealed nationally
  61. in the Telegard conference.  Curiously enough, there was only one person
  62. who complained about my giving this fact away - the person who locked the
  63. sysop out of his own system.  What distressed me the most was the fact that
  64. this person used to be my State Center, and he made a habit out of hacking
  65. the other Telegard boards in my area - including my Regional Center.
  66.  
  67.         We needed a solution.  Martin Pollard tries his best to keep us up
  68. to date on the progress of Telegard, but he's only one person.  We also
  69. have to consider the fact that the methods used by Telegard hackers do not
  70. lie within Telegard, but rather with the utilities used by Telegard in its
  71. normal operation, such as PKZIP and DSZ.  I started working with the
  72. ability of 4DOS to alias file and command names, and eventually discovered
  73. a way to defeat most of the loopholes in these utilities.  The result is
  74. the package you are working with right now.
  75.  
  76.  
  77.                              Starting Up
  78.                              ~~~~~~~~ ~~
  79.         Before installing the actual utilities included in this package,
  80. the first step is to configure Telegard properly.  The quickest ways to
  81. limit the amount of damage a hacker can do you your board are as follows:
  82.  
  83.         1. Remove the archive menu.  Many systems have been hacked through
  84.            loopholes found in the functions available in this menu.  After
  85.            deleting the archive menu, remove the menu option from the file
  86.            that branches into the archive menu. (/A is the default menu
  87.            option provided with Telegard.)
  88.  
  89.         2. Remove the sysop menu.  If a hacker logs on as you or your
  90.            cosysop and has access to this menu, then there's nothing to
  91.            prevent them from doing damage to your system.  For those sysops
  92.            who feel they absolutely MUST be able to shell to DOS remotely,
  93.            this security package will not do much good for them.  If you
  94.            can shell to DOS, so can a hacker.  This goes for Mini-DOS as
  95.            well.  Don't forget to remove the menu option to branch to the
  96.            sysop menu from all of the other menus on the system.
  97.  
  98.         3. Install the Shuttle Logon Menu.  This should be easy,
  99.            considering that all you have to do is switch in on in the
  100.            system configuration menu, and use the shuttle menu provided
  101.            with every newly-initialized version of Telegard.
  102.  
  103.         4. Lower your SL and DSL to 250.  No changes to the configuration
  104.            are so important that they can't wait until you get home.  If
  105.            you need sysop access at home, just hit F9 while logged on
  106.            locally.  If you remove the sysop menu, the only way the hacker
  107.            can use the sysop functions while logged on as you is by using
  108.            commandkeys.  For instance, the hacker could enter "\\*D" at any
  109.            menu prompt and get to Mini-DOS.  If your account is not SL 255,
  110.            then no one can do any damage logged on as you.
  111.  
  112.         5. You should also set the System ACS settings as follows:
  113.  
  114.  
  115. A. Full SysOp         :"s255u1b00"     B. Full Co-SysOp      :"s255u1b00"
  116. C. Message base SysOp :"s255u1b00"     D. File base SysOp    :"s255u1b00"
  117. E. SysOp PW at logon  :"s250u1"        F. See PW's remotely  :"s255u1b00"
  118. G. Post public        :"s50"           H. Send e-mail        :"s20"             
  119. I. See anon pub post  :"s255u1b00"     J. See anon E-mail    :"s255u1b00"
  120. K. Post anon ANY base :"s255u1b00"     L. E-mail anon        :"s255u1b00"
  121. M. See unval. files   :"s255u1b00"     N. DL unval. files    :"s255u1b00"
  122. O. No UL/DL ratio     :"s100"          P. No post/call ratio :"s200"
  123. R. No file pt checking:"s100"          S. ULs auto-credited  :"s250"
  124.  
  125.  
  126.            Please notice that a number of these entries use the ACS flag
  127.            "b00".  This means that these functions are active ONLY if the
  128.            user currently logged on is sitting at the console of your
  129.            computer.  I sincerely doubt that anyone is foolish enough to
  130.            try to break into your house to hack your BBS.
  131.  
  132.            Also notice that cosysop level is set to SL 255, baud 0.  Your
  133.            cosysops will most likely have access to the functions that you
  134.            want them to have access to.  However, if a hacker logs on as
  135.            one of your cosysops, he can send himself e-mail and get into
  136.            the user editor.  This is one of those places on the BBS that
  137.            ONLY the sysop should have access to.
  138.  
  139.         6. Go into the System Configuration menu, then the File Section
  140.            Configuration menu.  Change the Remote DOS re-direction device
  141.            to "CON", instead of "COM2", "GATE2", or whatever else you have
  142.            in there.  When your BBS tests the integrity of an uploaded
  143.            file, the results will be displayed on YOUR screen, not that of
  144.            the user logged on.  This will prevent him from getting a peek
  145.            at the directory path.
  146.  
  147.         7. Enter the Archive Configuration editor from the File Section
  148.            Configuration menu.  Modify the entry for PKZIP as follows:
  149.  
  150.  
  151. Archive #1 of 5                                                                 
  152.                                                                                 
  153. 1. Active                 : Yes                                                 
  154. 2. Extension name         : ZIP                                                 
  155. 3. Interior list method   : "/1" - *Internal* ZIP viewer                        
  156. 4. Compression cmdline    : *None*
  157. 5. Decompression cmdline  : *None*
  158. 6. Integrity check cmdline: *None*
  159. 7. Add comment cmdline    : PKZIP -z @F
  160. 8. Errorlevel for success : 0                                                   
  161. Q. Quit                                                                         
  162.                                                                                 
  163. Edit menu: (1-8,[,],Q) :
  164.  
  165.                                
  166.            Note that options 4,5 and 6 are shut off by using a null string
  167.            as the entry.  This seems extreme, doesn't it?  There are people
  168.            who know how to rewrite the structure of an archived file to
  169.            extract a ZIP file, search the hard drive for files of the same
  170.            name and replace them.  Sound far-fetched?  If you saw it in
  171.            action you would immediately change you mind.  Imagine a ZIP
  172.            file that had been reconfigured with a trojan program, and
  173.            replaced your PKZIP.EXE with a trojan designed to low-level
  174.            format your hard drive.  I've seen versions for ARC, ZIP and
  175.            LHARC.  They do indeed exist.
  176.  
  177.            For all of the other entries, either deactivate them or just
  178.            delete them completely.  The path shown above is just an example
  179.            - if you have PKZIP and PKUNZIP in a different directory,
  180.            replace C:\ZIPS\ with the path they reside in.
  181.  
  182.         8. The next step is probably the most important configuration of
  183.            Telegard.  More boards are hacked this way than any other.  A
  184.            hacker will use a poorly documented feature of DSZ to upload a
  185.            LOGOFF.BAT file to your main BBS directory.  If your initial
  186.            response is "So what?", then consider the fact that Telegard
  187.            looks for LOGOFF.BAT in your main BBS directory when a user
  188.            logs off, then runs it if it finds it.  What if, for instance,
  189.            the contents of the LOGOFF.BAT looked like this:
  190.  
  191.                 @echo off
  192.                 dsz sz c:\bbs\status.dat
  193.                 dsz sz c:\bbs\gfiles\user.lst
  194.                 del c:\bbs\trap\sysop.log
  195.  
  196.            or:
  197.  
  198.                 @echo off
  199.                 echo Y | format c: /v:gotcha
  200.  
  201.            The first one will result in the hacker getting your sysop
  202.            password, the user passwords (including yours), and all of the
  203.            users' private information.  The second one will result in the
  204.            complete destrcution of all of the data on your hard drive.  The
  205.            LOGOFF.BAT can contain other things, and uploaded in conjunction
  206.            with other programs - some designed to put a virus or a trojan
  207.            on your system, some designed to perform a low-level format of
  208.            your hard drive, making data recovery virtually impossible.
  209.  
  210.            To prevent this from happening, the DSZ "restrict" command will
  211.            prevent files from being uploaded anywhere except the current
  212.            directory (usually your upload directory or the TEMP directory
  213.            for batch uploads).  Restrict also prevents anyone from
  214.            uploading a file that contains the ASCII text "AUTOEXEC.BAT" and
  215.            "COMMAND.COM", in upper or lower case.  Go into the Protocol
  216.            Editor and configure Ymodem Batch, Ymodem-G Batch and Zmodem
  217.            Batch as follows:
  218.  
  219.  
  220. Ymodem:
  221.  
  222. Protocol #9 of 16
  223. !. Type/protocl:Active - Batch protocol                                         
  224. 1. Keys/descrip:"Y" / "(Y) Ymodem batch"                                        
  225. 2. ACS required: ""                                                             
  226. 3. Temp. log   : "%C\dsztemp.log"                                               
  227. 4. <U>L log    : "%C\xfer.log"                                                  
  228.    <D>L log    : "%C\xfer.log"                                                  
  229. 5. <U>L command: "dsz port %P est 0 %B restrict rb"
  230.    <D>L command: "dsz port %P est 0 %B sb -s @%L"
  231. 6. Codes mean  :Transfer bad                                                    
  232. 7. <U>L codes  :(1)""     (2)""     (3)""     (4)""     (5)""     (6)""         
  233.    <D>L codes  :(1)"E"    (2)"e"    (3)"L"    (4)"l"    (5)""     (6)""         
  234. E. Environ. cmd: "set DSZLOG=%T"                                                
  235. I. DL File list: "%C\fi.lst"                                                    
  236. C. Max DOS chrs:128   P. Log position: Filename: 51 - Status: 1
  237.  
  238.  
  239. Ymodem-G:
  240.  
  241. Protocol #12 of 16
  242. !. Type/protocl:Active - Batch protocol                                         
  243. 1. Keys/descrip:"G" / "(G) Ymodem-G batch"                                      
  244. 2. ACS required: ""                                                             
  245. 3. Temp. log   : "%C\dsztemp.log"                                               
  246. 4. <U>L log    : "%C\xfer.log"                                                  
  247.    <D>L log    : "%C\xfer.log"                                                  
  248. 5. <U>L command: "dsz port %P est 0 %B ha slow restrict rb -g"
  249.    <D>L command: "dsz port %P est 0 %B ha on sb @%F"
  250. 6. Codes mean  :Transfer bad                                                    
  251. 7. <U>L codes  :(1)""     (2)""     (3)""     (4)""     (5)""     (6)""         
  252.    <D>L codes  :(1)"E"    (2)"e"    (3)"L"    (4)"l"    (5)""     (6)""         
  253. E. Environ. cmd: "set DSZLOG=%T"                                                
  254. I. DL File list: "%C\fi.lst"                                                    
  255. C. Max DOS chrs:128   P. Log position: Filename: 51 - Status: 1                 
  256.  
  257.  
  258. Zmodem:
  259.  
  260. Protocol #15 of 16
  261. !. Type/protocl:Active - Batch protocol                                         
  262. 1. Keys/descrip:"Z" / "(Z) Zmodem batch"                                        
  263. 2. ACS required: ""                                                             
  264. 3. Temp. log   : "%C\dsztemp.log"                                               
  265. 4. <U>L log    : "%C\xfer.log"                                                  
  266.    <D>L log    : "%C\xfer.log"                                                  
  267. 5. <U>L command: "dsz port %P est 0 %B restrict rz -m"
  268.    <D>L command: "dsz port %P est 0 %B sz -s -mr @%L"
  269. 6. Codes mean  :Transfer bad                                                    
  270. 7. <U>L codes  :(1)""     (2)""     (3)""     (4)""     (5)""     (6)""         
  271.    <D>L codes  :(1)"E"    (2)"e"    (3)"L"    (4)"l"    (5)""     (6)""         
  272. E. Environ. cmd: "set DSZLOG=%T"                                                
  273. I. DL File list: "%C\fi.lst"                                                    
  274. C. Max DOS chrs:128   P. Log position: Filename: 51 - Status: 1                 
  275.  
  276.  
  277.            Note that *only* the batch modes of Ymodem, Tmodem-G and Zmodem
  278.            need to be reconfigured.  The single file modes may remain
  279.            unchanged.
  280.  
  281.  
  282.         9. Sometimes a malicious user will try to upload COM1 or LPT2 to
  283.            your file section.  Instead of the system waiting for the user
  284.            to upload the file, the system locks up because it tries to
  285.            access the serial port or printer port instead.
  286.  
  287.            Create a file base in your file base editor called "Security".
  288.            Password protect this file base, and set all of the available
  289.            ACS settings to s255u1b00.  Then place the file SECURITY.DIR
  290.            (included in this package) into your GFILES directory.  The
  291.            security directory contains entries for COM1 through COM4, and
  292.            LPT1 through LPT4 - these are the normal limits on an AT-class
  293.            machine.  If you wish to add more, feel free - just upload any
  294.            file to that directory and change the name of it to the COM or
  295.            LPT port of your choice.
  296.  
  297.            Please note that this bug in Telegard is not harmful to the
  298.            system - it only locks up the board, nothing more.  It doesn't
  299.            hurt to keep the system from crashing, though.
  300.  
  301.        10. Reconfigure the Telegard paths for the temporary upload
  302.            directory, your file directories, and rename the main BBS
  303.            directory. First, go into the System Configuration menu, then
  304.            the File Paths and BBS configuration menu.  Change the TEMP
  305.            directory to one that does not branch off of the main BBS
  306.            directory, such as C:\FILES.
  307.  
  308.            The default for the file directories in Telegard is C:\BBS\DLS\.
  309.            As with the TEMP directory, modify all of your file directories
  310.            in the File Base editor so that they branch off of the root
  311.            directory (C:\), not the main BBS directory.
  312.  
  313.            Finally, change the name of your main BBS directory.  This will
  314.            take some time.  Change it to something unusual that would not
  315.            normally be guessed.  You will have to change the paths for all
  316.            of the data subdirectories in the File Paths & BBS configuration
  317.            menu, as well as the FidoNet configuration menu if you run a
  318.            front-end mailer.  Don't forget the paths in your mailer
  319.            configuration as well.  You will probably have to change the
  320.            path settings in your online games, all of the batch files that
  321.            involve your main BBS directory and its subdirectories, and the
  322.            path setting in your AUTOEXEC.BAT.  Like I said, this will take
  323.            some time.  Your best bet is to go through your entire hard
  324.            drive with a directory utility such as Norton Commander or
  325.            Xtree Gold, modifying each batch file as you go along.
  326.  
  327.            Please note that your BBS will most likely crash after you
  328.            change these directory names.  This is expected.  When you get
  329.            to the DOS prompt, rename the C:\BBS directory to the new
  330.            directory you have defined for it.  For instance, if you changed
  331.            the name to C:\MYBOARD, just enter the following at the DOS
  332.            prompt:
  333.  
  334.            rendir c:\bbs c:\myboard
  335.  
  336.            This may not work on earlier versions of DOS.  Once 4DOS is
  337.            installed, however, this command will be possible.  See 4DOS
  338.            installation instructions below.
  339.  
  340.            If you have Xtree Gold or a similar program that can graft
  341.            directory branches from one place on the hard drive to another,
  342.            the process will go a lot quicker.  You will have to make sure
  343.            that your new TEMP directory exists on your hard drive, as well
  344.            as the subdirectories TEMP\1\, TEMP\2\, and TEMP\3\.  Don't
  345.            forget to do the same for your file directories as well, and to
  346.            move the files in those directories to the new ones.
  347.  
  348.  
  349.                            Installing ZANSI
  350.                            ~~~~~~~~~~ ~~~~~
  351.         The procedure for this is simple - just add the following line to
  352. your CONFIG.SYS, or edit the existing ANSI.SYS line:
  353.  
  354. DEVICE=C:\ZANSI.SYS
  355.  
  356. Putting the ZANSI.SYS file in your root directory is safe, so you can leave
  357. it there.
  358.  
  359.  
  360.                            Installing 4DOS
  361.                            ~~~~~~~~~~ ~~~~
  362.         The key to the security package is 4DOS.  4DOS is a replacement for
  363. COMMAND.COM, and has a unique feature known as "aliasing".  This allows you
  364. to change the name used to invoke a DOS command or executable file, without
  365. having to change the name of the file itself.  What I have done is provide
  366. an alias list that will defeat just about anything that a hacker will
  367. attempt to use to gain illegal access to your system over the phone line.
  368. Basically, if a hacker uploads a LOGOFF.BAT, instead of running the
  369. uploaded batch file the system will run a different batch file in a
  370. directory you specify.
  371.  
  372. Installing 4DOS is as follows:
  373.  
  374.         1. Place 4DOS.COM and 4DOSxxx.EXE into your root directory (C:\).
  375.            If you have an XT, use 4DOS88.EXE.  If you have a 286, 386 or
  376.            486, use 4DOS286.EXE.  Delete your bold COMMAND.COM, and rename
  377.            4DOS.COM to COMMAND.COM.
  378.  
  379.         2. Add the following lines to your AUTOEXEC.BAT:
  380.  
  381.            SET COMSPEC=C:\COMMAND.COM
  382.            ALIAS /R ALIASES
  383.  
  384.            These should be invoked right after your PATH statement.
  385.  
  386.         3. Place the following line in your CONFIG.SYS:
  387.  
  388.            SHELL=C:\COMMAND.COM /P
  389.            ^
  390.            └──── Make sure this is the last line in your CONFIG.SYS.
  391.  
  392.            Now reboot your computer to put 4DOS into action.
  393.  
  394.         4. Place the ALIASES file into your root directory.  You will
  395.            need to edit the ALIASES file so that the paths used in there
  396.            match those of your system configuration.
  397.  
  398.            Place the two files, LOGON.BAT and LOGOFF.BAT into your main BBS
  399.            directory.  Go to that directory and enter the following DOS
  400.            command:
  401.  
  402.            ATTRIB +RSH LOG*.BAT
  403.  
  404.            This will prevent the two batch files from being overwritten,
  405.            and make them invisible as well.
  406.  
  407.            Create a security directory on your system, such as C:\SECURITY,
  408.            and place LON.BAT and LOFF.BAT into this new directory.  If you
  409.            use a LOGON.BAT and LOGOFF.BAT in the normal operation of your
  410.            BBS, make sure that the procedures used in LOGON.BAT are placed
  411.            in LON.BAT, and the procedures for LOGOFF.BAT are placed in
  412.            LOFF.BAT.
  413.  
  414.  
  415.                               Reminder
  416.                               ~~~~~~~~
  417.         Once again, I must stress that the file names and directories I am
  418. describing here are only default SUGGESTIONS.  If you choose to keep the
  419. security setup with the file and directory names I am supplying, the
  420. hacker's job will be made a lot easier.  I urge you to change the default
  421. settings I am describing here.
  422.  
  423.  
  424.                           Additional Advice
  425.                           ~~~~~~~~~~ ~~~~~~
  426.         There is never enough advice to give to a sysop, but there are a
  427. few important tips I'd like to stress.  One, MAKE BACKUPS.  I cannot stress
  428. this one enough.  Too often have I heard horror stories about trojans and
  429. virii destroying months of work on hard drives.  I have gotten hit by a
  430. trojan only once, and it was because I made the mistake of running it
  431. without checking it first.  I only lost one day's worth of work because I
  432. make nightly backups during the maintenance event.  The second tip is to
  433. change your passwords regularly - both your sysop and user passwords.  And
  434. finally, never give am unknown new user a chance to do damage.  Give NO
  435. access at all to new users until you validate them.  The easiest way to do
  436. this is raise the security level of all functions in your main menu to that
  437. of a validated user, and lower the security level settings of a new,
  438. unvalidated user to a level below that.  The default settings on Telegard
  439. are fine - just make sure that everything except (G)oodbye is set to s50 or
  440. higher.
  441.  
  442.  
  443.                              Final Notes
  444.                              ~~~~~ ~~~~~
  445.         This should be a relatively painless task.  Once completed, your
  446. BBS will cause a great deal of aggravation to those people who hack your
  447. board for the simple pleasure of knowing that it pisses you off.  The good
  448. thing about this system is that when installed properly, there's nothing a
  449. hacker can do to breach the security short of forcing you to tell him what
  450. your passwords are, or by tricking you into running a trojan program that
  451. he wrote.  What's even more amusing is the fact that the posession of this
  452. package by a hacker will be of no help whatsoever to him - all it will do
  453. is show him how futile it would be to try hacking your system.
  454.  
  455. 4DOS itself has some pretty amazing features, such as online help.  You can
  456. access this by hitting F1 at the DOS prompt, or by typing "HELP".  Note
  457. that you'll need the entire 4DOS package to get this feature.  The latest
  458. version of 4DOS is available on my BBS (see below).
  459.  
  460. If you have any questions, suggestions,
  461. or bug reports, I can on my BBS at:
  462.  
  463.  
  464. Shadowdale
  465. Telegard Regional Center #1
  466. New York CIty                       FREQ Name:     File Name:
  467. (718) 934-1843                      ~~~~ ~~~~      ~~~~ ~~~~
  468. 1200/2400/9600/14400 HST/DS         TGSEC  -=>     TGSEC14.ZIP
  469. v.32/v.32bis/v.42/v.42bis           4DOS   -=>     4DOS303.ZIP
  470. FidoNet: 1:278/624                  ZANSI  -=>     ZANSI12.ZIP
  471. AAFNet:  13:13/7
  472.  
  473. Scott Raymond | Tristan
  474. Telegard Security Advisor
  475.