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 

advanced auto-voice script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Wed Dec 18, 2013 9:33 am    Post subject: advanced auto-voice script Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Wed Dec 18, 2013 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Dec 18, 2013 1:31 pm    Post subject: Reply with quote

@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
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Wed Dec 18, 2013 2:14 pm    Post subject: Reply with quote

Thanks guys for your replies Smile

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 Idea Exclamation

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 Razz )
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Wed Dec 18, 2013 5:46 pm    Post subject: Reply with quote

@caesar : oops Embarassed
_________________
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
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Thu Dec 19, 2013 5:11 am    Post subject: Reply with quote

so my guess is that it's more complicated than I thought Confused
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Dec 19, 2013 6:41 am    Post subject: Reply with quote

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. Smile

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
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Thu Dec 19, 2013 7:10 am    Post subject: Reply with quote

Oh you got a huge point there, good call. Thank you for pointing that out man Smile
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Sat Dec 21, 2013 2:51 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Sun Dec 22, 2013 3:59 pm    Post subject: Reply with quote

Anyone? Rolling Eyes
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Thu Jan 02, 2014 7:00 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Jan 02, 2014 10:04 am    Post subject: Reply with quote

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. Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Sat Jan 04, 2014 7:49 am    Post subject: Reply with quote

I'm looking forward to your reply, thanks Smile
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Fri Jan 17, 2014 8:51 am    Post subject: Reply with quote

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 Smile
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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