Skip to content

Commit 1adbcda

Browse files
committed
Fix Whitelist
1 parent 5f58dde commit 1adbcda

4 files changed

Lines changed: 34 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
members = ["libs/libwifi", "libs/libwifi_macros", "libs/pcap-file"]
33

44
[workspace.package]
5-
version = "0.7.4"
5+
version = "0.7.5"
66
authors = ["Ryan Butler"]
77
description = "80211 Attack Tool"
88
license = "MIT"

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,15 +354,15 @@ impl OxideRuntime {
354354
.filter_map(|f| {
355355
match MacAddress::from_str(&f) {
356356
Ok(mac) => {
357-
if targ_list.is_target_mac(&mac) {
357+
if targ_list.is_actual_target_mac(&mac) {
358358
println!("Whitelist {} is a target. Cannot add to whitelist.", mac);
359359
None
360360
} else {
361361
Some(White::MAC(WhiteMAC::new(mac)))
362362
}
363363
},
364364
Err(_) => {
365-
if targ_list.is_target_ssid(&f) {
365+
if targ_list.is_actual_target_ssid(&f) {
366366
println!("Whitelist {} is a target. Cannot add to whitelist.", f);
367367
None
368368
} else {

src/targets.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,36 @@ impl TargetList {
182182
return matches;
183183
}
184184

185+
pub fn is_actual_target_mac(&self, mac: &MacAddress) -> bool {
186+
187+
for target in &self.targets {
188+
match target {
189+
Target::MAC(tgt) => {
190+
if tgt.addr == *mac {
191+
return true;
192+
}
193+
}
194+
Target::SSID(_) => {} // do nothing
195+
}
196+
}
197+
false
198+
}
199+
200+
pub fn is_actual_target_ssid(&self, ssid: &str) -> bool {
201+
202+
for target in &self.targets {
203+
match target {
204+
Target::MAC(_) => {} // do nothing, we don't have anything to compare to here.
205+
Target::SSID(tgt) => {
206+
if tgt.match_ssid(ssid.to_owned()) {
207+
return true;
208+
}
209+
}
210+
}
211+
}
212+
false
213+
}
214+
185215
pub fn is_target_mac(&self, mac: &MacAddress) -> bool {
186216
if self.empty() {
187217
return true;

0 commit comments

Comments
 (0)