on *:start:{
scid -a RawWin
; Remove flood protection variables that weren't cleaned before mIRC exited
unset %exploit
unset %exploit.*
echo $color(info) -ae *** Raw window/exploit blocking script loaded.
}
alias RawWin {
window -ek0mnv $+(@Raw-, $cid)
.debug -ipt $+(@Raw-, $cid) DCCWorkaround
window -a $+(@Raw-, $cid)
}
on ^*:LOGON:*:{
window -ek0mv $+(@Raw-, $cid)
.debug -inpt $+(@Raw-, $cid) DCCWorkaround
}
menu @Raw-* {
Save past raw text to log file:{
var %i = 1, %file = $sfile($logdir $+ *.log, Save As, Save)
%file = $+($chr(34), $iif($chr(46) isin %file, %file, %file $+ .log), $chr(34))
if (%file != $null) {
while (%i <= $line($active, 0)) {
write %file $line($active, %i)
inc %i
}
}
}
}
on *:INPUT:@Raw-*:{
if ($left($gettok($1-, 1 ,32), 1) != $chr(47)) {
scid $cid .raw $1-
haltdef
}
}
on *:CLOSE:@Raw-*:{
; Continue to block exploits without using a window or writing to a file. /rawwin will reopen the window.
.debug -i NUL DCCWorkaround
}
alias DCCWorkaround {
if ($regex($1, /^<- :([^!]*)![^@]*@[^ ]*\s*PRIVMSG\s*(\S*)\s*:\001\s*DCC\s*(SEND|RESUME).*"(?:[^" ]*\s){32}.*$/i)) {
var %nick = $regml(1), %target = $regml(2), %type = $regml(3)
echo 4 -ae *** %nick sent a DCC %type exploit to %target
.ignore -du2 %nick
; Protect against flooding from botnets
inc -z %exploit 2
if ($($+(%, exploit., %nick), 2) != stop) {
; Protect against flooding from one nick
set -u30 $+(%, exploit., %nick) stop
if (%exploit < 5) {
whois %nick
notice %nick Please do not exploit me.
}
}
}
return $1-
}