/*
Chatspace Proxy Detector by KuTsuM
NOTE: You may need IRCop priv in order for this script to work properly.
Notes have been added to the code to help users port this script for Unreal IRCD, or any other IRCD.
*/
;The following trigger may need change for certain server platforms. UnrealIRCD should be ok as is.
on *:SNOTICE:*client connecting*: {
set %proxy. [ $+ [ $9 ] ] 1
whois $9
}
raw ^311:*: {
/*
The following is the portion that designates the difference between Chatspace servers, and IRCD servers. The $2 represents the nickname of the user, and $4 represents the IP.
Raw 311 on Chatspace:
Mynick TheirNick TheirUserID 255.0.0.0 * :Their Real Name
Please keep in mind, you may need IRCop priv in order for this script to work properly
*/
if (%proxy. [ $+ [ $2 ] ]) {
unset %proxy . [ $+ [ $2 ] ]
set %proxya [ $+ [ $4 ] ] $2
dns $4
haltdef
}
}
on ^*:DNS: {
;Set ports to scan in following, delimit by asterix
var %ports = 1080*80*3128*8080*3380,%x = 1
while ($gettok(%ports,%x,42)) {
if (%proxya [ $+ [ $dns(0).addr ] ]) {
var %w = $+(proxy,$r(1000,9999))
sockopen %w $gettok(%ports,%x,42)
sockmark %w $dns(0).ip $v1
}
else { break }
inc %x
}
}
on *:SOCKOPEN:proxy*: {
if ($sockerr) { halt }
;Set k-line message, can be edited to gline, gkline, etc
kline $gettok($sock($sockname).mark,2,32) Proxy Detected on port: $sock($sockname).port (If you disagree, send an email to: unknown@unknown.com)
sockclose $sockname
}