Linux.com

Home Linux Community Forums Hardware Networking remote ip with perl script tools

remote ip with perl script tools

Link to this post 27 Mar 11

Assalamualaikum war,wab.
hello brother..
last time i had coding new script perl
with this scropt we can remote computer with ip and port from Linux..
its usefull for me..
so chck these out


#!/usr/bin/perl -w
# connect and send commands to remote ip:port.
# the tor network is used for anonymity.
#
# usage: perl eript.pl <ip> <port>
#
# Rizky Ariestiyansyah
# greetz : Devilzc0de . Indonesiancoder . IndonesianHacker . Id-backtrack

use strict;
use Net::SOCKS;

my ($sock, $conn, $pid);

# setup tor connection (defaults are used)
$sock = new Net::SOCKS
(socks_addr => '127.0.0.1',
socks_port => 9050,
protocol_version => 4 ) || die "$!\n";

$conn = $sock->connect
(peer_addr => $ARGV[0],
peer_port => $ARGV[1]) || die "$!\n";

print "port $ARGV[1] is open\n";

$conn->autoflush(1);

$pid = fork();
if ($pid) {
while(<$conn>) {
print $_;
}
kill("TERM" => $pid)
} else {
print ">> ";
while(<STDIN>) {
print $conn "$_\n";
}
}
$conn->close();
$sock->close();

i hope this usefull for u,,
the tutor include in the script..

just run script with

perl source.pl

oke..

thanks

regards

Ph03nix
:woohoo: :P

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board