home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!Germany.EU.net!urmel.informatik.rwth-aachen.de!zipfizoc!bytewurm
- From: bytewurm@zipfizoc.informatik.rwth-aachen.de (Michael Weber)
- Newsgroups: alt.irc
- Subject: Making robots more secure.
- Date: 17 Dec 92 11:33:46 GMT
- Organization: Rechnerbetrieb Informatik - RWTH Aachen
- Lines: 69
- Message-ID: <bytewurm.724592026@zipfizoc>
- NNTP-Posting-Host: zipfizoc.informatik.rwth-aachen.de
- Summary: Checking all Data to be EXEC`d
-
- Hi.
- There have been many discussions about making bots more secure.
- The best solution would probably be, not to start a Bot, which is
- not really practicable as all kiddies playing with bots (me included)
- know.
- If a bot needs EXEC it can become very critical as you know.
- The following ircII-HACK checks for critical characters and
- notifies what, where and who!
- It may be not the best code but it works ;-))
-
-
- ASSIGN ERROR 0
-
- ALIAS AT ASSIGN FUNCTION_RETURN $%INDEX(@ $0) # find out where the @ is
- ALIAS GETUID ASSIGN FUNCTION_RETURN $%LEFT($%AT($0) $0) # construct the UID
-
- ALIAS STATUS {
- IF "$0=0" "ASSIGN ERROR 0" "ASSIGN ERROR $({$ERROR+$0})"
- }
-
- ALIAS NOEXEC {
- NOTICE $ROGUE ------------------------------------------------
- NOTICE $ROGUE I am awfully sorry, but due to security reasons
- NOTICE $ROGUE you will be ignored !!!
- NOTICE $ROGUE ------------------------------------------------
- ASSIGN UID $%GETUID($ADRESS)
- IGNORE $UID@* ALL # ignoring nickname would be less effective
- MODE +b *!$UID@* # we dont want such ppl on our channel, do we?
- KICK $C $ROGUE
- ECHO ALARM: "$*" [$ERROR] # something for the logfile ...
- ECHO Ignoring and Banning $ADRESS ($ROGUE)
- }
-
- ALIAS SYS {
- ASSIGN ROGUE $, # lets assign it right here, maybe someone else
- # msgs the bot during checking for chars
- ASSIGN ADRESS $%USERHOST() # same here
- STATUS 0 # we start with NO errors, surprised? ;-)
- IF "$%INDEX(\; $*)!-1" "STATUS 1"
- IF "$%INDEX(\! $*)!-1" "STATUS 2"
- IF "$%INDEX(\& $*)!-1" "STATUS 4"
- IF "$%INDEX(\| $*)!-1" "STATUS 8"
- IF "$%INDEX(\$ $*)!-1" "STATUS 16"
- IF "$%INDEX(\` $*)!-1" "STATUS 32"
- IF "$%INDEX(\\ $*)!-1" "STATUS 64"
- IF "$ERROR=0" "EXEC $*" "NOEXEC $*" # to do or not to do
- }
-
- Instead of EXEC you have to call SYS.
-
- SYS checks ALL given Parameters for critical chars and sets
- specific Errornumbers for each of them - this is not very important
- (a poor boolean would work as well), but more comfortable ;-)
-
- If any Error occured, the one who sent the msg will be told what's
- wrong and is ignored in the future.
-
- The most chars beeing checked are not really critical but I think it
- cannot be THAT wrong to look out for them...
-
-
- If noone wants it .. throw it away ;-)
-
-
- -Bytewurm
- --
- "Doctors pour drugs of which they know little, to cure diseases of which
- they know less, into human beings of whom they know nothing."
- (Voltaire)
-