09.02.2002


security.tcl Component Documentation




# security.tcl for netbots.tcl v3.35
# designed to work with eggdrop 1.3.28 or higher
# Johoho's Eggdrop Page - http://johoho.tuts.net/eggdrop/
# security.tcl copyright (c) 1999,2001 by Johoho <johoho@hojo-net.de>
# abrahams_paranoid_rebinds section (c) 2001 by Abraham <abraham@mud.pl>
# netbots.tcl copyright (c) 1998-2001 by slennox <slennox@egghelp.org>

## security.tcl component script v0.52.0, 09.02.2002 ##

# History:
#
# v0.10.0, 16.06.2000 - initial design and concept
# v0.11.0, 18.06.2000 - fixed a small bug
# v0.12.0, 19.06.2000 - added booting support
# v0.20.0, 07.01.2001
# till
# v0.49.0, 14.06.2001 - not public, internal devel. versions, in which existing
# ------------------- code was cleaned-up and optimisation was done, detalis:
# ------------------- * added warning message in case when eggdrop is older than
# ------------------- 1.6.4 because of broken booting code in "pre-1.6.4" eggs
# ------------------- (Abraham)
# ------------------- * added suport for .deluser command was added (Abraham)
# v0.50.0, 28.06.2001 - 1st public release after freatures addition tested ealier
# ------------------- in dev-versions, implemented by Abraham, details follows:
# ------------------- * added posibility to rebind critcial commads to perm-owners
# ------------------- * added logging (by notes) for selected commands,
# ------------------- note is send to people specified in se_spy_note variable,
# ------------------- * added secured .whois command,
# ------------------- * added secured .match command,
# ------------------- * added slighty reworked .chhandle command,
# ------------------- * added secured +-host routines because of security
# ------------------- flaw in eggdrop (unfixed yet),
# ------------------- * added optix's safe .die command writen at Ben Dover
# ------------------- request and added DCCcomplex
# v0.50.1, 29.06.2001 - improved DCCcomplex
# v0.51.0, 06.07.2001 - recoded/improved seriously command handling
# v0.51.1, 11.07.2001 - fixed minor in and improved DCCcomplex
# v0.51.2, 12.06.2001 - improved/recoded: safe die, it uses now bind FILT.
# v0.51.3, 16.06.2001 - improved: safe whois.
# v0.51.4, 28.08.2001 - fixed: case-sensivity bug.
# v0.52.0, 09.02.2002 - added: support for four XTRA fields which will containg
# ------------------- usefull informations, improved: +-host, fixed: minor bugs
# ------------------- in dcc:se_common proc, reverted changes of safe die code.

# thanks slennox for netbots.tcl

Please note that this component is fully compatible with netbots.tcl v3.15 - 3.35 by slennox

Additional Note #1: from version 0.51.0 security uses completly diffrent command handling procedures, this impiles fact that during upgrade rehash is NOT sufficent, restart IS needed.

Index




Description

This script was designed to fix some, in ours (Johoho & Abraham) opinion, security flaws which wont be fixed in the core eggdrop, since 'it can be easily done in tcl'. Well, here we go. At the moment there's only one fix in here:
  • .-user fix
    This hack kills every connection of the deleted user with the bot. This includes relay, telnet, dcc or partyline connections. Some additional security routines are added to avoid situation when i.e. one global master may erase other master account. Additionaly removal of bots by .-user is blocked - for bot removal works from now only .-bot command.
    IMPORTANT NOTE: becouse of bug in eggdrop code(in versions prior 1.6.4) booting procedure is not efective when remote-boots var in eggdrop config is set to 1

    Following changes are active only when se_paranoid_dcc_rebinds is set to 1.

  • .whois & .match rework
    This hacks limits access to data given by .whois & .match commands. Users wich dosen't have at least global +m flag are not allowed to view information about users with "higher" flags and bots. In case of .whois command that routines works also on channel flags

  • .chhandle rework
    This hacks limits master/owners rights on .chhandle command. Master may only change handles of users with flags "lower" than own, can't change own handle nor other masters/owners handles. Owner may change users and master handles, but not own and other owners handles. Only perm-owner has total power :)

  • rebinded commands
    Several commands are rebinded to "higher" flags becouse of security reasons, some of them are now accessible only for perm-owners. Stay tuned. Futher details will be published.

  • spymode
    This addition gives possibility to log usage of commands wich may influence on botnet security when se_spymode is set to 1. Notes are sent to users given in se_note variable.

  • DCCcomplex
    This addition gives flexible autoaway/autoboot support when se_DCCcomplex is set to 1.




Installation

netset.tcl

To install this component properly you have to copy it to your netbots directory and add these lines to your netset.tcl conf:

# security.tcl
set nb_component(security) 1
set se_paranoid_dcc_rebinds 1
set se_paranoid_msg_unbinds 1
set se_spy_mode 0
set se_spy_victims all
set se_spy_note "$owner"
set se_DCCcomplex 0
set se_DCCcomplexinterval 1
set se_DCCcomplexwarntime 30
set se_DCCcomplexawaytime 45
set se_DCCcomplexkicktime 90
set se_joinctrl 0
set se_joincotrl_botnet_master_check 0
set se_joincotrl_perm_owner_check 0

Settings Documentation

se_paranoid_dcc_rebinds (default: 1)
Should the script activate abraham's security dcc extensions/rebinds?
Valid settings: 1 to enable, 0 to disable.
 
se_paranoid_msg_unbinds (default: 1)
Should the script activate abraham's security msg unbinds?
Valid settings: 1 to enable, 0 to disable.
 
se_spy_mode (default: 0)
Should the script log usage of critical to botnet security commands?
Valid settings: 1 to enable, 0 to disable.
IMPORTANT NOTE: spymode can't be enabled without enabled abraham's security extensions/rebinds.
 
se_spy_victims (default: all)
Should the script log commands issued by all people or by people with specified flag ?
Valid settings: all or any resonable eggdrop flag.
 
se_spy_note (default: "$owner")
Enter here a list of people who should be notified about usage of logged commands.
Valid settings: One or more nicknames, seperated by a blank " ". Leave completely blank to disable.
 
set se_DCCcomplex (default: 0)
Should the script activate DCCcomplex.
Valid settings: 1 to enable, 0 to disable.
 
set se_DCCcomplexinterval (default: 5)
Enter here interval after wich bot should check users idle-timed.
Valid settings: Number of minutes, this variable is MANDATORY.
IMPORTANT NOTE: higher value gives smaller CPU usage at cost of precision, oposite case gives higher CPU usage but more precise script work.
 
set se_DCCcomplexwarntime (default: 30)
Enter here timeout value after wich user should be warned.
Valid settings: Number of minutes. Enter 0 to disable.
 
set se_DCCcomplexawaytime (default: 45)
Enter here timeout value after wich user should be awayed.
Valid settings: Number of minutes, greater than DCCcomplexwarntime. Enter 0 to disable.
 
set se_DCCcomplexkicktime (default: 90)
Enter here timeout value after wich user should be kicked.
Valid settings: Number of minutes, greater than DCCcomplexawaytime or DCCcomplexwarntime. Enter 0 to disable.
 
set se_joinctrl 0 (default: 0)
Should the script activate partyline access restrictions ?
Valid settings: 1 to enable, 0 to disable.
 
set se_joincotrl_botnet_master_check (default: 0)
Should the script limit access to users with +t flag only ?
Valid settings: 1 to enable, 0 to disable.
 
set se_joincotrl_perm_owner_check (default: 0)
Should the script limit access to perm-owners only ?
Valid settings: 1 to enable, 0 to disable.



FAQ

Q:  I have a question, but it's not listed here.
A:  Feel free to contact the author at johoho@hojo-net.de!



Contact

You can contact me via E-Mail at johoho@hojo-net.de, at ICQ 2499577 (tell me who you are and what you want or I'll ignore you) or catch me on irc usually around 18-24 UTC+1 in #eggdrop. (IrcNET)


DISCLAIMER

security.tcl is provided 'as is' and without warranty of any kind. You may use it own will as long as the author is NOT held responsible for ANY damage caused by the usage of this script, neither direct or indirect.
You may modify the script and all belonging files as long as you keep this copyright-text, include a short description of all changes, and send a copy to the author (e-mail: johoho@hojo-net.de).



©2000 by Johoho@IrcNET, 08 February 2002. CONTACT