Pwnagotchi: [BUG] Pwnagotchi trying to push handshakes while server is down

Created on 19 Nov 2019  路  7Comments  路  Source: evilsocket/pwnagotchi

Describe the bug
When the pwnagotchi detects an internet connection, it tries to upload handshakes. When the website is not responsive, this results in the pwnagotchi doing an accidental DDoS attack and blowing up the log. The screen also starts flipping and shows false information (2/26 sent, 4/28 sent)

To Reproduce
Steps to reproduce the behavior:

  1. Get some handshakes
  2. Point the config in such a way that it uploads handshakes to a non-existing website (or a non-responsive website)
  3. Check the logging

Expected behavior
When the upload of any handshake fails, a longer cooldown is needed before attempting again (eg 5 minutes).

Environment (please complete the following information):

  • Pwnagotchi version - 1.3.0
  • OS version - Default
  • Type of hardware - Raspi Zero W
  • Any additional hardware used - Wavescreen2

Additional context
This seems to only happen when the website is not responding, a "failure to connect" occurs after 30 seconds.

bug

Most helpful comment

After a lot of issues I found out that the offending line might be this one:

https://github.com/evilsocket/pwnagotchi/blob/9b594f7fb234d01808cc0ba286a51e8af056c9df/bin/pwnagotchi#L42

As soon as this one gets triggered (every 5 seconds), it boots up another handshake upload...

All 7 comments

The website is always responding and so is the API (you can check here https://pwnagotchi.ai/map/) ... i think sometimes it's the connectivity that prevents it from connecting ... what is the line that's filling the logs?

"Connection time-out while sending handshake to wpa-sec.stanev.org" repeated multiple times. Also multiple handshakes being uploaded at the same time. Might be caused by "on_internet_available()" being called multiple times in a row...

The wpa-sec plugin adds the handshakes which got an error to the skip-list. So, you should see the connection-timeout only once per handshake. Isn't that the case?

The plugin "assumes" that the connectivity is given, because, well...on_internet_available is called :D

What I see is a case of "threading" causing the issue: on_internet_available seems to be called multiple times, which causes multiple connection attempts at the same time. At one moment I had 5 simultaneous upload attempts before the website dropped...

I'm having the same, mostly on the pi3 but also on the pi0. On the pi3 is more often because I seem to have BT problems on that device, so it often disconnects from internet, and from the WebUI I've seen up to three uploaders running together (different total number of nets to be reported).

After a lot of issues I found out that the offending line might be this one:

https://github.com/evilsocket/pwnagotchi/blob/9b594f7fb234d01808cc0ba286a51e8af056c9df/bin/pwnagotchi#L42

As soon as this one gets triggered (every 5 seconds), it boots up another handshake upload...

If it's worth the same happens for other plugins as well. I was reading the logs during an automatic upgrade and while pwnagotchi issued reboot another instance of the plugin was fetching the release file

Was this page helpful?
0 / 5 - 0 ratings

Related issues

evilsocket picture evilsocket  路  8Comments

evilsocket picture evilsocket  路  7Comments

myasn1k picture myasn1k  路  7Comments

sayak-brm picture sayak-brm  路  3Comments

jeffedstrom picture jeffedstrom  路  4Comments