home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / alt / irc / 4718 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  3.0 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!urmel.informatik.rwth-aachen.de!zipfizoc!bytewurm
  2. From: bytewurm@zipfizoc.informatik.rwth-aachen.de (Michael Weber)
  3. Newsgroups: alt.irc
  4. Subject: Making robots more secure.
  5. Date: 17 Dec 92 11:33:46 GMT
  6. Organization: Rechnerbetrieb Informatik - RWTH Aachen
  7. Lines: 69
  8. Message-ID: <bytewurm.724592026@zipfizoc>
  9. NNTP-Posting-Host: zipfizoc.informatik.rwth-aachen.de
  10. Summary: Checking all Data to be EXEC`d
  11.  
  12. Hi.
  13. There have been many discussions about making bots more secure.
  14. The best solution would probably be, not to start a Bot, which is
  15. not really practicable as all kiddies playing with bots (me included)
  16. know.
  17. If a bot needs EXEC it can become very critical as you know.
  18. The following ircII-HACK checks for critical characters and
  19. notifies what, where and who!
  20. It may be not the best code but it works ;-))
  21.  
  22.  
  23. ASSIGN ERROR 0
  24.  
  25. ALIAS AT ASSIGN FUNCTION_RETURN $%INDEX(@ $0) # find out where the @ is
  26. ALIAS GETUID ASSIGN FUNCTION_RETURN $%LEFT($%AT($0) $0) # construct the UID
  27.  
  28. ALIAS STATUS {
  29.         IF "$0=0" "ASSIGN ERROR 0" "ASSIGN ERROR $({$ERROR+$0})"
  30. }
  31.  
  32. ALIAS NOEXEC {
  33.         NOTICE $ROGUE ------------------------------------------------
  34.         NOTICE $ROGUE I am awfully sorry, but due to security reasons
  35.         NOTICE $ROGUE you will be ignored !!!
  36.         NOTICE $ROGUE ------------------------------------------------
  37.         ASSIGN UID $%GETUID($ADRESS)
  38.         IGNORE $UID@* ALL # ignoring nickname would be less effective
  39.         MODE +b *!$UID@*  # we dont want such ppl on our channel, do we?
  40.         KICK $C $ROGUE
  41.         ECHO ALARM: "$*" [$ERROR]  # something for the logfile ...
  42.         ECHO Ignoring and Banning $ADRESS ($ROGUE)
  43. }
  44.  
  45. ALIAS SYS {
  46.         ASSIGN ROGUE $, # lets assign it right here, maybe someone else
  47.                         # msgs the bot during checking for chars
  48.         ASSIGN ADRESS $%USERHOST()  # same here
  49.         STATUS 0        # we start with NO errors, surprised? ;-)
  50.         IF "$%INDEX(\; $*)!-1" "STATUS 1"
  51.         IF "$%INDEX(\! $*)!-1" "STATUS 2"
  52.         IF "$%INDEX(\& $*)!-1" "STATUS 4"
  53.         IF "$%INDEX(\| $*)!-1" "STATUS 8"
  54.         IF "$%INDEX(\$ $*)!-1" "STATUS 16"
  55.         IF "$%INDEX(\` $*)!-1" "STATUS 32"
  56.         IF "$%INDEX(\\ $*)!-1" "STATUS 64"
  57.         IF "$ERROR=0" "EXEC $*" "NOEXEC $*" # to do or not to do
  58. }
  59.  
  60. Instead of EXEC you have to call SYS.
  61.  
  62. SYS checks ALL given Parameters for critical chars and sets
  63. specific Errornumbers for each of them - this is not very important
  64. (a poor boolean would work as well), but more comfortable ;-)
  65.  
  66. If any Error occured, the one who sent the msg will be told what's
  67. wrong and is ignored in the future.
  68.  
  69. The most chars beeing checked are not really critical but I think it
  70. cannot be THAT wrong to look out for them...
  71.  
  72.  
  73. If noone wants it .. throw it away ;-)
  74.  
  75.  
  76.   -Bytewurm
  77. -- 
  78. "Doctors pour drugs of which they know little, to cure diseases of which
  79. they know less, into human beings of whom they know nothing."
  80.                                                          (Voltaire)
  81.