Archive

Archive for February, 2009

a way to control a remote host behind NAT (implementation)

17 February 2009 Ivo Leave a comment

yep, after the problem and  the theoretical solution, here is a couple of implementations.

prolunga is an user oriented solution. it is provided with a plain README file which will help you understand the concept and its implementation. with a pair of minor changes you will also be able to daemonize it. the readme file contains also ideas for further developments. I haven’t still tried to compile it on windows, but it works on gnu/linux

bidipipes is the minimal solution. a pragmatic readme is provided, and it won’t help you setting up the environment. in this case, the only help will be the image on the previous post. this software is fully tested on windows/cygwin.

Once compiled, both softwares will need as well nc(1). :-)

so far, here are the links towards the code:

§

Categories: Uncategorized

a way to control a remote host behind a NAT

11 February 2009 Ivo Leave a comment

requisites:
* the managing part can open a couple of ports on a public internet host
* the managed part can execute a process

under these circumstances, the managing part will be able to take the control of the managed part’s host.

How?
Using a little trick, based on nc (1) and pipe(2). Man is your friend, as usual.

In particular, you will have to execute two instances of nc, listening on two ports, reciprocally binded by a couple of pipes (bidirectional pipe, in the follow), on the public host of the managing part.
And you will have to execute two instances of nc, the first connecting to the port of the (managed) service you want to export, the second one connectiong to one of the ports you’ve created in the step before.
Doing so, you will have a socket binded to the managed part’s service, on a public host.

An image is worth all the words above

Continuing with the explication, you will find at least a problem: There’s no software which implements a bidirectional pipe. So I’ve made it. It’s pretty unuseful, except in this case. Then, I’ve added to it a pair of functionalities, and now it is available. :-)

How have I thought such a thing? Somewhen ago, somebody told me that Apple’s iChat offers you the opportunity to manage a remote host. So, I’ve told myself that I was able to implement the same mechanism to manage a parent’s computer.

Will it be available in pidgin, soon? ;-)