Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [netcat]

Netcat is a simple but powerful utility program that reads and writes data across network connections, using TCP or UDP protocol, IPv4 or IPv6, with a variety of functions.

Filter by
Sorted by
Tagged with
1 vote
0 answers
59 views

Ncat inside WSL2 not behaving correctly

I have an instance of kali linux running in WSL2 on Windows 11. It is configured to use mirrored networking mode, if that is relevant. Typically, if one were to start listening on 127.0.0.1 on any ...
JavaNoob's user avatar
0 votes
1 answer
57 views

Double SSH then execute NC using Batch file and Plink

Good morning, I need to execute a netcat command and get the output to do elaboration on my local PC (windows). I just need the "connection good/bad" Now I use PuTTY using the following step ...
ThEnGi's user avatar
  • 1
0 votes
0 answers
11 views

Why does netcat -v send extra X packets?

I'm using netcat 1.218 on Ubuntu 22.04 to generate test syslog packets, and I noticed an odd behavior I can't explain. When I use the -v flag, netcat sends 2 additional packets containing the letter ...
Elliott B's user avatar
  • 1,225
0 votes
0 answers
22 views

How to switch between sessions in NetCat

I have a nc in listen mode nc -klvmp 12345 --max-conns 3 I create 3 sessions. At the end I want to be able to switch on the server side between client's sessions. Or work in 1 and then close it and ...
Alex's user avatar
  • 1
1 vote
0 answers
2k views

Why can I `curl localhost:<port>` but can't `curl <my IP>:<port>`?

I start by retrieving my IP address by running ifconfig | grep -B7 "status: active". Then, I listen on port 12345 by running nc -l 12345. Observations: curl localhost:12345 works curl <...
Caleb Koch's user avatar
0 votes
1 answer
167 views

Is it safe to expose a port opened from netcat?

I'm planning to open a port from a device inside my LAN to the internet with the command: nc -kl 9999 > /dev/null The idea is just to know if that specific device is powered on whenever I want to ...
victim's user avatar
  • 3
1 vote
0 answers
40 views

What possibly a Mac prohibit remote connection?

With my company Mac, I can't connect to one of my company's server:ppppp. The problem is all my colleagues can connect to the server:ppppp. All environments are same. Connect VPN all works including ...
Jin Kwon's user avatar
  • 336
0 votes
2 answers
1k views

Pipe Python command output to netcat without sending an EOF

I have access to an external netcat server to which I am trying to send a large input. I am currently trying to do so with this command: python -c 'print("a" * (50000-64))' | nc www.host.net ...
TheDoctor025's user avatar
0 votes
1 answer
215 views

How to prevent change of bytes when transferring file with nc?

If you open a port on a listening host and send bytes with nc to this port, the hash of the source and destination file might not be the same. Why is that and can it be prevented? Here are the ...
TMOTTM's user avatar
  • 219
0 votes
2 answers
644 views

socat TCP server bidirectional using sleep, non-interactive client returns without response. Server reports: I/O error

I have the following TCP server: socat TCP-LISTEN:10000,fork,reuseaddr SYSTEM:'read -r msg && sleep 3 && echo "OK"' When I execute (interactive mode): socat - TCP:localhost:...
lepe's user avatar
  • 738
1 vote
1 answer
812 views

Using netcat / ncat to test the Hole Punching paradigm / technique

Being in need to revalidate rationale behind internal workings of protocols of my own I decided to play around with netcat to simulate what's to be going on under the hood. The Aim Is to simulate the ...
Vega4's user avatar
  • 161
1 vote
0 answers
101 views

why does netcat work(to scan) faster in local host in virtual box but not for remote server?

I am using netcat to scan the ip of metasploitable2 from my kali machine in virtual box.netcat is very much faster to scan an ip of a local machine in virtual box. But when I am trying to scan a ...
Khan Shaheb's user avatar
0 votes
0 answers
385 views

Netcat connection not working both ways (Mac-Kali), connection refused

I was following this website in order to establish a netcat connection. I have a mac and a kali virtual machine. If from my mac I type nc -lv 1234 and from kali I type nc ip.of.my.mac 1234 then the ...
edamondo's user avatar
  • 101
0 votes
1 answer
2k views

Why is netcat not running like it should on my macOS?

I tried running nc -lnvp 1234 > filename.log on my macOS today and it returned this error saying I need to specify a port number, while I specified the port number on my command. This command ...
PsOom's user avatar
  • 1
1 vote
2 answers
567 views

Could someone execute commands on my netcat server/listener?

TLDR Someone has connected to my netcat server and tried to execute a command. Is it possible they have done any harm to me/my computer/my network? Detailed story I've been learning about networking ...
nom4d's user avatar
  • 13
1 vote
1 answer
4k views

How to use netcat on Mac?

I start the app with sockets on Mac and returns following: kukodajanos@Kukodas-MacBook-Pro niots % swift run Building for debugging... [2/2] Emitting module niots Build complete! (0.30s) Server ...
János's user avatar
  • 271
1 vote
0 answers
572 views

Log IP address using netcat

How to log IP address every time which is connected to the port, I'm using nc to listen and tee to append in a log file netcat -lkv -W2 -p 4000 | tee -a /tmp/netcat.log
roXx's user avatar
  • 11
0 votes
1 answer
1k views

Linux Remove Previous nc Directive

I need to use nc -lp4 5432 --allow 192.168.1.24 but I have a previous nc directive that only has it listening on localhost. It throws an error when I try overwriting it: $ nc -lp4 5432 --allow 192....
Rich_F's user avatar
  • 121
0 votes
1 answer
269 views

Open shells with ncat on wan target

I created an azure VM and I configured a ngrok server to make my localhost accessible from internet and I put a VPN to VM in order to simulate a wan attack. What I want is to set a TCP connection to ...
Turing's user avatar
  • 9
1 vote
0 answers
742 views

How to create a serial over LAN server under Linux, using virtual ports

I am able to connect to serial over LAN devices (like USRIOT-TCP-232-302), as client, from my linux server, using socat and it works pretty well. I now would like to have devices connecting to the ...
Cedric Simon's user avatar
1 vote
1 answer
1k views

Sending PJlink commands with netcat

I have a projector that I want to control over TCP using a protocol called "PJlink", but I can't manage to get it working. I'm currently trying to do this through Windows Terminal in WSL ...
Hampus's user avatar
  • 13
1 vote
1 answer
2k views

Use netcat to send UDP packets out 1 ethernet port and into another on the same server

I am trying to sanity check a network device and want to use netcat to send upd traffic out a specific ethernet port (eth0 for example) and receive that packet on a different port on the same system (...
rt0218's user avatar
  • 21
0 votes
1 answer
1k views

When sending email to Gmail address from netcat or openssl s_client, why do I get "Username and Password not accepted", despite correct credentials

My goal was to send an email to a gmail address, like [email protected] from a commandline tool such as netcat or telnet etc. WHAT I TRIED: I first tried netcat. nc -C smtp.gmail.com 587 220 smtp.gmail....
Shy's user avatar
  • 173
-1 votes
1 answer
887 views

Is it possible to make Netcat behave exactly like Telnet?

Is it possible to make Netcat behave exactly like Telnet? The "-t" option doesn't seem to quite do it.
Fattie's user avatar
  • 121
1 vote
0 answers
263 views

Simulate "Enter" keypress after successfully making connection using Netcat on Raspberry Pi

I have an issue with using Netcat on Raspberry Pi terminal to output data after making a connection. The issue is that when I run this command, after it is succeeded, 5 seconds pass, and the ...
Thanks's user avatar
  • 11
0 votes
1 answer
217 views

Trying to start nc listener via torify?

Trying to start nc listener via torify: torify nc -lvnp 4444 get response: local listen fuxored: Operation not permitted I then tried to add: -q -1 and got same response?
tesla6699's user avatar
0 votes
1 answer
334 views

nc Won't Listen on a Port on CentOs6

I'm playing with nc for the file transfer function. On a CentOS6 machine, If I put nc on the listening mode, it returns a help message instead. It seems nc with older visions needs different ...
NeilWang's user avatar
  • 125
1 vote
0 answers
99 views

how to do netcat in a terminal

i have a program that is like a terminal that i want always on, how do i put it in a port through netcat so when i connect to that port i can write in the terminal and when i exit, the program doesn't ...
Guack's user avatar
  • 21
0 votes
0 answers
261 views

Netcat or similar: Dockerized general purpose TCP/IP port proxy/gateway (for any service: mysql, ssh, dns, etc)

Context We manage a radio station with 35+ workplaces for journalists. All them using a desktop application, connecting to a MySQL exposing 3306 at some internal IP address. There are also other ...
Xavi Montero's user avatar
0 votes
1 answer
2k views

difference between nc and telnet using smtp service as an example

I can use both nc and telnet to connect to port 25. $ nc 192.168.1.120 25 220 localhost ESMTP Exim 4.68 Tue, 29 Dec 2020 06:07:27 +0000 $ telnet 192.168.1.120 25 Trying 192.168.1.120... Connected to ...
user1424739's user avatar
0 votes
1 answer
1k views

Redirect arecord output and send it with netcat

I am trying to redirect sound from a microphone from one computer to another in my local network. I did following to achieve that In one terminal: arecord -t raw -c 2 -f S16_LE -r 48000 | nc -u #...
nmd_07's user avatar
  • 235
0 votes
1 answer
1k views

How to netcat to multiple ports

I'am using a raspberry and i need 2 local streams. This is what i've tried: Attempt raspivid <some options> -o - | tee nc localhost 5100 | nc localhost 5000 Question I can receive the output on ...
SirPilan's user avatar
  • 103
0 votes
1 answer
274 views

monitor PID and respawn processes in bash script (simulatord, nc, ping)

For a student environment, I have a simple bash script that runs upon boot up on Ubuntu 18.04 (@reboot in crontab -e). It runs ok (java file starts, netcat starts, pings, and all PIDs are viewable via ...
Roger's user avatar
  • 151
1 vote
1 answer
274 views

Connection refused, but port is open

My Idea was to make netcat-Connection between two devices in different LAN; Now I looked in settings of WiFi-Router and created a port forwarding; port 4004 of router should now be able to connect me ...
gXLg's user avatar
  • 31
0 votes
1 answer
2k views

Bypass Linux password login with netcat or ssh or telnet

How can you bypass a password login with nc or ssh? I type 'nc IP-address 13880' and it gives me the login form I need to bypass. Can anyone give me any tips?
Ollie's user avatar
  • 143
3 votes
1 answer
17k views

Use netcat to listen on a port and send output from a command when a client connects

I have a Raspberry Pi (Debian Linux) connected to my LAN that can read data from some connected devices and output it to STDOUT. Let's say the program is run on "Server" and I want to serve the ...
Joshua Besneatte's user avatar
2 votes
0 answers
389 views

How to transfer files between two hosts through a bastion using netcat and pigz

I have to regularly transfer the contents of folders containing a lot of small files with a volume of around 10GB from one server to another. Before I used the command bellow which did the job very ...
Abe Rad's user avatar
  • 21
0 votes
2 answers
3k views

Scan open port with netcat

I'm just wrapping my head around the utility netcat. So for test purpose I install Apache on my Linux OS and verified Apache runs by accessing the localhost url in my browser. I want to test if the ...
Vetouz's user avatar
  • 101
1 vote
1 answer
2k views

linux nc (netcat) UDP Connection refused

I faced with some strange nc behavior. It works well with TCP when on one host I do: nc -tlp 31337 and on the other one: nc 14.0.0.1 31337 So there can be some data exchange. But when I do: nc -...
z0lupka's user avatar
  • 137
0 votes
1 answer
107 views

Netcat listening on Debian Security advice please nc -(dknl)

I would be very grateful for some help: This is with regards to a Netcat based script running on a Debian based distribution, specifically the Proxmox hypervisor (see here if unknown https://en....
Bob Hart's user avatar
1 vote
1 answer
527 views

SSH'ing through a proxy with CentOS 8

I'm using CentOS 8, and I'm trying to SSH from behind a firewall through a (HTTP but also somehow SOCKS) proxy. I've read this answer, which suggests using nc -X - but my nc doesn't support that. I'...
einpoklum's user avatar
  • 9,590
4 votes
1 answer
2k views

Install both gnu-netcat and openbsd-netcat simultaneously on Arch Linux

They are in conflict when I try to install them conveniently. How can I have both of them at the same time?
radrow's user avatar
  • 143
0 votes
1 answer
302 views

Receive UDP packets from multiple broadcast servers

I have two sensors which broadcast their data using UDP. I configured them to use different ports. If I connect only one sensor, I receive the packets using nc -ul port without any trouble. If I ...
miloszmaki's user avatar
4 votes
1 answer
3k views

What's the alternative to "nc -l" for HTTPS?

You can run netcat in the "listen" mode: nc -l 8080 This will listen on localhost:8080, dump everything that comes in to stdout and reply with data from netcat's stdin. This is useful for a ...
Nickolay's user avatar
  • 541
1 vote
0 answers
1k views

Netcat/nc messages not send/received on either computer

I have two computers (both running Ubuntu) in the same network. They are able to ping each other successfully. Their IPs are: Computer 1: 172.16.10.59 Computer 2: 172.16.10.72 The following works: ...
Nooyi's user avatar
  • 111
37 votes
1 answer
42k views

What is the difference between telnet and netcat?

I am looking for an explanation where I can find the difference between telnet and netcat. In which cases should I use telnet and netcat? What a telnet can do that netcat can not do and vice versa? I ...
rbashish's user avatar
  • 496
0 votes
2 answers
3k views

Scanning streamed data with clamav

I am trying to come up with a command with which I can scan a file by streaming it via network interface. I have tried the following: telnet clamd.server.com 3310 STREAM PORT <some random ...
zozo6015's user avatar
  • 183
2 votes
2 answers
5k views

Is NetCat command dangerous?

I'm s server-side developer and used to invoke the nc command to check whether a remote port is open. Suddenly, the security guy prohibited the command and as soon as I use the nc command my ...
Jin Kwon's user avatar
  • 336
0 votes
1 answer
829 views

Netcat as a inetd service on port 1815 and redirect incomming to /dev/ttyS2

I'm trying to let my Debian 7 system to listen on port 1815 with netcat and redirect the incoming traffic to a VacuumFluorecentDisplay. Iptables are open and I'm using inetd instead of xinetd(came ...
Steven's user avatar
  • 1
3 votes
0 answers
2k views

Why does this netcat pipeline work in macOS but not Linux?

I set up the following pipeline. This allows me to see the raw HTTP requests and responses that pass through the pipeline. Note: I use BSD nc below (this is what comes with macOS and AmazonLinux), ...
Josh Cooley's user avatar

1
2 3 4 5