James Seward 20 жил өмнө
parent
commit
703331a56d

+ 38 - 0
GuardChan/guardchan.tcl

@@ -0,0 +1,38 @@
+# GuardChan by JamesOff
+# Kickbans people if they're not in the bot's userfile
+# No other filtering options, sorry
+# 
+# Released under the BSD licence
+# http://jamesoff.net/site/projects/eggdrop-scripts/guardchan
+
+# Instructions:
+#  - edit the owner setting below to your nick
+#  - load script
+#  - for channels you want to protect: .chanset #channel +guardchan
+
+# Only configurable setting (default has invalid char in to make sure you set it)
+set guardchan_owner "YOUR_NICK_HERE%"
+
+# Stop editing here unless you like TCL
+
+bind join - *!*@* guardchan_join
+
+setudef flag guardchan
+
+proc guardchan_join { nick host handle channel } {
+  global guardchan_owner
+  if {![channel get $channel guardchan]} {
+    return 0
+  }
+
+  if {$handle == "*"} {
+    if [botisop $channel] {
+      putkick $channel $nick "You are not permitted to be in here"
+      puthelp "PRIVMSG $guardchan_owner :Kicked $nick from $channel"
+      return 0
+    } else {
+      puthelp "PRIVMSG $guardchan_owner :HELP! $nick has joined $channel and I can't do anything about it :("
+      return 0
+    }
+  }
+}

+ 116 - 0
ProxyCheck/proxycheck.tcl

@@ -0,0 +1,116 @@
+# open proxy checker for eggdrop
+# (c) James Seward 2003-6
+# version 1.11
+
+# http://www.jamesoff.net/site/projects/eggdrop-scripts/proxycheck
+# james@jamesoff.net
+
+# Released under the GPL
+
+## INSTRUCTIONS
+###############################################################################
+
+# This script will check the hosts of people joining channels against one or
+# RBLs. Choose your RBLs wisely, some of them list DIALUP SPACE and that would
+# be a bad thing to be matching your IRC users against :P
+#
+# Enable the 'proxycheck' flag for channels you want the script active on
+# --> .chanset #somechannel +proxycheck
+#
+# Users who are +o, +v, or +f in your bot (local or global) won't be checked.
+#
+# Turn on console level d on the partyline to see some debug from the script
+# --> .console +d (to enable)
+# --> .console -d (to disable)
+
+## CONFIG
+###############################################################################
+
+# space-separated list of RBLs to look in
+set proxycheck_rbls { 
+  "cbl.abuseat.org" 
+  "opm.blitzed.org" 
+}
+
+# time in minutes to ban for
+set proxycheck_bantime 15
+
+# stop editing here unless you're TCL-proof
+
+
+
+## CODE
+###############################################################################
+
+#add our channel flag
+setudef flag proxycheck
+
+#bind our events
+bind join - *!*@* proxycheck_join
+
+#cache
+set proxycheck_lastip ""
+
+#swing your pants
+
+# catch joins
+proc proxycheck_join { nick host handle channel } {
+  #check we're active
+  if {![channel get $channel proxycheck]} {
+    return 0
+  }
+
+  #don't apply to friends, voices, ops
+  if {[matchattr $handle fov|fov $channel]} {
+    return 0
+  }
+
+  #get the actual host
+  regexp ".+@(.+)" $host matches newhost
+  if [regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} $newhost] {
+    #it's a numeric host, skip the lookup
+    proxycheck_check2 $newhost $newhost 1 $nick $newhost $channel
+  } else {
+    putloglev d * "proxycheck: doing dns lookup on $newhost to get IP"
+    dnslookup $newhost proxycheck_check2 $nick $newhost $channel
+  }
+}
+
+# first callback (runs RBL checks)
+proc proxycheck_check2 { ip host status nick orighost channel } {
+  global proxycheck_rbls proxylookup_rbls
+
+  if {$status == 1} {
+    putloglev d * "proxycheck: $host resolves to $ip"
+
+    # reverse the IP
+    regexp {([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})} $ip matches a b c d
+    set newip "$d.$c.$b.$a"
+
+    # look it up in the rbls
+    foreach rbl $proxycheck_rbls {
+      putloglev d * "proxycheck: looking up $newip.$rbl"
+      dnslookup "$newip.$rbl" proxycheck_check3 $nick $host $channel $rbl
+    }
+  } else {
+    putlog "proxycheck: Couldn't resolve $host. (No further action taken.)"
+  }
+}
+
+# second callback (catches RBL results)
+proc proxycheck_check3 { ip host status nick orighost channel rbl } {
+  global proxycheck_bantime proxycheck_lastip
+
+  if {$status} {
+    if {$ip == $proxycheck_lastip} {
+      putlogdev d * "proxycheck: $host = $ip appears in RBL $ip, but I've already seen this one."
+      return 0
+    }
+    set proxycheck_lastip $ip
+    putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
+    newchanban $channel "*@$orighost" "proxychk" "proxycheck: $rbl" $proxycheck_bantime
+  }
+  #if we didn't get a host, they're not in RBL
+}
+
+putlog "proxycheck 1.11 by JamesOff loaded (checking [llength $proxycheck_rbls] RBLs)"

+ 59 - 0
noIPhost/noiphost.tcl

@@ -0,0 +1,59 @@
+# no ip checker for eggdrop
+# (c) James Seward 2003-6
+# version 1.1
+
+# http://www.jamesoff.net/site/projects/eggdrop-scripts/noiphost
+# james@jamesoff.net
+
+# Released under the GPL
+
+## INSTRUCTIONS
+###############################################################################
+
+# This script bans users joining your channel with non-resolving hosts. Bans 
+# last for a day. (Change the 1440 in the line near the end of the script to 
+# change this).
+# 
+# Users who are +o, +v, or +f in your bot (local or global) are left alone.
+# 
+# Enable the 'noiphosts' flag for channels you want to protect.
+# --> .chanset #somechannel +noiphosts
+# 
+# Enable the debug level on the partyline for some debug output
+# --> .console +d (to enable)
+# --> .console -d (to disable)
+
+
+## CODE
+###############################################################################
+
+#bind to joins
+bind join - *!*@* bancheck_join
+
+#add our channel flag
+setudef flag noiphosts
+
+#it all happens in here
+proc bancheck_join { nick host handle channel } {
+  #check we're active
+	if {![channel get $channel noiphosts]} {
+		return 0
+	}
+
+  putloglev d * "noiphosts: join by $host to $channel"
+  
+  #don't apply to friends, voices, ops
+	if {[matchattr $handle +fov|+fov $channel]} {
+    putloglev d * "noiphosts: $nick is a friend"
+    return 0
+  }
+
+  #check host
+  if [regexp {@([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})$} $host matches ip] {
+    putlog "noiphosts: $nick has an un-resolved host ($ip), banning"
+    set banhost "*@$ip"
+    newchanban $channel $banhost "noiphosts" "Non-resolving host" 1440
+  }
+}
+
+putlog "noiphost 1.1 by JamesOff loaded"