Align device ID with MAC profile OUI for consistent network identity

Device ID is now a MAC-format hex string (12 chars) using the same
OUI as the randomly selected device profile. If the device gets an
Amazon OUI for its MAC, the device ID starts with fc65de. Hostname,
MAC, and device ID all point to the same vendor — no inconsistency
for anyone watching the network.
This commit is contained in:
Cobra
2026-04-07 14:48:22 -04:00
parent d8de49a53d
commit 84f0775f76
+69 -65
View File
@@ -221,79 +221,83 @@ else
error "Invalid SSH option"
fi
# Device ID — no tool fingerprint in default
step "Device ID"
DEFAULT_DEVICE_ID=$(cat /proc/sys/kernel/random/uuid | tr -d '-' | cut -c1-10)
prompt_default device_id "Device label (e.g. a3f2c19d08)" "$DEFAULT_DEVICE_ID"
DEVICE_ID="$device_id"
# Hostname — pick from MAC device profiles (matches MAC identity)
step "Hostname"
# Device identity — pick profile first, derive hostname + device ID from same OUI
step "Device Identity"
PROFILE_NAMES=(
"Fire TV Stick 4K|amazon-firetv"
"Fire TV Stick Lite|amazon-lite"
"Fire TV Cube|amazon-cube"
"Roku Ultra|roku-ultra"
"Roku Express|roku-express"
"Chromecast|chromecast"
"Chromecast with Google TV|chromecast-gtv"
"Apple TV 4K|apple-tv-4k"
"Apple TV HD|apple-tv-hd"
"Samsung Smart TV|samsung-tv"
"Samsung QLED TV|samsung-qled"
"LG webOS TV|lg-tv-webos"
"LG OLED TV|lg-tv-oled"
"Vizio SmartCast TV|vizio-tv"
"TCL Roku TV|tcl-tv"
"Sony Bravia Android TV|sony-tv"
"Sonos One|sonos-one"
"Sonos Beam|sonos-beam"
"Google Home Mini|google-home"
"Google Nest Hub|google-nest"
"Echo Dot|echo-dot"
"Echo Show|echo-show"
"Ring Doorbell|ring-doorbell"
"Nest Thermostat|nest-thermo"
"Nest Protect|nest-protect"
"Philips Hue Bridge|philips-hue"
"TP-Link Kasa Smart Plug|tplink-kasa"
"Wyze Cam v3|wyze-cam"
"Ecobee Thermostat|ecobee-thermo"
"Roomba i7|roomba-i7"
"Roomba j7|roomba-j7"
"Raspberry Pi IoT Sensor|raspberrypi-sensor"
"Raspberry Pi IoT Gateway|raspberrypi-gateway"
"Raspberry Pi IoT Controller|raspberrypi-ctrl"
"HP LaserJet Pro|hp-laserjet"
"HP OfficeJet Pro|hp-officejet"
"Brother HL-L2350DW|brother-hl"
"Brother MFC-L2750DW|brother-mfc"
"Brother DCP-L2550DW|brother-dcp"
"Epson EcoTank ET-4760|epson-ecotank"
"Canon PIXMA G6020|canon-pixma"
"Xbox Series X|xbox-series-x"
"PlayStation 5|ps5"
"PlayStation 4|ps4"
"Nintendo Switch|nintendo-switch"
"iPhone 15 Pro|iphone-15"
"iPad Air|ipad-air"
"Galaxy Tab S9|galaxy-tab"
"Galaxy S24|galaxy-s24"
"UniFi AP|unifi-ap"
"USG Gateway|usg-gateway"
"TP-Link Archer AX50|archer-ax50"
"TP-Link Deco M5|deco-m5"
"Netgear Orbi|orbi"
"Netgear Nighthawk|nighthawk"
"Fire TV Stick 4K|amazon-firetv|FC:65:DE"
"Fire TV Stick Lite|amazon-lite|FC:65:DE"
"Fire TV Cube|amazon-cube|FC:65:DE"
"Roku Ultra|roku-ultra|B8:3E:59"
"Roku Express|roku-express|B8:3E:59"
"Chromecast|chromecast|54:60:09"
"Chromecast with Google TV|chromecast-gtv|54:60:09"
"Apple TV 4K|apple-tv-4k|F0:B4:79"
"Apple TV HD|apple-tv-hd|F0:B4:79"
"Samsung Smart TV|samsung-tv|8C:79:F0"
"Samsung QLED TV|samsung-qled|8C:79:F0"
"LG webOS TV|lg-tv-webos|A8:23:FE"
"LG OLED TV|lg-tv-oled|A8:23:FE"
"Vizio SmartCast TV|vizio-tv|00:E0:36"
"TCL Roku TV|tcl-tv|54:B7:B2"
"Sony Bravia Android TV|sony-tv|F0:D7:AA"
"Sonos One|sonos-one|94:9F:3E"
"Sonos Beam|sonos-beam|94:9F:3E"
"Google Home Mini|google-home|54:60:09"
"Google Nest Hub|google-nest|54:60:09"
"Echo Dot|echo-dot|FC:65:DE"
"Echo Show|echo-show|FC:65:DE"
"Ring Doorbell|ring-doorbell|B0:09:DA"
"Nest Thermostat|nest-thermo|18:B4:30"
"Nest Protect|nest-protect|18:B4:30"
"Philips Hue Bridge|philips-hue|00:17:88"
"TP-Link Kasa Smart Plug|tplink-kasa|50:C7:BF"
"Wyze Cam v3|wyze-cam|2C:AA:8E"
"Ecobee Thermostat|ecobee-thermo|44:61:32"
"Roomba i7|roomba-i7|80:91:33"
"Roomba j7|roomba-j7|80:91:33"
"Raspberry Pi IoT Sensor|raspberrypi-sensor|DC:A6:32"
"Raspberry Pi IoT Gateway|raspberrypi-gateway|DC:A6:32"
"Raspberry Pi IoT Controller|raspberrypi-ctrl|DC:A6:32"
"HP LaserJet Pro|hp-laserjet|3C:D9:2B"
"HP OfficeJet Pro|hp-officejet|3C:D9:2B"
"Brother HL-L2350DW|brother-hl|00:80:77"
"Brother MFC-L2750DW|brother-mfc|00:80:77"
"Brother DCP-L2550DW|brother-dcp|00:80:77"
"Epson EcoTank ET-4760|epson-ecotank|00:26:AB"
"Canon PIXMA G6020|canon-pixma|00:1E:8F"
"Xbox Series X|xbox-series-x|7C:1E:52"
"PlayStation 5|ps5|BC:60:A7"
"PlayStation 4|ps4|BC:60:A7"
"Nintendo Switch|nintendo-switch|98:B6:E9"
"iPhone 15 Pro|iphone-15|3C:22:FB"
"iPad Air|ipad-air|3C:22:FB"
"Galaxy Tab S9|galaxy-tab|8C:BE:BE"
"Galaxy S24|galaxy-s24|8C:BE:BE"
"UniFi AP|unifi-ap|24:A4:3C"
"USG Gateway|usg-gateway|24:A4:3C"
"TP-Link Archer AX50|archer-ax50|50:C7:BF"
"TP-Link Deco M5|deco-m5|50:C7:BF"
"Netgear Orbi|orbi|9C:3D:CF"
"Netgear Nighthawk|nighthawk|9C:3D:CF"
)
PROFILE_IDX=$(( RANDOM % ${#PROFILE_NAMES[@]} ))
SELECTED_PROFILE="${PROFILE_NAMES[$PROFILE_IDX]}"
PROFILE_DISPLAY="${SELECTED_PROFILE%%|*}"
DEFAULT_HOSTNAME="${SELECTED_PROFILE##*|}"
echo -e " Profile: ${BOLD}${PROFILE_DISPLAY}${NC}"
_prest="${SELECTED_PROFILE#*|}"
DEFAULT_HOSTNAME="${_prest%%|*}"
PROFILE_OUI="${SELECTED_PROFILE##*|}"
echo -e " Profile: ${BOLD}${PROFILE_DISPLAY}${NC} (OUI: ${PROFILE_OUI})"
prompt_default bb_hostname "Hostname" "$DEFAULT_HOSTNAME"
BB_HOSTNAME="$bb_hostname"
# Device ID derived from same profile OUI — MAC-format, consistent with network identity
OUI_CLEAN=$(echo "$PROFILE_OUI" | tr -d ':' | tr '[:upper:]' '[:lower:]')
RAND_SUFFIX=$(printf '%02x%02x%02x' $(( RANDOM % 256 )) $(( RANDOM % 256 )) $(( RANDOM % 256 )))
DEFAULT_DEVICE_ID="${OUI_CLEAN}${RAND_SUFFIX}"
prompt_default device_id "Device ID" "$DEFAULT_DEVICE_ID"
DEVICE_ID="$device_id"
# Auto-start mode
step "Auto-start Mode on Boot"
echo " [1] Passive only (capture + analysis, no active offense)"