Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catches wifi down exception and cycles epoch #1003

Merged
merged 1 commit into from
Jun 4, 2021

Conversation

troystauffer
Copy link
Contributor

Description

It has come up in several community threads that when attempting to use the wifi adapter to connect to a network, even after pausing Bettercap, the main loop will continue to call agent.recon(), causing a JSON decoding exception to be thrown with no chance to recover.

This change allows the main loop to continue running, just with a pause, but by advancing to the next epoch, it triggers all the normal plugin hooks so that plugin code will have an opportunity to restart Bettercap once the wifi adapter can be freed up.

Motivation and Context

Addresses this issue: #207

  • I have raised an issue to propose this change (required)

How Has This Been Tested?

Tested on Raspberry Pi Zero W with pwnagotchi 1.5.5. Tested with a custom plugin that manipulates the availability of the wifi adapter, then restores the Bettercap wifi recon after disconnecting wifi. This small change is all that was required to support that plugin.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

@evilsocket evilsocket merged commit a5d5533 into evilsocket:master Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants