| View previous topic :: View next topic |
| Author |
Message |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Wed Dec 18, 2013 9:33 am Post subject: advanced auto-voice script |
|
|
This script is a combination of two scripts I found on the forum and it is working great, my problem is that the owners (script kiddies) of the botnets realized that they have to idle their bots to spam in a moderated channel and they configured their bots to do so.
Thing is, that their spambots/drones don't have a ctcp version reply.
So my question is this, how can I make it scan on join for ctcp version replies and IF we get one (or a certain reply for future use), then proceed to the timer and voice after the time set. Here's the script:
| Code: | #Set your maximum idletime here
set maxidle 60
bind time - * idlecheck
#Set your channel name Here
set voicechan "#channel"
bind join - "#channel *" av:join
bind part - "#channel *" av:part
bind mode - "#channel +v" av:mode
bind sign - "#channel *" av:part
proc av:join {nick host hand chan} {
set host [string trimleft $host ~]
global dontvoice
if ![info exists dontvoice($chan)] { set dontvoice($chan) [list] }
if {[botisop $chan]&&[lsearch -exact $dontvoice($chan) $host]=="-1"} {
utimer 300 [list pushmode $chan +v $nick]
}
}
proc av:part {nick host hand chan {msg ""}} {
set host [string trimleft $host ~]
global dontvoice
if ![info exists dontvoice($chan)] { set dontvoice($chan) [list] }
if {![isbotnick $nick]&&![isvoice $nick $chan]&&![isop $nick $chan]&&[lsearch -exact $dontvoice($chan) $host]=="-1"} {
lappend dontvoice($chan) $host
timer 300 [list set dontvoice($chan) [lreplace $dontvoice($chan) [set foo [lsearch -exact $dontvoice($chan) $host]] $foo]]
}
}
proc av:mode {nick host hand chan mode {target ""}} {
set thost [string trimleft [getchanhost $target $chan] ~]
global dontvoice
if ![info exists dontvoice($chan)] return
if {[set foo [lsearch -exact $dontvoice($chan) $thost]]!="-1"} {
set dontvoice($chan) [lreplace $dontvoice($chan) $foo $foo]
}
}
proc idlecheck {min hour day month year} {
global botnick voicechan maxidle
foreach nick [chanlist $voicechan] {
if {$nick == $botnick} {continue}
if {[isop $nick $voicechan]} {continue}
if {![isvoice $nick $voicechan]} {continue}
if {[getchanidle $nick $voicechan] > $maxidle } {
putserv "MODE $voicechan -v-k $nick \00312Inactive.user(s)\00304"
}
}
}
|
_________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Wed Dec 18, 2013 11:54 am Post subject: |
|
|
Well, it's quite simple to do. I explain, I'll try to make the code later in the day.
- You must have a list of people on the chan ("global" variable), empty on the beginning.
- When someone join the channel, do the CTCP query
- When you got the raw 351 (RPL_VERSION), parse the message to separate nick and version
- If version is ok, add nick to the global list
- idlecheck works with the global list, not with [chanlist]
- when an user part, remove it from the list _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Dec 18, 2013 1:31 pm Post subject: |
|
|
@spithash : What will you do next if they decide to add a regular IRC client reply to their bot's version reply? I would honestly consider talking with an IRC Operator about this issue if persists.
@CrazyCat According to IRC/2 Numeric List that raw is for the server the user is connected on, not from the user itself.
You actually need to bind the ctcp "VERSION"" like this:
| Code: |
bind ctcp - VERSION version:reply
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Wed Dec 18, 2013 2:14 pm Post subject: |
|
|
Thanks guys for your replies
| caesar wrote: | @spithash : What will you do next if they decide to add a regular IRC client reply to their bot's version reply? I would honestly consider talking with an IRC Operator about this issue if persists.
|
ceasar: I guess I thought about it really, if that doesn't work, maybe add like 10 questions in a small database (something like 4+2 = ? )and randomly notice the users on join, if the reply is correct, the user gets voiced by the bot, something like captcha, only for IRC... just a thought, it might be stupid. but for now, this ctcp thing would help me a lot
Also, for the longest time (more than 3 years now) that I've been watching botnets/drones like these, they never had ctcp version reply - maybe they can't be bothered to add one? (I sure hope so ) _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Dec 19, 2013 5:11 am Post subject: |
|
|
so my guess is that it's more complicated than I thought  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Dec 19, 2013 6:41 am Post subject: |
|
|
Complicated? Not necessarily. It's up to you how far you want to take things and how to manage such a list. I'm trying something and will get back as soon as it's done.
Btw spithash, you are missing a nick changing function. as is right now, if someone that's in the list changes it's nick it will remain in the loop but will never be voiced so you should take care of that too. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Dec 19, 2013 7:10 am Post subject: |
|
|
Oh you got a huge point there, good call. Thank you for pointing that out man  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Dec 21, 2013 2:51 am Post subject: |
|
|
Let's say I want to use/combine this script here with the rest of the script, http://forum.egghelp.org/viewtopic.php?p=91730
but instead of only ban a certain ctcp reply (which is cool for me for future use), set it to NOT to voice users with NO ctcp reply on join, and if a user replies to VERSION, proceed to the timer and then voice _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sun Dec 22, 2013 3:59 pm Post subject: |
|
|
Anyone?  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Jan 02, 2014 7:00 am Post subject: |
|
|
unfortunately the attacks are still going on, I am still thinking that this ctcp version thing would be the best idea, anyone interested to help me around with this? _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Jan 02, 2014 10:04 am Post subject: |
|
|
I started working on something for you but put the work on hold due to holidays. In a few days will get back to work and finish it and reply here to test it out.
Meanwhile anyone else feel free to contribute.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Sat Jan 04, 2014 7:49 am Post subject: |
|
|
I'm looking forward to your reply, thanks  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Fri Jan 17, 2014 8:51 am Post subject: |
|
|
I hate doing this but the botnet attack is still going on, really constant, so I had to bug you guys again.
Anyone else feeling like contributing to this CTCP VERSION thing?
It would help me a lot. Thank you  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
|