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

	<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-03-08T16:11:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-08T16:11:37-04:00</updated>

		<published>2007-03-08T16:11:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71103#p71103</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71103#p71103"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71103#p71103"><![CDATA[
Thanks nml375!<br><br>All works. Sockets communicate 100% now. I just to do lots of testing now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Thu Mar 08, 2007 4:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-07T17:18:57-04:00</updated>

		<published>2007-03-07T17:18:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71075#p71075</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71075#p71075"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71075#p71075"><![CDATA[
Think I've found the error for this one...<br>Running with bgerror reveals that ::trojan::commands throws the following error:<blockquote class="uncited"><div>expected boolean value but got ""</div></blockquote>Which is caused by some conditional returning "" rather than true or false within a conditional (such as "if"). In this case, I'd suspect this line to be the cause:<div class="codebox"><p>Code: </p><pre><code> if {[set err [fconfigure $sock -error]]} {</code></pre></div>Reading the manpage for fconfigure and socket, reveals that "fconfigure &lt;socket&gt; -error" returns "" if there is no error condition present...<br><br>Fix should be trivial :p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Mar 07, 2007 5:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-07T15:24:21-04:00</updated>

		<published>2007-03-07T15:24:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71073#p71073</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71073#p71073"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71073#p71073"><![CDATA[
I would check for bgerror's, but at this moment my linux bot has gone down, annoying. Ill get tcl installed on this windows comp, and then hopefully tclsh will work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Mar 07, 2007 3:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-07T15:16:50-04:00</updated>

		<published>2007-03-07T15:16:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71072#p71072</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71072#p71072"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71072#p71072"><![CDATA[
Checked for bgerror's?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Mar 07, 2007 3:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-07T15:04:35-04:00</updated>

		<published>2007-03-07T15:04:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71070#p71070</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71070#p71070"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71070#p71070"><![CDATA[
Just one last thing. The sockets are fine, still alive and connected.<br><br>Sending data from the client to the hub is fine, and the hub bot detects it and works 100%, all the putlogs return etc.<br><br>But, when i send data back to the client from the hub bot, nothing happens in the partyline for the client bot.<br><br>Updated version of the client script:<br><div class="codebox"><p>Code: </p><pre><code>namespace eval trojan {        variable author "r0t3n"    variable version "1.00-LEAF"    variable script [lindex [split [info script] /] end]        if {![info exists trojan::socket]} {        variable socket    }        variable ip "208.110.72.126"    variable port "3465"    variable passwd "trojan"        if {![info exists trojan::socket] || ![string match -nocase sock* $trojan::socket]} {        if {[catch {set trojan::socket [socket ${ip} ${port}]} err]} {            if {[info exists trojan::socket]} {                unset trojan::socket            }            putlog "&lt;${script}&gt; Error connecting to trojan db:"            foreach x [split $err \n] {                putlog "$x"            }            putlog "&lt;${script}&gt; End of socket error."        } else {            putlog "&lt;${script}&gt; Connected to trojan db!"            fconfigure $trojan::socket -buffering line -blocking 0            fileevent $trojan::socket readable [list trojan::commands $trojan::socket]        }    } else {        putlog "&lt;${script}&gt; Already connected to trojan db!"    }        variable whois    array set whois {}        variable kickmsg {        "just another irc-trojan drone - :id:"        "irc-trojan drone detected! - :id:"        "its fun kicking you trojans - :id:"        "not another trojan...? - :id"        "you cant get past me you trojans - :id:"        "you have just benn drone-ized by me! - :id"        "just another parasite! - :id:"        "just another doctor fighting the infections - :id:"        "well someone has to fight you infections off!? - :id:"    }        variable trigger "\&amp;"    variable flags "nm|nm"        bind pub "$flags" "{$trigger}at" [namespace current]::control        bind join -|- {*} [namespace current]::onjoin        foreach raw "311 319 317 313 301 330 318" {        if {$raw == ""} { return }        bind raw -|- $raw [namespace current]::whois    }        bind nick -|- {*} [namespace current]::nickch        bind time -|- {?0 * * * *} [namespace current]::reload    }setudef flag trojansetudef flag trojan_cyclesetudef flag trojan_relaysetudef int trojan_kidproc trojan::control {nickname hostname handle channel text} {    global lastbind    set status [channel get $channel trojan]    set cycle [channel get $channel trojan_cycle]    set relay [channel get $channel trojan_relay]    set kid [channel get $channel trojan_kid]    if {$kid == ""} {        channel set $channel trojan_kid "0"        set kid "0"    }    switch -exact -- [set cmd [lindex [split $text] 0]] {        "trojan" {            switch -exact -- [lindex [split $text] 1] {                "on" - "enable" {                    if {$status} {                        putserv "NOTICE $nickname :Anti-Trojan already \002enabled\002."                    } else {                        channel set $channel +trojan                        if {$kid == ""} {                            channel set $channel trojan_kid "0"                        }                        putserv "NOTICE $nickname :Anti-Trojan now \002enabled\002."                    }                }                "off" - "disable" {                    if {!$status} {                        putserv "NOTICE $nickname :Anti-Trojan already \002disabled\002."                    } else {                        channel set $channel -trojan                        putserv "NOTICE $nickname :Anti-Trojan now \002disabled\002."                    }                }                "status" {                    if {$status} {                        putserv "NOTICE $nickname :Anti-Trojan is currently \002enabled\002. Current Kick-ID is \002$kid\002."                    } else {                        putserv "NOTICE $nickname :Anti-Trojan is currently \002disabled\002."                    }                }                "default" {                    putserv "NOTICE $nickname :$lastbind $cmd on|off|status."                }            }        }        "cycle" {            switch -exact -- [lindex [split $text] 1] {                "on" - "enable" {                    if {$cycle} {                        putserv "NOTICE $nickname :Anti-Trojan Cycle already \002enabled\002."                    } else {                        channel set $channel +trojan_cycle                        putserv "NOTICE $nickname :Anti-Trojan Cycle now \002enabled\002."                    }                }                "off" - "disable" {                    if {!$cycle} {                        putserv "NOTICE $nickname :Anti-Trojan Cycle already \002disabled\002."                    } else {                        channel set $channel -trojan_cycle                        putserv "NOTICE $nickname :Anti-Trojan Cycle now \002disabled\002."                    }                }                "status" {                    if {$cycle} {                        set cycle "enabled"                    } else {                        set cycle "disabled"                    }                    putserv "NOTICE $nickname :Anti-Trojan Cycle is currently \002$cycle\002."                }                "default" {                    putserv "NOTICE $nickname :$lastbind $cmd on|off|status."                }            }        }        "relay" {            switch -exact -- [lindex [split $text] 1] {                "on" - "enable" {                    if {$relay} {                        putserv "NOTICE $nickname :Anti-Trojan Relay already \002enabled\002."                    } else {                        channel set $channel +trojan_relay                        putserv "NOTICE $nickname :Anti-Trojan Relay now \002enabled\002."                    }                }                "off" - "disable" {                    if {!$relay} {                        putserv "NOTICE $nickname :Anti-Trojan Relay already \002disabled\002."                    } else {                        channel set $channel -trojan_relay                        putserv "NOTICE $nickname :Anti-Trojan Relay now \002disabled\002."                    }                }                "status" {                    if {$relay} {                        set relay "enabled"                    } else {                        set relay "disabled"                    }                    putserv "NOTICE $nickname :Anti-Trojan Relay is currently \002$relay\002."                }                "default" {                    putserv "NOTICE $nickame :$lastbind $cmd on|off|status."                }            }        }        "status" {            if {$status} {                set status "enabled"            } else {                set status "disabled"            }            if {$cycle} {                set cycle "enabled"            } else {                set cycle "disabled"            }            if {$relay} {                set relay "enabled"            } else {                set relay "disabled"            }            putserv "NOTICE $nickname :Anti-Trojan - (Trojan \002$status\002) - (Cycle \002$cycle\002) - (Relay \002$relay\002) - (Kick-ID: $kid)."        }        "list" {            putserv "NOTICE $nickname :To get a list of trojans detected on channel visit -&gt; http://208.110.72.122/~chris/trojan/index.php?page=list&amp;chan=$channel"        }        "version" {            putserv "NOTICE $nickname :&lt;$trojan::script&gt; Version: $trojan::version Author: $trojan::author."        }        "default" {            putserv "NOTICE $nickname :$lastbind trojan on/off/status|cycle on/off/status|relay on/off/status|status|list|version."        }    }}proc trojan::onjoin {nickname hostname handle channel} {    global botnick    if {![channel get $channel trojan]} { return }    if {![info exists trojan::socket] || $trojan::socket == ""} { return }    if {![string equal -nocase $botnick $nickname] &amp;&amp; ![matchattr $handle nmovfS|nmovfS $channel] &amp;&amp; ![regexp {[ikr]{1,3}} [lindex [split [getchanmode $channel]] 0]]} {        puts $trojan::socket "8c46d8d9d3402788403e2f6911153089 $nickname!$hostname $channel"    }}proc trojan::whois {from raw arg} {    set nickname [string tolower [lindex [split $arg] 1]]    if {![info exists trojan::whois($nickname)]} { return }    switch -exact -- $raw {        "311" {            set trojan::whois($nickname,hostname) "$nickname![string trim [lindex [split $arg] 2]]@[string trim [lindex [split $arg] 3]]"            set trojan::whois($nickname,realname) "[string trim [join [string range [string map { : \: } [lrange $arg 5 end]] 1 end]]]"        }        "319" {            set trojan::whois($nickname,channels) "[string trim [join [lrange $arg 2 end]]]"        }        "313" {            set trojan::whois($nickname,ircop) "1"        }        "301" {            set trojan::whois($nickname,away) "[string trim [join [string range [lrange $arg 2 end] 1 end]]]"        }        "330" {            set trojan::whois($nickname,auth) "[string trim [lindex [split $arg] 2]]"        }        "317" {            set trojan::whois($nickname,idle:sign) "[string trim [lindex [split $arg] 2]]:[string trim [lindex [split $arg] 3]]"        }        "318" {            foreach var "realname channels ircop away auth idle:sign" {                if {$var == ""} { return }                if {![info exists trojan::whois($nickname,$var)]} {                    set trojan::whois($nickname,$var) "0"                }            }            puts $trojan::socket "bd62feeea3e44690d648f976c63a874f $trojan::whois($nickname,hostname) $trojan::whois($nickname,realname):$trojan::whois($nickname,channels):$trojan::whois($nickname,ircop):$trojan::whois($nickname,away):$trojan::whois($nickname,auth):$trojan::whois($nickname,idle:sign)"            foreach var [array names trojan::whois $nickname*] {                unset trojan::whois($var)            }        }    }}proc trojan::portscan {host ports} {    set portlist ""    set hostmask ""    set ip ""    set nmap [exec nmap -sT -P0 -p [join $ports ,] $host]    foreach line [split $nmap \n] {        if {[regexp {Interesting ports on (.+) \(([^)]+)\)} $line]} {            set hostmask [lindex [split $line] 3]            set ip [string range [lindex [split $line] 4] 1 end-1]        } elseif {[regexp {[0-9]{1,3}/tcp open|filtered [a-z0-9]} $line]} {            lappend portlist [set p [lindex [split [lindex [split $line] 0] /] 0]]        }    }    if {$portlist == ""} {        set portlist "0"    }    foreach x [split $portlist \n] {        return "$x"    }}proc trojan::commands {sock} {    if {[set err [fconfigure $sock -error]]} {        set trojan::socket ""        close $sock        putlog "Trojan db connection ($sock) closed due to socket fconfigure error!"        foreach x [split $err \n] {            putlog "$x"        }        putlog "End of fconfigure error!"    } elseif {[eof $sock]} {        set trojan::socket ""        close $sock        putlog "Trojan db connection ($sock) closed due to eof error!"    } elseif {[catch {gets $sock arguments} status]} {         set trojan::socket ""        close $sock        putlog "Trojan db connection ($sock) closed due to catch error!"    } else {        set cmd [lindex [split $arguments] 0]        putlog "Command: $cmd (Arguments: [lrange $arguments 1 end])"        switch -exact -- $cmd {            "acad0ced00954d1b2c17bf30528acce6" {                set nickname [lindex [split $arguments] 1]                set trojan::whois($nickname) "1"                putquick "WHOIS $nickname $nickname"                putlog "Parsed whois for $nickname"            }            "e13ff1e898920d2c7ce191c4aad11319" {                set result [trojan::portscan [lindex [split $arguments] 1] [lrange $arguments 2 end]]                puts $sock "379f0209b3f2aa2adafe3f8b4f1727e4 $result [lindex [split $arguments] 1] $result"                putlog "Portscan results: [lindex [split $arguments] 1] $result"            }            "5cd8a3828ce36907a27551de5e71221e" {                set nickname [lindex [split $arguments] 1]                set banmask [lindex [split $arguments] 2]                set gid [lindex [split $arguments] 3]                set kmsg [lindex [split $trojan::kickmsg] [rand [llength $trojan::kickmsg]]]                putlog "Banning $nickname ($banmask) with global id ($id)"                foreach c [channels] {                    if {[channel get $c trojan]} {                        if {[onchan $nickname $c]} {                            channel set $c trojan_kid [set kid [expr {[channel get $c trojan_kid] + 1}]]                            putquick "MODE $c -o+b $nickname $banmask"                            putquick "KICK $c $nickname :$kmsg"                        }                    }                }            }            "default" {                putlog "&lt;$trojan::script&gt; Unknown command: $arguments"            }        }    }}putlog "&lt;$trojan::script&gt; Version: $trojan::version Author: $trojan::author"</code></pre></div>Thanks in advance! (again)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Mar 07, 2007 3:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-07T14:29:07-04:00</updated>

		<published>2007-03-07T14:29:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71067#p71067</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71067#p71067"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71067#p71067"><![CDATA[
Arh it finally works <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>[18:26:12] &lt;C15|r0t3n&gt; .tcl puts $trojan::socket abcd[18:26:13] &lt;Wars`Relay01&gt; [13:18] tcl: builtin dcc call: *dcc:tcl r0t3n 14 puts $trojan::socket abcd[18:26:13] &lt;Wars`Relay01&gt; [13:18] tcl: evaluate (.tcl): puts $trojan::socket abcd[18:26:13] &lt;Wars`Relay01&gt; Tcl: </code></pre></div><div class="codebox"><p>Code: </p><pre><code>[18:25:46] &lt;Wars&gt; [13:17] &lt;trojan-hub.tcl&gt; Connection from 208.110.72.126:54596 (sock20)[18:25:59] &lt;Wars&gt; [13:18] Command: x (Arguments: )[18:25:59] &lt;Wars&gt; [13:18] &lt;trojan-hub.tcl&gt; Unknown command: x (Arguments: )[18:26:13] &lt;Wars&gt; [13:18] Command: abcd (Arguments: )[18:26:13] &lt;Wars&gt; [13:18] &lt;trojan-hub.tcl&gt; Unknown command: abcd (Arguments: )</code></pre></div>Thanks to both of you, nml375 and rosc2112, also User for that info on gets <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Time for some intensive testing, and then i can finally release it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Thanks again <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Mar 07, 2007 2:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-07T14:15:48-04:00</updated>

		<published>2007-03-07T14:15:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71066#p71066</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71066#p71066"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71066#p71066"><![CDATA[
Yes, i have a switch will all the commands in. It could be that stupid elseif ill give it a try <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Mar 07, 2007 2:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-07T13:15:52-04:00</updated>

		<published>2007-03-07T13:15:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71064#p71064</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71064#p71064"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71064#p71064"><![CDATA[
Any errors reported using the bgerror mechanism?<br><br><em class="text-italics">Edit:</em><br>Unless you've changed this, it will also generate an error, which also will be reported using the bgerror-mechanism:<div class="codebox"><p>Code: </p><pre><code>...    } elseif {        # commands etc go here in a switch   }</code></pre></div>Think you're thinking of actually using else here, otherwize, you'll have to add a conditional...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Mar 07, 2007 1:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-07T07:17:23-04:00</updated>

		<published>2007-03-07T07:17:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71063#p71063</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71063#p71063"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71063#p71063"><![CDATA[
Added the array, and the socket works <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>(11:11:14) &lt;C15|r0t3n&gt; .tcl fconfigure sock19 -peername(11:11:14) &lt;Wars&gt; [06:03] tcl: builtin dcc call: *dcc:tcl r0t3n 17 fconfigure sock19 -peername(11:11:15) &lt;Wars&gt; [06:03] tcl: evaluate (.tcl): fconfigure sock19 -peername(11:11:15) &lt;Wars&gt; Tcl: 208.110.72.126 208.110.72.126 58299</code></pre></div><div class="codebox"><p>Code: </p><pre><code>(11:11:18) &lt;C15|r0t3n&gt; .tcl fconfigure $trojan::socket -peername(11:11:18) &lt;Wars`Relay01&gt; [06:03] tcl: builtin dcc call: *dcc:tcl r0t3n 14 fconfigure $trojan::socket -peername(11:11:19) &lt;Wars`Relay01&gt; [06:03] tcl: evaluate (.tcl): fconfigure $trojan::socket -peername(11:11:19) &lt;Wars`Relay01&gt; Tcl: 208.110.72.126 208.110.72.126 3465</code></pre></div>Its just when i type:<br><div class="codebox"><p>Code: </p><pre><code>(11:12:31) &lt;C15|r0t3n&gt; .tcl puts $trojan::socket abcd(11:12:31) &lt;Wars`Relay01&gt; [06:04] tcl: builtin dcc call: *dcc:tcl r0t3n 14 puts $trojan::socket abcd(11:12:31) &lt;Wars`Relay01&gt; [06:04] tcl: evaluate (.tcl): puts $trojan::socket abcd(11:12:31) &lt;Wars`Relay01&gt; Tcl: </code></pre></div>I dont get anything on the partyline at the hub bot...<br><div class="codebox"><p>Code: </p><pre><code>putlog "Command: $cmd (Arguments: [lrange $arguments 1 end])"</code></pre></div><div class="codebox"><p>Code: </p><pre><code>"default" {                putlog "&lt;$trojanhub::script&gt; Unknown command: $cmd (Arguments: [lrange $arguments 1 end])"            }</code></pre></div>I dont get the Command: blah (blah) nor do i get the unknown command putlog aswell.<br><br>Thanks nml375 for finding that namespace error using bgerror <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Thanks in advance!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Mar 07, 2007 7:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-07T07:05:35-04:00</updated>

		<published>2007-03-07T07:05:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71062#p71062</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71062#p71062"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71062#p71062"><![CDATA[
Possibly because i didnt set the variable + array within the namespace. Ill add it quickly and give it a test.[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Mar 07, 2007 7:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-06T15:07:58-04:00</updated>

		<published>2007-03-06T15:07:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71043#p71043</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71043#p71043"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71043#p71043"><![CDATA[
Actually, loaded the script in a simple tclsh debbuging environment (with bgerror enabled), which resulted in this while handling the connection:<blockquote class="uncited"><div>% source test.tcl<br>&lt;bleh&gt; Server socket opened on port {2000}.<br>&lt;bleh&gt; Connection password set to: trojan.<br>% update<br>&lt;bleh&gt; Connection from 127.0.0.1:58939 (sock4)<br>bgError: can't set "trojanhub::addr(sock4)": parent namespace doesn't exist</div></blockquote>After which the connection was terminated. This explains why your sock20 seems to just disappear. However, for some reason, the client never gets notified that the connection was dropped. Update your connection-handler to use absolute namespace-adressing (preceed any namespace-path with "::")<br><br>I'd suggest you start using bgerror reporting while developing this script, as tcl's event-mechanism does not use, or even know of, eggdrop's logging facilities, and as eggdrop forks, stderr is not available.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Mar 06, 2007 3:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-06T14:42:47-04:00</updated>

		<published>2007-03-06T14:42:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71042#p71042</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71042#p71042"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71042#p71042"><![CDATA[
The person who installed tcl on my server is an experienced unix administrater, working in a datacentre in the US. I could go and reinstall it, possibly using apt-get, but the other 17 bots running on the machine seem to be working fine, but there again they dont use any sockets.<br><div class="codebox"><p>Code: </p><pre><code>[18:33:38] &lt;@C15|r0t3n&gt; Wars set ::s [socket -server socket:conn -myaddr 208.110.72.122 1364][18:33:39] -Wars- » TCL: No Complications: sock17 - 18.429 ms «[18:35:03] &lt;@C15|r0t3n&gt; Wars proc socket:conn {sock addr port} { putquick "PRIVMSG #Wars.admin :Connection from ${addr}:${port} on sock $sock." ; puts $sock "abcd" ; close $sock ; putquick "PRIVMSG #Wars.admin :Sent data to $sock, closed $sock." }[18:35:04] -Wars- » TCL: No Complications - 0.057 ms «[18:35:38] &lt;@C15|r0t3n&gt; Wars`Relay01 set ::socket [socket 208.110.72.122 1364][18:35:39] -Wars`Relay01- » TCL: No Complications: sock13 - 28.004 ms «[18:35:40] &lt;@Wars&gt; Connection from 208.110.72.122:59015 on sock sock18.[18:35:40] &lt;@Wars&gt; Sent data to sock18, closed sock18.[18:35:47] &lt;@C15|r0t3n&gt; Wars`Relay01 gets $::socket ::line ; return "$::line"[18:34:48] -Wars`Relay01- » TCL: Return: abcd - 0.139 ms «</code></pre></div>A little test i did, seems to work fine....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Mar 06, 2007 2:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-06T13:42:23-04:00</updated>

		<published>2007-03-06T13:42:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71040#p71040</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71040#p71040"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71040#p71040"><![CDATA[
True that the last fix is not related to the "no such socket" issue, guess we should've made a note on that, still issues needed to be fixed aswell.<br>I am abit puzzled that client thinks the socket is connected, while the server apparently thinks not. It does accept the connection and assigns it a socket-identifier (sock20), so SYN/ACK negotiation seems to work without any problems.<br>Also, I cannot see any code that would cause the server-side connection to drop without generating a log-message, and apparently, the fconfigure and fileevents don't seem to complain 'bout "can not find channel named sock20" in your "connect-handler".<br>I'm beginning to suspect this issue is not within your script, but with tcl on that system.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue Mar 06, 2007 1:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2007-03-06T09:01:48-04:00</updated>

		<published>2007-03-06T09:01:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71037#p71037</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71037#p71037"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71037#p71037"><![CDATA[
I tried both rosc2112's and nml375's fixes, but still the hub still says no such socket sock20 (It's always sock20) and the client still thinks its connected (fconfigure -error returns nothing, -peername and -sockname works).<br><div class="codebox"><p>Code: </p><pre><code>[12:51:15] &lt;C15|r0t3n&gt; .tcl fconfigure $trojan::socket -peername[12:51:15] &lt;Wars`Relay01&gt; [07:43] tcl: builtin dcc call: *dcc:tcl r0t3n 14 fconfigure $trojan::socket -peername[12:51:16] &lt;Wars`Relay01&gt; [07:43] tcl: evaluate (.tcl): fconfigure $trojan::socket -peername[12:51:16] &lt;Wars`Relay01&gt; Tcl: 208.110.72.126 208.110.72.126 3465[12:51:19] &lt;C15|r0t3n&gt; .tcl fconfigure $trojan::socket -sockname[12:51:19] &lt;Wars`Relay01&gt; [07:43] tcl: builtin dcc call: *dcc:tcl r0t3n 14 fconfigure $trojan::socket -sockname[12:51:19] &lt;Wars`Relay01&gt; [07:43] tcl: evaluate (.tcl): fconfigure $trojan::socket -sockname[12:51:19] &lt;Wars`Relay01&gt; Tcl: 208.110.72.126 208.110.72.126 39590</code></pre></div>I changed the ip address, and added the -myaddr &lt;ip.here&gt; argument to the  socket -server, and it works, and the hub still gets the connection from the client. I just dont know why the client thinks its still connected when the hub says the socket dont exist...<br><div class="codebox"><p>Code: </p><pre><code>[12:56:43] &lt;Wars`Relay01&gt; [07:49] tcl: evaluate (.tcl): puts $trojan::socket blahblah[12:56:43] &lt;Wars`Relay01&gt; Tcl: </code></pre></div>Nothing returned, i get nothing at the hub bot, i should expect the 'Unknown command :blah" from the putlog at the switch in the commands proc, but nothing. <br><br>I might just give up on the sockets idea, and make it through a botnet, but i want this system to be like aspb, with the hub as the database. I dont want to have people asking me to add their bot(s) as a bot on the hub bot...<br><br>Thanks in advance!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Mar 06, 2007 9:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-05T16:22:59-04:00</updated>

		<published>2007-03-05T16:22:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71024#p71024</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71024#p71024"/>
		<title type="html"><![CDATA[Socket error?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71024#p71024"><![CDATA[
Actually, I'd suggest something like this:<div class="codebox"><p>Code: </p><pre><code>    } elseif {[catch {gets $sock arguments} status]} {        set trojan::socket ""        close $sock        putlog "Trojan db connection ($sock) closed due to catch error!"    } else {#arguments holds whatever we read from the socket,#status holds the number of characters read, since we did'nt encounter an error condition while reading        set cmd [lindex [split $arguments] 0]        switch -exact -- $cmd {            "acad0ced00954d1b2c17bf30528acce6" {...</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Mar 05, 2007 4:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
