Results 1 to 3 of 3
Hi,
I am trying to redirect connection to port 8980 to execute a telnet command to a local machine
by issuing the following command :
In Server 1 :
socat ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-15-2010 #1Just Joined!
- Join Date
- Apr 2010
- Posts
- 5
Socat and Binary data
Hi,
I am trying to redirect connection to port 8980 to execute a telnet command to a local machine
by issuing the following command :
In Server 1 :
socat TCP-LISTEN:8980,fork EXEC:/myscript,reuseaddr
myscript contains
#!/bin/bash
telnet 192.168.20.12 //local Server 2
I am sending Binary data from the client to Server 2 via Server 1.
so it happens that I have some characters in Hex translated to special characters in ASCII like open brackets or Commas etc.. and that closed the socket between the two machines.
Did anybody have this issue before ? if yes it there a workaround done to fix it ?
Any help is appreciated
- 04-15-2010 #2
Have you looked at IPTABLES and REDIRECT?
- 04-15-2010 #3Just Joined!
- Join Date
- Apr 2010
- Posts
- 5
Thanks Lazydog,
that was the first thing that I tried before, and rinetd as well ( I m using it for other purpose ) but in this case it would not work because the client is using GSM with AT command, when the client connects with telnet, the telnet server checks what type of terminal the client is using, so in this case my GSM doesn't have an embedded terminal emulator.
So I have to go through another box using socat where the telnet server thinks that the client is the machine that runs socat which is fine.
So my solution should be some workaround on socat source code to handle those special characters as data.
or something alternative to socat.
or replace special characters before it reaches the socat with something else and that requires more coding.


Reply With Quote
