<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/2273" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2002-08-20T11:41:47-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/2273</id>

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-20T11:41:47-04:00</updated>

		<published>2002-08-20T11:41:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9925#p9925</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9925#p9925"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9925#p9925"><![CDATA[
<blockquote class="uncited"><div>Btw, the bible.tcl file was removed on 11 July. Check the egghelp.org frontpage <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";-)" title="Wink"></div></blockquote>Oof! Guess i need a new pair of lenses <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by Guest — Tue Aug 20, 2002 11:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-19T19:44:47-04:00</updated>

		<published>2002-08-19T19:44:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9921#p9921</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9921#p9921"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9921#p9921"><![CDATA[
Thanks for your input check function, Maverick. It's pretty much better then my solution.<br><br>Btw, the bible.tcl file was removed on 11 July. Check the egghelp.org frontpage <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";-)" title="Wink"><p>Statistics: Posted by Guest — Mon Aug 19, 2002 7:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-19T04:53:36-04:00</updated>

		<published>2002-08-19T04:53:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9910#p9910</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9910#p9910"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9910#p9910"><![CDATA[
I found another script vulnerable to this while browsing google, thanks to Avi Norowitz. Bible.tcl. I walked through the bible_brs.tcl i found on bseen/ftp.eggheads.org and i think that's the one. It looks like the script is (still) vulerable but i cannot test it from my current location. I'll patch it if it is.<br><br>Usenet Article: (07/09/2002)<br><a href="http://groups.google.com/groups?dq=&amp;hl=nl&amp;lr=&amp;ie=UTF-8&amp;selm=20020709150103.130971d3.usenet%40ulag.net" class="postlink">http://groups.google.com/groups?dq=&amp;hl= ... 40ulag.net</a><p>Statistics: Posted by Guest — Mon Aug 19, 2002 4:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-16T09:44:12-04:00</updated>

		<published>2002-08-16T09:44:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9843#p9843</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9843#p9843"/>
		<title type="html"><![CDATA[Optimized code]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9843#p9843"><![CDATA[
Stripping off invalid characters is not very user friendly, since the scripts will return unexpected results without notification. Therefore i wrote a small, fast function that can be used to check for invalid characters and trigger messages to the user involved:<div class="codebox"><p>Code: </p><pre><code>proc mk_inptcheck {txt} {  foreach char {"&gt;" "&lt;" "|" "&amp;"} {    if [string match "*$char*" $txt] {return 1}  }  return 0}</code></pre></div>I have applied this patch to the following scripts:<br>- bserv1.0.tcl<br>- hlquery.tcl<br>- internic-lookup.tcl<br>- shoutcast.tcl<br><br>Am currently testing and awaiting reply from authors.<br><br>EXAMPLE: (shoutcast.tcl)<br><div class="codebox"><p>Code: </p><pre><code>################################################################### Written by Minox @ #SPooKY / iRCnet                            ##                                                                ## Please report bugs: minox@spooky.homelinux.org                 ##                                                                ## If you want to change that script, please send a copy to me... ##                                                                ## Read the README or get busted :P                               ##                                                                ####################################################################--# EDITED: 8/16/2002 by Mapherick^ApL#    PROBLEM SUMMARY:#    Fixed exec vulnerability as pointed out by Peter Postma here:#    http://forum.egghelp.org/viewtopic.php?t=2273#    User input can cause eggdrop runtime files to be overwritten #    and/or corrupted because of an unchecked variable used with #    the 'exec' command.##    SOLUTION:#    Added procedure mk_inptcheck and a routine in 'shoutcast' to#    call mk_inptcheck and give a proper reply to the user. Execution#    speed should be optimal.##    Also fixed the repetitive copyright message because that was way#    irritating ;)##    Questions/Suggestions should go to &lt;mapherick at apl-productions.org&gt;#--# Here you can define the prefix (trigger). E.g !audiosearchset cmdpre "!shoutcast"# Define the location of the binaryset searchshoutcast "~/eggdrop/scripts/searchshoutcast"# Set exec vulnerability checking on/off (1 = ON, 0 = OFF)set use_mk_inptcheck 1bind pub -|- [set cmdpre] shoutcastproc shoutcast { nick uhost hand chan args} { global cmdpre searchshoutcast  set args [lindex $args 0]    if {([mk_inptcheck [lindex $args 0]] || [mk_inptcheck [lindex $args 1]] || [mk_inptcheck [lindex $args 2]]) &amp;&amp; $use_mk_inptcheck} {    puthelp "notice $nick :  TERMINATED: Your input contains illegal characters."    puthelp "notice $nick :  Unable to process '|', '&lt;', '&gt;' and '&amp;'."    puthelp "notice $nick :  Please modify your searchterms and try again."    return  }    set msg [split [exec -- $searchshoutcast [lindex $args 0] [lindex $args 1] [lindex $args 2] ] "\n"]    putserv "PRIVMSG $nick :Shoutcast Server Search - Copyright by Minox @ #SPooKY / iRCnet"  putserv "PRIVMSG $nick : "   foreach line $msg {putserv "PRIVMSG $nick :$line"}}proc mk_inptcheck {txt} {  foreach char {"&gt;" "&lt;" "|" "&amp;"} {    if [string match "*$char*" $txt] {return 1}  }  return 0}</code></pre></div>Comments and suggestions are always welcome.<br><br>Mapherick<p>Statistics: Posted by Guest — Fri Aug 16, 2002 9:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-07T13:21:41-04:00</updated>

		<published>2002-08-07T13:21:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9513#p9513</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9513#p9513"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9513#p9513"><![CDATA[
Try downloading it again.<br>I just fixed the script.. <br>It was a !@#$ typo..<br><br><em class="text-italics">$arg == "" ![string_check $arg]</em> should be <em class="text-italics">$arg == "" || ![string_check $arg]</em><br><br>The script is also not tested, but it should work. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by Guest — Wed Aug 07, 2002 1:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-07T12:46:04-04:00</updated>

		<published>2002-08-07T12:46:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9512#p9512</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9512#p9512"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9512#p9512"><![CDATA[
Tcl error [pub:qstat_hlp]: syntax error in expression "$arg == "" ![string_check $arg]"<br><br>help???<br><br>i have downloaded this version<br><a href="http://ai-bot.mine.nu/scripts/qstat.tar.gz" class="postlink">http://ai-bot.mine.nu/scripts/qstat.tar.gz</a><p>Statistics: Posted by Guest — Wed Aug 07, 2002 12:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-06T13:26:51-04:00</updated>

		<published>2002-08-06T13:26:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9468#p9468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9468#p9468"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9468#p9468"><![CDATA[
Someone on IRC suggested me to use regex stuff for checking input.<br>So I did.... I've made another function to get rid of the bug.<br>Here it is:<br><div class="codebox"><p>Code: </p><pre><code>proc check_string {text} {  regsub -all "&gt;" $text "" text   regsub -all "&lt;" $text "" text   regsub -all "|" $text "" text  regsub -all "&amp;" $text "" text  return $text}</code></pre></div>It simply replaces the chars: &gt; &lt; | and &amp; with nothing, so it deletes the chars from the string.<br><br>usage:<div class="codebox"><p>Code: </p><pre><code>set checked [check_string $string]</code></pre></div>Comments on this function?<p>Statistics: Posted by Guest — Tue Aug 06, 2002 1:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-08-04T14:00:00-04:00</updated>

		<published>2002-08-04T14:00:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9401#p9401</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9401#p9401"/>
		<title type="html"><![CDATA[Heads up:Exploit in Qstat4eggdrop.tcl and possible others!!]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9401#p9401"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># exploit.tcl - string check prog. by Peter Postma &lt;mail@ask.me&gt;## This function checks the whole string for false chars.# We need to do this when we're passing arguments from IRC to the TCL# exec command. Without checking which characters in the string are,# we create a huge security hole which can be easily exploited.# I'll explain this later.## I found this hole in some of my own code. I audited all my code and also# the well known Qstat script, there are now alot versions available of# Qstat4eggdrop and all which I've seen are exploitable.## Exploit: redirect the output with the '&gt;' char to a file which can be# called whatever you want. It's possible to create and overwrite files.# Like Qstat4eggdrop's "!hl" command can be exploited with:#      !hl &gt;test : it will create the file "test" with the output from !hl## This is how it looks like in IRC:#   10:41 &lt;Me&gt; !hl localhost#   10:41 &lt;Bot&gt; Some server (localhost) 0/16 de_dust 10ms cstrike#   10:41 &lt;Me&gt; !hl &gt;server.qstat#   10:41 &lt;Me&gt; !hl localhost#   (no response)#   10:42 &lt;Me&gt; !hl localhost#   (still nothing offcourse)## The bot's config file got screwed up, cause of my 'corrupt' command.# Now that anyone is able to overwrite your config file, they also can# overwrite your documents, public html files or anything else.## The redirection in the other direction "&lt;" (read), seems to be safe, also# the pipe "|" character, but it always better to NOT allow these characters# to prevent possible errors/bugs or maybe exploits.## Solution: Use the string_check function below. This function checks the# whole string for false characters, the chars which will be# checked are:  &gt;  &lt;  |## The function returns a 1 when no false chars are found and a 0 when a false# character is found. Use the function like this:#   if {![string_check $text]} { return 0 }## Tip: Be very carefull when calling the TCL exec command and passing# arguments to it directly from IRC. Without checking the argument will# create a easily exploited security hole. I've found this multiple times# in my scripts. A good idea is to use the function below which checks if# the string contains bad characters.## The check could be better, suggestions are always welcome.## That's it!  (i am sorry for my poor english)#proc string_check {text} {  for {set i 0} {$i &lt; [string length $text]} {incr i} {     if {[string index $text $i] == "&gt;" || [string index $text $i] == "&lt;" ||         [string index $text $i] == "|"} { return 0 }  }  return 1}</code></pre></div>I hope this explains it all....<br>A non-exploitable version for the qstat script can be downloaded here: <a href="http://ai-bot.mine.nu/scripts/qstat.tar.gz" class="postlink">http://ai-bot.mine.nu/scripts/qstat.tar.gz</a><p>Statistics: Posted by Guest — Sun Aug 04, 2002 2:00 pm</p><hr />
]]></content>
	</entry>
	</feed>
