| 280 | return byteCount == 6; |
| 281 | } |
| 282 | void ARPScanner::afterScanOptions(const Host &host) { |
| 283 | int opt = 0; |
| 284 | IPAddress gw = gateway; |
| 285 | options = { |
| 286 | {"Host info", |
| 287 | [=]() { |
| 288 | HostInfo( |
| 289 | host, wifiConnected |
| 290 | ); // At this point we are sure that if user use WiFi is connected for sure |
| 291 | }}, |
| 292 | #ifndef LITE_VERSION |
| 293 | {"SSH Connect", lambdaHelper(ssh_setup, host.ip.toString())}, |
| 294 | #endif |
| 295 | {"Station Deauth", |
| 296 | [=]() { |
| 297 | if (!wifiConnected) { |
| 298 | displayError("Station deauth not available on ethernet"); |
| 299 | } else { |
| 300 | stationDeauth(host); |
| 301 | } |
| 302 | }}, |
| 303 | {"ARP Spoofing", |
| 304 | [this, host, gw]() { |
| 305 | auto it = std::find_if(hostslist_eth.begin(), hostslist_eth.end(), [this](const Host &host) { |
| 306 | return host.ip == gateway; |
| 307 | }); |
| 308 | |
| 309 | uint8_t mac[6]; |
| 310 | esp_err_t err = esp_netif_get_mac(esp_net_interface, mac); |
| 311 | if (err == ESP_OK) { |
| 312 | uint8_t gw_mac[6]; |
| 313 | macStringToByteArray((*it).mac.c_str(), gw_mac); |
| 314 | ARPSpoofer(host, gw, gw_mac, mac, false); |
| 315 | } else { |
| 316 | ESP_LOGE("MAC Address", "Failed to get MAC address: %s", esp_err_to_name(err)); |
| 317 | } |
| 318 | }}, |
| 319 | #if !defined(LITE_VERSION) |
| 320 | {"ARP Poisoning", [this]() { ARPoisoner{gateway}; }}, |
| 321 | {"DHCP Starvation", [=]() { DHCPStarvation(); }}, |
| 322 | {"MAC Flooding", [=]() { MACFlooding(); }}, |
| 323 | #endif |
| 324 | }; |
| 325 | // if(sdcardMounted && bruceConfig.devMode) options.push_back({"ARP MITM (WIP)", [&](){ opt=5; }}); |
| 326 | loopOptions(options); |
| 327 | if (opt == 5) { |
| 328 | Serial.println("Starting MITM"); |
| 329 | // arpSpoofing(host, true); |
| 330 | } |
| 331 | } |
| 332 | #endif |
nothing calls this directly
no test coverage detected