1
1
I set up nc on some computers in my office. They're connecting to our server like so:
nc 192.168.1.2 3291 -e cmd
Does anyone know how to list incoming connection attempts rather than accept one? Not:
nc -l 192.168.1.2 3291
EDIT: Listing part solved, using tcpdump. Remaining part of question:
How to accept a connection in nc from a specific host only? i.e., 192.168.1.6
, 192.168.1.7
, and 192.168.1.8
are all asking to connect, and we only want to talk to 192.168.1.7
. Is there any way to do this with nc?
Thanks, any way to single a client out and connect to it with nc? – Megsi – 2013-02-19T03:13:48.343
you can single a client out using the pcap syntax: tcpdump -i any tcp port 3291 and host 1.2.3.4 – replay – 2013-02-19T03:15:46.187
but how do you want to connect to it? if you have an nc server running and listening there, you can connect back using nc – replay – 2013-02-19T03:16:17.107
btw. if you want to know more about the filters in tcpdump, this manpage is very helpful
man 7 pcap-filter
– replay – 2013-02-19T03:21:22.3901preferably like
nc -l 192.168.1.2 3291 --CLIENT-TO-CONNECT
– Megsi – 2013-02-19T03:23:05.083I'm using
sudo tcpdump -i en1 -vv tcp port 3291
to pick up the packets atm. Thanks. Just need to figure out how to accept a specific connection from one machine with nc. – Megsi – 2013-02-19T03:25:10.363