开发者

TOR Control Protocol from Perl

开发者 https://www.devze.com 2023-01-28 18:49 出处:网络
I am trying to basically make a signal newnym call via Tor control protocol bound to an internal port. Just for testing I am trying without any auth field at the moment.

I am trying to basically make a signal newnym call via Tor control protocol bound to an internal port. Just for testing I am trying without any auth field at the moment.

In telnet, if I just call AUTHENTICATE I get authenticated and can then proceed to signal calls.

In perl using both IO::So开发者_运维问答cket, and Socket send methods I end up with this error:

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

A sample call I am using in IO::Socket would look approximately like this:

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);


From

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

I would infer the need for

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

But you need to be certain what is in $torauth.

0

精彩评论

暂无评论...
验证码 换一张
取 消