<?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/5612" />

	<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>2003-09-17T20:28:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-17T20:28:55-04:00</updated>

		<published>2003-09-17T20:28:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27229#p27229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27229#p27229"/>
		<title type="html"><![CDATA[tcl syntax question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27229#p27229"><![CDATA[
well, i put a putlog in there and it is returning the args, so im now quite how to go about this...<p>Statistics: Posted by Guest — Wed Sep 17, 2003 8:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-09-17T20:04:51-04:00</updated>

		<published>2003-09-17T20:04:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27228#p27228</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27228#p27228"/>
		<title type="html"><![CDATA[tcl syntax question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27228#p27228"><![CDATA[
Why not instead figure out what chars are bad, like | and &amp;, and simply check for those?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Sep 17, 2003 8:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-17T17:56:35-04:00</updated>

		<published>2003-09-17T17:56:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27222#p27222</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27222#p27222"/>
		<title type="html"><![CDATA[tcl syntax question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27222#p27222"><![CDATA[
i rewrote it to this:<br><br>proc pub_fm {nick uhost hand chan text} {<br>  if {[regexp {[^a-zA-Z0-9\-\_\ ]} $text] == 1} {<br>    putserv "PRIVMSG $chan :Invalid request."<br>  } else {<br>    foreach cmd [split [exec /script.php $text] "\r\n"] { putserv "PRIVMSG $chan :$cmd" }<br>  }<br>}<br><br>and now it works... if i do this ".fm query", it returns data. if i try to add more than one query like ".fm query1 query2" i get an invalid request. would i need to add something else to the regex to get it to count spaces too?<p>Statistics: Posted by Guest — Wed Sep 17, 2003 5:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-17T16:33:36-04:00</updated>

		<published>2003-09-17T16:33:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27216#p27216</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27216#p27216"/>
		<title type="html"><![CDATA[tcl syntax question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27216#p27216"><![CDATA[
hmm, its still not working. heres what im dealing with:<br><br>bind pub - .fm pub_fm<br>bind pubm n "#* .exec *" pub_exec<br><br>proc pub_fm {nick uhost hand chan text} {<br>        if {[regexp {[^a-zA-Z0-9]} $text] == 1}<br>        {<br>                putserv "PRIVMSG $chan :Invalid request."<br>        } else<br>        {<br>                pub_exec $nick $uhost $hand $chan ".exec script.php $text"<br>        }<br>}<br><br>Before when I just had the pub_exec ... "script.php $text" it worked, but the problem was that if someone execute the command ".fm query | echo oops". but bot would execute the command "echo oops", which can be a real serious vulnerabiliry. So what im trying to do is catch anything that is not a letter or number so that I can not even have the script execute unless if is so.<br><br>Here's what i got when i tried to execute it:<br><br>&lt;jk0&gt; .rehash<br>&lt;wh0red&gt; Rehashed.<br>&lt;jk0&gt; .fm #$%<br>&lt;jk0&gt; .fm query<br><br>The bot didnt respond to the search or the invalid request. Any suggestions?<p>Statistics: Posted by Guest — Wed Sep 17, 2003 4:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-09-17T15:27:31-04:00</updated>

		<published>2003-09-17T15:27:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27210#p27210</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27210#p27210"/>
		<title type="html"><![CDATA[tcl syntax question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27210#p27210"><![CDATA[
Almost. Assuming that you want the if statement to catch requests that don't start with a letter or digit, you just have to change is to add { } around the regular expression. In tcl, [ ] is interpreted specially.<br><br>[^a-zA-Z0-9] --&gt; {[^a-zA-Z0-9]}<br><br>Also, the command is regexp, not regex.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Sep 17, 2003 3:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-17T14:26:25-04:00</updated>

		<published>2003-09-17T14:26:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27207#p27207</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27207#p27207"/>
		<title type="html"><![CDATA[tcl syntax question]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27207#p27207"><![CDATA[
I am trying to work around a vulnerability in php's argv's by doing this:<br><br>proc pub_fm {nick uhost hand chan text} {<br>        if {[regex [^a-zA-Z0-9] $text] == 1}<br>        {<br>                putserv "PRIVMSG $chan :Invalid request."<br>        } else<br>        {<br>                pub_exec $nick $uhost $hand $chan ".exec script.php $text"<br>        }<br>}<br><br><br>I cannot seem to get this to work. Am i doing this the right way? (I am new to TCL)<p>Statistics: Posted by Guest — Wed Sep 17, 2003 2:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
