This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Change the ban command to exempt.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Change the ban command to exempt.

Post by gamble27 »

basically what i want this tcl do is simple,i want it to kick the user when found on dnsbl but DO NOT ban them,which allows them to rejoin(if they are user).When they rejoin they will not get kicked for say abt 10 mins(exempt for this period).tats all,as DNSBL are not very accurate what we can do is we allow genuine users to rejoin if they are found in dnsbl wrongly.im sure many of us will enjoy such tcl.. TCL is pasted below.. waiting to hear soon thanks :)

# open proxy checker for eggdrop
# (c) James Seward 2003/4
# version 1.0

# http://www.jamesoff.net/projects/eggdrop
# 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 { "rbl.efnetrbl.org" }

# time in minutes to ban for
set proxycheck_bantime 60

# stop editing here unless you're TCL-proof



## CODE
###############################################################################

#add our channel flag
setudef flag proxycheck

#bind our events
bind join - *!*@* proxycheck_join

#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

if {$status} {
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

if {$status} {
putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
newchanban $channel "*@$orighost" "proxychk" "SPAM." $proxycheck_bantime
}
#if we didn't get a host, they're not in RBL
}

putlog "proxycheck 1.0 by JamesOff loaded"
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

just change

Code: Select all

putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning" 
newchanban $channel "*@$orighost" "proxychk" "SPAM." $proxycheck_bantime
to

Code: Select all

putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... kicking"
putserv "KICK $channel $nick :Possible spam/advertize/invite bot or drone."
This will make the script issue a kick for the person found on the RBL, and not add a ban for them.

As for
When they rejoin they will not get kicked for say abt 10 mins(exempt for this period)
this dosen't make much sense :roll:
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

thank you for assisting,but reason why i want it to exempt the user after it being kicked is i don want to create any kick flood,imagine if a real user gets kicked he/she will rejoin the channel and eggdrop will kick it again and he/she will rejoin again,and same will follow and it create kick flood.so that is why its very important to exempt a user for certain period of time in order to allow a genuine user to join the channel after he/she being kicked.Hope to hear from u all soon,this tcl will be very useful for anyone who are fighting spam in their channels :)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Ok, :) thank you that helps. Its not really tested but you can try using the following:

Change

Code: Select all

#don't apply to friends, voices, ops 
if {[matchattr $handle fov|fov $channel]} { 
 return 0 
}
to

Code: Select all

#don't apply to friends, voices, ops 
if {[matchattr $handle fov|Pfov $channel]} { 
 return 0 
}
and change

Code: Select all

if {$status} { 
putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning" 
newchanban $channel "*@$orighost" "proxychk" "SPAM." $proxycheck_bantime 
} 
#if we didn't get a host, they're not in RBL 
}
to

Code: Select all

if {![validuser "proxychk"]} {
 adduser "proxychk"
 setuser "proxychk" COMMENT "Added to prevent multi-RBL lookups of users"
 putlog "proxycheck: created new user 'proxychk' to prevent mult-RBL lookups of users"
}
if {$status} {
putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... kicking" 
putserv "KICK $channel $nick :Possible spam/advertize/invite bot or drone."
chattr proxychk +|+P $channel
setuser "proxychk" HOSTS "*!*@$orighost"
putlog "proxycheck: exempting $orighost for 10min to prevent mult-RBL lookup"
timer 10 [list delhost "proxychk" "*!*@$orighost"]
}
#if we didn't get a host, they're not in RBL 
}
This will creat the user "proxychk" in eggdrop's userfile, and add the host of the user that was scanned to prevent them being re-scanned. This will last for 10mins before eggdrop will remove the host, allowing them to be rescanned again. After 10mins is up. It uses the +P channel flag (custom flag *) Also, it will as before prevent the bot from banning the user, it will only issue a kick for them. :? its rough, like i said and untested. any problems let me know :wink:

P.S This should also allow u to exempt your own users, from being scanned when they join serton channels. Without them having to be ops, halfops or voice's in eggdrop userfile. Just give them the +P flag for the channel you dont want them to RBL checked.
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

thanks again for assisting :) i did what u told me to and changed what ever was there to be changed and i receive the following error after loading the tcl

[13:21] <eggdrop> [13:24] proxycheck: 219.94.71.157 resolves to 219.94.71.157
[13:21] <eggdrop> [13:24] proxycheck: looking up 157.71.94.219.dnsbl-3.uceprotect.net
[13:21] <eggdrop> [13:24] DNS resolve failed for 157.71.94.219.dnsbl-3.uceprotect.net
[13:21] <eggdrop> [13:24] Tcl error [proxycheck_check3]: invalid command name " adduser"

The one in bold is the error,the rest lines are normal but in the bold is the error.the eggdrop didnt kick even after detecting RBL.

Thank u again.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

[13:24] Tcl error [proxycheck_check3]: invalid command name "Â adduser"
adduser is a valid eggdrop tcl command. Think this has something to do with the way its uploaded/pasted to your shell, i'd double check the script on the shell. :idea:
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

sure mate,plz let me know the result.. :) if this tcl works it will be VERY useful :) thanks again
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

gamble27, you're the one who's supposed to check the script in your shell and not TCL_no_TK. Probably the editor you used when pasting the script added some weird characters that are causing this error.
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

after trying on my shell countless time the same prob still persist:< what could possibly the error/ problem : <
s
sk-4
Halfop
Posts: 51
Joined: Sat Oct 06, 2007 6:37 am

Post by sk-4 »

im using this edited tcl.any it look gr8..so far np..just want to ask is this script lookup for scan from this site
set proxycheck_rbls { "cbl.abuseat.org" "opm.blitzed.org" "dnsbl.ahbl.org" "tor.ahbl.org" }
... seem im getting kick only for cbl.abuseat.org
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

try

Code: Select all

set proxycheck_rbls { "cbl.abuseat.org opm.blitzed.org dnsbl.ahbl.org tor.ahbl.org" }
:)

Also opm.blitzed.org i dont think this RBL is active any more :?
[13:24] Tcl error [proxycheck_check3]: invalid command name "Â adduser"
If the error is the same/simlar to this one in referance to the "Â" char's then its down to the shell, it would be worth while uploading an other copy after removing the current one. :idea:
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

sk-4 dont mind can u please paste the exact tcl that you are using here,i dont know why the same error persist still,ill ask my shell company,also i wanna compare yours and mine.. so plz if you dont mind thanks :)
s
sk-4
Halfop
Posts: 51
Joined: Sat Oct 06, 2007 6:37 am

Post by sk-4 »

# open proxy checker for eggdrop
# (c) James Seward 2003/4
# version 1.0

# http://www.jamesoff.net/projects/eggdrop
# 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 { "dnsbl.ahbl.org" "tor.ahbl.org" "cbl.abuseat.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

#swing your pants

# catch joins
proc proxycheck_join { nick host handle channel } {
# allow 10 seconds for chanserv to op users on the channel access list
utimer 5 [list proxycheck_join_delay $nick $host $handle $channel]

}

proc proxycheck_join_delay { nick host handle channel } {
#check we're active
if {![channel get $channel proxycheck]} {
return 0
}

#don't apply to friends, voices, ops
if {[isop $nick $channel] || [isvoice $nick $channel] || [matchattr $handle fov|Pfov $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

if {$status} {
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

if {![validuser "proxychk"]} {
adduser "proxychk"
setuser "proxychk" COMMENT "Added to prevent multi-RBL lookups of users"
putlog "proxycheck: created new user 'proxychk' to prevent mult-RBL lookups of users"
}
if {$status} {
putlog "proxycheck:4 $nick 1 $host = ip4 $ip from RBL14 $rbl ... kicking"
putserv "KICK $channel $nick :14Possible spam/advertize/invite bot or drone 4LISTED14 in1 $rbl"
puthelp "PRIVMSG $nick :This is an automated response. You've been kicked from $channel because your host $host is listed at $rbl"
puthelp "PRIVMSG $nick :You will need to fix whatever caused you to be listed and get removed from $rbl before you're able to rejoin $channel ."
chattr proxychk +|+P $channel
setuser "proxychk" HOSTS "*!*@$orighost"
putlog "proxycheck:1Exempting4 $orighost 1for 10min to prevent4 mult-RBL lookup"
timer 10 [list delhost "proxychk" "*!*@$orighost"]
}
#if we didn't get a host, they're not in RBL
}

putlog "proxycheck 1.0 by JamesOff loaded"




TCL_no_TK i tried as u say,and it seem nothing happend..
g
gamble27
Halfop
Posts: 71
Joined: Tue Aug 05, 2008 7:51 am

Post by gamble27 »

its great going,its working nicely,i was jus wondering how can we ignore scanning for certain mask like *!*@121.121.* or *!*@203.82.* can we exempt scanning for such mask?? thanks :)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

gamble27 wrote:its great going,its working nicely,i was jus wondering how can we ignore scanning for certain mask like *!*@121.121.* or *!*@203.82.* can we exempt scanning for such mask?? thanks :)
Ok change

Code: Select all

#don't apply to friends, voices, ops 
if {[isop $nick $channel] || [isvoice $nick $channel] || [matchattr $handle fov|Pfov $channel]} { 
return 0 
}
so that its the following:

Code: Select all

#don't apply to friends, voices, ops 
if {[isop $nick $channel] || [isvoice $nick $channel] || [matchattr $handle Pfov|Pfov $channel]} { 
return 0 
}
and then just add the address's you want to exempt from being scanned, to the user "proxychk" like the following:
.+host proxychk *!*@121.121.*
or if there already a user in the bot, you can exempt them from being scanned (this will be globally, all channels) with
.chattr <there-handle> +P
in DCC/telnet with the eggdrop.

@sk-4 am not sure about this, could just be down to the eggdrop dns ;)

Code: Select all

set proxycheck_rbls [list "dnsbl.ahbl.org" "tor.ahbl.org" "cbl.abuseat.org " ]
Post Reply