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
1answer
39 views

ncat stops listening after 100 UDP packets

I'm continuously sending packets to a UDP server after 1 second. To listen for UDP packets: ncat -klup 1234 --sh-exec "cat > /proc/$$/fd/1" However, after printing 100 packets, nothing else ...
1
vote
0answers
25 views

How I can detect whether the database layer is either mysql or mariadb using only netcat

Sometimes on docker entrypoint files I need to detect whether the database layer is either mysql or mariadb in order to provide the correct configuration for my application whilst I develop docker ...
3
votes
0answers
47 views

netcat -s switch does not work or do anything at all

I have a computer with a NIC with two ports and a switch between them, and I'm trying to send data from one port to the other using netcat. I thought I could simply specify the source address (i.e. ...
0
votes
0answers
25 views

'nc.exe' not showing up in directory listing inside netcat session

Sorry for the confusing title. For a class lab, we were required to use netcat to establish a bind shell with a Windows workstation that was listening on a particular port and pushing out its command ...
1
vote
1answer
90 views

How to resume a file transfer using netcat or socat or curl?

I have to transfer a 400Gb database consisting of a single file over the Internet from a server where I have full control to an other computer at the opposite border of the ocean (but which uses a ...
1
vote
0answers
28 views

BSD netcat how to terminate after sending command?

echo "test" | nc -N -U example.soc How can I have this terminate once it has successfully sent the message over? According to the man page: There should now be a connection between the ports. ...
0
votes
1answer
47 views

Making a text based server with netcat or other programs?

The idea I have is to make a netcat server, and when you connect to it, the server runs a python script with which the user can interact. So for example the script asks for a number, and it outputs ...
4
votes
1answer
149 views

How can I check what version of netcat am I running?

netcat doesn't support --version or --license flag, running strings against the binary doesn't mention version number or anything of that kind. How can I reliably check what does version (openbsd/gnu +...
1
vote
0answers
138 views

How can I send a Hex value to a specific IP address and port number

I am using bash script to send hex values to my network. I need to send 0001000011050000FF00 hex value to IP: 192.168.1.5 Port# 502 using netcat. I tried $ echo '0001000011050000FF00' | xxd -r -p |...
0
votes
0answers
220 views

Socat is echoing back the user input

I am remotely connecting to a serial COM port via socket created by socat. The idea is to manage multiple devices mapped as PORT:SERIAL_TTY. Everything works fine except it echoes back my commands ...
2
votes
1answer
65 views

How to make netcat to simulate a null-modem cable

I am trying to make two VICE emulators on different machines to communicate. They are both able to write and receive characters on a specific port of the local host, but they cannot communicate as ...
0
votes
1answer
123 views

How to keep netcat open using it as a TCP tunnel?

Say I am doing something like this: (bsd variant of nc) nc -k -l 8080 <fifo | nc 10.90.34.18 80 >fifo This works great, I can use the server this is run on as a proxy to reach 10.90.34.18. ...
0
votes
0answers
29 views

With netcat how to safely open an external port to the Internet

I have found the perfect solution to write scripts which send files across machines over the Internet using netcat. On the machine receiving files I do nc -l -p 1234 -k and then on the machines ...
1
vote
0answers
773 views

Line-ending problem with Telnet: can't remove LF from CRLF when sending command

I am unable to get Telnet to send only CR (\r) at the end of a command, despite setting the crlf toggle to <CR><NUL> (see example below). Instead, Telnet always sends CR-LF (\r\n). My ...
-3
votes
1answer
104 views

Docker with Debian Wheezy is lacking lot of commands!

I have created a docker image from debian:wheezy, to follow a tutorial. I am just wondering how useful is this image because it does not support many commands. For example: "nc", but also (and the ...
0
votes
1answer
312 views

How can I upgrade a primitive Netcat shell to a fully-featured login shell with tab-completion and line editing?

How can I upgrade a primitive Netcat shell to a fully-featured login shell with tab-completion and line editing? Suppose I start a remote (reverse) shell using Netcat as follows: nc -lvp $port nc $...
3
votes
1answer
123 views

Execute a command when upon receipt of a TCP connection

I would like to run a bash command when a remote connection is successfully established to a specified local open port. I have looked into netcat and socat, but I'm not sure if either have the ...
0
votes
1answer
169 views

How can a client talk to another client using unix domain sockets?

Using bash we might have something like this with netcat: nc -lk -U /my/fifo | while read line; do # line => {"client_id":123} done; clients send data like this: echo '{"client_id":123,"data":...
0
votes
0answers
6 views

Send response based on client request using s6-tcpserver4

I am trying to create a socket where the client receives a response based on their request, but I can not figure out how to achieve this on CentOS 7 using s6-networking from http://skarnet.org/...
0
votes
1answer
114 views

Netcat listens on a wrong port

When I run the command nc -l -p 443 it starts listening but when I try connecting to it it fails. A few hours later I tried with verbose mode nc -lvp 443 and it printed out listening on [any] 2443. ...
0
votes
1answer
111 views

Understanding the Netcat properly [closed]

Netcat confuses me a little bit and here are the reasons: when I run: nmap localhost There are some ports listed with the information whether they are open or closed. So if I run the command : nc -l -...
0
votes
0answers
814 views

How to send CTRL+c special char to interactive bash over tcp socket?

I use interactive bash shell over TCP network, but can't figure out how to send CTRL+c sequence to the remote bash. I first run netcat instance (this is where I interact with remote bash): nc -nvlp ...
0
votes
0answers
87 views

Netcat Computer connections

When I open a command prompt on my host system and enter: nc -lvp 1234 I get the output: listening on [any] 1234 … as expected, and when I open a terminal in one of my virtual machines and ...
2
votes
2answers
721 views

How to use bash to create a socket server and allow multiple clients in the same port?

I have 4 programs, will be increased in the future, these programs have to connect to the same ip:port to send and receive messages at the same time. Until now I have the socket opened, I also would ...
1
vote
1answer
536 views

compressing a folder tgz , encode to base64 and send over the fly

I am trying to compress a folder, encode to base64 and send it over the fly , but I am getting a error tar: Cowardly refusing to create an empty archive tar -czf Pictures | base64 | nc ...
0
votes
0answers
145 views

Receive only ONE packet using netcat

I would like to use netcat to listen to data and receive only ONE packet. How does one do this?
-1
votes
3answers
720 views

How to send literal string over TCP (netcat/socat-like), but provided by command arguments?

If I want to send a string over TCP in a shell environment, I can do something like: echo text | nc 1.2.3.4 9876 Cool. Interactively, that works. Now I want to do this programmatically by spawning a ...
0
votes
0answers
31 views

writing data out to already opened port

I have a setup in which one unix program (s51 from a microcontroller simulation package) is a server tied to a specific port. Let's call the port 111. I also have setup a client on the same computer ...
0
votes
0answers
92 views

ssh tunnel with intermediary machine using named pipes and without listening on any ports on the intermediary

I would like to use an intermediary host to tunnel between two other hosts which are both behind firewalls, and cannot accept incoming connections. For security reasons, I wish to avoid having any ...
0
votes
1answer
259 views

Download zip file from remote HTTPS host using netcat

I'm trying to download a zip file from : https://download.sysinternals.com/files/ProcessExplorer.zip (no curl and no WGET). I want to do that by netcat i used this command : echo -e "GET https://...
1
vote
1answer
185 views

Stop netcat as soon as grep matches something

I am facing a problem using netcat in a bash script. I would like to match a specific output after sending a command and continue the script execution as soon as possible (not waiting for a netcat ...
0
votes
1answer
574 views

redirect created files in a directory from command line

I was wondering if there is any way to redirect created files from a .sh script to a specific directory without modifying the script itself but straight from command line. Let's say: I've a script ...
0
votes
1answer
1k views

Usage of nc with timeouts in ms

I'm using nc in a Debian environment: # dpkg -l | grep netcat ii netcat-traditional 1.10-41+b1 # cat /etc/debian_version 9.4 Its help page describe the behavior of the -w flag: -...
-2
votes
2answers
91 views

How make a port appear open with an nmap scan

To avoid someone knowing which port are open on my machine, I thought it would useful to open all unused port so that the nmaper is unable to identify which port are really open. How make a port ...
0
votes
2answers
296 views

How to let process continue running even after disconnecting ssh?

I have a Linux based router that I’m trying to “control” with a home automation controller. On my automation controller I’m able to utilize a ‘two way strings’ driver to send a string to the Linux ...
1
vote
2answers
1k views

Shell Script in netcat listener to talk with client

I have this script on my netcat server which asks for name and some other information: *echo "Tell me your name" read $ln ...
0
votes
2answers
218 views

Creating persistent netcat link

I have a remote raspberrypi that uses autossh to connect to my local machine (with reverse tunnel -R). This should feed a dump1090 instance on my local machine. I'm using /bin/nc localhost 40005 | /...
15
votes
3answers
5k views

How do I create a UDP packet?

When I perform the following Netcat command and view the packets with Wireshark, it says the UDP packet is malformed. $ echo "this is a test" | nc -u 127.0.0.1 53 Similarly, using commands like $ ...
1
vote
1answer
813 views

netcat, inverse name lookup failed, listening on any address

I'm trying to understand why netcat is listening on any address. Here is the command I give and the response I get # nc -l -p 9500 -vvu 172.24.176.221 9500 Warning: Inverse name lookup failed for `...
2
votes
2answers
886 views

Netcat: UDP connections don't terminate?

A simple example, here's my server/host: nc -ul 192.168.0.2 54 And the client: echo "test" | nc -u 192.168.0.2 54 The server will intercept the "test" message, but nc doesn't close. It just ...
1
vote
1answer
157 views

Are netcat connections stored to any log file in Linux?

I have opened a service: nc -l -p 1234 -e service.sh If someone connects to this service. nc xxx.xxx.xxx.xxx 1234 Can this connection be found in any Linux log file?
2
votes
1answer
176 views

How can I write directly to a Solaris FIFO pipe over ssh?

I have a Solaris server running a process that has its input and output redirected into FIFO pipes (fifo_in, fifo_out). How can I connect to these two pipes over ssh? I would like to be able to ...
-2
votes
1answer
299 views

Meaning of ncat connection nc:connect message?

I have a question regarding ncat. I have nc: connect to <IP> port <PORT> (tcp) failed: Connection nc:connect What does this mean?
0
votes
1answer
1k views

netcat error: Inappropriate ioctl for device

Im trying to create a 'reverse shell' using a bash oneliner and a netcat listener. This combination worked great a few days ago however now it only gives errors when connection. Does anyone know what ...
1
vote
1answer
1k views

Pipe Output of Executable to Existing Netcat Connection

I open a terminal window and connect to shell using netcat: Terminal Window 1: nc hostname port Then, I navigate to a directory and open a file,... etc (I would need to be able to do this myself, ...
1
vote
2answers
538 views

Print netcat input on terminal

I'm trying to write a script where I cat the content of a file and pipe it into nc: $cat somefile.txt | nc server port The file content is sent to the server as expected but on the terminal I only ...
0
votes
1answer
696 views

Using netcat and curl together in a bash script

This question is more related to infosec, but I can't seem to find a workaround in automating the following process: There is a cURL command which triggers a connection to the netcat. Without ...
1
vote
1answer
109 views

Proc stdin weird behaviour

Can sombody explain why this happening and how to fix it so that the data sent to stdin behaves the same way as the data typed in to stdin. For those who can't see the .gif Basically i have 3 ...
13
votes
2answers
13k views

Netcat - How to listen on a TCP port using IPv6 address?

I am using the newest version of netcat (v1.10-41.1) which does not seem to have an option for IPv6 addresses (as the -6 was in the older versions of nc). If I type in nc -lvnp 2222 and check ...
2
votes
1answer
6k views

create a UDP to serial bridge with socat

I have a piece of software that transmits data over a UDP connection. However in our system we can transmit data only over a serial port. I was thinking of making a bridge between a UDP and serial ...

1 2 3 4 5