Questions tagged [netcat]
Netcat is a computer networking service for reading from and writing network connections using TCP or UDP
306 questions
0 votes
0 answers
31 views
Are a ncat ip port -vz or netstat -tunlp enough to say that a port is opened? A mongo connection to :27017 looks refused at socket level nevertheless
I have a mongo database in a container exposed by its 27017 port. When I do a netstat -tulpn, I see: tcp 0 0 0.0.0.0:27017 0.0.0.0.* LISTEN - tcp6 0 0 :::27017 :::* LISTEN - ...
0 votes
2 answers
90 views
socat/netcat how to send a file and wait for server response?
I want to send a file to a TCP server, keep the TCP connection open, wait (couple of seconds) for the response, and send the response to stdout. I don't want the connection to be (half) closed ...
0 votes
3 answers
290 views
Send input from a file into a single netcat connection via a Bash script
I have tried the following to no avail, the script just stops after the first input. filename="..." while IFS="" read -r line; do echo "$line" | nc <target> <...
0 votes
1 answer
770 views
Communicate with UNIX sockets opened by dbus-daemon
I'm trying to learn how to interact with message buses under Linux, and doing so with shell commands that doesn't involve utilities packaged under dbus-*. For this instance, I want to understand how ...
0 votes
1 answer
121 views
Can I use netcat to read data from a serial port?
We routinely use netcat (nc) to read data from UDP ports. For example: user@host ~$ nc -luv 57303 Listening on [0.0.0.0] (family 0, port 57303) NAV 2024/12/05 12:09:56.326365 DPS112 $GPZDA,121003.35,...
2 votes
1 answer
789 views
Why am I getting no output in tcpdump even though there is data being sent and received when using network namespaces?
I'm using a fresh minimal Ubuntu server 24.04.1 LTS install. I run these commands as root to set up networking and do some experiments: If you have seen this post, it's the same setup but with the ip ...
3 votes
2 answers
363 views
Why doesn't netcat print anything when listening in UDP mode when it can't reach the client even when the client can reach the server?
I'm using a fresh minimal Ubuntu server 24.04.1 LTS install. I run these commands as root to set up networking and do some experiments: apt install netcat-traditional ip netns add ns1 ip netns add ...
1 vote
1 answer
145 views
How does netcat-openbsd work with UDP?
On a Ubuntu system I have the netcat(-openbsd) package installed, the one that, when run with no parameters, prints: This is nc from the netcat-openbsd package. An alternative nc is available in the ...
0 votes
3 answers
164 views
Sending to linux serial tty from embedded system too fast
I use an embedded computer to send data to a Linux serial port for transfer to a remote server. The terminal mode is "none". After my embedded system logs in, it sends data for example, ...
0 votes
0 answers
130 views
Check if a port is blocked with socat
How to check if a port is blocked with socat? How to check with IPv6? I heard a saying that machines behind NAT can still be directly connected via IPv6, is that true? Anyway, say I have a machine ...
3 votes
1 answer
681 views
Piping live sound from raspberry pi to macOS
I want to pipe and live play the sound recorded on my raspberry to my MacBook. I've tried the following: On My raspberry: I tried to establish a data stream on a port 3333 arecord -D plughw:3,0 -f ...
0 votes
1 answer
248 views
websocat command argument equivalent for this nginx custom configuration?
I have this nginx custom configuration: server { listen 8080; server_name subdomain.domain.my.id; location /vless-ws { # Consistent with the path of V2Ray configuration if ($...
-1 votes
2 answers
208 views
How I could check connectivity in shell using an oneliner command without using netcat?
In a docker image I want to avoid installing netcat in order to ping for db connectivity at my entrypoint script: /bin/sh MOODLE_DB_HOST="xxxx" MOODLE_DB_PORT=80 function pingdb { OK=0 ...
0 votes
0 answers
238 views
Using netcat stty not giving complete tty shell when doing CTRL+Z
I'm using netcat and stty to get terminal (tty) access, but I'm not able to do so as the CTRL+Z action on the netcat session is giving me suspended session instead of stopped and then I'm not able to ...
0 votes
0 answers
56 views
Strange incongruent output for both nc and fifo
I have this exact code: #!/bin/bash gtimeout(){ if type -f gtimeout &> /dev/null; then command gtimeout "$@" else timeout "$@" fi } export -f gtimeout; ...