Code: Select all
Tcl error [pjen:check]: can't read "pjen": no such variable
Tcl error [pjen:nick]: can't read "pjen": no such variable
Code: Select all
setudef flag pjen
setudef str pjendetected
setudef str pjenkicked
setudef str pjenjoin
bind join - * pjen:check
bind nick - * pjen:nick
bind pub - !trojan pub:pjen
bind pub - !pjen pub:pjen
proc pub:pjen {nick host hand chan arg} {
set cmd [lindex [split $arg] 0]
switch -exact -- [string tolower $cmd] {
"on" {
if {![matchattr $hand nmo|nmo $chan]} {
putserv "NOTICE $nick :Error: You do not have access to this command."
} else {
if {[channel get $chan "pjen"]} {
putserv "NOTICE $nick :Antipjen scan is already enabled for $chan."
} else {
putserv "NOTICE $nick :Antipjen scan is now enabled for $chan."
channel set $chan +pjen
putserv "PRIVMSG $chan :Antipjen scan is now enabled for this channel."
}
}
}
"off" {
if {![matchattr $hand nmo|nmo $chan]} {
putserv "NOTICE $nick :Error: You do not have access to this command."
} else {
if {![channel get $chan "pjen"]} {
putserv "NOTICE $nick :Antipjen scan is already disabled for $chan."
} else {
putserv "NOTICE $nick :Antipjen scan is now disabled for $chan."
channel set $chan -pjen
putserv "PRIVMSG $chan :Antipjen scan is now disabled for this channel."
}
}
}
"stats" {
if {([channel get $chan "pjenjoin"] == "")} {
channel set $chan pjenjoin 0
}
if {([channel get $chan "pjendetected"] == "")} {
channel set $chan pjendetected 0
}
if {([channel get $chan "pjenkicked"] == "")} {
channel set $chan pjenkicked 0
}
putserv "NOTICE $nick :Antipjen stats for $chan."
putserv "NOTICE $nick :Joins: [channel get $chan "pjenjoin"]"
putserv "NOTICE $nick :Detected: [channel get $chan "pjendetected"]"
putserv "NOTICE $nick :Kicked/Banned: [channel get $chan "pjenkicked"]"
putserv "NOTICE $nick :End of Antipjen stats for $chan."
}
"default" {
if {[channel get $chan "pjen"]} {
set pjen_status enabled
} else {
set pjen_status disabled
}
putserv "NOTICE $nick :Antipjen scan for $chan is: $pjen_status."
putserv "NOTICE $nick :Commands: !antipjen on|off|stats."
}
}
}
proc pjen:nick {nick host hand chan newnick} {
if {![isbotnick $nick] || ![string equal -nocase $nick $newnick]} {
pjen:check $newnick $host $hand $chan
}
}
proc pjen:check {nick host hand chan} {
if {![channel get $chan "pjen"]} {
return 0
}
if {[matchattr $hand nmoT|nmof $chan]} {
return 0
}
if {[string match "*quakenet.org" $host]} {
return 0
}
variable pjen-check "1"
set pjen-nick "$nick"
if {${pjen-check}} {
if {[string is alpha $pjen-nick]} {
return 0
}
if {[string match "*\[{}()^*|-_`\]" $pjen-nick]} {
return 0
}
scan $uhost %\[^@\]@%s ident host
set pjen-host $host
set pjen-newhost *!*[lindex [split $pjen-host @] 1]
set pjen-ident $ident
set pjen-newident [string trimleft $pjen-ident ~]
if {[string match "*$pjen-newident*" $pjen-nick] || [string match "*$pjen-nick*" $pjen-newident]} {
set pjen-method "Nick/Ident matching"
incr $pjen(joined,$chan); channel set $chan pjenjoined $pjen(joined,$chan)
incr $pjen(detected,$chan); channel set $chan pjendetected $pjen(detected,$chan)
if {[botisop $chan]} {
incr $pjen(kicked,$chan); channel set $chan pjenkicked $pjen(kicked,$chan)
set pjen-kickmsg "Pjen infected drone. Detection method: $pjen-method ID: [channel get $chan pjenkicked]"
putquick "KICK $chan $pjen-nick $pjen-kickmsg"
newchanban $chan $pjen-newhost $::botnick "$pjen-kickmsg" 30
newchanban $chan *!$ident@* $::botnick "$pjen-kickmsg" 0
putquick "MODE $chan +bb $pjen-newhost *!$pjen-newident@*"
putlog "\[$::botnick\] \[Pjen detected\] \[Idents: $pjen-ident $pjen-newident\] \[Host: $pjen-host\] \[Detection method: $pjen-method\] \[Added to database\]"
set pjen(ident,db) "$pjen(ident,db) $pjen-ident $pjen-newident"
set pjen(hosts,db) "$pjen(hosts,db) $pjen-host"
} else {
putlog "\[$::botnick\] \[Pjen detected\] \[Idents: $pjen-ident $pjen-newident\] \[Host: $pjen-host\] \[Detection method: $pjen-method\] \[Added to database\]"
set pjen(ident,db) "$pjen(ident,db) $pjen-ident $pjen-newident"
set pjen(hosts,db) "$pjen(hosts,db) $pjen-host"
}
return 0
}
if {[string is integer [string range $pjen-nick end-1 end]] && [string is alpha [string range $pjen-nick 0 3]]} {
set pjen-method "Last 2 letters of your nick contains numbers \(integers \[0-9\]\)"
incr $pjen(joined,$chan); channel set $chan pjenjoined $pjen(joined,$chan)
incr $pjen(detected,$chan); channel set $chan pjendetected $pjen(detected,$chan)
if {[botisop $chan]} {
incr $pjen(kicked,$chan); channel set $chan pjenkicked $pjen(kicked,$chan)
set pjen-kickmsg "Pjen infected drone. Detection method: $pjen-method ID: [channel get $chan pjenkicked]"
putquick "KICK $chan $pjen-nick $pjen-kickmsg"
newchanban $chan $pjen-newhost $::botnick "$pjen-kickmsg" 30
newchanban $chan *!$ident@* $::botnick "$pjen-kickmsg" 0
putquick "MODE $chan +bb $pjen-newhost *!$pjen-newident@*"
putlog "\[$::botnick\] \[Pjen detected\] \[Idents: $pjen-ident $pjen-newident\] \[Host: $pjen-host\] \[Detection method: $pjen-method\] \[Added to database\]"
set pjen(ident,db) "$pjen(ident,db) $pjen-ident $pjen-newident"
set pjen(hosts,db) "$pjen(hosts,db) $pjen-host"
} else {
putlog "\[$::botnick\] \[Pjen detected\] \[Idents: $pjen-ident $pjen-newident\] \[Host: $pjen-host\] \[Detection method: $pjen-method\] \[Added to database\]"
set pjen(ident,db) "$pjen(ident,db) $pjen-ident $pjen-newident"
set pjen(hosts,db) "$pjen(hosts,db) $pjen-host"
}
return 0
}
if {[string is integer [string range $pjen-newident end-1 end]] || [string match "~" [string range $pjen-ident 0]]} {
set pjen-method "Unresolved ident or ident contains numbers \(integers \[0-9\]\} in the ident"
incr $pjen(joined,$chan); channel set $chan pjenjoined $pjen(joined,$chan)
incr $pjen(detected,$chan); channel set $chan pjendetected $pjen(detected,$chan)
if {[botisop $chan]} {
incr $pjen(kicked,$chan); channel set $chan pjenkicked $pjen(kicked,$chan)
set pjen-kickmsg "Pjen infected drone. Detection method: $pjen-method ID: [channel get $chan pjenkicked]"
putquick "KICK $chan $pjen-nick $pjen-kickmsg"
newchanban $chan $pjen-newhost $::botnick "$pjen-kickmsg" 30
newchanban $chan *!$ident@* $::botnick "$pjen-kickmsg" 0
putquick "MODE $chan +bb $pjen-newhost *!$pjen-newident@*"
putlog "\[$::botnick\] \[Pjen detected\] \[Idents: $pjen-ident $pjen-newident\] \[Host: $pjen-host\] \[Detection method: $pjen-method\] \[Added to database\]"
set pjen(ident,db) "$pjen(ident,db) $pjen-ident $pjen-newident"
set pjen(hosts,db) "$pjen(hosts,db) $pjen-host"
} else {
putlog "\[$::botnick\] \[Pjen detected\] \[Idents: $pjen-ident $pjen-newident\] \[Host: $pjen-host\] \[Detection method: $pjen-method\] \[Added to database\]"
set pjen(ident,db) "$pjen(ident,db) $pjen-ident $pjen-newident"
set pjen(hosts,db) "$pjen(hosts,db) $pjen-host"
}
return 0
}
variable pjen-check "0"
}
}
proc pjen:db:info {nick host hand arg} {
set id [lindex [split $text] 0]
set database(pjen) [open pjen.db r]
set data [gets $database(pjen)]
close $database(pjen)
set data [split $data "\n"]
if {![string match "$id*" $data]} {
putserv "PRIVMSG $nick :Unique ID Number: $id does not exist in the database. Please contact a admin for futher help."
} elseif {[string match "$id*" $data]} {
set pjen(data) $data
set pjen(nick) [lindex [split $pjen(data)] 2]
set pjen(password) [lindex [split $pjen(data)] 1]
set pjen(ident) [lindex [split $pjen(data)] 3]
set pjen(host) [lindex [split $pjen(data)] 4]
set pjen(reason) [ range [lindex [split $pjen(data)] 4 end]]
putserv "PRIVMSG $nick :Info for ID: $id"
if {[matchattr $hand nm|]} {
putserv "PRIVMSG $nick :Password: $pjen(password)"
} else {
putserv "PRIVMSG $nick :Password: Admin's only!!"
}
putserv "PRIVMSG $nick :Nickname: $pjen(nick)
putserv "PRIVMSG $nick :Ident: $pjen(ident)"
putserv "PRIVMSG $nick :Host: $pjen(host)"
putserv "PRIVMSG $nick :Reason: $pjen(reason)
}
}
putlog "Antipjen script by Tosser^^ loaded. Beta script!!"
thx