Page MenuHomeDevCentral

D475.id1163.diff
No OneTemporary

D475.id1163.diff

diff --git a/vendor/README.md b/vendor/README.md
--- a/vendor/README.md
+++ b/vendor/README.md
@@ -6,6 +6,12 @@
These are 3rd party scripts we import as is.
+### Licensing
+
+These scripts don't follow our BSD-2-Clause licensing,
+but are shipped under their own license.
+
### Contents
- bseen1.4.2.tcl - Bass's Seen - provides `!seen` command
+ - proxycheck.tcl - Open proxy checker by James Seward (GPL)
diff --git a/vendor/proxycheck.tcl b/vendor/proxycheck.tcl
new file mode 100644
--- /dev/null
+++ b/vendor/proxycheck.tcl
@@ -0,0 +1,83 @@
+# 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
+
+set proxycheck_rbls [registry get proxycheck.rbls]
+set proxycheck_bantime [registry get proxycheck.bantime]
+
+#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
+ putloglev d * "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
+ putlog "proxycheck: $nick ($orighost) is listed in $rbl ... banning from $channel"
+ newchanban $channel "*@$orighost" "proxychk" "proxycheck: $rbl" $proxycheck_bantime
+ }
+ #if we didn't get a host, they're not in RBL
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 22:13 (18 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259019
Default Alt Text
D475.id1163.diff (2 KB)

Event Timeline