tmux and netcat listener Linux question
-
Hello all,
Recently I picked up a new NB-IoT project, and started playing around again, with Linux and some NB-IoT and CAT-M1 devices.
There are somethings I don’t understand. Maybe someone here does.
I created some listeners and parsers on a Linux machine. I configure 2 devices to connect to them. It is all quick and dirty coding, but I get the devices to connect and send data.
On linux, I listen to TCP and I redirect incoming data to a file with
with the commandnetcat -k -l [port] > netcat.pcap
I start the listener with
tmux
so that I can detach from the session and keep the listener running headless-
It seems that one listener can only serve one device. Is that correct? I am used to Apache Webserver, that can handle as many devices (browsers) that you want. But that is HTTP. If I point 2 devices to the same port, I get only the data from 1 device. Or am I doing something wrong / thinking in the wrong direction?
-
Another question. each device connects to it’s own port. For current testing, that is good enough. (remember, I run the listener headless.) Yet it also seems the listener can get ‘corrupted’ or so. I then need to restart the netcat listener. Does anyone have any experience with this?
Thank you.
Adriaan
-
-
Hi Adriaan,
Yes, thats true. I also made the same observations. For such “advanced” testing purposes, I strongly recommend to use python using the socket library. The easiest way would be to start a new thread for each incoming device and a more advanced setup would be with one thread for incoming traffic and one thread for outgoing traffic using asyncio.
BR,
Kolja -
@Kolja-Vornholt Thank you, Kolja!
I am going to look at python. Still, I would expect that when a device has done it’s work, it should nicely close the TCP session and the listerer should be ‘ready for next connection’.
(It’s logical that a listener van not handle 2 devices on the same port at the same time, of course)
Do you also have experience with the listener getting ‘corrupted’? My listener seems perfectly stable as long as my IoT device does not connect to it
-
@Adriaan This thread continues here:
https://forum.iotcreators.com/topic/716/tcp-listener-seems-to-be-killed-or-stalled/9
-
@Adriaan This post continues here: click link
(Why can we not edit posts?)
-
@Adriaan said in tmux and netcat listener Linux question:
Hello all,
Recently I picked up a new NB-IoT project, and started playing around again, with Linux and some NB-IoT and CAT-M1 devices.
There are somethings I don’t understand. Maybe someone here does.
I created some listeners and parsers on a Linux machine. I configure 2 devices to connect to them. It is all quick and dirty coding, but I get the devices to connect and send data.
On linux, I listen to TCP and I redirect incoming data to a file with
with the commandnetcat -k -l [port] > netcat.pcap
I start the listener with
tmux
so that I can detach from the session and keep the listener running headless-
It seems that one listener can only serve one device. Is that correct? I am used to Apache Webserver, that can handle as many devices (browsers) that you want. But that is HTTP. If I point 2 devices to the same port, I get only the data from 1 device. Or am I doing something wrong / thinking in the wrong direction?
-
Another question. each device connects to it’s own port. For current testing, that is good enough. (remember, I run the listener headless.) Yet it also seems the listener can get ‘corrupted’ or so. I then need to restart the netcat listener. Does anyone have any experience with this?
Thank you.
Adriaan
Im looking for instructions to see how I can use Netcat to listen in on suspicious portsneed. I found nclistener in cloudzy netcat listener blog as a solution but is it essential to run it as “super-user” (sudo) or its possible with linux terminal?
-
-
@Adriaan said in tmux and netcat listener Linux question:
@Adriaan This post continues here: click link
(Why can we not edit posts?)
I find new source , but I dont know how reliable it is : https://cloudzy.com/knowledge-base/netcat-listener/, Can anyone help me?
-
@aliza-izaton As mentioned earlier, I strongly recommend using a python-based solution.