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

airodump-ng: add support for '--exclude-bssid' option #2463

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gemesa
Copy link
Contributor

@gemesa gemesa commented Feb 21, 2023

Fixes #796

Added support for --exclude-bssid or -X option. Updated airodump-ng --help and man airodump-ng also. Replaced some BSSID related Notice: ... messages with Error: .... The second part in the linked issue is already implemented (--essid-regex).

Test measurements (always sorted by BSSID):

$ sudo ./airodump-ng wlan0mon -c 1

image

$ sudo ./airodump-ng wlan0mon -c 1 -d D2:21:F9:00:00:00 --netmask FF:FF:FF:00:00:00

image

$ sudo ./airodump-ng wlan0mon -c 1 -X D2:21:F9:00:00:00 --netmask FF:FF:FF:00:00:00

image

$ sudo ./airodump-ng wlan0mon -c 1 -d D2:21:F9:XX:XX:XX -d 22:E8:29:XX:XX:XX

image

$ sudo ./airodump-ng wlan0mon -c 1 -X D2:21:F9:XX:XX:XX -X D2:21:F9:XX:XX:XX -X D2:21:F9:XX:XX:XX -X D2:21:F9:XX:XX:XX

image

$ sudo ./airodump-ng wlan0mon --netmask FF:FF:FF:00:00:00                                                        
Error: specify "--bssid" or "--exclude-bssid" with "--netmask"
"/home/gemesa/git-repos/aircrack-ng/.libs/airodump-ng --help" for help.

@gemesa
Copy link
Contributor Author

gemesa commented Feb 21, 2023

Hm... the style check action keeps getting cancelled for some reason.

@Mister-X-
Copy link
Collaborator

I'm guessing it was because this was still using ubuntu 18.04. I just updated it to 22.04, but it disappeared from the checks.

@gemesa
Copy link
Contributor Author

gemesa commented Feb 21, 2023

Did a force push, lets see.

@@ -103,6 +103,9 @@ It will only show networks matching the given encryption. Note that WPA is a sho
.I -d <bssid>, --bssid <bssid>
It will only show networks, matching the given bssid. May be specified more than once: \(aq\-d 0D:F7:E2:61:C6:6D \-d 5B:62:A1:83:00:A8\(aq
.TP
.I -X <bssid>, --exclude-bssid <bssid>
It will show all networks, except the one matching the given bssid. May be specified more than once: \(aq\-X 0D:F7:E2:61:C6:6D \-X 5B:62:A1:83:00:A8\(aq
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BSSID should be uppercase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it for --bssid and --netmask also, so it is consistent

" --exclude-bssid\n"
" <bssid> : Similar to --bssid but excludes the AP,\n"
" you can pass multiple --exclude-bssid "
"options\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix Indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what it looks like:

$ ./airodump-ng --help
...
      --write-interval
                  <seconds> : Output file(s) write interval in seconds
      --background <enable> : Override background detection.

  Filter options:
      --encrypt   <suite>   : Filter APs by cipher suite,
                              you can pass multiple --encrypt options
      --netmask <netmask>   : Filter APs by mask
      --bssid     <bssid>   : Filter APs by BSSID,
                              you can pass multiple --bssid options
      --exclude-bssid
                  <bssid>   : Similar to --bssid but excludes the AP,
                              you can pass multiple --exclude-bssid options
      --essid     <essid>   : Filter APs by ESSID,
                              you can pass multiple --essid options
...

Writing --exclude-bssid <bssid> in one line would be too long so it would not fit, thats why I split it similarly to --write-interval. If you meant shifting it so there will be only 1 space between <bssid> and :, I updated it:

$ ./airodump-ng --help
...
      --exclude-bssid
                    <bssid> : Similar to --bssid but excludes the AP,
                              you can pass multiple --exclude-bssid options
...

@@ -6530,7 +6577,22 @@ int main(int argc, char * argv[])
}
else
{
printf("Notice: invalid bssid\n");
printf("Error: invalid bssid\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BSSID should be uppercase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated it for --bssid also, so it is consistent

@gemesa gemesa force-pushed the airodump-xbssid branch 2 times, most recently from 0c21f3a to 607db32 Compare February 22, 2023 08:24
@gemesa gemesa mentioned this pull request Feb 22, 2023
1 task
@gemesa gemesa force-pushed the airodump-xbssid branch 2 times, most recently from 0fc78cd to 6d63b5f Compare February 23, 2023 18:30
@gemesa
Copy link
Contributor Author

gemesa commented Feb 23, 2023

Now at least all 4 macOS CI fail consistently, not only 1 or 2 of them (see #2465 for reference).

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.

Add filter support to airodump-ng
2 participants