Include & add more generic hostnames to increase hostname set #6

Open
opened 2023-09-25 18:51:52 +00:00 by Pinky · 2 comments

Iphone
Chronos # ChromeOS
Macintosh.local # MacOS
My-Computer.local # MacOS
Docker Container Default hostname 12 character alpha numeric with no uppercase
https://www.digitalocean.com/community/tutorials/3-tips-for-naming-docker-containers

# VARIABLES
checktime=".5"				# seconds between mac addr checks: lower = more frequent checks
hightime="600"				# Make this number higher if you want randomization times longer
lowtime="300"				# Make this number lower to lower min time randomized
rando=$((RANDOM%$hightime+$lowtime))	# Create Random time
kernmit="on"				# Turn on to mitigate kernel (warning: passes changes to kernel) - it's optional
oui_file='/etc/wipri/final.OUI'		# Valid OUI list required for verifiable MAC addresses
phoui_file='/etc/wipri/phone.OUI' 	# phone OUI file
+ DOCKER=$(tr -dc a-z0-9 </dev/random | head -c 12) # Docker ID 12 char alpha numeric no uppercase
	array[0]="localhost" 
	array[1]="laptop" 
	array[2]="computer" 
	array[3]="DESKTOP" 
	array[4]="Owner-iPhone" 
	array[5]="PC" 
	array[6]="Toshiba"
	array[7]="WORKGROUP"
	array[8]="macbook"
	array[9]="mac"
	array[10]="phone"
-	groupnum=$[ $RANDOM % 11 ]
+	array[11]="Iphone"
+	array[12]="Chronos"
+	array[13]="Macintosh.local"
+	array[14]="My-Computer.local"
+	array[15]="$DOCKER"
+	groupnum=$[ $RANDOM % 16 ]
	hostbase=${array[$groupnum]}
	hostnamectl set-hostname $hostbase || hostname $hostbase
Iphone \ Chronos # ChromeOS Macintosh.local # MacOS My-Computer.local # MacOS Docker Container Default hostname 12 character alpha numeric with no uppercase \ https://www.digitalocean.com/community/tutorials/3-tips-for-naming-docker-containers ```diff # VARIABLES checktime=".5" # seconds between mac addr checks: lower = more frequent checks hightime="600" # Make this number higher if you want randomization times longer lowtime="300" # Make this number lower to lower min time randomized rando=$((RANDOM%$hightime+$lowtime)) # Create Random time kernmit="on" # Turn on to mitigate kernel (warning: passes changes to kernel) - it's optional oui_file='/etc/wipri/final.OUI' # Valid OUI list required for verifiable MAC addresses phoui_file='/etc/wipri/phone.OUI' # phone OUI file + DOCKER=$(tr -dc a-z0-9 </dev/random | head -c 12) # Docker ID 12 char alpha numeric no uppercase ``` ```diff array[0]="localhost" array[1]="laptop" array[2]="computer" array[3]="DESKTOP" array[4]="Owner-iPhone" array[5]="PC" array[6]="Toshiba" array[7]="WORKGROUP" array[8]="macbook" array[9]="mac" array[10]="phone" - groupnum=$[ $RANDOM % 11 ] + array[11]="Iphone" + array[12]="Chronos" + array[13]="Macintosh.local" + array[14]="My-Computer.local" + array[15]="$DOCKER" + groupnum=$[ $RANDOM % 16 ] hostbase=${array[$groupnum]} hostnamectl set-hostname $hostbase || hostname $hostbase ```

Could increase hostname set even more:

-	array[0]="localhost" 
-	array[1]="laptop" 
-	array[2]="computer" 
-	array[3]="DESKTOP" 
-	array[4]="Owner-iPhone" 
-	array[5]="PC" 
-	array[6]="Toshiba"
-	array[7]="WORKGROUP"
-	array[8]="macbook"
-	array[9]="mac"
-	array[10]="phone"
-	groupnum=$[ $RANDOM % 11 ]
- array[11]="Iphone"
- array[12]="Chronos"
- array[13]="Macintosh.local"
- array[14]="My-Computer.local"
- array[15]="$DOCKER"
- groupnum=$[ $RANDOM % 16 ]
- hostbase=${array[$groupnum]}
- hostnamectl set-hostname $hostbase || hostname $hostbase
	array[0]="localhost" 
	array[1]="laptop" 
	array[2]="computer"
+	array[3]="$WINDOWS" 
	array[4]="DESKTOP"
+	array[5]="Ubuntu"
+	array[6]="ubuntu-server"
+	array[7]="ubuntu-20.04-vm" 
	array[8]="Owner-iPhone" 
	array[9]="PC" 
	array[10]="Toshiba"
	array[11]="WORKGROUP"
+	array[12]="$Android"
+	array[13]="SAMSUNG"
	array[14]="macbook"
	array[15]="mac"
+	array[16]="Intel Corporate"
+	array[17]="$CHROME"
	array[18]="phone"
+	array[19]="Iphone"
+        array[20]="Virtual-Host-$VHnum"
+        array[21]="Android"
+	array[22]="Macintosh.local"
+	array[23]="My-Computer.local"
+	array[24]="$DOCKER"
+	array[25]="host"
+        array[26]="raspberrypi"
+	array[27]="$EC2"
-	groupnum=$[ $RANDOM % 16 ]
+	groupnum=$[ $RANDOM % 28 ]
	hostbase=${array[$groupnum]}
	hostnamectl set-hostname $hostbase || hostname $hostbase

Sources:

Android hostname of ANDROID_ID

android_<64_HEX_16_Char_String>

https://android.stackexchange.com/questions/82614/identifying-an-android-device-by-its-hostname

https://android.googlesource.com/platform/frameworks/base/+/android-7.0.0_r14/services/core/java/com/android/server/ConnectivityService.java#656

https://stackoverflow.com/questions/14491693/what-is-the-length-in-bytes-of-the-android-id

https://developer.android.com/reference/android/provider/Settings.Secure.html%23ANDROID_ID

Whonix hostname

host

In the case of Whonix, the hostname is always set to "host".

https://www.whonix.org/wiki/Hostnames

RaspberryPI OS

raspberrypi

https://www.raspberrypi.com/documentation/remote-access/ip-address.md

The default hostname on a fresh Raspberry Pi OS install is raspberrypi

AWS EC2 Hostname

When you launch an EC2 instance with a Hostname type of Resource name, the guest OS hostname is configured to use the EC2 instance ID.

i-0123456789abcdef.ec2.internal 16 alpha numeric or 16 HEX string

Format for an instance in any other AWS Region: ec2-instance-id.region.compute.internal:

i-0123456789abcdef.us-west-2.compute.internal

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html

Red Hat Virtual Host

Virtual-Host <NUMBER>

https://access.redhat.com/documentation/id-id/red_hat_enterprise_linux/5/html/deployment_guide/s2-httpd-default-settings

Ubuntu

ubuntu-20.04-vm

Most likey what a VM would look like in virtualbox and 20.04 is commonly used version of Ubuntu

https://www.virtualbox.org/manual/ch01.html#create-vm-wizard-unattended-install

Windows

Generic named windows hostnames

ChromeOS

ChromeOS_<6_digit>

default ChromeOS Linux container name is penguin

Intel Corporate

https://www.androidpolice.com/2021/07/23/google-is-giving-your-chromebook-the-nerdiest-possible-customization/

https://support.google.com/chrome/a/answer/1698333?hl=en

https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/flag-metadata.json#2992

https://www.reddit.com/r/chromeos/comments/q22dls/how_to_locate_hostname_of_chromebook/

https://www.reddit.com/r/chromeos/comments/wxkebc/penguin_name_change/

https://www.reddit.com/r/chromeos/comments/gsktr7/in_chrome_os_83_are_able_to_change_host_name/

Variables to test for yourself

not sure where you would add them?

#! /bin/bash
# Amazon EC2 ID
region=("us-east-2" "us-east-1" "us-west-1" "us-west-2" "af-south-1" "ap-east-1" "ap-south-2" "ap-southeast-3" "ap-southeast-4" "ap-south-1" "ap-northeast-3" "ap-northeast-2" "ap-southeast-1" "ap-southeast-2" "ap-northeast-1" "ca-central-1" "eu-central-1" "eu-west-1" "eu-west-2" "eu-south-1" "eu-west-3" "eu-south-2" "eu-north-1" "eu-central-2" "il-central-1" "me-south-1" "me-central-1" "sa-east-1")
RANDregion="${region[ RANDOM % ${#region[@]} ]}"
EC2region=(".ec2" "."$RANDregion".compute")
EC2final="${EC2region[ RANDOM % ${#EC2region[@]} ]}"
EC2=$(echo "i-$(tr -dc a-z0-9 </dev/urandom | head -c 16)""$(echo $EC2final)".internal)
# Android 
ANDROID_ID=$(hexdump -n8 -e'4/4 "%08X" 1 "\n"' /dev/urandom | tr "A-Z" "a-z") # Android 64 hex 16 char string
Android="android_$(echo $ANDROID_ID)"
# Windows
WIN=("windows10" "WSL" "Windows11" "Win10" "win10-vm" "wsl" "windows11" "Win11" "win11-vm" "Windows10")
WINDOWS="${WIN[ RANDOM % ${#WIN[@]} ]}"
# Virtual Host
VHnum=$(shuf -n 1 -i 0-10)  # Red Hat Virtual Host Number
# ChromeOS
CHROMEid=$(tr -dc 0-9 </dev/urandom | head -c 6)
CHROMElist=("ChromeOS" "pixelbook" "ChromeOS"_"$CHROMEid" "chromebook")
CHROME="${CHROMElist[ RANDOM % ${#CHROMElist[@]} ]}"
echo "$EC2"
echo "$Android"
echo "$WINDOWS"
echo "Virtual-Host $VHnum"
echo "$CHROME"

It may be better to use the Android HEX generation for the amazon EC2 ID 16 char string instead of the one above

**Could increase hostname set even more:** ```diff - array[0]="localhost" - array[1]="laptop" - array[2]="computer" - array[3]="DESKTOP" - array[4]="Owner-iPhone" - array[5]="PC" - array[6]="Toshiba" - array[7]="WORKGROUP" - array[8]="macbook" - array[9]="mac" - array[10]="phone" - groupnum=$[ $RANDOM % 11 ] - array[11]="Iphone" - array[12]="Chronos" - array[13]="Macintosh.local" - array[14]="My-Computer.local" - array[15]="$DOCKER" - groupnum=$[ $RANDOM % 16 ] - hostbase=${array[$groupnum]} - hostnamectl set-hostname $hostbase || hostname $hostbase ``` ```diff array[0]="localhost" array[1]="laptop" array[2]="computer" + array[3]="$WINDOWS" array[4]="DESKTOP" + array[5]="Ubuntu" + array[6]="ubuntu-server" + array[7]="ubuntu-20.04-vm" array[8]="Owner-iPhone" array[9]="PC" array[10]="Toshiba" array[11]="WORKGROUP" + array[12]="$Android" + array[13]="SAMSUNG" array[14]="macbook" array[15]="mac" + array[16]="Intel Corporate" + array[17]="$CHROME" array[18]="phone" + array[19]="Iphone" + array[20]="Virtual-Host-$VHnum" + array[21]="Android" + array[22]="Macintosh.local" + array[23]="My-Computer.local" + array[24]="$DOCKER" + array[25]="host" + array[26]="raspberrypi" + array[27]="$EC2" - groupnum=$[ $RANDOM % 16 ] + groupnum=$[ $RANDOM % 28 ] hostbase=${array[$groupnum]} hostnamectl set-hostname $hostbase || hostname $hostbase ``` ### Sources: **Android hostname of ANDROID_ID** > `android_<64_HEX_16_Char_String>` > > https://android.stackexchange.com/questions/82614/identifying-an-android-device-by-its-hostname > > https://android.googlesource.com/platform/frameworks/base/+/android-7.0.0_r14/services/core/java/com/android/server/ConnectivityService.java#656 > > https://stackoverflow.com/questions/14491693/what-is-the-length-in-bytes-of-the-android-id > > https://developer.android.com/reference/android/provider/Settings.Secure.html%23ANDROID_ID **Whonix hostname** > `host` > > In the case of Whonix, the hostname is always set to "host". > > https://www.whonix.org/wiki/Hostnames **RaspberryPI OS** > `raspberrypi` > > https://www.raspberrypi.com/documentation/remote-access/ip-address.md > > The default hostname on a fresh Raspberry Pi OS install is raspberrypi **AWS EC2 Hostname** > When you launch an EC2 instance with a Hostname type of Resource name, the guest OS hostname is configured to use the EC2 instance ID. > > `i-0123456789abcdef.ec2.internal` **16 alpha numeric or 16 HEX string** > > Format for an instance in any other AWS Region: ec2-instance-id.region.compute.internal: > > `i-0123456789abcdef.us-west-2.compute.internal` > > https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html > > https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html **Red Hat Virtual Host** > `Virtual-Host <NUMBER>` > > https://access.redhat.com/documentation/id-id/red_hat_enterprise_linux/5/html/deployment_guide/s2-httpd-default-settings **Ubuntu** > `ubuntu-20.04-vm` > > Most likey what a VM would look like in virtualbox and 20.04 is commonly used version of Ubuntu > > https://www.virtualbox.org/manual/ch01.html#create-vm-wizard-unattended-install **Windows** > Generic named windows hostnames **ChromeOS** > `ChromeOS_<6_digit>` > > default ChromeOS Linux container name is `penguin` > > `Intel Corporate` > > https://www.androidpolice.com/2021/07/23/google-is-giving-your-chromebook-the-nerdiest-possible-customization/ > > https://support.google.com/chrome/a/answer/1698333?hl=en > > https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/flag-metadata.json#2992 > > https://www.reddit.com/r/chromeos/comments/q22dls/how_to_locate_hostname_of_chromebook/ > > https://www.reddit.com/r/chromeos/comments/wxkebc/penguin_name_change/ > > https://www.reddit.com/r/chromeos/comments/gsktr7/in_chrome_os_83_are_able_to_change_host_name/ ### Variables to test for yourself > not sure where you would add them? ```shell #! /bin/bash # Amazon EC2 ID region=("us-east-2" "us-east-1" "us-west-1" "us-west-2" "af-south-1" "ap-east-1" "ap-south-2" "ap-southeast-3" "ap-southeast-4" "ap-south-1" "ap-northeast-3" "ap-northeast-2" "ap-southeast-1" "ap-southeast-2" "ap-northeast-1" "ca-central-1" "eu-central-1" "eu-west-1" "eu-west-2" "eu-south-1" "eu-west-3" "eu-south-2" "eu-north-1" "eu-central-2" "il-central-1" "me-south-1" "me-central-1" "sa-east-1") RANDregion="${region[ RANDOM % ${#region[@]} ]}" EC2region=(".ec2" "."$RANDregion".compute") EC2final="${EC2region[ RANDOM % ${#EC2region[@]} ]}" EC2=$(echo "i-$(tr -dc a-z0-9 </dev/urandom | head -c 16)""$(echo $EC2final)".internal) # Android ANDROID_ID=$(hexdump -n8 -e'4/4 "%08X" 1 "\n"' /dev/urandom | tr "A-Z" "a-z") # Android 64 hex 16 char string Android="android_$(echo $ANDROID_ID)" # Windows WIN=("windows10" "WSL" "Windows11" "Win10" "win10-vm" "wsl" "windows11" "Win11" "win11-vm" "Windows10") WINDOWS="${WIN[ RANDOM % ${#WIN[@]} ]}" # Virtual Host VHnum=$(shuf -n 1 -i 0-10) # Red Hat Virtual Host Number # ChromeOS CHROMEid=$(tr -dc 0-9 </dev/urandom | head -c 6) CHROMElist=("ChromeOS" "pixelbook" "ChromeOS"_"$CHROMEid" "chromebook") CHROME="${CHROMElist[ RANDOM % ${#CHROMElist[@]} ]}" echo "$EC2" echo "$Android" echo "$WINDOWS" echo "Virtual-Host $VHnum" echo "$CHROME" ``` *It may be better to use the Android HEX generation for the amazon EC2 ID 16 char string instead of the one above*
Pinky changed title from Add more generic hostnames to Include & add more generic hostnames to increase hostname set 2023-10-01 23:14:27 +00:00

Good references / info. Will work on some updates coming up.

Thank you for filing.

Good references / info. Will work on some updates coming up. Thank you for filing.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: RightToPrivacy/wipri#6
There is no content yet.