2010-12-01 34 views
1

我试图基本上通过Tor control protocol呼叫signal newnym呼叫绑定到一个内部端口。为了测试,我现在尝试没有任何授权字段。来自Perl的TOR控制协议

在telnet中,如果我只是拨打AUTHENTICATE,我会得到身份验证,然后可以继续进行信号调用。

在Perl中使用IO::SocketSocketsend方法,我结束了这个错误:

551 Invalid quoted string. You need to put the password in double quotes.

我正在使用IO ::插座示例调用看起来大约是这样的:

print "SIG-TOR:Connecting..."; 

my $TORSOCK = new IO::Socket::INET(
    PeerAddr => $torcont, 
    PeerPort => $torconp, 
    Proto => 'tcp' 
); 
$TORSOCK or die "no socket :$!"; 

print "OK!\n"; 

print "SIG-TOR:authenticating..."; 

print $TORSOCK $torauth; 

while (<$TORSOCK>) { 
    print $_; 
} 

print "OK!\n"; 
sleep(1); 
+0

`$ torauth`的值是多少? – DVK 2010-12-01 02:27:40

回答

1

551 Invalid quoted string. You need to put the password in double quotes.

我推断

print $TORSOCK '"', $torauth, '"'; 

的需要,但你必须某些什么是在$ torauth。