egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Change the ban command to exempt.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Thu Jun 25, 2009 4:20 am    Post subject: Change the ban command to exempt. Reply with quote

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 Smile

# 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 Razz
#
# 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"
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Jun 26, 2009 11:09 am    Post subject: Reply with quote

just change
Code:
putlog "proxycheck: got host $host = ip $ip from RBL $rbl ... banning"
newchanban $channel "*@$orighost" "proxychk" "SPAM." $proxycheck_bantime
to
Code:
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
Quote:
When they rejoin they will not get kicked for say abt 10 mins(exempt for this period)
this dosen't make much sense Rolling Eyes
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Sat Jun 27, 2009 1:10 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sat Jun 27, 2009 6:08 pm    Post subject: Reply with quote

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

Change
Code:
#don't apply to friends, voices, ops
if {[matchattr $handle fov|fov $channel]} {
 return 0
}
to
Code:
#don't apply to friends, voices, ops
if {[matchattr $handle fov|Pfov $channel]} {
 return 0
}
and change
Code:
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:
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. Confused 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.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Sun Jun 28, 2009 1:28 am    Post subject: Reply with quote

thanks again for assisting Smile 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.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Jun 28, 2009 5:01 am    Post subject: Reply with quote

Quote:
[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
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Sun Jun 28, 2009 6:01 am    Post subject: Reply with quote

sure mate,plz let me know the result.. Smile if this tcl works it will be VERY useful Smile thanks again
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Jun 29, 2009 4:00 am    Post subject: Reply with quote

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.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Mon Jun 29, 2009 7:56 am    Post subject: Reply with quote

after trying on my shell countless time the same prob still persist:< what could possibly the error/ problem : <
Back to top
View user's profile Send private message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Tue Jun 30, 2009 10:12 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Tue Jun 30, 2009 12:50 pm    Post subject: Reply with quote

try
Code:
set proxycheck_rbls { "cbl.abuseat.org opm.blitzed.org dnsbl.ahbl.org tor.ahbl.org" }
Smile

Also opm.blitzed.org i dont think this RBL is active any more Confused

Quote:
[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
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Tue Jun 30, 2009 11:45 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
sk-4
Halfop


Joined: 06 Oct 2007
Posts: 51

PostPosted: Wed Jul 01, 2009 6:19 am    Post subject: Reply with quote

# 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 Razz
#
# 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..
Back to top
View user's profile Send private message
gamble27
Halfop


Joined: 05 Aug 2008
Posts: 71

PostPosted: Wed Jul 01, 2009 8:11 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Wed Jul 01, 2009 1:53 pm    Post subject: Reply with quote

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 Smile
Ok change
Code:
#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:
#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:
Quote:
.+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
Quote:
.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 Wink
Code:
set proxycheck_rbls [list "dnsbl.ahbl.org" "tor.ahbl.org" "cbl.abuseat.org " ]

_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber