Questions tagged [nc]
`nc` is the "network `cat`" program, connecting Unix pipe I/O to TCP and UDP sockets.
88 questions
0
votes
1
answer
103
views
How to compare output of a program with a reference value in a shell script?
I have my own implementation of a Redis server which I'd like to test through a shell script.
The general idea is to feed it with some commands through nc, and since nc prints the output of my program ...
0
votes
1
answer
102
views
how to use unix domain socket with bash
First of all - I know fifos for IPC, but read about unix domain sockets, which are bidirectional and i wanted to test this, whats possible with command line and bash.
I asked Chat GPT, but the ...
-1
votes
1
answer
452
views
FreeBSD Reverse Shell Command Issue: Ambiguous Output Redirect Error
I’ve been experimenting with penetration testing recently, and I need to use reverse shell techniques for testing. I’ve previously used reverse shell on Ubuntu with the following command:
/bin/bash -i ...
12
votes
1
answer
2k
views
Odd inconsistency between executing and sourcing Bash script
I know this is not a very descriptive title (suggestions are welcome), but the fact is that I've been pulling my hair over this for hours and I have no clue where the root of the problem might lie.
I ...
0
votes
1
answer
61
views
Redirect command options to a file
From the following nc command,i would like to redirect source-server.fqdn name to the output file. By default nc command is not returning the source-server.fqdn in the output.
nc -zv -s source-server....
0
votes
1
answer
1k
views
Redirect output of current script to a socket
I am trying to debug a shell script executing on a remote server, where I do not have access to the standard output of the script. Can I redirect the output to go over a socket?
0
votes
0
answers
52
views
Why do udp requests fail temporarily
I've a UDP web server, which bound to the port 10000. I just deployed it on the server 172.20.0.10. Then I tried to scan the port nc -v -z -w2 -u 172.20.0.10 10000, it seems that everyting is OK. The ...
0
votes
0
answers
100
views
finger daemon / nc fowarding error
For an assignment I'm trying to properly send a buffer overflow exploit with ncat in order gain root access on a vulnerable machine set up by the professor. I feel I created my egg right but I keep ...
0
votes
1
answer
99
views
Weird behaviour of bash in Kali Terminal (Qt I think) - piping to nc ends with awaiting input forever
I've been trying to pipe bytecode to netcat (nc) like this:
python3 -c "import sys;bof='a'*16;bof2='a'*8;sys.stdout.buffer.write(bof.encode('ascii')+b'\xef\xbe\xad\xde'+bof2.encode('ascii')+b'\...
0
votes
1
answer
731
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 ...
0
votes
2
answers
1k
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 ...
1
vote
0
answers
2k
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 (...
2
votes
0
answers
846
views
Is there any way to send request via authenticated proxy in OpenBSD netcat (nc)?
I am using following command using the nc to connect to my server via proxy (localhost:8080). But this proxy is authenticated. I am not sure how to pass the auth details. Pls. note this is older ...
-1
votes
1
answer
2k
views
How to make nc listen for remote connections
I'm trying to listen for a remote connection but nc keeps giving me this error:
Error: Couldn't setup listening socket (err=-3)
This is the command I used:
nc -lvnp port_number -s my_public_ip
0
votes
0
answers
186
views
Userspace solution to use store data and create a UDP server
I'm trying to come up with a good way manage an intermittently connected device that I'm using for a research project. It's a sensor that goes in and out of the water. While under water, of course, ...