AleksaMCode / Preferred-Network-List-Sniffer

A reconnaissance tool for capturing and displaying SSIDs from device's Preferred Network List.
MIT License
139 stars 7 forks source link

[BUG] Short-lived Connection in sniffer causes restart too often #6

Closed AleksaMCode closed 8 months ago

AleksaMCode commented 8 months ago

Is there an existing issue for this?

System information

  1. Kali Linux
  2. 2023.3
  3. Raspberry Pi 4

Actual Behavior

Every 50 seconds, the socket connection is closed, and its recovery is dependent on packet capturing. If the socket is closed, the sniffer won't know this until it tries to send captured data (in the try-catch block). After, the sniffer will create a new socket connection.

Expected Behavior

Keeping the connection open, reconnect if need, transparently without opening another socket.

Steps To Reproduce

  1. Start the Redis server
  2. Start the Web server
  3. Start the React server
  4. Start the sniffer
  5. Wait for socket to disconnect
  6. 🔁 Repeat 4 & 5

Anything else?

A Short-lived Connection should be replaced with a Long-lived Connection in the sniffer.py. It's more expensive to re-open the connection frequently than keeping the connection open.