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.

Anyone know how to script this kind of tcl

Old posts that have not been replied to for several years.
Locked
g
gIga

Anyone know how to script this kind of tcl

Post by gIga »

Eg: i type .ping www.besthostings.com

reply from 202.136.5.2: bytes=32 time=45ms TTL=249
reply from 202.136.5.2: bytes=32 time=17ms TTL=249
reply from 202.136.5.2: bytes=32 time=17ms TTL=249
reply from 202.136.5.2: bytes=32 time=48ms TTL=249

ping statistics for 202.136.5.2:
Packet: sent = 4, Recieved = 4, Lost = 0 <0% loss>
Approximate round trip times ìn milli-seconds:
Minium = 17 ms, Maximum = 48ms, Average = 31ms

if anyone know how to script this into tcl i would like it
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

Code: Select all

bind pub n|n .ping pub:ping
proc pub:ping {nick host handle chan text} {
     set ping_var [exec ping $text]
     set l [split $ping_var "\t\n"]
     foreach i $l { puthelp "PRIVMSG $chan :$i" }     
     }
basically ripped this from an old nmap script (no author mentioned in it, btw), untested & i cant guaratee its secure or anything.

one thing to note though, if two identical lines are spit out by ping, only one will be msg'ed. check the "help-queue" setting in the config file if you want duplicate lines msg'ed aswell;

this
reply from 202.136.5.2: bytes=32 time=45ms TTL=249
reply from 202.136.5.2: bytes=32 time=17ms TTL=249
reply from 202.136.5.2: bytes=32 time=17ms TTL=249
reply from 202.136.5.2: bytes=32 time=48ms TTL=249


will become this
reply from 202.136.5.2: bytes=32 time=45ms TTL=249
reply from 202.136.5.2: bytes=32 time=17ms TTL=249
reply from 202.136.5.2: bytes=32 time=48ms TTL=249

another thing to note;
this will not work as well on linux/bsd. windows pings four times by default, but unix ping pings until stopped, so you'd have to add the -c (count) parameter.
photon?
M
MC_8
Voice
Posts: 36
Joined: Sat Apr 26, 2003 5:04 pm
Location: Dallas, Texas
Contact:

Post by MC_8 »

Code: Select all

bind pub n|n .ping pub:ping 
proc pub:ping {nick host handle channel text} { 
  putserv "PRIVMSG $channel :$text> Pinging..."
  set ping_var [exec ping $text]
  set l [split $ping_var \n]
  for {set i 0} {$i < [llength $l]} {incr i} {
    set line [lindex $l $i]
    putserv "PRIVMSG $channel :$text_$i> $line"
  }
  putserv "PRIVMSG $channel :$text> Done."
} 
This will keep it from stopping the output of duplicates as spock mentions.
Carl M. Gregory - MC_8
http://mc.purehype.net/whois/
g
gIga

I don't get it

Post by gIga »

Can explain clearer to me thanks
M
MC_8
Voice
Posts: 36
Joined: Sat Apr 26, 2003 5:04 pm
Location: Dallas, Texas
Contact:

Re: I don't get it

Post by MC_8 »

gIga wrote:Can explain clearer to me thanks
Umm, that is clear. If you don't know TCL, learn it to better understand this. http://mc.purehype.net/faq/?view=56
Carl M. Gregory - MC_8
http://mc.purehype.net/whois/
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

MC_8 wrote:

Code: Select all

bind pub n|n .ping pub:ping 
proc pub:ping {nick host handle channel text} { 
  putserv "PRIVMSG $channel :$text> Pinging..."
  set ping_var [exec ping $text]
... [snip] ...
} 
[snip]
That is about a classical example of an enormous security hole.
M
MC_8
Voice
Posts: 36
Joined: Sat Apr 26, 2003 5:04 pm
Location: Dallas, Texas
Contact:

Post by MC_8 »

All code on a forum should be considered an example and not a full blown script with all the bells and wistles.
Carl M. Gregory - MC_8
http://mc.purehype.net/whois/
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

MC_8 wrote:All code on a forum should be considered an example and not a full blown script with all the bells and wistles.
What a lousy and stupid anwer.

Was there any request for bells and wistles? no! Was this hole easy to fix? yes!
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

@egghead: so why dont you correct it? ;)

@MC_8: i see your point. its a forum to help ppl write their own scripts and not to write the whole script for them. but you should also consider that just these people who answer questions are the last to find out these security holes. so i would say, experient coders should take care that big security holes are put out. my opinion.
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Security holes are how you learn.

However, there is the point, where we have some form of responsibity to help keep things secure.

The more people we fail to notify of the issues, the more insecure script become available.

At least some form of notice, that it is insecure, and a pointer to more information on the security problem.

Also, @arcane. Can you remove the image in your sig. It is one thing to have an avatar, but I hate seeing images like this inside the thread themselves.
M
MC_8
Voice
Posts: 36
Joined: Sat Apr 26, 2003 5:04 pm
Location: Dallas, Texas
Contact:

Post by MC_8 »

I gave an example of how you COULD code it. You take that information and read about each command in the manual to see what each does to get a better understanding of what your trying to do.

And egghead, fuc|< you. You need to learn how to talk to people with respect, son.
Carl M. Gregory - MC_8
http://mc.purehype.net/whois/
Locked