Questions tagged [netcat]
Netcat is a computer networking service for reading from and writing network connections using TCP or UDP
305 questions
0
votes
2
answers
48
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
1
answer
704
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 ...
2
votes
1
answer
741
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 ...
1
vote
1
answer
122
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
0
answers
118
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 ...
0
votes
1
answer
240
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 ($...
0
votes
0
answers
230
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
1
answer
539
views
busybox nc server cannot accept new connection once the old one dropped out
BusyBox v1.36.1 (2023-07-17 18:29:09 UTC) multi-call binary.
I run minimal nc server like:
nc -lkp 12345
I can connect to it once nc localhost 12345. After ctr-C, the next attempt will fail.
however ...
1
vote
2
answers
442
views
How to pass a bash variable (list of numeric data) to gnuplot *without using a file*
I am using netcat to get a series of points which I would like to plot with gnuplot. However, I am having trouble passing the data to gnuplot without writing it to a file first.
In the simplest case, ...
0
votes
0
answers
174
views
MD5 Hash modified trought netcat
I used dd to create a sample empty file with 1MB, edited the sample file, created a MD5 hash of the file, started a listener on the examiner machine, piped the output off to nc and compared the hashes....
1
vote
1
answer
1k
views
send (alsa) audio via network via UDP
This to my understanding records mono in wav format for 300 seconds to a named pipe called "mic_rec"
rec arecord -D hw:4,0 -d 300 -f cd -t wav -c 1 mic_rec
And this sends whatever it finds ...
0
votes
0
answers
50
views
Netcat uploads hanging after a certain point
I'm working through an introductory cybersec challenge that requires me to upload a word and brute force a 4 digit code to a port. I put the combinations in a file, and tried to use netcat to upload ...
2
votes
1
answer
2k
views
Can i trust echo result of nc command for UDP?
Context :
I want to test UDP port with nc command
What happens :
nc command return nothing on output and 0 when i put echo $?
Which command :
nc -vzu <ip> <port>
echo $?
What is the ...
2
votes
1
answer
2k
views
Usage of named pipe as data source for netcat
I want to use netcat as a TCP-server that reads data from a named pipe. For that I did the following:
Step 1. Created a pipe and the server that uses it as a source
mkfifo /tmp/all.pipe
nc -k -l 8080 &...
3
votes
1
answer
207
views
Unable to get output from netconsole
nc -l -u 6666 on the receiving machine gets no messages from netconsole.
tested by doing "echo test > /dev/kmsg"
i am able to connect with netcat by doing "nc -u 10.0.0.192 6666"...
0
votes
0
answers
298
views
How can I write a command into a subprocess?
Currently, I am working on a project where I use telnet to netcat to send an email message within my university.
I am trying to make the process automated but my script can't seem to enter in any ...
0
votes
0
answers
73
views
why does Netcat show output in the wrong order?
I am using netcat to run a file over a network like so
nc -lvnp 1111 -e file
on the client machine, the connection is empty and I only get an output after I enter an input.
How to show the output of ...
0
votes
1
answer
104
views
Bash script to open a port when traffice is being recieved
I have 2 Ubuntu boxes one of them acting as an Attack platform (we will call it AP), the other as an already compromised server (we will call it S1).
I have this rule
sudo iptables -t nat -I ...
0
votes
1
answer
8k
views
"Connection refused" when I try to send a UDP packet with netcat on an embedded-linux board
I'm trying to send a binary packet to a local process, via netcat (nc), like this:
nc -w 1 -u localhost 10000 < my_binary_packet.bin
The output is:
read(net): Connection refused
Anyone know what'...
1
vote
0
answers
483
views
How to pass IP address to netcat as variable in bash scripting?
I have this script on a Linux machine that loops through a .txt file to see if connection is successful or not. When I give the IP directly is works. However, when I pass the variable it says: nc: ...
2
votes
1
answer
2k
views
How can I connect to a specfic Ethernet interface using netcat
I am trying to use netcat to echo some data to a custom board I have. The board is connected using a 10G Ethernet connection. I can see that the link is up but when I try using netcat I am not getting ...
0
votes
2
answers
1k
views
netcat in systemd service resets
I am using netcat to connect to a server over TCP and continuously pipe the data received to file.
nc 10.0.2.2 3456 > file.data
When running this from terminal or a script it stays connected
I want ...
0
votes
1
answer
3k
views
SOCAT (only) reverse tunnel
I have a situation where we are trying to get data from one network to another - specifically access to a private maven repo on a different network.
Network 1 contains a maven repo. And network is ...
1
vote
1
answer
619
views
How to "talk" to a "parent" IP in a subnet?
I have access to just *nix systems. Either NetBSD and/or bare Linux-based OS.
So my question comes from the fact that ADB is not widely available on all platforms, if so is very hard to install or ...
1
vote
1
answer
3k
views
netcat broadcast understanding
I'm using macOS with gnu netcat. I want to understand how can I broadcast message using netcat.
I have a netcat listening on 4555
netcat -l -p 4555 192.168.0.101
but as I attempt to send a broadcast ...