Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
54 views

Linux TTY driver waits for 1024 bytes received and I need unbuffered [closed]

I am looking for a command to monitor a serial terminal port dumping the data unbuffered in hex. The data is not line oriented. I tried: socat -b 1 -v -x /dev/ttymxc2,cfmakeraw - | cat >/dev/null I ...
John Klug's user avatar
-1 votes
2 answers
39 views

Can't get socat working with custom operation [closed]

I'm trying to set up a relay server with socat. a user sends a request to client, then it applies rot13 on input and forwards it to server, the server applies rot13 again to decrypt and finally passes ...
mirhossein's user avatar
2 votes
0 answers
37 views

How to forward socat command to ssh target server via ssh tunnel?

I am currently using sequence of commands such as: ssh -N -L 3307:localhost:3307 [email protected] inside open terminal I run this: socat TCP-LISTEN:3307,reuseaddr,fork UNIX-CONNECT:/var/lib/mysql/...
juslintek's user avatar
  • 501
0 votes
0 answers
57 views

How to mirror TCP connections in nginx free version

Using nginx free version, on receiving a tcp connection request, is it possible to broadcast connection to list of backend servers simultaneously using streams module. Could find below post for http ...
ritesh kumar's user avatar
0 votes
2 answers
128 views

Socat child processes not terminating after client disconnect

I'm using socat to forward traffic from a local port to a remote server over SSL. My command is as follows: socat -d -d TCP-LISTEN:1234,fork,reuseaddr OPENSSL:192.168.1.2:1234,verify=0 However, I'm ...
David Sýkora's user avatar
1 vote
3 answers
198 views

How do I redirect socat's stdin and stdout to its parent process which is a bash script?

What I want to do SHOULD be fairly straight forward but a whole day lost to this already I'm reworking the question a bit to help focus: The overall goal is to have a bash based "server" ...
Richard T's user avatar
  • 4,660
0 votes
0 answers
54 views

Virtual serial port - Windows

I'm using compiled version of socat for windows - https://github.com/tech128/socat-1.7.3.0-windows, and tried to open connection between two ptys ./socat.exe -d -d -x PTY,raw,link=/c/test/tty1 PTY,...
knd97's user avatar
  • 3
0 votes
0 answers
59 views

socat to fork interactive sessions to support reverse shell

I want to use socat to fork multiple screeen/tmux sessions which accept reverse shell from nc. Let's say socat listens on 5555. I used many approaches, one of them: #!/bin/bash # Use socat to listen ...
rlib's user avatar
  • 7,737
1 vote
1 answer
40 views

socat to simulate noisy serial line

due to educational purposes I have some scenarios to deal with. The main one is to simulate a noisy serial line using socat (I currently have version 1.7.4) I'll elaborate: I have software that has to ...
mastupristi's user avatar
  • 1,428
0 votes
0 answers
25 views

How to create a pty with pipes on both ends

I am attempting to use minimodem to connect 2 computers over audible sound (ik it's weird but I like shenanigans). minimodem uses pipes, either into it for transmit, or out for recieve. I would like ...
Drew Helgerson's user avatar
1 vote
1 answer
89 views

Redirect the stderr of a socat fork to separate process

I have a python program that is accessed via socat, so that stdin and stdout are provided and displayed on a client. I use: socat TCP4-LISTEN:12345,reuseaddr,fork EXEC:"python prompt.py" ...
Michael's user avatar
  • 1,387
0 votes
0 answers
566 views

docker socket over socat get write: broken pipe

I'm trying to share the docker unix socket with a user inside a docker (docker in docker), it work well for most commands but for some I got a "broken pipe" on the daemon side. docker run -v ...
edelangh's user avatar
  • 331
0 votes
0 answers
52 views

Docker container for proxying ports to other containers of the stack

I am currently using Docker Compose for deployment of services in stacks. A typical simplified configuration looks like this: version: '2' services: database: image: database-v1 networks:...
tpimh's user avatar
  • 568
0 votes
0 answers
115 views

Is it possible to configure kubectl port-forward to not exit on connection refused?

I am attempting to use the socat gender change trick with the following commands, to allow code inside the pod to access google.com (as an example). # Terminal 1 kubectl port-forward $POD 5432:5432 # ...
merlin2011's user avatar
  • 74.3k
0 votes
0 answers
136 views

socat stops working to redirect UDP traffic after first successful packet?

My setup, I have an device (192.168.1.2) connecting to my WinBox (192.168.0.102) via ethernet. WinBox connects to LinBox (192.168.0.107) via WIFI. On WinBox, I have installed cygwin and runs socat to ...
neuron mac's user avatar
0 votes
0 answers
182 views

socat: forward remote character device to local

How to forward a character device from remote to local using socat? I'm trying to use URH with an SPI (cc1101) device. My local computer has a lack of SPI Interface and my BananaPI can't run URH (at ...
mawe222222's user avatar
0 votes
1 answer
141 views

Access /dev/tpm0 from Kubernetes pod without privileged mode

I am running a Kubernetes Pod for a service that needs to access the /dev/tpm0 device on the host. This works in privileged mode, however, I want to work unprivileged. Is there a way of establishing a ...
Lemon Sky's user avatar
  • 697
0 votes
1 answer
233 views

Packet Capture and Retransmission, socat permission denied

I am trying to do packet capture and retransmission using a raspberrypi using tcpdump and socat. However i keep getting the error: tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot ...
dgholmes's user avatar
0 votes
0 answers
408 views

socat with EXEC:script spawns 5 processes/sec

I'm using socat to run a script that cat's the output of a file. The script looks like this: while true do echo hello sleep 1 done The socat command looks like this: socat -v -d -d -d ...
andand's user avatar
  • 105
0 votes
1 answer
80 views

How can I one-to-many stream with netcat or socat?

I have a serial device I would like to share with other devices on my network. I would like each device to be able to read/write to this serial device. I have used netcat to stream this serial device ...
cluberic's user avatar
0 votes
1 answer
277 views

Creating a virtual serial device in linux programmatically

I want to implement a modbus slave simulator that creates it's own serial device. Something like in this example, where socat creates a "tunnel" between /dev/pts/6 and /dev/pts/7 and then ...
microo8's user avatar
  • 3,864
0 votes
0 answers
101 views

Spark Streaming Connection Refused

I am trying to run the Spark Streaming sample program slightly modified as follows : from pyspark import SparkContext from pyspark.streaming import StreamingContext if __name__ == "__main__":...
Calcutta's user avatar
  • 1,129
1 vote
0 answers
217 views

How can I replace socat code with python code

Right now I'm using subprocess to create communication between two virtual serial ports as such: def socat_runner(self): self.socat_subprocess = subprocess.Popen(['socat', '-d', '-d', 'pty,raw,...
Amit Chen's user avatar
3 votes
0 answers
312 views

Pipe LSP server over HTTP

I'm trying to pipe different LSP Servers over HTTP (to put it in docker and run in a more isolated way). But after some hours trying I stopped in a final error for my actual knowledge (and being here ...
user21839707's user avatar
0 votes
1 answer
795 views

How exactly does using socat in conjuction with openssl for encrypted shells work?

While studying reverse/bind shells on TryHackMe, I encountered a few lines of code that I am struggling to fully understand their functions. Here is the code in question: openssl req --newkey rsa:2048 ...
Douglas Peaslee's user avatar
1 vote
0 answers
633 views

SSH through HTTP proxy with Socat got CreateProcessW failed error:2 posix_spawnp: No such file or directory

I'm trying to establish an SSH connection to my remote host at x.x.x.x from a Windows machine. I'm behind an HTTP proxy which filters only HTTP(S) packages. The first thing I did was to bind my remote ...
ZioG's user avatar
  • 11
0 votes
0 answers
217 views

Terminate tls with ssh port forwarding

There is a TLS wrapped tcp port on a remote machine that I need to forward to a unix domain socket without TLS on my local machine. I know I can do that with ssh and socat but I'm curious if ssh can ...
everett1992's user avatar
  • 2,592
0 votes
1 answer
102 views

socat, need example using af_inet sock_stream to get data from machine

Need example to connect using PF_INET and SOCK_STREAM via socat program. When I try: sudo socat socket-connect:af_inet:0:192.168.0.10 STDIO I get: [11458] E exiting on signal 11
kml1208's user avatar
1 vote
1 answer
1k views

socat and dig simulate DNS request on localhost DNS server

I am trying to play with socat to simulate a DNS request on localhost. Here is what I did setup DNS server on localhost port 15353 and once request received on 15353, it will forword it to google's ...
Jia's user avatar
  • 2,503
0 votes
3 answers
1k views

What is the simplest way to emulate a bidirectional UDP connection between two ports on localhost?

I'm adapting code that used a direct connection between udp://localhost:9080 and udp://localhost:5554 to insert ports 19080 and 15554. On one side, 9080 now talks and listens to 19080 instead of ...
Jerry Miller's user avatar
1 vote
0 answers
143 views

How to isolate pty buffers created with socat and tee from tty?

I'm trying to clone a tty that is connected to a serial device, so that I can have two programs reading the data simultaneously (one program occasionally writes to the serial device as well). I'm ...
Dan Pit's user avatar
  • 11
6 votes
2 answers
6k views

What actually reuseaddr option does in socat?

I'm reading the doc about socat here and here. The example socat -u TCP4-LISTEN:3334,reuseaddr,fork OPEN:/tmp/test.log,creat,append works well with and without option reuseaddr. What does the ...
Andrei's user avatar
  • 107
0 votes
1 answer
654 views

use existing SSH_AUTH_SOCK to execute commands on remote server

I connect to my work server (workserver1.com) from my local PC (localhost) using SSH and execute a bunch of commands on workserver1. Below are the commands I execute using SSH 1) run script on server ...
Jia's user avatar
  • 2,503
1 vote
0 answers
2k views

socat localhost proxy with 'Connection refused'

I want to play with socat to setup a localhost proxy , which could redirect my request from local proxy I setup to a remote server. Below are 2 commands I try (by google) Command 1: works right on ...
Jia's user avatar
  • 2,503
2 votes
2 answers
2k views

How to access the web server which is installed on Google colab through my local computer browser without using SSH or ngrok

I wanted to create a web server that runs on Google colab. Also I should be able to access it through my browser without using any third party services or SSH. I installed lamp server and tried the ...
Run's user avatar
  • 31
-1 votes
1 answer
34 views

How to run large number of linux command from java application

I already can run Linux commands from the java app by creating a process builder and then execute by that process. I am also tailing the logs/output of that command as I need to parse them and do some ...
Nafiul Alam Fuji's user avatar
0 votes
0 answers
171 views

SOCAT command tailing from java app isn't working

Here is my runCommand that takes Linux command input as a string public static ArrayList<String> runCommand(String command) { ArrayList<String> arrayList = new ArrayList<>(); ...
Nafiul Alam Fuji's user avatar
1 vote
1 answer
730 views

Docker container gives IO error when accessing psedo tty using socat

I am trying to connect serial ports from docker container. My host machine has two serial ports. One of them is created using socat. Serial ports: ttyS0, ttyV2 ttyV2 is created with following socat ...
Ahmet's user avatar
  • 33
0 votes
1 answer
2k views

Any alternatives to socat and netcat for port forwarding?

I need to forward an exposed port of a Docker container to a remote port of a remote server. There are two approaches. One is with IP tables, but this wouldn't work for me since I'm not able to give ...
wsh25's user avatar
  • 55
1 vote
0 answers
267 views

Getting device or resource busy when trying to write to virtual serial port?

Please bear in mind that I am fairly inexperienced in C#. So, I've been trying to write to a virtual serial port but I keep getting a Device or resource busy error. The virtual port I am connecting to ...
stillTrying's user avatar
2 votes
2 answers
1k views

Link docker.sock in /var/run

<TL;DR> I have a binary tool that relies on docker UNIX socket /var/run/docker.sock I am running the binary in a Gitlab CI job, thus having a docker on a TCP socket tcp://docker:2375 How to bind ...
aymericpineau's user avatar
2 votes
0 answers
3k views

SOCAT - Forwarding TCP packets to UDP

I have an application that sends simple data over TCP (simple, no auth) and another application that must receive it. The only allowed connection between the two is UDP. On the receiving side, I have ...
chiletechmaster's user avatar
0 votes
1 answer
775 views

Sending to a serial device via socat only shows up if I'm actively reading -- I need the data to be cached

I have socat creating two serial ports: ttyclient and ttyserver, ttyclient will be called by an application and I have a script listening to ttyserver. The sequence of events I need is My socat ...
Dan's user avatar
  • 196
1 vote
1 answer
691 views

PROXY protocol - test client /tool

Proxy Protocol is implemented by various software including of course HAProxy itself. When testing from a host via a proxy, it would be useful to have a simple command-line tool to establish ...
tuck1s's user avatar
  • 1,163
1 vote
0 answers
251 views

Can't use socat to process HTTP request via serial port

I'm trying to use socat in order to process incoming HTTP requests and send them via serial port to a board which will process it and send the response back. The problem is that concurrent requests ...
Mario de la Haba Navarro's user avatar
-1 votes
2 answers
392 views

How to connect to an integrated VM without using SSH tunelling

I want to connect to a locked (cannot be modified and I do not have permissions to log into) windows vm which is hosted in a linux machine. Until now these two machines were communicating via port ...
Mr_Saint's user avatar
0 votes
1 answer
262 views

How can I see the same as the client in a socat reverse shell?

I am serving an interactive program to a remote terminal using socat. To start simple I used script.sh below, but it also works fine for the client with bash (for reverse shell), python, vim, irssi, ...
Paulo Amaral's user avatar
0 votes
1 answer
1k views

How to redirect input and output between two instances of cat with socat

I'm learning socat and as an excercise try to send text between two different shell windows. The following works well: socat - UNIX-LISTEN:uah socat - UNIX-CONNECT:uah I assumed that I could replace ...
jan's user avatar
  • 1,460
0 votes
1 answer
698 views

socat throw error while trying to connect external mysql

I try to connect 2 docker containers to each other via socat. Inside of the web container, I'll use socat to bind the external mysql-container to Port 3306. I do use this command line: socat TCP:$...
suther's user avatar
  • 13.4k
1 vote
0 answers
412 views

Script execution of host commands from docker for Mac using Socat

I have a SOCAT setup that allows me to break out of the docker container and execute commands on the host. I realize this defeats the purpose of the container, but I'm leveraging a CNAB tool that ...
richbai90's user avatar
  • 5,154

1
2 3 4 5 6