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] Unhandled exception in sniffer #2

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

The thread is terminated due to the Exception which occurs when the socket connection is closed unexpectedly and abruptly. The WebSocketConnectionClosedException with a message "socket is already closed" occurs when the thread tries to send data through the closed socket connection. The Exception is captured in a try-catch block but due to the while loop in which it is placed, the new sniffer thread is constantly being created making the program doomed to repeat its mistake over and over again like it is a Groundhog Day.

Expected Behavior

To stop the thread which is sniffing packets in a non-violent way and possibly try to reconnect to the web server before sending more data.

Steps To Reproduce

  1. Start the Redis server
  2. Start the Web server
  3. Start the React server
  4. Start the sniffer

Anything else?

Here is a screenshot of the error. Screenshot_2023-12-15_19-38-04