Questions tagged [socat]

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

socat is a relay for bidirectional data transfer between two independent data channels. Each of these data channels may be a file, pipe, device (serial line etc. or a pseudo terminal), a socket (UNIX, IP4, IP6 - raw, UDP, TCP), an SSL socket, proxy CONNECT connection, a file descriptor (stdin etc.), the GNU line editor (readline), a program, or a combination of two of these. These modes include generation of "listening" sockets, named pipes, and pseudo terminals.

socat can be used, e.g., as TCP port forwarder (one-shot or daemon), as an external socksifier, for attacking weak firewalls, as a shell interface to UNIX sockets, IP6 relay, for redirecting TCP oriented programs to a serial line, to logically connect serial lines on different computers, or to establish a relatively secure environment (su and chroot) for running client or server shell scripts with network connections.

Many options are available to refine socats behaviour: terminal parameters, open() options, file permissions, file and process owners, basic socket options like bind address, advanced socket options like IP source routing, linger, TTL, TOS (type of service), or TCP performance tuning.

More capabilities, like daemon mode with forking, client address check, "tail -f" mode, some stream data processing (line terminator conversion), choosing sockets, pipes, or ptys for interprocess communication, debug and trace options, logging to syslog, stderr or file, and last but not least precise error messages make it a versatile tool for many different purposes.

In fact, many of these features already exist in specialized tools; but until now, there does not seem to exists another tool that provides such a generic, flexible, simple and almost comprehensive (UNIX) byte stream connector.

282 questions
0
votes
0 answers

network redirection of 2 physical serial ports

I have a question about the best way to redirect over a TCP-IP connection a serial stream and I have some restrictions: The network connection might be unstable Communication is one way only Communication has to be as real-time as possible to avoid…
0
votes
1 answer

socat device files not removed when interface is closed

I am using socat version 1.7.3.2 to create a character device from a VLAN Ethernet device for communication. I create the device using following command: socat INTERFACE:wwan0.vlan_dev1,type=2 PTY,mode=0777,rawer,link="/dev/ser_vlan0" & It creates…
Raj
  • 3,300
  • 8
  • 39
  • 67
0
votes
1 answer

Configuring PHP development environment

After a long time of using LAMP and WAMP, I've decided to try out Docker (buying new hard drives today, so why not?). I've managed to create containers for my website and everything works fine. Content is updated, database is saved to the folder…
Ivan Zhivolupov
  • 1,107
  • 2
  • 20
  • 39
0
votes
1 answer

Serial port not working when using SOCAT in linux

I want to make a serial to ethernet and vice versa converter using Linux based board (Nano Pi board with Debian OS). For this I am using socat tool and making my board as TCP server. Using the below command in terminal I am Piping the serial port to…
0
votes
1 answer

Sending a file continuously via netcat/socat

I want to send a file from one Raspberry Pi to another continuously (until they are powered off or something). I am sending data from one Pi to an AP, and forwarding that data from that AP to the other Pi. I am using the current code to send the…
Sapiens
  • 3
  • 1
  • 4
0
votes
1 answer

How to tap unix socket

I have app A and B and they are communicating using unix socket. What I need is to tap this socket and listen/send the communication for evaluation? socat -t100 -x -v UNIX-LISTEN:/tmp/.sock,mode=777,reuseaddr,fork…
Libor Tomsik
  • 668
  • 7
  • 24
0
votes
1 answer

Socat on raspberry Pi for Serial over UDP

I have a RPi connected to a Windows 8 machine through ethernet and I need to transfer data from the PC with udp to the RPi and out to one of its USB ports. I am using a program called SOCAT. I found this command on a help site, but it produces an…
Makk
  • 13
  • 1
  • 6
0
votes
1 answer

No such server found while disabling HAproxy disable server from cluster

My haproxy.cfg global log 127.0.0.1 local0 maxconn 20000 user haproxy group haproxy stats socket /var/run/haproxy/haproxy.sock level admin stats timeout 2m listen admin bind *:8080 stats enable defaults log …
Munai Das Udasin
  • 510
  • 1
  • 10
  • 24
0
votes
2 answers

Can not write to open QSerialPort using socat

I have a Class Serial in which I can open a port via the member function Serial::openPort() with private QSerialPort serial_stream: bool Serial::openPort(std::string port) { std::string realPort = "/dev/" + port; if(isOpen()) { …
goulashsoup
  • 2,639
  • 2
  • 34
  • 60
0
votes
1 answer

socat - problems with logfile to tcp binding

I have a question to using socat in a special situation. I have a logfile on a system e.g. /var/log/logfile.log and I want to do a binding from the logfile to a tcp (telnet) connection. So when I start a telnet to the system I will see new entries…
0
votes
1 answer

How to I set up Socat to relay data between rapberry pi and Windows using cygwin via ethernet

I have downloaded SoCat via Cygwin on my windows device and have downloaded it on my Raspberry Pi. What commands should I be using to relay data between the two devices. I don't want to relay any complicated data, I just want to be able to set up a…
steam1234322
  • 63
  • 1
  • 6
0
votes
2 answers

Shell script echo outputting arguments

I'm currently trying to build a shell script that sends broadcast UDP packets. My problem is that my echo is outputting the arguments instead, and I have no ideia why. Here's my script: #!/bin/bash #…
Ricardo Alves
  • 1,071
  • 18
  • 36
0
votes
1 answer

socat reverse shell run python script

I am new to using socat and was wondering if this was even possible. So my scenario is I am working on my OSCP and have a machine that I can get a reverse shell back on, let's say port 8888. I am trying to keep from writing to disk on this windows…
user2216998
  • 1
  • 1
  • 3
0
votes
1 answer

Permission refused when connecting to domain socket created by Boost.Asio

I'm trying to create a server that receives connections via domain sockets. I can start the server and I can see the socket being created on the filesystem. But whenever I try to connect to it via socat I get the following error: 2015/03/02 14:00:10…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
0
votes
1 answer

Not able to connect to socket using socat

I am trying to parse rsyslog logs. For this i am sending all my logs to socat which is then sending them to Unix Domain Socket. That socket is created via perl script which is listening on that socket to parse logs. My bash script to which rsyslog…
shivams
  • 2,597
  • 6
  • 25
  • 47
1 2 3
18
19