Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [socat]

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

0
votes
0answers
15 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
48 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 ...
0
votes
0answers
53 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
42 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
222 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
123 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
265 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
82 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
290 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
152 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
145 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
63 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 ...
1
vote
1answer
346 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
243 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
57 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
566 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:...
6
votes
1answer
310 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
446 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
289 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
188 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 ...
2
votes
2answers
453 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
3k 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
1k 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
201 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
104 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
502 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
208 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
536 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
619 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
771 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
389 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
363 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
363 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
525 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
461 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
479 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
451 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
246 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
4k 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 ...
1
vote
2answers
3k views

How to use virtual serial port without root privileges?

Background: I want to use this Wifi-to-Serial adapter to control a telescope via Stellarium running on Kubuntu 16.04 (64 Bit). I'd created a virtual com port using socat with this command line: $ ...
1
vote
0answers
60 views

How can I simulate a ssh session on a client behind a NAT? [duplicate]

Quick question: How can I simulate a ssh session, that I can use to run commands on a client behind a NAT, that uses only program installed by default on most operating systems (telnet...). Long ...
1
vote
1answer
434 views

socat[10261] E SSL_CTX_load_verify_locations():

I was trying to run this command in ubuntu: sudo socat -v -v openssl-listen:443,reuseaddr,fork,cert=$FILENAME.pem,cafile=$FILENAME.crt,verify=0 - But I got this error message: 2017/05/17 20:56:12 ...
2
votes
0answers
1k views

Socat- No buffering

I am using a TP-Link router TL-WR710N with OpenWRT as an IPv4-to-IPv6 translater/gateway with the following socat-command: socat TCP4-LISTEN:80,fork,su=nobody TCP6:[xx:xx:xx::xx]:80 On the IPv4-...
2
votes
0answers
602 views

Socat open TCP only when PTY opened

I am trying to link a virtual PTY with a remote device which accepts TCP connections on port 23. The opening and closing of the socket on the target device is a significant event and part of the ...
2
votes
1answer
853 views

socat pipe to pipe for multiple open-write-close and open-read-close operations

I'm trying to use socat on two systems in order to send a multivolume tar from one system to the other. Multivolume is an absolute requirement as I'm trying to shift potentially petabytes of data to a ...
1
vote
0answers
54 views

tracking proxied TCP connection

I'm a unix admin at a college. I've two web servers. One of them is for faculty and one of them is for the official college web team. The offical web server proxies requests for faculty web pages, ...
0
votes
1answer
295 views

How do I get socat OPENSSL-LISTE/CONNECT to use IPv4 only?

socat usually has separate command names for IPv4 and IPv6 variants (e.g., TCP4-LISTEN: vs TCP6-LISTEN). However, OPENSSL-LISTEN/CONNECT only seems to come in a generic variant. Is there a way to ...
1
vote
0answers
590 views

socat: calling from script, bashrc or systemd?

I do want to use socat for directing serial commands over ethernet to a ethernet-serial converter (static ip adress). I was wondering which would a good way of starting socat. If I understand ...
4
votes
1answer
1k views

Unbuffered socat command to connect serial ports in remote machines and log the data

I'm currently using the following command. It reads from serial ttyUSB0 in local machine, and bidirectionally connects to ssh, through two tee commands for logging. On the remote end, socat connects ...