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

	<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>2007-09-03T02:37:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2007-09-03T02:37:00-04:00</updated>

		<published>2007-09-03T02:37:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75646#p75646</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75646#p75646"/>
		<title type="html"><![CDATA[need help with script security]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75646#p75646"><![CDATA[
Replace the following lines <div class="codebox"><p>Code: </p><pre><code>foreach i $text {if {([string match "*http://*" $i]) || ([string match "*ftp://*" $i])|| ([string match "*www.*" $i]) || ([string match "*ftp.*" $i])} {set fd [open $urllogfile a+]if {[string match "*www.*" $i] &amp;&amp; ![string match "*http://*" $i]} {set i "http://$i"}if {[string match "*ftp.*" $i] &amp;&amp; ![string match "*ftp://*" $i]} {set i "ftp://$i"}</code></pre></div> to match <div class="codebox"><p>Code: </p><pre><code>foreach i $text { if {[string match "*http://*" $i] &amp;&amp; ![string match "*http://*&lt;*&gt;*" $i] || [string match "*ftp://*" $i] &amp;&amp; ![string match "*ftp://*&lt;*&gt;*" $i] || [string match "*www.*" $i] &amp;&amp; ![string match "*www.*&lt;*&gt;*" $i] || [string match "*ftp.*" $i] &amp;&amp; ![string match "*ftp.*&lt;*&gt;*" $i]} {  set fd [open $urllogfile a+]   if {[string match "*www.*" $i] &amp;&amp; ![string match "*http://*" $i]} {    set i "http://$i"   }    if {[string match "*ftp.*" $i] &amp;&amp; ![string match "*ftp://*" $i]} {     set i "ftp://$i"    }</code></pre></div> should work. (its just a case of checking that the &lt;tags&gt; are in the url address). <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_idea.gif" width="15" height="15" alt=":idea:" title="Idea"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Mon Sep 03, 2007 2:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iNFERNiS]]></name></author>
		<updated>2007-08-21T11:32:48-04:00</updated>

		<published>2007-08-21T11:32:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75431#p75431</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75431#p75431"/>
		<title type="html"><![CDATA[need help with script security]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75431#p75431"><![CDATA[
I needed a script that catches urls from a chan and outputs it to a html file.<br><br>I found this script:<br><blockquote class="uncited"><div>## This script catches urls said on channels and set on topics <br>## and makes a webfile of them.<br>## 21.7.1997 by Goblet  email: <a href="mailto:goblet@sci.fi">goblet@sci.fi</a><br> <br>set urllogfile "urls.log"<br>set urlwebfile "/wwwhome/goblet/public_html/blerp/urllog.html"<br><br>bind pubm - * check_if_url<br>bind topc - * check_if_url<br><br>proc check_if_url {nick uhost hand chan text} {<br>global urllogfile urlwebfile botnick<br>   foreach i $text {<br>      if {([string match "*http://*" $i]) || ([string match "*ftp://*" $i]) <br>         || ([string match "*<a href="www" class="postlink">www</a>.*" $i]) || ([string match "*ftp.*" $i])} {<br>        set fd [open $urllogfile a+]<br>        if {[string match "*<a href="www" class="postlink">www</a>.*" $i] &amp;&amp; ![string match "*http://*" $i]} {<br>            set i "http://$i"<br>           }<br>        if {[string match "*ftp.*" $i] &amp;&amp; ![string match "*ftp://*" $i]} {<br>            set i "ftp://$i"<br>           }<br>        puts $fd "&lt;a href=\"$i\"&gt;$i&lt;/a&gt;&lt;br&gt;"<br>        puts $fd "[ctime [unixtime]] $nick ($uhost)&lt;br&gt;&lt;hr&gt;"<br>        close $fd<br>        putlog "URL detected ($nick)"<br>        set fd [open $urlwebfile w]<br>        set fd2 [open $urllogfile r]<br>        puts $fd "&lt;html&gt;&lt;head&gt;&lt;title&gt;Catched URLs&lt;/title&gt;&lt;/head&gt;"<br>        puts $fd "&lt;body bgcolor=#FFFFFF text=#000000&gt;"<br>        puts $fd "&lt;center&gt;&lt;font size=6&gt;URLs catched by $botnick&lt;/center&gt;&lt;hr&gt;"<br>        puts $fd "&lt;font size=3&gt;"<br>        while {![eof $fd2]} {<br>           gets $fd2 foo<br>           puts $fd $foo<br>        }        <br>        puts $fd "&lt;center&gt;&lt;address&gt;© &lt;a href=\"<a href="http://www.sci.fi/~goblet/" class="postlink">http://www.sci.fi/~goblet/</a>\"&gt;"<br>        puts $fd "Goblet&lt;/a&gt; 1997&lt;/address&gt;&lt;/center&gt;"<br>        puts $fd "&lt;/body&gt;&lt;/html&gt;"<br>        close $fd<br>        close $fd2<br>      }<br>   }<br>}<br>putlog "URL-catcher by Goblet"</div></blockquote>The problem is, ppl can inject html/java code into it, i'd like to avoid that. I don't know tcl, wish I did. <br><br>This is an example of how you can mess the generated html page up.<br><br>http://www.&lt;textarea&gt;.com<br>I think it speaks for itself what happens when it catches that url <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Any help to fix this flaw is appreciated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9246">iNFERNiS</a> — Tue Aug 21, 2007 11:32 am</p><hr />
]]></content>
	</entry>
	</feed>
