Questions tagged [netcat]

Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.

features:

  • Outbound and inbound connections, TCP or UDP, to or from any ports.
  • Featured tunneling mode which allows also special tunneling such as UDP to TCP, with the possibility of specifying all network parameters (source port/interface, listening port/interface, and the remote host allowed to connect to the tunnel.
  • Built-in port-scanning capabilities, with randomizer.
  • Advanced usage options, such as buffered send-mode (one line every N seconds), and hexdump (to stderr or to a specified file) of trasmitted and received data.
  • Optional RFC854 telnet codes parser and responder.
186 questions
1
vote
2 answers

Netcat says 'operation not permitted'

I thought I could easily copy a tgz from a linux box to a windows box (cygwin) by doing this on the linux box: nc -vv -l 4444 < file.tgz And this on the windows box: nc -vv 10.13.13.2 4444 > file.tgz But whenever I do that the windows box…
dsummersl
  • 206
  • 3
  • 8
1
vote
1 answer

ssh use with netcat to forward connections via bastion host to inside machine

I am having a server in a corporate data centre who's sys admin is me. There are some virtual machines running on it.The main server is accessible from internet via SSH. There are some people who within the lan access the virtual machines whose IPs…
Registered User
  • 1,463
  • 5
  • 18
  • 37
1
vote
1 answer

redirecting output from telnet / nc to file in script fails when cron'd

So, I have device on my network which sits there listening on a port for a connection, and when a connection is made it dumps ascii data out. I need to capture that data to a file. I wrote a dead simple shell script that does…
qhartman
  • 51
  • 1
  • 7
1
vote
1 answer

Is it possible to make a web browser proxy tunnel with Netcat/Socat?

Concerning the Netcat/Socat utility . From the man page, it seems like it is possible to create a secure proxy using netcat by which I could point my web browser to like a proxy server , that could fork/drive my web traffic through the proxy. Is…
djangofan
  • 4,182
  • 10
  • 46
  • 59
1
vote
2 answers

Netcat successfully sends UDP packet despite all UDP traffic being blocked via Network ACL

I've created an AWS instance in the default VPC and I've blocked all UDP traffic in the Network ACLs. Here's how my outbound rules look: Rule number Type Protocol Port range Destination Allow/Deny 99 All UDP UDP…
1
vote
1 answer

IPv6 port scanners hang after scanning a closed port

I am testing nftables firewall rules using two virtual machines, one with the active firewall and one that tries to connect to it. For example with netcat and no firewall: nc -6 fe80::9d08:b3e2:47fa:2935%ens33 responds successfully with…
stmas
  • 11
  • 1
1
vote
0 answers

xnatd + netcat + ssh = 100% CPU usage

I have a Raspberry PI with a Syncthing Admin-Web-UI binding to localhost:8384. I can access this UI from my laptop using SSH-tunnel: $ ssh me@raspberrypi -Llocalhost:8384:localhost:8384 $ chrome http://localhost:8384 Now I would like to delete this…
1
vote
1 answer

Scanning a range of ports with Ncat?

I'm aware that Nmap is the obvious choice for this task, however I would still like to know if it's possible to scan a range of ports with Ncat. I see that I'm able to scan one port, but with a range of ports I get an error. With traditional Netcat…
Ed Shway
  • 111
  • 2
1
vote
0 answers

Netcat on MacOS failing with simple commands

I'n trying to follow a tutorial here. As an example we can say that we need a friend of ours to help us with something on our work system(Windows). To be able to receive a connection from us first our friend would need to set up a listener. nc…
1
vote
0 answers

'socat' not displaying incoming UDP packets, but Wireshark does

The link is an image of a Wireshark dump of an incoming 60-byte Ethernet frame which contains a UDP packet. The packet payload is the single word 'hello' (sorry, I don't have enough rep to paste the image directly). Problem: I can't get socat or nc…
QF0
  • 183
  • 1
  • 7
1
vote
1 answer

UDP connection i/o timeout while port is reachable

on one server we encountered an issue where all kinds of UDP connections are failing. The same application and tests work on other servers with the same OS and similar setup. nc -vz -u 83.61.**.** 7092 Connection to 83.61.**.** 7092 port [udp/*]…
user2693017
  • 203
  • 3
  • 12
1
vote
1 answer

How to capture UDP traffic so it can be piped to grep

I'm trying to capture UDP traffic which is being sent as StatsD metrics (on port 8125). The most simple approach I tried is to run nc -ul 8125 which prints the metrics to the terminal...but they are not newline separated. Additionally, piping the…
Darragh
  • 113
  • 5
0
votes
1 answer

Spawn background process from ncat

How can ncat be used to spawn a process in the background? For example: ncat -lp 2342 -c "setsid sleep 5 &" As I understand, setsid and & will make the process run in the background but ncat does not close until sleep finishes. I can forcefully…
Dave
  • 101
  • 1
0
votes
1 answer

Simple netcat Responder

Trying to create a simple netcat responder: The "server" would be: $ while true; do { ./secret.sh; } | sudo netcat -k -q -1 -l 123; done secret.sh is: #!/bin/bash read line if [ "$line" == "open" ]; then echo "sesame" fi And the client…
Utkonos
  • 416
  • 4
  • 15
0
votes
1 answer

Send data recieved by netcat to script

I'm trying to take data I receive over a netcat connection to a script that will send each line to another server via a curl post command. Heres where I am. This works: nc -lk 9272 > test.log Each line received is in the log as expected This doesn't…
ahackney
  • 137
  • 7