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.

no ctcp reply help needed

Old posts that have not been replied to for several years.
Locked
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

no ctcp reply help needed

Post by CrazyEgg »

I have a little problem.

Last month i had attack with sdbots.after all i saw that looks like a human user(with ident/real name/nick etc.).only one bug have.cause this spam are zombies pc and many of them have version reply.others have and ping reply but noone have time reply(until now).

so what is my problem now.I try to detect onjoin and with a delay of 20 sec version/ping/time.Is the only solution what i have.I try with bind ctcr.
i have response like:
CTCP reply VERSION: mIRC v6.16 Khaled Mardam-Bey from $nick(uhost) to $botnick.

what is the correct to find out the user without version/ping/time reply?
ctcr detect text after CTCP reply VERSION:
i try to find out what means "CTCP reply VERSION:"
Is that an action? notc? msg? ctcp? and if yes what is the correct procedure?

thanks and sorry for my english
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

yes, [bind ctcr] catches CTCP replies (VERSION is one of them)

and no, there is no sure way of recognizing channel user as drone - most dronebots (sdbot definitely) do a pretty good job in disguising as normal mIRC users (you can't catch those by their CTCP replies)
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

part of the script:
bind join - * verjoin
bind ctcr - VERSION verreply

proc verjoin {nick uhost hand chan} {
if {((![isbotnick $nick]) && (![isbotnick [hand2nick $hand $chan]]))} {
if {([onchan $nick $chan]) && ("[getchanhost $nick $chan]" == "$uhost") && (![isvoice $nick $chan]) && (![isop $nick $chan])} {
putserv "PRIVMSG $nick :\001VERSION\001"
}
}
}

proc verreply {nick uhost hand dest key arg} {
global botnick
if {[string tolower $nick] != [string tolower $botnick]} {
if {[string match "*VERSION*" [lindex $arg 0]]} {
putlog "user have version"
} else {
putlog "NO version reply."

.................................................................................................
this one is wrong.
how must modify that?
i dont care the version if is mirc,xicr,pirch,xchat,windows chat or anything else.


thanks for your attention
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If the nick replied to a version request then it does have a reply. Something like this should make it clearer for you:

Code: Select all

bind join - * ask:ver
bind ctcr - VERSION get:ver

proc ask:ver {nick uhost hand chan} {
 global askedv
 if {![isbotnick $nick]} {
  puthelp "PRIVMSG $nick :\001VERSION\001"
  set askedv([string tolower $nick]) 1
 }
}

proc get:ver {nick uhost hand dest key arg} {
 global askedv
 if {[info exists askedv([string tolower $nick])]} {
  putlog "$nick has a version reply"
  unset askedv([string tolower $nick])
 }
}
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

still not working

Code: Select all

bind join - * ask:ver
bind ctcr - VERSION get:ver

proc ask:ver {nick uhost hand chan} {
 global askedv
 if {![isbotnick $nick]} {
  puthelp "PRIVMSG $nick :\001VERSION\001"
  set askedv([string tolower $nick]) 1
 }
}

proc get:ver {nick uhost hand dest key arg} {
 global askedv
 utimer 5 [list check $nick $uhost $hand $dest $key $arg]
}

proc check {nick uhost hand dest key arg} {
global askedv
if {![info exists askedv([string tolower $nick])]} {
putlog "$nick has NOT a version reply"
unset askedv([string tolower $nick])
} else  {
putlog "$nick has a version reply"
unset askedv([string tolower $nick])
 }
}
i have add a timer for reply.when version exist then everything ok.
when not nothing happend
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you need to set your timer outside the ctcr handler
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

where? cause i tried all possible places and errors like :
can't read "uhost": no such variable
while executing
"list check $nick $uhost $hand $dest $key $arg"
etc.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

in the proc that issues CTCP VERSION

and 5 seconds is too low, because of the possible lag you should give clients at least 10 seconds to reply
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

well i tried like that as you propose

Code: Select all

proc ask:ver {nick uhost hand chan} {
 global askedv
 if {![isbotnick $nick]} {
  puthelp "PRIVMSG $nick :\001VERSION\001"
  set askedv([string tolower $nick]) 1
utimer 5 [list get:ver $nick $uhost $hand $dest $key $arg]
 }
}
the errors and the results:
when the script had version reply :

[21:27:01] <Bot> testingmon joined #
[21:27:03] <Bot> testingmon has a version reply
[21:27:03] <Bot> CTCP reply VERSION: mIRC v6.12 Khaled Mardam-Bey from testingmon to Bot

when the script have no reply the results:
[21:27:22] <Bot> testingmon joined #
[21:27:22] <Bot> Tcl error [ask:ver]: can't read "dest": no such variable

Meaning that: wrong arguments and if you observ the timer does not exist.
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

sorry ppl but after what happend on #egghelp i have to say that:

1.thanks the user greenbear for help.Even if the proc doesnt work.
2.Thanks the user rudenstam for his comments like "let's just say that some people arn't supposed to run eggdrops.... and you are one of them"

At last i say another one time.
I want to make a tcl that the results "version reply exist or not exist" can be catched after a 20 sec.

anyone if want to help just help.Nothing more.

Thanks for your attention

p.s. sorry but i didn born knowed tcl language like others.
i am glad to make some ppl "laughing at me on teh forum":)
r
rudenstam
Voice
Posts: 5
Joined: Fri May 21, 2004 11:24 am

Post by rudenstam »

if anyone else is up for 6hours spoonfeeding him

I'm sure you will understand me and greenbear :)
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

Here's the final piece of the code, building on the code Sir_Fz already wrote for you. So now you can stop blaming others because you're a total idiot.

Code: Select all

bind join - * ask:ver
bind ctcr - VERSION get:ver

proc ask:ver {nick uhost hand chan} {
 global askedv
 if {![isbotnick $nick]} {
  puthelp "PRIVMSG $nick :\001VERSION\001"
  set askedv([string tolower $nick]) 1
  utimer 25 [list no:vreply $nick]
 }
}

proc get:ver {nick uhost hand dest key arg} {
 global askedv
 if {[info exists askedv([string tolower $nick])]} {
  putlog "$nick has a version reply"
  unset askedv([string tolower $nick])
 }
}

proc no:vreply {nick} {
 global askedv
 if {[info exists askedv([string tolower $nick])]} {
   putlog "$nick has no version reply"
   unset askedv([string tolower $nick])
 }
}
C
CrazyEgg
Halfop
Posts: 47
Joined: Thu Jul 28, 2005 4:02 pm

Post by CrazyEgg »

i want to thank you a lot for the script and for your comment.
sorry why i have no experiance and try to find solutions but if you search to find out that is the first tcl doing that.
Hope to help and other ppl and not only me and let me be an idiot.

many thanks to: demondand special thanks to Sir_Fz and greenbear.
Locked