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

	<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-25T12:06:23-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-25T12:06:23-04:00</updated>

		<published>2003-09-25T12:06:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27568#p27568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27568#p27568"/>
		<title type="html"><![CDATA[Security regarding the exec command. (Need some guidance).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27568#p27568"><![CDATA[
hehe, not that easy heh..<br><br>Ok, now I at least know its a security hazard.. <br><br>Thnx<br><br>Draugen<p>Statistics: Posted by Guest — Thu Sep 25, 2003 12:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-09-25T06:46:57-04:00</updated>

		<published>2003-09-25T06:46:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27548#p27548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27548#p27548"/>
		<title type="html"><![CDATA[Security regarding the exec command. (Need some guidance).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27548#p27548"><![CDATA[
No, that is incorrect.<br><br>Split converts a string into a Tcl list.<br><br>However, there are ocasions where strings can contain harmful Tcl commands. These will only ever cause hastle when you use them in eval, expr or callback functions like after, filevent, eggdrop timers or the dns query callback in eggdrop.<br><br>Using exec with user input is a little more worrying. While you can split the elements in a script to contain a list, it isn;t Tcl dealing with the parsing of the command being sent to exec.<br><br>Caracters such as | can be interpreted and causing security issues.<br><br>Your best bet is to look at other scripts that deal with exec functions like domain whois scripts, ping script or others. These will give you a good idea of what can be done to combat this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Sep 25, 2003 6:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-24T20:46:11-04:00</updated>

		<published>2003-09-24T20:46:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27541#p27541</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27541#p27541"/>
		<title type="html"><![CDATA[Security regarding the exec command. (Need some guidance).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27541#p27541"><![CDATA[
Thanks I will try that.<br>I did read the the split man page, but I was unable to figure out why this is a more secure way to do it. <br><br>It converts the string into a table, and while printing out the content from a table it does not run any cmd that might be in it?<p>Statistics: Posted by Guest — Wed Sep 24, 2003 8:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2003-09-24T15:31:25-04:00</updated>

		<published>2003-09-24T15:31:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27530#p27530</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27530#p27530"/>
		<title type="html"><![CDATA[Security regarding the exec command. (Need some guidance).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27530#p27530"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if { [ catch { exec echo $arg | /usr/bin/mail -s "Eggdrop Paged by: $nick" me@myplace.com } fid ] } {</code></pre></div>should be<div class="codebox"><p>Code: </p><pre><code>if { [ catch { exec echo [split $arg] | /usr/bin/mail -s "Eggdrop Paged by: [split $nick]" me@myplace.com } fid ] } { </code></pre></div>then it should be okay, I guess.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Sep 24, 2003 3:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-09-24T13:26:28-04:00</updated>

		<published>2003-09-24T13:26:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=27523#p27523</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=27523#p27523"/>
		<title type="html"><![CDATA[Security regarding the exec command. (Need some guidance).]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=27523#p27523"><![CDATA[
Im trying to make a *.tcl that will send me an email if someone sends a /ctcp page "Some text" to the bot. (As you can see this is the first time I have tried to do something using the TCL)<br><div class="codebox"><p>Code: </p><pre><code>bind ctcp n page ctcp:pageproc ctcp:page { nick host handle dest key arg } {        if { [ catch { exec echo $arg | /usr/bin/mail -s "Eggdrop Paged by: $nick" me@myplace.com } fid ] } {                 putserv "NOTICE $nick :\001Page failed: $fid"        } else {                 putserv "NOTICE $nick :\001Page Page success!!"        }         return 0}</code></pre></div>This does the job, but I belive the variables in the exec command might be a security hazard? If that is, I would really would be happy if someone knows a clever way of cleaning the variable for any hamfull content, or if there are any website that deals with such issues I'd be happy to have their url's. ( I have done some searching on my own, but I have not found the right info )<br><br>BTW, Im aware that someone might send me 1000 emails as I dont have system stops that, but that seems like a minor problem that I can deal with on my own.<br><br>Thats all<br><br>Draugen.<p>Statistics: Posted by Guest — Wed Sep 24, 2003 1:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
