| View previous topic :: View next topic |
| Author |
Message |
timew Voice
Joined: 10 Feb 2005 Posts: 7
|
Posted: Fri Nov 14, 2008 3:59 am Post subject: Help on changing default ban mask for eggdrop 1.6.19 |
|
|
Hi,
I've posted here before about this a few years ago but didn't help. I've recently rebuilt my eggdrop bot, and it used to ban at *!*@*host.com on any users it found matching +dk in the userbase.
But now it bans at *!ident@*.com by default, regardless of what host is added to the +d user. And looks messy and unprofessional, plus it's ban evaded in seconds. No idea why an ident ban was suggested as best, but i'm against it.
I just want to change my whole configurration of eggdrop so that when I have +d set to a user called BADUSER, containing the host *!*@*.comcast.net it'll do that ban, and not the stupid ident one.
How do I change the setting in eggdrop to accept this overall?
I feel stupid because I've googled, I've looked at tcl.doc, I've looked at all the help files and also the source code and buggered if I know how to do this simple thing.
*I edited this to include +k as +d wasn't the problem, it's +k causing grief.
Last edited by timew on Fri Nov 14, 2008 11:51 pm; edited 2 times in total |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Nov 14, 2008 12:33 pm Post subject: |
|
|
Just a question, if you wish for "*!*@*.comcast.net" to be banned, why not just add it to eggdrop's internal banlist, and it'll use exactly that banmask, rather than creating an arbitrary handle with +d (which actually means "do not allow this user to obtain operator status", nothing else). _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
timew Voice
Joined: 10 Feb 2005 Posts: 7
|
Posted: Fri Nov 14, 2008 9:32 pm Post subject: |
|
|
ok to clear things up - comcast is an example and is a nuisance host to australian irc networks. We had a flood of over 90 open proxies from that isp alone. Secondly, we have over 400 bans and it's too much for the bot and users to sift through to undo 1 ban, whereas you can use the .match command to find which host is assosiated to which user.
However.. when the bot reads a *!*@*comcast.com host and then interprits as *!blah@host.comcast.com then this actually becomes near on hopeless and now I'm wondering why i'm even running eggdrop. I thought they were more configurable than this.
I'm considering replacing eggdrop with mirc over this. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Nov 14, 2008 10:24 pm Post subject: |
|
|
Native functions in eggdrop were designed for a way of using, if you choose to use them in a different manner, you'll most likely find them very restrictive. When it comes to user records, these are intended to identify a single user. The +d flag simply means don't allow the user to gain operator status, the +k flag means don't allow the user to remain in the specific channel. Your eggdrop will then try to determine a suitable hostmask to use, in order to ban the offending user.
Basically, you are telling your eggdrop to get rid of this user, not a specific hostmask.
Eggdrops are very flexible when it comes to scripting (which would be the case if you do go for a mirc-bot anyway). Which language you prefer is entirely up to you.
I've yet to see an eggdrop choking on a banlist personally, and for user actions, both ".bans" and ".-ban" can take bans as argument. ".bans" even permit wildcard searches on bans. Personally, I'd consider this an advantage over +k users and .match, as searches are only done against hostmasks, and not handles or such. Not to mention the control with sticky bans, comments, and expire-time.
Now, all that said, to your question:
| Quote: | I just want to change my whole configurration of eggdrop so that when I have +d set to a user called BADUSER, containing the host *!*@*.comcast.net it'll do that ban, and not the stupid ident one.
How do I change the setting in eggdrop to accept this overall? |
Simply, write a script for it. What you are describing is not the intended behaviour for eggdrop.
You could alter the function named _maskhost found in /src/misc.c, as this is used by the quickban function in action during these kinds of kick/bans. Keep in mind that this would pretty much affect any automated (native) hostmask-generation within your eggdrop, not only bans. Also, details on the user (handle) being kicked is not provided at this call-level, so you would have to retrieve this aswell. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
timew Voice
Joined: 10 Feb 2005 Posts: 7
|
Posted: Fri Nov 14, 2008 11:48 pm Post subject: |
|
|
I see... this is why I was asking because i did look through the source and I do understand it but there's a lot to sift through. I'm not biased towards mirc or eggdrop because i'm a user who runs both linux and windows, so no arguments there.
However... I will say that Bots are only as good as the operating system itself. I cannot and will not see the day I'll get a 60 day mininum uptime of a mircbot or a wineggdrop, however I've seen this already with eggdrop.
I have managed though to upgrade the source code for gseen.mod to hand 26 character nicks and it was very successful.
I love my eggdrop and want to make it work the way I want to (it's been running 8 years now).
You are very good at your replies I commend you on that, as I am a support technician as well and take support replies fairly seriously.
From your suggestions, what I'll probably end up doing is this:
Instead of using +k (sorry about mentioning +d, my bad but it didn't affect the outcome of what you were saying, just created more info), that I use a different user flag. I could maybe add this via userinfo.tcl and then possibly use a ban script to simply ban at that host when matched.
However because of the many upgrades of eggdrop this should be written to a separate script overall to avoid having to hack up userinfo.tcl later on.
I would've hardcoded this into the bot, as i really do find ident bans useless. This should maybe be looked at as a serious enhancement to eggdrop as a configurable banmask for the built-in ban, otherwise it should be separate anyway. I have spent a lot of time looking how to configure and just stick with the basic eggdrop.
People just disconnect mirc, then change the ident and reconnect, and they can do this 1000 times over. I see the pain of this from watching other ops, and the user d/c's then r/c's and starts all over, till the op works out the ident ban is useless themself.
Upon looking at my post back in 2001 this reply here from awyeah: http://forum.egghelp.org/posting.php?mode=quote&p=46521&sid=348280bd3b7404e7b9476b1c93dbe5a9
was very handy but upon looking through .help set there was nothing to set the banmask, but it was also an excellent reply.
but when i went to attempt to set it via the .conf file or in the bot, it would return an error.
Thanks for your help so far |
|
| Back to top |
|
 |
Callisto Halfop
Joined: 13 Mar 2005 Posts: 86
|
Posted: Sat Nov 15, 2008 4:19 am Post subject: |
|
|
| Quote: | | We had a flood of over 90 open proxies from that isp alone |
If this is the case then you really should complain to the network admin. If your network doesnt use hostmasking then you could also look at a proxy detector. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Nov 15, 2008 12:13 pm Post subject: |
|
|
@timew:
Thank you, it's always nice to hear people appreciate ones efforts
Better options on customizing the behaviour of maskhost is a good idea, as not all people have the same needs. This would best be expressed to the eggdrop development team at eggheads.org
Simplest approach script-wize would probably be to use one of the 26 user-defined flags (A-Z, in this case, I choose K), and extend the stub below to suit your needs. There is no need whatsoever to tie in the userinfo.tcl script.
| Code: | bind join K|K "% *" CustomKick
proc CustomKick {nick host handle channel} {
### Use this if you wish to iterate through the users list of hostmasks
# foreach hm [getuser $handle HOSTS] {
# ...
# }
### To simply ban major domain+tld, use something like this
# set t [split $host "."]
# pushmode $channel +b "*!*@*[join [lrange $t end-1 end] "."]"
### To ban the offending host, use something like this
# set t [split $host "@"]
# pushmode $channel +b "*!*@[lindex $t end]"
} |
I would still encourage the use of the internal banlist, as it was designed exactly for the use and conditions you've described. However, I cannot force you into doing that
Good luck with your scripting, and don't hesitate to ask here if you get stuck in the process. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
timew Voice
Joined: 10 Feb 2005 Posts: 7
|
Posted: Fri Nov 21, 2008 3:54 pm Post subject: |
|
|
Thanks for this, I ended up using this exact script leaving the comments in for later... !
How exactly does this work:
| Code: | # foreach hm [getuser $handle HOSTS] {
# ...
# } |
Pardon being a noob but does the ban code go into the "..." area?
I wrote a kick part to this too so overall my script looks like this: (Just incase someone else reads this and wants the quick fix:
| Code: | bind join K|K "% *" CustomKick
proc CustomKick {nick host handle channel} {
### Use this if you wish to iterate through the users list of hostmasks
# foreach hm [getuser $handle HOSTS] {
# ...
# }
### To simply ban major domain+tld, use something like this
#set t [split $host "."]
#pushmode $channel +b "*!*@*[join [lrange $t end-1 end] "."]"
### To ban the offending host, use something like this
set t [split $host "@"]
pushmode $channel +b "*!*@[lindex $t end]"
putserv "KICK $channel $nick :This host has been blacklisted"
}
putlog "Custom Kicker by nickname Loaded" |
Works exactly how I want it to now, thanks. I just want the host banned although the whole isp is blacklisted.
Cheers![/code] |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Nov 21, 2008 4:37 pm Post subject: |
|
|
Nice you got it working.
As for the code you asked about, it works by retrieving a list of hostmasks added to a given handle, and then iterates through the list.
"..." would probably be replaced with some code to check $hm (the current hostmask in the list) against the nick!user@host of the offender in order to see if it was this hostmask that matched. If it would match, you'd then add this as the ban. To simply place a siteban, this would be overkill. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
timew Voice
Joined: 10 Feb 2005 Posts: 7
|
Posted: Fri Nov 21, 2008 4:56 pm Post subject: |
|
|
Yep sure did, and didn't take that long either, about 15 minutes and i did know enough to put the putlog commands and some bits and pieces.
This particular script is good, because i can add certain hosts like nickname!*@* and when nickname!*@* comes in, it'll ban at *!*@dialup555.hostmark.com
Which is pretty sneaky really too because the user thinks they've been blacklisted through their host and not their nick so they're less persistant on evading by nickname, etc. Plus it keeps a lot of consistancy with the bans alongside our chanserve bot which has a lot of the same hosts, but if services go down, this is the backup. |
|
| Back to top |
|
 |
|
|
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
|
|