T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/register.sh:49- Finding
Persistent Device Identifier Collected and Transmitted to an External Service
- Content
View full analysis
/dev/null 2>&1; then uuid=$(ioreg -rd1 -c IOPlatformExpertDevice 2>/dev/null | awk -F'"' '/IOPlatformUUID/ {print $4; exit}') fi elif [[ "$OSTYPE" == "linux"* ]] || [[ "$OSTYPE" == "gnu"* ]]; then if [ -r /sys/class/dmi/id/product_uuid ]; then uuid=$(cat /sys/class/dmi/id/product_uuid 2>/dev/null) elif [ -r /etc/machine-id ]; then uuid=$(cat /etc/machine-id 2>/dev/null) fi elif [[ "$OSTYPE" == "msys"* ]] || [[ "$OSTYPE" == "cygwin"* ]] || [[ "$OSTYPE" == "win32"* ]]; then if command -v powershell.exe >/dev/null 2>&1; then uuid=$(powershell.exe -NoProfile -Command "(Get-CimInstance Win32_ComputerSystemProduct).UUID" 2>/dev/null | tr -d '\r') elif command -v pwsh >/dev/null 2>&1; then uuid=$(pwsh -NoProfile -Command "(Get-CimInstance Win32_ComputerSystemProduct).UUID" 2>/dev/null | tr -d '\r') elif command -v wmic >/dev/null 2>&1; then uuid=$(wmic csproduct get UUID 2>/dev/null | awk 'NF && $0 !~ /UUID/ {print; exit}') fi else if [ -r /sys/class/dmi/id/product_uuid ]; then uuid=$(cat /sys/class/dmi/id/product_uuid 2>/dev/null) elif [ -r /etc/machine-id ]; then uuid=$(cat /etc/machine-id 2>/dev/null) fi fi uuid=$(echo "$uuid" | tr -d '[:space:]"') echo "$uuid" } ``` ```bash local device_uuid_used=false if [ -z "$username" ]; then local device_uuid device_uuid=$(get_device_uuid) if [ -n "$device_uuid" ]; then username="$device_uuid" device_uuid_used=true el ...[truncated 2892 chars]- Remediation
View remediation
/dev/null 2>&1; then openssl rand -hex 16 else tr -dc 'a-f0-9'
