I'm trying to use some host I own as a bridge to a lan. But this host is behind the router of the lan.
For example, If I'd like to connect to 192.168.0.1 on port 22 on that lan... How could I do it? I tried the reverse connection on stcppipe, but I'm not sure on how to do it.
Joined: 13 Aug 2007 21:44 Posts: 4068 Location: http://aluigi.org
uhmmm, for a connection between only 2 endpoints (so without an external server which handles the connection like a proxy or which creates a direct UDP connection (example Gamespy natneg)) you need that at least one of them can accept direct connections.
so if this host can't be reached directly but your pc can be contacted by that host (host->you) you can do the following:
on the other host run: > stcppipe -r 127.0.0.1:22 YOUR_IP 69 0
on your pc run: > stcppipe 0 22 69
where YOUR_IP is obviously the IP address of your pc and 69 is a port at your choice of your pc where you can receive connections, I tell you in case you have a router and so must open a port.
after you do this the only thing you must do is waiting the connection from that host (appears a message in your stcppipe) and then just connecting ssh to yourself (127.0.0.1).
obviously it's not the "state of the art" but works. note that the stcppipe on the remote host will continue to connect to your IP forever because it's made for giving to the other endpoint (you) all the time to bind the port so keep this in mind.
Joined: 13 Aug 2007 21:44 Posts: 4068 Location: http://aluigi.org
in this case you need a vpn software without doubts using your machine as vpn server and one of the hosts there as client with the ability of forwarding the packets to the other hosts too (so the others pc there can use that machine as router to reach your network). don't ask me how to do it in practice because I have never set up a similar thing :)
Dear, I tried to use this program, it works. I have one problem. I would like to use the -s to change sting in the data. But the length of the 2 strings differ. The program overwrites the data after the original string because the new string is longer. You used memcpy but probably the memmove would be better. Regards, Imre
Joined: 13 Aug 2007 21:44 Posts: 4068 Location: http://aluigi.org
memmove would be necessary for copying data between 2 points of the same string and even in that case I would never suggest to use it due to some bad experiences I had in the past, better to use a classical byte-per-byte manual copying.
while for the rest you can't do that thing with stcppipe because I added that option only for some simple tests so the data will not be expanded/shinked if the second string is larger/smaller, it simply replaces it overwriting data after if if it's longer.
indeed it's technically not possible to do a similar substituition without knowing and parsing the protocol correctly (tons of techcnical reasons, while on udp it's ok)
Hello, Still no success! We tried BorlandC, c++, gcc... . . . stcppipe.c:990: error: invalid conversion from `char*' to `u8*' stcppipe.c:993: error: invalid conversion from `u8*' to `const char*' stcppipe.c:993: error: initializing argument 1 of `int atoi(const char*)' stcppipe.c:997: error: invalid conversion from `u8*' to `char*' stcppipe.c:997: error: initializing argument 1 of `in_addr_t resolv(char*)' stcppipe.c: In function `in_addr_t* create_ip_array(u8*)': stcppipe.c:1017: error: invalid conversion from `u8*' to `const char*' stcppipe.c:1017: error: initializing argument 1 of `char* strchr(const char*, int)' stcppipe.c:1017: error: invalid conversion from `char*' to `u8*' stcppipe.c:1019: error: invalid conversion from `void*' to `in_addr_t*' stcppipe.c:1023: error: invalid conversion from `u8*' to `const char*' stcppipe.c:1023: error: initializing argument 1 of `char* strchr(const char*, int)' stcppipe.c:1023: error: invalid conversion from `char*' to `u8*' stcppipe.c:1026: error: invalid conversion from `u8*' to `char*' stcppipe.c:1026: error: initializing argument 1 of `in_addr_t resolv(char*)' stcppipe.c: In function `in_addr_t* get_ifaces()': stcppipe.c:1077: error: invalid conversion from `u8*' to `char*' stcppipe.c:1087: error: invalid conversion from `void*' to `in_addr_t*'
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum