Fix Monitor Mode Detection for Various Network Adapters #58
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This update resolves an issue where the script was not compatible with many popular network adapters, such as the TP-Link WN722N. These adapters retain the same interface name in both managed and monitor modes, meaning they do not append "mon" at the end (e.g.,
wlan0
remainswlan0
in monitor mode, instead ofwlan0mon
).Previously, the script assumed that the monitor mode interface would always be named
wlanXmon
, which caused compatibility issues. This update introduces a feature that automatically finds the correct monitor mode version of the selected interface, making it compatible with adapters using different naming conventions.Changes
Demonstration
Example 1: Adapter that appends "mon"
Actual Interface Name:
wlan0 (Managed Mode) → wlan0mon (Monitor Mode)
Expected Detection:
Monitor mode interface detected: wlan0mon
Example 2: Adapter that keeps the same name
Actual Interface Name:
wlan0 (Managed Mode) → wlan0 (Monitor Mode)
Expected Detection:
Monitor mode interface detected: wlan0
Example 3: Multiple interfaces
Actual Interface Names:
wlan1 (Managed Mode) → wlan1mon (Monitor Mode)
wlan2 (Managed Mode) → wlan2 (Monitor Mode)
Expected Detection:
Monitor mode interface detected: wlan1mon
Monitor mode interface detected: wlan2
This fix enhances the script's flexibility and compatibility, making it more reliable across different network adapters.