-
Notifications
You must be signed in to change notification settings - Fork 404
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
--filterlist_ap does not filter #116
Comments
You have forgotten the (mandatory) filter mode: From the help menu:
so you have to add --filtermode=2 Please notice: If you don't want this behavior, you must use the Berkeley Packet Filter:
Please notice: |
Dear me! You're right, I overlooked that. Thank you. |
The BPF is very powerful and extreme fast, because it is running inside the kernel space. The packets are filtered out, before they reach hcxdumptool. That means that running BPFC is more strict, than running filterlist in combination with filtermode. |
I'm probably doing something wrong, but I keep beeing disconnected even though I added MAC into protect.bpf like so:
My |
The source of the filtercode is not correct. You mus add AP to wlan addr1 and wlan addr2. The same applies to the client.
Example 2:
explanation: BTW: Please notice: |
I see, I misunderstood the logic of addrX (I thought it's just enumeration). Now I got it. |
No problem, you're welcome. |
BTW: |
Agh, after 3 years I still run into the same problem. So I have an external USB wifi adapter A1 (Alfa something) connected to my PC and I'd like to avoid getting disconnected while running hcxdumptool on an OrangePI 3 with another USB Alfa adapter A2 put into the unmanaged mode. On my PC I ran
and got
Soon I realized that I need to switch the interface to the monitor mode (after I read the help of hcxdumptool carefully). I was thinking of the Update 1. The tcpdump command should be issued on the device from which the attacks are performed - on orange pi, in my case. It does not alter the meaning of the rest of the discussion. |
On second thought, such an option might be better suited as a separate command of your HCX tools ecosystem because it should be able to merge the results from parsing 22000/pcapng files with a previously saved BPF file. |
In either case, switching to the monitor mode and back can be made inside the tool transparently for the users. |
To give you an idea of what I'm currently doing on python: rules = [f"not wlan addr1 {m} and not wlan addr2 {m}" for m in macs]
tcprules_gen_string = f"tcpdump -i white {' and '.join(rules)} -ddd > protect.bpf" |
Please read this: Than you understand that a BPF is (much) more than adding simple rules. A BPF is a form of instructions for a virtual machine, which are interpreted, or compiled into machine code by a just-in-time (JIT) mechanism and executed, in the kernel. BTW: Your python solution is nice, but I don't want to hard code a tcpdump or a libpcap dependency to hcxdumptool. hcxpcapngtool is a tool that get information from a dump file and to store this information to other files on which other tools (hcxhashtool, hashcat or JtR) can work on. Using a BPF on the dump file doesn't make sense, because the entire filtering is provided by hcxhashtool (which take care about the special requirements of hashcat and JtR). BTW: I don't want to bloat the code unnecessarily. You may have noticed that hcxdumptool is going back to the roots (since v 6.3.0). |
An example that shows the complexity of generating BPF code. We want to allow bradcast frames by BPF: Such a simple thing: will become in assembly language:
or c language:
and decimal count, accepted by hcxdumptool:
As mentioned above, there are a lot of good tools that can do it much better than I could ever do. |
What I actually mean is not to rewrite tcpdump from scratch in C (which of course is not worth the trouble) but instead, just come up with a wrapper command that utilizes tcpdump internally given a list of MACs (or a list of .22000/pcapng to extract MACs from) - just like I showed with Python. Since I have already come up with such Python code, I'll probably just use it as it serves the needs I'm trying to describe. It will still require me to parse MACs from 22000 but I can extend this simple Python program to do it as well. I do understand why you refrain from adding it to your tool though. It was just an idea. |
Please take a look at add3. On several cases it can be used instead of a combination of addr1 & addr2. Also please take a look at tshark (e.g. to get MAC addresses from dump files).
There are good tools (tshark which is 100% compatible to hcxdumptool, tcpdump, bpf-tools, scapy) to collect all information. A python script (like yours - which is a good idea) can be used to put them all together. Pearl, java, php scripts can do the same. BTW: |
A BPF can be powerful and fast. Mostly I use this an advanced BPF like this one:
or in tcpdump high level syntax: Purpose is to filer out unwanted control frames. That reduce CPU cycles of hcxdumtool. The possibility to include this kind of filer code makes hcxdumptool very flexible - much more than a hard coded wrapper can ever do. |
I hardly believe that anyone knows about it. Perhaps a cheat sheet of such BPF rules on your Wiki would not hurt. |
As mentioned in README.md section requirements: and |
Hi, I experience an issue with limiting capturing (and what is more important, sending deauth and flooding the network) to only one particular AP.
I saved 1 AP mac that I got from
--do_racscan
into a file like thisOf course, I put a different mac address. I tried with a breaking line at the end and without. The AP is on channel
1
. Then I run your tool like thisand it immediately shows me
But it seems that the tool ignores the
--filterlist_ap
option because it captures the packets from other APs that are not specified in theap-mac
file list. I take the info by runninghcxhashtool --info=stdout
followed byhcxpcapngtool
.I've run
--check_driver
and--check_injection
tests with success.Am I doing something wrong?
The text was updated successfully, but these errors were encountered: