| 387 | //============================================================================= |
| 388 | |
| 389 | HIDDeviceProfile HIDExploitEngine::analyzeHIDDevice(NimBLEAddress target, const String &name, int rssi) { |
| 390 | HIDDeviceProfile profile; |
| 391 | profile.deviceName = name; |
| 392 | profile.rssi = rssi; |
| 393 | profile.osType = "Unknown"; |
| 394 | profile.supportsBootProtocol = false; |
| 395 | profile.supportsReportProtocol = false; |
| 396 | profile.requiresAuthentication = true; |
| 397 | profile.hasExistingBond = false; |
| 398 | profile.vendorId = 0; |
| 399 | profile.productId = 0; |
| 400 | profile.connectionBehavior = 0; |
| 401 | profile.isAppleDevice = false; |
| 402 | profile.isWindowsDevice = false; |
| 403 | profile.isAndroidDevice = false; |
| 404 | profile.isLinuxDevice = false; |
| 405 | profile.isIoTDevice = false; |
| 406 | profile.suggestedAttack = "Standard"; |
| 407 | |
| 408 | String nameLower = name; |
| 409 | nameLower.toLowerCase(); |
| 410 | |
| 411 | if (nameLower.indexOf("apple") != -1 || nameLower.indexOf("magic") != -1 || |
| 412 | nameLower.indexOf("ipad") != -1 || nameLower.indexOf("iphone") != -1 || |
| 413 | nameLower.indexOf("mac") != -1 || name.indexOf("Apple") != -1) { |
| 414 | profile.osType = "macOS/iOS"; |
| 415 | profile.isAppleDevice = true; |
| 416 | profile.suggestedAttack = "AppleSpoof"; |
| 417 | profile.requiresAuthentication = false; |
| 418 | } else if ( |
| 419 | nameLower.indexOf("surface") != -1 || nameLower.indexOf("windows") != -1 || |
| 420 | nameLower.indexOf("microsoft") != -1 || nameLower.indexOf("xbox") != -1 |
| 421 | ) { |
| 422 | profile.osType = "Windows"; |
| 423 | profile.isWindowsDevice = true; |
| 424 | profile.suggestedAttack = "WindowsBypass"; |
| 425 | profile.requiresAuthentication = true; |
| 426 | } else if ( |
| 427 | nameLower.indexOf("android") != -1 || nameLower.indexOf("google") != -1 || |
| 428 | nameLower.indexOf("pixel") != -1 || nameLower.indexOf("samsung") != -1 |
| 429 | ) { |
| 430 | profile.osType = "Android"; |
| 431 | profile.isAndroidDevice = true; |
| 432 | profile.suggestedAttack = "AndroidJustWorks"; |
| 433 | profile.requiresAuthentication = false; |
| 434 | } else if ( |
| 435 | nameLower.indexOf("linux") != -1 || nameLower.indexOf("raspberry") != -1 || |
| 436 | nameLower.indexOf("pi") != -1 |
| 437 | ) { |
| 438 | profile.osType = "Linux"; |
| 439 | profile.isLinuxDevice = true; |
| 440 | profile.suggestedAttack = "BootProtocol"; |
| 441 | profile.requiresAuthentication = false; |
| 442 | } else if ( |
| 443 | nameLower.indexOf("tv") != -1 || nameLower.indexOf("smart") != -1 || nameLower.indexOf("iot") != -1 |
| 444 | ) { |
| 445 | profile.osType = "IoT"; |
| 446 | profile.isIoTDevice = true; |