Questions tagged [netcat]

Netcat is a computer networking service for reading from and writing network connections using TCP or UDP

Filter by
Sorted by
Tagged with
0 votes
1 answer
16 views

Communicating between two processes on different namespaces with netcat

the situation is quite simple, I have two processes, one on the host the other is inside a container. The processes are on different namespaces. I thought I would simply be able to do something like ...
user avatar
0 votes
1 answer
23 views

Is it possible to create a ncat loop?

If you had two computers, wanting to control one from another using only ncat, without using telnet, ssh or other networking tools and only two shells, how could i go about that? I have successfully ...
user avatar
0 votes
1 answer
59 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'...
user avatar
1 vote
0 answers
64 views

netcat command not working

Any idea why nc command is not working and telnet is working. Ideally nc will also work. I am trying to use nc in script but getting error however telnet is working. Ideally nc command is working for ...
user avatar
  • 11
1 vote
0 answers
29 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: ...
user avatar
  • 11
0 votes
0 answers
61 views

Exporting Python's script errors/traceback to file with netcat

I have a Python script accessible with netcat: nc 'serverIP' port. The Python script awaits an input from the user. If the input is expected, the script keeps running. If the input is unexpect (e.g. ...
user avatar
2 votes
1 answer
94 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 ...
user avatar
  • 21
1 vote
0 answers
62 views

Basic webserver supporting post+get (using curl and netcat)

Sorry if the question's title isn't clear about the objective of this question. I was able to make a respond-only webserver using Bash only; when it gets a curl post request, it returns results no ...
user avatar
0 votes
2 answers
71 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 ...
user avatar
1 vote
0 answers
267 views

nc -lvnp (port) Non-responsive w/ PHP Reverse Shell til closed

I am currently working on Machine's on HackTheBox. I've used nc -lvnp (port) quite a bit and i've never ran into this issue: $nc -lvnp 4444 listening on [any] 4444 .... connect to [my IP] from (...
user avatar
0 votes
0 answers
94 views

Creating Script that Connects with Netcat and inputs username?

Is it possible to write a bash script that connects using nc -host -port number then the server displays “Enter Username:” and the bash script enters the username? I have been trying to figure out how ...
user avatar
  • 1
0 votes
1 answer
370 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 ...
user avatar
  • 157
0 votes
0 answers
23 views

socat looks for a dll file extension even though it has not been specified

I have a small .net based CLI executable that I want to bind to some port, and then be able to netcat to, and then run the file. After googling for a while, I found that socat might be the preferred ...
user avatar
  • 127
3 votes
0 answers
193 views

'netcat' not working as expected on Arch, but works on openSUSE Tumbleweed? What's going on?

I'm having a bit of trouble utilising netcat on Arch, specifically, the GNU version of it. My situation: I basically made a simple server in Python that can accept multiple clients and send responses. ...
user avatar
  • 31
0 votes
0 answers
172 views

Using netcat for reverse shell but connection refused?

I’m using netcat to create a reverse shell I’m using kali as my attacker/listener and a windows 7 VM as my victim/client computer But when I fill in the commands: On Windows 7: nc -Lp 4444 -vv -e cmd....
user avatar
  • 11
0 votes
2 answers
797 views

netcat on ubuntu/kali-linux not working

I have a problem with netcat.I tried the "pickle rick" challenge on tryhackme,The problem is that I don't get a shell with netcat: nc -lnvp 9999 and this is the output: Listening on 0.0.0.0 ...
user avatar
1 vote
1 answer
119 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 ...
user avatar
  • 143
3 votes
1 answer
276 views

netcat closing connection on localhost listening end after connection attempt

Ι am nc-listening on localhost:2500 ▶ nc -l 2500 _ On another terminal I am trying to connect to this listening end ▶ nc -zv localhost 2500 nc: connectx to localhost port 2500 (tcp) failed: ...
user avatar
  • 2,205
0 votes
1 answer
287 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 ...
user avatar
  • 105
0 votes
1 answer
298 views

Using netcat to setup a bind shell on localhost, but having issue with '-e' flag

I'm trying to do a simple exercise, where I need to set up a "server" hosting a bind shell, using netcat. On my localhost. I'm running ubuntu 20.04 I'm following this tutorial, that has this ...
user avatar
1 vote
2 answers
722 views

'ncat' considers redirection as (additional) port specification when run from python script

In a python script I am trying to run a subrocess that listens and recives a file using ncat: proc = subprocess.Popen(command,stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ...
user avatar
2 votes
1 answer
194 views

Playing, recording, and streaming sound with cat and /dev/dsp

A couple of comments on Hacker News suggest that, on FreeBSD, you can: use cat to send a file ( a .wav file for instance ) to the audio speaker (/dev/dsp). record from the mic using a similar method. ...
user avatar
  • 185
0 votes
0 answers
62 views

netcat blank result for UDP packets, with windows as listener and Linux machine as sender

I set one of my Linux machine as server , and ensure one of my windows machine as reachable from Linux. netcat was installed in both , while Linux is sending UDP packets , I am not able to capture any ...
user avatar
1 vote
1 answer
567 views

Netcat with device or interface flag?

Traceroute has an -i flag, -i interface, --interface=interface Specifies the interface through which traceroute should send packets. By default, the interface is selected according to the routing ...
user avatar
  • 22.9k
1 vote
1 answer
86 views

How to get grep to exit immediately when command is received from netcat?

I want to open a port and listen for a command, and when that command comes in, immediately run a script. The best I've come up with is (the echo is a substitute for my script): nc -lk 9999 | grep -q ...
user avatar
  • 203
1 vote
1 answer
298 views

netcat producing EINVAL when sending to UDP IPv6 multicast

I'm using netcat on Fedora to test an IPv6 UDP multi-cast address. The command is echo hi | nc -6 -u ff02::777:777:777 7777 netcat responds, "Invalid argument." Running strace yields ...
user avatar
0 votes
0 answers
48 views

Prevent ncat from terminating after running python script

How do I prevent ncat from terminating after running a python script? My current netcat command is: ncat -lvp 50000 -e main.py. I would also like it so there can only be one connection per ip.
user avatar
0 votes
1 answer
393 views

netcat / nc / telnet perform math on received data then output

I am not an expert on bash so sorry in advance. For my high school CTF competition, I have to read in 3 numbers, perform some arithmetic on them, then output the value back to the server. In ...
user avatar
0 votes
0 answers
354 views

Netcat listener: Line break between syslog messages

I am playing with netcat command. On this linux system, I have set up a netcat listener on UDP 514, so that I get to see syslog messages from remote systems. $ sudo nc -v -ulp 514 listening on [::]:...
user avatar
1 vote
1 answer
65 views

Can I delay exection or otherwise postpone an outgoing netcat connection within a pipe?

I'm not sure if this is an XY problem, but I have to aupport a horrible piece of software that won't talk to modern mail servers properly. It can only do SMTP and insists on providing AUTH ... even ...
user avatar
  • 1,086
0 votes
1 answer
161 views

how to exit in bash script from ProFTPD via netcat after some copy operations

I am connecting to a proftpd server via netcat nc 10.10.239.150 21 Then I am doing some copy operations like "The mod_copy module implements SITE CPFR and SITE CPTO commands" After "...
user avatar
0 votes
1 answer
117 views

Netcat working on Linux but not on mac terminal

When I run nc -l 2399 on my mac it doesn't work, regardless of what device I'm trying to connect to on. I run nc 192.168.1.24 2399 and it just prompts me for the next input. When I start the listen ...
user avatar
1 vote
1 answer
185 views

Get my public IP from ifconfig.co using netcat

From my Android TV box, I would like to get my public IP and other related info from ifconfig.co, but it does not seem to work. If I try this code, it works fine: adb -s 192.168.1.125:5555 shell ...
user avatar
0 votes
0 answers
972 views

How to "cat" a socket?

So to read and write to a socket: Write to a socket: echo "hello" > /dev/tcp/192.168.0.144/27002 Read from socket: netcat -p 27002 -l BUT... I would like to read a socket using "...
user avatar
  • 775
0 votes
1 answer
378 views

Connect to a port without use of netcat - alternatives

I want to connect to a port on a specific IP address without the use of netcat. I don't know of any method that would get the same result. Below is me connecting to a port with netcat: The above ...
user avatar
0 votes
1 answer
749 views

Netcat Brute Force Script

When I enter netcat [ip address] [port] I am asked to enter a password, I actually know the password, it is a date. However, I would like to create a script that enters the the netcat ip and port ...
user avatar
0 votes
1 answer
114 views

Changing port when using netcat

The manual instructs to use -p option for entering port. When I tried to use it, 'no port to connect' was displayed. I was connecting to localhost. But the connection went through when nc localhost ...
user avatar
0 votes
2 answers
543 views

How do I write a simple request/response tcp server using `nc`?

I’m trying to write a request/response TCP server to handle a small number of very simple commands. I'm using a shell script to be as portable as possible, avoiding compilation or requiring specific ...
user avatar
0 votes
1 answer
175 views

How to connect two instances of netcat through a veth device pair?

I want to connect to instances of netcat through a veth(4) device pair. Thus, I create the veth pair using ip as follows: ip link add eth0 type veth peer name eth1 ip addr add 10.0.0.1/24 dev eth0 ip ...
user avatar
  • 3,357
0 votes
2 answers
620 views

Delay in piping arecord output and into aplay

There is a noticeable delay in the sound coming from the speakers when doing, arecord | aplay I want to reduce the latency because I want to write a low-latecy sound server with a bash script. ...
user avatar
  • 125
0 votes
1 answer
498 views

How to loop netcat for each line of input?

I am trying to send text log files to my remote syslog server. I need to be able to take a file, and for each line in that file (newline as the separator), send that line via netcat to a remote syslog ...
user avatar
4 votes
2 answers
1k views

netcat missing -x option

I am having problem with nc command, I cannot use a proxy, because there is no -x option, which should be there. nc -h [v1.10-41] connect to somewhere: nc [-options] hostname port[s] [ports] ... ...
user avatar
0 votes
2 answers
2k views

Sending multiple packets of hex data with UDP

I'm trying to reverse engineer a wifi webcam that connects to an Android app. I sniffed the traffic and found that the transaction is initiated when the app sends a series of 8 UDP packets, at which ...
user avatar
  • 35
0 votes
1 answer
153 views

How to use netcat to check ports on more than one remote server?

I have the following lines in a script file to wait until port 1521 is open in server1 AND server2 are open and then execute start_apps.sh script. How can I modify this to wait until port 1521 is open ...
user avatar
2 votes
0 answers
197 views

Redirecting only whole lines from serial port to netcat

I would like to redirect data from two serial ports over ethernet connection to single port. I've managed to send data, but as serial port data is slow, messages might get corrupted as these does not ...
user avatar
  • 23
1 vote
0 answers
83 views

Shell script to relay stdin/stdout from an application on one machine to the same application on a different machine

The application, call it 'go-engine-1' is a Go game engine that runs from a Neural Network. It is really strong and I want to benchmark it on different machines on my network. It is intended to be ...
user avatar
1 vote
0 answers
605 views

Bridge / Tunnel using netcat and named pipes

I have two devices (A and B) that should communicate with each other - indirectly via a server (S): /---\ /---\ /---\ | A | <===> | S | <===> | B | \---/ \---/ \---/...
user avatar
0 votes
1 answer
402 views

Need for the -n option in netcat

According to man nc -n Do not do any DNS or service lookups on any specified addresses, hostnames or ports. What I do not understand is why it needs to do any service lookup (also I do not know ...
user avatar
0 votes
1 answer
171 views

Keep track of successful pin in Bandit CTF 24 to 25 [duplicate]

I am doing the bandit wargame of OverTheWire and am trying to pass level 24 -> 25. I successfully got the password with the script below but I'd like to recover the successful pin. I tried ...
user avatar
  • 111
4 votes
1 answer
1k views

UDP packets received on veth, caught by tcpdump, accepted by iptables, but not forwarded to netcat

I have two namespaces srv1 and srv2, interconnected via a softswitch (p4 bmv2) with veth pairs. The softswitch does just simple forwarding. The veth interfaces inside the namespaces have IP addresses ...
user avatar

1
2 3 4 5 6