All Questions

Tagged with
Filter by
Sorted by
Tagged with
3
votes
1answer
48 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 ...
1
vote
2answers
632 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
1answer
479 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 ...
0
votes
2answers
83 views

xclip doesn’t send contents to netcat

I got an assignment from my teacher to try and beat a bot which sends a number each time and I need to send the exact number, but faster. I wrote a bash script: #!/bin/bash while true; do nc ip ...
1
vote
1answer
377 views

Create lock using unix socket/port

Is there a way to hold a lock a unix port using netcat or some other command? I want to do something like this: set -e; nc -lock 8000 & # this needs to fail if another process holds the lock ...
1
vote
2answers
204 views

How can i execute text as code from server to client on shell script (netcat)

I have two files, client.sh and server.sh, all the necessary data is on the server, which is sent to the client using netcat, the client just get these data and display it to the end user, the problem ...
3
votes
1answer
6k views

How can i keep netcat connection open?

I have two files, client.sh and server.sh, all the necessary data is on the server, which is sent to the client using netcat, the client just get these data and display it to the end user, the problem ...
0
votes
2answers
4k views

How to pipe a loop to one netcat connection

I'm doing a challenge where I have to feed a password (which I have) and a 4 digit passcode (which can only be found via brute-forcing all 10000 possibilities) to a netcat daemon. Currently I'm doing ...
1
vote
1answer
85 views

Security of netcat

I'm receiving complaints quite often that users can't hard-reset their VMs on my virtualization host. So I decided to set up some way of killing VM, without giving full access to QEMU console to users....
0
votes
1answer
91 views

netcat pipe running too early?

I have the following script running in the background: while true; do { file=$(/somescript); echo -ne "HTTP/1.0 200 OK\r\n\r\n"; cat $file; } | nc -l -p 20000 done It works fine, except that /...
2
votes
2answers
4k views

Store netcat output into variable

I want to store the output from an netcat function into a variable. I tried a lot of different ways, but it doesn't work to me. Can someone help me? The whole scripting thing is whole new for me! #! ...
1
vote
0answers
60 views

Ensure that file socket is already opened

I'd like to open a simple file socket that can run in background like: nc -l -k -m 10 -U my_socket -c cat & so other processes can connect into it with nc -U my_socket -c read. After this ...
0
votes
1answer
153 views

Filter for remote server response from netcat SMTP scan

I am using netcat to test if remote exchange server (lets call it exchange1) is online with this code. nc -w 3 192.168.130.17 25 I want to create a file that has that servers name if and only if the ...
1
vote
0answers
421 views

Netcat server/client for a social thread

I have been learning nc for a while now, and I decided to make a social thread server for it in bash. Surprisingly, I got it working, but I have a couple problems with it. My main problem I want to ...
1
vote
1answer
3k views

How to have netcat server close after n seconds

I need to use nc in a weird way, where I want the server to first send a file, and then recieve a file, and this repeats. I would like to have every instance of the server server close after some ...
10
votes
4answers
37k views

Test if telnet port is active within a shell script

I am trying to create a script to test whether it is possible to login via telnet. I do not want to really log in; therefore, expect is not needed. I just want to see if I am able to get a login ...
2
votes
1answer
552 views

How to avoid sending EOF from a script parsing requests from and sending answers to netcat

I made a simple server using netcat and backpipe: mkfifo backpipe nc -l 8080 < backpipe | parseRequests.sh > backpipe The contents of "parseRequests.sh" is just: #!/bin/sh if [ "$1" = "1+1" ];...