Questions tagged [socat]

The program socat is a relay for bidirectional data transfer between two independent data channels.

Filter by
Sorted by
Tagged with
0
votes
1answer
37 views

socat - multiple connection attempts fail to pass through serial

I'm using socat to route serial input over a network to allow me to control an Arduino device over a virtual COM port setup. My command to start socat is: socat /dev/serial0,b500000,raw,echo=0 TCP-...
0
votes
1answer
34 views

Sed with port forwarding in socat?

Not sure if this belongs on here, StackOverflow, or SuperUser. I have a device running a reverse telnet server that I need to be able to send/receive data to. I'm able to play with it if I run socat ...
1
vote
1answer
69 views

How to resume a file transfer using netcat or socat or curl?

I have to transfer a 400Gb database consisting of a single file over the Internet from a server where I have full control to an other computer at the opposite border of the ocean (but which uses a ...
0
votes
1answer
31 views

How to only run a command in .bash_profile if its not already running?

Goal: Run socat only once. I'm trying to expose docker web services via TCP. On macOS/linux these services are bound to a unix socket. The following command accomplishes the task: socat -d TCP-...
0
votes
0answers
53 views

How to get a Serial Connection through a Reverse SSH Tunnel

I have a project where I have a Serial port on one computer and not on the other. I need to provide a virtual serial port that is connected to TCP on the computer without a physical serial port. I ...
0
votes
0answers
159 views

Socat is echoing back the user input

I am remotely connecting to a serial COM port via socket created by socat. The idea is to manage multiple devices mapped as PORT:SERIAL_TTY. Everything works fine except it echoes back my commands ...
0
votes
0answers
34 views

How to access service which is listening on the private IP range within Vagrant from the host?

I have a Vagrant VM which is running Ubuntu 18.04/Bionic. In this VM, there is a DNS server (systemd resolve in this case) running. This can be seen here: vagrant@ubuntu-bionic:~$ netstat -peanut | ...
2
votes
1answer
57 views

How to make netcat to simulate a null-modem cable

I am trying to make two VICE emulators on different machines to communicate. They are both able to write and receive characters on a specific port of the local host, but they cannot communicate as ...
1
vote
2answers
266 views

How to create a socket forwarder as a server?

I'm looking for a tool that starts a socket server, and forwards incoming requests on that socket port to another internal one. I found socat is able to forward socket ports in general: socat tcp-l:...
0
votes
1answer
137 views

How can a client talk to another client using unix domain sockets?

Using bash we might have something like this with netcat: nc -lk -U /my/fifo | while read line; do # line => {"client_id":123} done; clients send data like this: echo '{"client_id":123,"data":...
0
votes
1answer
102 views

Using socat, how to send to and receive from a public DNS server?

In a file called "query.bin" we have stored the data that is transmitted to a public DNS server by the following command. dig +notcp hello.com @8.8.8.8 How can query.bin now be sent to 8.8.8.8 again ...
1
vote
2answers
155 views

TCP listener that drops all of its input?

I'm trying to implement a TCP listener that accepts connections and then simply drops all of its input (it's for a test harness). Right now, I'm using socat - tcp-listen:2003,fork,reuseaddr, but that ...
1
vote
0answers
243 views

Using socat to access deluge daemon in a different namespace

I'm using namespaced-openvpn to ensure that my torrent traffic in deluge is always behind a VPN. A modified script from this blog post helped to connect the VPN namespace to the real network: ip ...
1
vote
1answer
361 views

Sending data to Unix socket failing unless proxied with socat via UDP

I'm trying to debug why data isn't being sent over a Unix Domain Socket. I have 2 applications which should be communicating over a UDS but aren't. To test I've done the following: Using socat, I ...
-1
votes
3answers
665 views

How to send literal string over TCP (netcat/socat-like), but provided by command arguments?

If I want to send a string over TCP in a shell environment, I can do something like: echo text | nc 1.2.3.4 9876 Cool. Interactively, that works. Now I want to do this programmatically by spawning a ...
0
votes
1answer
392 views

Socat. Bridge TCP - SERIAL PORT. With log

I'm trying to create a bridge between TCP server and a client connected thorough a serial port using socat. I emulate my TCP server with the following command socat tcp-listen:8888,reuseaddr - I ...
0
votes
0answers
697 views

socat - UNIX-LISTEN and TCP-LISTEN in one command

Is it possible, to open a tcp port and a socket with one process/command? socat UNIX-LISTEN:/var/run/mysqld/mysqld.sock,fork,user=mysql,group=mysql,mode=777 TCP:123.123.123.1:3306 combined with: ...
0
votes
0answers
478 views

How do I specify a socks5 proxy with go get using socat

On a centos machine I want to do go get git.address.org/123 through a socks5 proxy. I thought maybe using socat to make the socks5 proxy into an http and then specifying it in the command like : ...
0
votes
0answers
556 views

socat windows virtual serial port

is there any example command line options for socat windows virtual serial port redirection ? i installed com0com virtual serial port driver which is assigned CNCB10 to COM10 port as well and running ...
0
votes
1answer
335 views

create pty and connect it to a serial port /dev/ttyUSB0

Problem: I have two Linux machines connected with a serial interface. I use ppp to communicate between them (I have to since it is a project requirement). Communication speed is at 9600 bits/s. I ...
0
votes
1answer
279 views

Using socat to make a secure tcp connection to an irc server

Recently, I got into irc, so I installed sic and started - obviously - chatting. But, it turns out that sic doesn't provide any security features like SSL or TCP so I in man sic, they told to use ...
0
votes
0answers
128 views

How to sniff a socket without using socat?

I would like to do socket sniffing, but I'm wondering what options there to do without using socat? I can't use that command, since it's not already installed (and I cannot install it). I thought ...
2
votes
1answer
873 views

Virtual serial port between docker containers

I can create two linked virtual serial ports on a Linux system with socat, and pretend one end is a serial device, and the other one is some code that uses the device. The socat command would look ...
2
votes
0answers
461 views

socat parent process killed by failed connection

Short Question Failed connection attemps to a forking socat process seem to be killing the parent process. Is this a bug? What's the best solution to this? Long Question I'm running a socat server (...
0
votes
0answers
96 views

How to make HTTP proxy to the VPN Tunnel?

I have a VPN tunnel running, where test.google.com = VPN HTTP server with IP 10.0.0.3. So I have /etc/hosts with DNS mapping test.google.com = 10.0.0.3 when I ping test.google.com it works. Now ...
1
vote
1answer
1k views

Error using openssl with socat - SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small

Short Version of Question Assuming the existence of the relevant files, why does the following sequence of commands not work? socat tcp-listen:10001,fork exec:'/bin/cat' & socat openssl-listen:...
7
votes
2answers
628 views

How can I add message delimiters to a UDP stream socat is piping?

I am using socat to intercept UDP messages and send them to a named pipe: socat UDP-LISTEN:9999,fork PIPE:/tmp/mypipe,append I am able to tail this pipe and see all the messages it receives. I ...
2
votes
2answers
821 views

socat route tcp6 traffic to tcp4

I'm using socat to route incoming tcp6 to tcp4. The destination (tcp4) is a pod/container with the pod service external-ip. Within the container I use ncat to listen for the port 5555. # socat TCP6-...
5
votes
1answer
462 views

How can I sniff unix dgram socket without having file path?

From that article, I realized that: a UNIX domain socket is bound to a file path. So, I need to sniff DGRAM Unix socket through the socat as mentioned here. But when I try to retrieve the path for ...
1
vote
0answers
282 views

bridge between UDP and serial doesn't work

I've created a bridge between UDP and serial port using socat. Here is what I have socat -xv udp4:localhost:54321 open:/dev/ttyUSB1,rawer,lockfile=/tmp/s1.locak,echo=1,b115200,crnl To monitor ...
3
votes
2answers
702 views

Port Forwarding without delay and high fps in a real time live stream using socat

I am using the command socat to port forward a connection from a real-time live stream. TCP4-LISTEN:8080 TCP4:123.456.789.12:80 The problem is it has added delay and low fps while the live stream ...
2
votes
1answer
5k views

create a UDP to serial bridge with socat

I have a piece of software that transmits data over a UDP connection. However in our system we can transmit data only over a serial port. I was thinking of making a bridge between a UDP and serial ...
1
vote
1answer
2k views

Create HTTPS server with socat

Currently I am trying to setup a toy https server with socat I am doing the following: As described here http://www.dest-unreach.org/socat/doc/socat-openssl.txt cert() { openssl genrsa -out $1....
1
vote
0answers
291 views

socat to merge TCP streams

I'm trying to merge 2 TCP streams into one and then send the result outside through a TCP port server. The first part is Ok, I'm able to capture incoming streams as below: STREAM1: socat TCP:127.0.0....
1
vote
1answer
175 views

socat and gawk piped

I'm trying to manipulate a TCP stream using gawk. The TCP server streams out a text string separated by whitespaces. I want to add an extra string at the beginning and then separate the remaining ...
1
vote
1answer
734 views

How to make SOCAT send each character from STDIO?

I have the following scenario: I have a Windows in a VM, which has an exposed serial port to a host pipe (named-pipe / fifo). The host pipe is at /tmp/win-serial-com3. On my host OS, I'm using ...
0
votes
0answers
253 views

How can be reverse port forwarding connection established without encryption?

I have a docker image running on localhost and what I want is to let the docker container communicate with my host's application on a specific port. I cannot change the network=bridge docker ...
2
votes
1answer
755 views

socat forward input to both tcp-connect and exec (script)

I'm interested in implementing the advanced content filter example for postfix. socat tcp-listen:10026,reuseaddr,fork tcp:localhost:10025 This is a simple "passthru" that works, but obviously doesn'...
3
votes
1answer
954 views

Building a Unix socket bridge via TCP

I have two processes (Client and server) that communicate with each other using a Unix socket /tmp/tm.ipc. Both processes (Client and Server) don't support TCP. Client -> /tmp/tm.ipc -> Server Now, ...
1
vote
1answer
1k views

Posting to socket using curl

I'm struggling to get curl and socat to play nicely together. The situation is the following: I post XML to login to a system. Return message contains authentication token. I post subsequent requests ...
0
votes
1answer
481 views

Socat command syntax

Here is some socat command example I find: $ printf "md.b 0x0800000 0x100000\r\r" | \ socat - /dev/ttyUSB0,raw,echo=0,crnl >u-boot.ascii 2>&1 It's not clear what is purpose of backslash "\"...
4
votes
0answers
646 views

socat gives error (read(6, 0xf97acc0, 8192): Permission denied)

I'm trying to use socat as a port mapper to map IPv4 connections to my OpenVPN server running behind a DS-Lite IPv6 cable connection. //edit I tried with a non root user and root. But I get the same ...
0
votes
2answers
535 views

How can I reliably send data from a TCP port on one computer across the network to a different port on another?

I have two applications on two networked Linux machines on the same LAN. One runs a server program which listens for TCP connections on a specified port and when connected, emits (but does not receive)...
1
vote
1answer
830 views

socat wait for answer

I use this in a script echo $(echo "sign 00:07:32:46:04:75" | socat UDP4-DATAGRAM:239.192.0.2:9000 -) but this does immediately stop and I get no answer from the server if I do echo $(echo "sign ...
3
votes
0answers
592 views

Limiting socat udp to receive one packet or timeout

When testing certain multicast connectivities in the past I have been using socat to do this: socat -u UDP4-RECVFROM:12345,add-membership=224.1.2.3:eth0,fork,reuseaddr,readbytes=32 SYSTEM:"hexdump -C"...
1
vote
1answer
1k views

socat - Monitoring USB port to standard CP2102 serial adaptor

I have been trying to get a HEX dump of what is being sent/received to CP2102 serial converter chip. I can find examples of people monitoring hardware serial ports /dev/TTYS0 and the like. socat -d -...
2
votes
0answers
594 views

Setting up Linux Bluetooth 4.0 serial port - gatttool/socat?

Bluetooth LE/ 4 is different from traditional Bluetooth serial port profiles and old instructions don't work. Bluetooth LE is basically all user mode, and there are some instructions on accessing LE ...
0
votes
0answers
583 views

socat as SCTP client

There is an SCTP (see: https://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol ) server running in my network. I want to send it a simple message to verify that it works and is accessible. ...
1
vote
1answer
346 views

Does socat forward any information about source?

I'm using socat in double vpn chain instead of the middle vpn server: me(1.1.1.1) -> socat(2.2.2.2) -> OpenVPN-Server(3.3.3.3) I'm using it on 2.2.2.2 this way: socat TCP-LISTEN:995,fork TCP:3.3.3....
2
votes
1answer
5k views

socat - UART logging and redirecting

I am currently trying to log all communication from and to /dev/ttyUSB0 and simultaneously be able to connect minicom/screen to the same device for interaction. I tried a couple of tools and ...