Deprecated mac-address-prefixes

This commit is contained in:
Sun Knudsen 2022-03-10 07:32:45 -05:00
parent ac37c9c7a2
commit 7ff0380263
No known key found for this signature in database
GPG Key ID: 02C43AD072D57783
4 changed files with 2075 additions and 2839 deletions

View File

@ -41,21 +41,13 @@ source ~/.zshrc
### Step 3: download [first-names.txt](./first-names.txt)
This list includes the top 2048 most popular baby names from the [USA Social Security Administration](https://www.ssa.gov/oact/babynames/limits.html).
This list includes top 2048 most popular names for people aged 25 from the [USA Social Security Administration](https://www.ssa.gov/oact/babynames/limits.html) (last [updated](./misc/update-first-names.sh) on March 9th 2022).
```shell
curl --fail --output /usr/local/sbin/first-names.txt https://raw.githubusercontent.com/sunknudsen/privacy-guides/master/how-to-spoof-mac-address-and-hostname-automatically-at-boot-on-macos/first-names.txt
```
### Step 4: download [mac-address-prefixes.txt](./mac-address-prefixes.txt)
This list includes 768 Apple MAC address prefixes.
```shell
curl --fail --output /usr/local/sbin/mac-address-prefixes.txt https://raw.githubusercontent.com/sunknudsen/privacy-guides/master/how-to-spoof-mac-address-and-hostname-automatically-at-boot-on-macos/mac-address-prefixes.txt
```
### Step 5: create `spoof.sh` script
### Step 4: create `spoof.sh` script
```shell
cat << "EOF" > /usr/local/sbin/spoof.sh
@ -79,9 +71,9 @@ sudo scutil --set HostName "$host_name"
printf "%s\n" "Spoofed hostname to $host_name"
# Spoof MAC address of Wi-Fi interface
mac_address_prefix=$(sed "$(jot -r 1 1 768)q;d" $basedir/mac-address-prefixes.txt | sed -e 's/[^A-F0-9:]//g')
mac_address_prefix=$(networksetup -listallhardwareports | awk -v RS= '/en0/{print $NF}' | head -c 8)
mac_address_suffix=$(openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//')
mac_address=$(echo "$mac_address_prefix:$mac_address_suffix" | awk '{print toupper($0)}')
mac_address=$(echo "$mac_address_prefix:$mac_address_suffix" | awk '{print tolower($0)}')
networksetup -setairportpower en0 on
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --disassociate
sudo ifconfig en0 ether "$mac_address"
@ -89,13 +81,13 @@ printf "%s\n" "Spoofed MAC address of en0 interface to $mac_address"
EOF
```
### Step 6: make `spoof.sh` executable
### Step 5: make `spoof.sh` executable
```shell
chmod +x /usr/local/sbin/spoof.sh
```
### Step 7: create `local.spoof.plist` launch daemon
### Step 6: create `local.spoof.plist` launch daemon
```shell
cat << "EOF" | sudo tee /Library/LaunchDaemons/local.spoof.plist
@ -118,7 +110,7 @@ cat << "EOF" | sudo tee /Library/LaunchDaemons/local.spoof.plist
EOF
```
### Step 8: create `spoof-hook.sh` script
### Step 7: create `spoof-hook.sh` script
```shell
cat << "EOF" > /usr/local/sbin/spoof-hook.sh
@ -129,13 +121,13 @@ networksetup -setairportpower en0 off
EOF
```
### Step 9: make `spoof-hook.sh` executable
### Step 8: make `spoof-hook.sh` executable
```shell
chmod +x /usr/local/sbin/spoof-hook.sh
```
### Step 10: make sure `com.apple.loginwindow` does not exist
### Step 9: make sure `com.apple.loginwindow` does not exist
> Heads-up: if `com.apple.loginwindow` exists, one needs to backup user default carefully and consider using an abstraction that runs both current `LogoutHook` script and `/usr/local/sbin/spoof-hook.sh`.
@ -149,33 +141,33 @@ Domain com.apple.loginwindow does not exist
👍
### Step 11: configure user default (used to disable Wi-Fi interface at logout)
### Step 10: configure user default (used to disable Wi-Fi interface at logout)
```shell
sudo defaults write com.apple.loginwindow LogoutHook "/usr/local/sbin/spoof-hook.sh"
```
### Step 12: reboot and confirm hostname and MAC address have been spoofed
### Step 11: reboot and confirm hostname and MAC address have been spoofed
#### Spoofed hostname
```console
$ scutil --get HostName
Gatlins-MacBook-Pro
Ottos-MacBook-Pro
```
#### Spoofed MAC address
```console
$ ifconfig en0 | grep ether | awk '{print $2}'
20:ee:28:31:03:f6
98:01:a7:8e:0f:51
```
#### Hardware MAC address
```console
$ networksetup -listallhardwareports | awk -v RS= '/en0/{print $NF}'
9c:f4:8e:d6:2b:7d
98:01:a7:5e:d0:c2
```
“Spoofed hostname” is random and “Spoofed MAC address” does not match “Hardware MAC address”?
@ -190,7 +182,6 @@ $ networksetup -listallhardwareports | awk -v RS= '/en0/{print $NF}'
```shell
rm /usr/local/sbin/first-names.txt
rm /usr/local/sbin/mac-address-prefixes.txt
rm /usr/local/sbin/spoof-hook.sh
rm /usr/local/sbin/spoof.sh
sudo rm /Library/LaunchDaemons/local.spoof.plist

View File

@ -1,768 +0,0 @@
60:8B:0E
88:B2:91
C4:2A:D0
CC:D2:81
10:40:F3
58:6B:14
BC:B8:63
44:E6:6E
C0:E8:62
F4:06:16
E4:B2:FB
4C:56:9D
38:53:9C
40:26:19
6C:E8:5C
F8:38:80
10:94:BB
F8:6F:C1
28:FF:3C
F0:99:B6
88:E9:FE
38:89:2C
74:9E:AF
94:BF:2D
40:CB:C0
C4:61:8B
08:E6:89
DC:56:E7
54:33:CB
34:08:BC
1C:36:BB
3C:2E:FF
24:F6:77
B0:CA:68
C8:3C:85
B8:63:4D
A4:E9:75
30:35:AD
84:41:67
98:00:C6
AC:1F:74
A8:5C:2C
00:DB:70
24:5B:A7
70:F0:87
B0:70:2D
6C:19:C0
2C:33:61
EC:AD:B8
98:01:A7
24:F0:94
08:6D:41
E0:C7:67
80:ED:2C
AC:61:EA
38:B5:4D
1C:5C:F2
28:ED:6A
A4:D1:8C
24:1E:EB
CC:25:EF
28:CF:E9
00:A0:40
3C:D0:F8
68:09:27
6C:C2:6B
44:D8:84
00:26:08
00:26:B0
00:26:BB
D4:9A:20
F8:1E:DF
C8:2A:14
3C:07:54
A4:B1:97
F0:B4:79
10:93:E9
44:2A:60
A4:D1:D2
28:CF:DA
00:30:65
00:14:51
00:1E:52
00:21:E9
CC:08:E0
04:54:53
F4:F9:51
C0:63:94
18:AF:8F
C8:B5:B7
90:B2:1F
30:F7:C5
40:B3:95
44:FB:42
E8:8D:28
94:94:26
20:7D:74
F4:F1:5A
C8:6F:1D
30:90:AB
8C:2D:AA
84:85:06
98:FE:94
D8:00:4D
64:20:0C
C8:33:4B
64:E6:82
B8:E8:56
D8:96:95
14:99:E2
B4:18:D1
9C:20:7B
B0:65:BD
54:26:96
64:A3:CB
90:3C:92
D8:1D:72
34:12:98
70:E7:2C
70:EC:E4
68:AE:20
AC:87:A3
D8:BB:2C
D0:4F:7E
20:78:F0
E0:AC:CB
A0:99:9B
24:24:0E
F0:DB:F8
48:74:6E
54:AE:27
FC:E9:98
0C:BC:9F
34:36:3B
D0:A6:37
78:9F:70
9C:F3:87
A8:5B:78
C8:F6:50
A8:8E:24
CC:20:E8
70:48:0F
F0:B0:E7
04:69:F8
40:70:F5
B0:35:B5
80:0C:67
90:81:2A
B8:7B:C5
10:29:59
E4:76:84
F0:5C:D5
70:EA:5A
B4:40:A4
48:B8:A3
F4:DB:E3
F8:87:F1
30:57:14
C8:B1:CD
14:60:CB
B8:F1:2A
80:4A:14
70:3C:69
14:C2:13
A4:D9:31
BC:FE:D9
80:82:23
BC:E1:43
64:70:33
84:68:78
C8:D0:83
60:30:D4
F8:95:EA
18:F1:D8
30:D9:D9
D0:81:7A
98:CA:33
68:AB:1E
70:EF:00
0C:15:39
D8:8F:76
40:9C:28
58:E2:8F
78:7B:8A
50:32:37
B0:48:1A
B4:9C:DF
48:BF:6B
9C:84:BF
00:B3:62
E4:E4:AB
60:33:4B
FC:D8:48
A8:60:B6
C4:B3:01
E0:5F:45
48:3B:38
1C:91:48
30:63:6B
A4:F1:E8
44:00:10
00:56:CD
00:CD:FE
E4:98:D6
F4:31:C3
64:A5:C3
00:23:32
00:23:6C
00:23:DF
00:25:00
00:25:BC
00:19:E3
00:1B:63
00:1E:C2
00:1F:F3
00:10:FA
00:50:E4
00:0D:93
7C:FA:DF
78:A3:E4
14:8F:C6
28:6A:B8
28:E0:2C
E0:B9:BA
00:C6:10
B8:F6:B1
8C:FA:BA
7C:D1:C3
F0:DC:E2
24:AB:81
E0:F8:47
28:E7:CF
E4:CE:8F
A8:20:66
BC:52:B7
5C:59:48
C8:BC:C8
E8:04:0B
14:5A:05
1C:AB:A7
C0:84:7A
34:15:9E
58:B0:35
DC:86:D8
90:B9:31
D0:E1:40
24:A2:E1
80:EA:96
60:03:08
04:F1:3E
98:F0:AB
78:31:C1
78:3A:84
5C:8D:4E
88:63:DF
88:1F:A1
C8:E0:EB
98:B8:E3
88:53:95
78:6C:1C
4C:8D:79
1C:E6:2B
0C:30:21
0C:3E:9F
FC:FC:48
9C:29:3F
08:74:02
94:F6:A3
98:E0:D9
CC:29:F5
28:5A:EB
F0:24:75
2C:1F:23
54:9F:13
F0:DB:E2
74:81:14
18:F6:43
A4:5E:60
A0:18:28
D0:03:4B
10:41:7F
A8:66:7F
D0:25:98
80:BE:05
24:A0:74
84:78:8B
58:7F:57
00:6D:52
B8:44:D9
14:87:6A
E0:B5:5F
F8:FF:C2
E0:EB:40
3C:BF:60
AC:15:F4
88:A4:79
04:72:95
D4:46:E1
78:D1:62
08:F8:BC
90:A2:5B
7C:AB:60
44:C6:5D
18:7E:B9
20:E8:74
D0:3F:AA
50:7A:C5
4C:6B:E8
8C:86:1E
54:2B:8D
44:18:FD
00:5B:94
E0:89:7E
64:C7:53
38:F9:D3
FC:18:3C
90:E1:7B
D8:1C:79
58:E6:BA
9C:E6:5E
C4:98:80
E0:33:8E
08:F6:9C
50:A6:7F
D4:61:DA
F0:18:98
88:19:08
5C:09:47
14:20:5E
B8:41:A4
D4:90:9C
E4:E0:A6
80:B0:3D
E4:9A:DC
AC:E4:B5
D0:D2:B0
8C:85:90
6C:96:CF
78:88:6D
20:EE:28
B4:F6:1C
08:F4:AB
D4:DC:CD
48:4B:AA
DC:A9:04
6C:AB:31
4C:74:BF
98:9E:63
88:6B:6E
50:82:D5
64:B0:A6
7C:04:D0
84:FC:AC
DC:0C:5C
70:70:0D
18:65:90
F8:62:14
78:4F:43
40:4D:7F
9C:8B:A0
CC:08:8D
60:9A:C1
74:8D:08
10:DD:B1
C0:1A:DA
68:FB:7E
84:A1:34
0C:51:01
2C:F0:A2
B4:4B:D2
DC:41:5F
F4:5C:89
20:76:8F
E8:B2:AC
E4:9A:79
38:CA:DA
34:AB:37
18:AF:61
5C:F9:38
6C:72:E7
74:1B:B2
CC:44:63
60:FE:C5
E4:25:E7
BC:92:6B
10:1C:0C
08:00:07
40:D3:2D
C4:2C:03
90:27:E4
10:9A:DD
58:1F:AA
88:C6:63
00:1F:5B
00:24:36
00:25:4B
00:16:CB
00:17:F2
7C:6D:62
20:C9:D0
68:96:7B
84:FC:FE
E4:8B:7F
00:88:65
BC:3B:AF
3C:E0:72
38:48:4C
A4:67:06
8C:58:77
7C:F0:5F
80:49:71
6C:3E:6D
BC:67:78
D8:D1:CB
A8:FA:D8
B8:17:C2
7C:11:BE
28:37:37
50:EA:D6
98:D6:BB
18:9E:FC
AC:CF:5C
80:00:6E
84:8E:0C
3C:15:C2
6C:70:9F
C0:F2:FB
24:E3:14
80:E6:50
90:FD:61
08:70:45
A8:88:08
A4:C3:61
2C:F0:EE
5C:97:F3
D4:F4:6F
64:76:BA
34:E2:FD
04:48:9A
F0:F6:1C
8C:29:37
B0:9F:BA
0C:4D:E9
E0:F5:C6
A0:ED:CD
5C:F5:DA
18:EE:69
64:9A:BE
F0:99:BF
94:E9:6A
AC:29:3A
9C:FC:01
9C:35:EB
48:43:7C
34:A3:95
78:7E:61
60:F8:1D
38:C9:86
D0:33:11
50:7A:55
20:9B:CD
F0:A3:5A
60:83:73
84:AD:8D
74:42:8B
28:77:F1
88:A9:B7
EC:CE:D7
AC:90:85
B8:90:47
90:9C:4A
90:8C:43
3C:7D:0A
18:55:E3
E4:50:EB
88:64:40
60:70:C0
F0:C3:71
94:16:25
34:A8:EB
A4:83:E7
F4:AF:E7
AC:88:FD
DC:08:0F
F8:E9:4E
EC:2C:E2
40:BC:60
E8:36:17
9C:64:8B
34:42:62
14:D0:0D
64:5A:ED
C0:B6:58
48:A9:1C
50:BC:96
FC:2A:9C
A0:56:F3
54:99:63
90:DD:5D
C4:84:66
34:7C:25
CC:2D:B7
E4:2B:34
3C:2E:F9
A0:4E:A7
F0:98:9D
B0:19:C6
38:66:F0
70:3E:AC
98:10:E8
C0:D0:12
BC:A9:20
48:A1:95
F8:03:77
DC:A4:CA
8C:8F:E9
2C:20:0B
88:66:A5
00:1C:B3
F0:79:60
A0:D7:95
B8:FF:61
90:C1:C6
70:A2:B3
F4:0F:24
4C:57:CA
48:E9:F1
1C:9E:46
C0:CC:F8
9C:4F:DA
84:89:AD
68:DB:CA
08:66:98
BC:54:36
04:4B:ED
6C:8D:C1
0C:D7:46
60:A3:7D
90:60:F1
B8:78:2E
00:05:02
00:0A:95
00:26:4A
04:1E:64
00:11:24
00:22:41
7C:C5:37
78:CA:39
18:E7:F4
70:CD:60
8C:7B:9D
D8:9E:3F
B8:C7:5D
0C:74:C2
40:30:04
84:29:99
74:E2:F5
E0:C9:7A
68:A8:6D
7C:C3:A1
70:73:CB
90:84:0D
E8:06:88
EC:85:2F
00:F4:B9
5C:95:AE
98:03:D8
60:C5:47
68:5B:35
2C:B4:3A
68:9C:70
38:0F:4A
30:10:E4
A8:86:DD
44:4C:0C
B4:F0:AB
80:92:9F
9C:04:EB
5C:96:9D
60:92:17
84:B1:53
E0:66:78
48:D7:05
04:15:52
CC:78:5F
88:CB:87
F0:C1:F1
84:38:35
8C:00:6D
A8:96:8A
F4:1B:A1
60:D9:C7
3C:AB:8E
F8:27:93
90:72:40
90:8D:6C
B8:09:8A
4C:7C:5F
68:64:4B
C8:1E:E7
A4:31:35
68:D9:3C
00:F7:6F
C8:85:50
70:14:A6
98:5A:EB
78:D7:5F
E0:B5:2D
6C:94:F8
C0:CE:CD
C8:69:CD
A4:B8:05
5C:AD:CF
BC:6C:21
54:4E:90
AC:BC:32
7C:A1:AE
3C:22:FB
94:0C:98
E8:FB:E9
38:EC:0D
E4:90:FD
D0:65:44
84:AB:1A
74:E1:B6
F4:0E:01
14:95:CE
50:DE:06
CC:66:0A
FC:1D:43
B8:B2:F8
98:46:0A
B8:5D:0A
7C:9A:1D
10:30:25
54:62:E2
14:9D:99
C0:9A:D0
94:B0:1F
94:F6:D6
F8:2D:7C
18:81:0E
60:8C:4A
74:B5:87
FC:B6:D8
24:1B:7A
8C:FE:57
C0:A6:00
00:03:93
1C:1A:C0
40:83:1D
DC:D3:A2
5C:1D:D9
88:AE:07
68:FE:F7
68:EF:43
D0:2B:20
2C:61:F6
D4:A3:3D
F0:76:6F
40:98:AD
6C:4D:73
78:67:D7
B8:C1:11
9C:E3:3F
A8:BE:27
C0:A5:3E
D4:61:9D
14:BD:61
7C:50:49
58:40:4E
D0:C5:F3
BC:9F:EF
20:AB:37
60:F4:45
88:E8:7F
9C:F4:8E
5C:F7:E6
B8:53:AC
20:3C:AE
A0:3B:E3
4C:32:75
D8:30:62
B8:8D:12
8C:8E:F2
90:B0:ED
04:D3:CF
B4:8B:19
BC:EC:5D
28:A0:2B
38:71:DE
70:81:EB
60:69:44
04:52:F3
60:FB:42
64:B9:E8
00:1D:4F
00:23:12
D8:A2:5E
00:0A:27
18:34:51
0C:77:1A
28:6A:BA
4C:B1:99
C0:9F:42
D0:23:DB
70:DE:E2
F0:CB:A1
18:20:32
40:3C:FC
48:60:BC
34:51:C9
40:6C:8F
58:55:CA
DC:2B:61
40:A6:D9
60:FA:CD
00:3E:E1
FC:25:3F
04:F7:E4
34:C0:59
F0:D1:A9
70:56:81
14:10:9F
04:0C:CE
54:EA:A8
28:E1:4C
E4:C6:3D
54:E4:3A
04:DB:56
AC:3C:0B
70:11:24
04:26:65
EC:35:86
78:FD:94
2C:BE:08
E8:80:2E
00:61:71
8C:7C:92
B0:34:95
F4:37:B7
AC:7F:3E
28:0B:5C
AC:FD:EC
DC:9B:9C
54:72:4F
D8:CF:9C
7C:6D:F8
04:E5:36
A8:BB:CF
6C:40:08
40:33:1A
CC:C7:60
BC:4C:C4
DC:37:14
20:A2:E4
28:F0:76
7C:01:91
80:D6:05
DC:2B:2A
08:2C:B6
F8:4E:73
F0:78:07
3C:CD:36
44:4A:DB
30:90:48
BC:09:63
D8:4C:90

View File

@ -0,0 +1,13 @@
#! /bin/sh
printf "%s\n" "Updating first-names.txt…"
curl --remote-name https://www.ssa.gov/oact/babynames/names.zip
unzip -d names -o names.zip
cat names/yob$(echo "$(date +%Y) - 25" | bc).txt | grep ",F" | awk -F, '{ print $1 }' | head -n 1024 > ../first-names.txt
cat names/yob$(echo "$(date +%Y) - 25" | bc).txt | grep ",M" | awk -F, '{ print $1 }' | head -n 1024 >> ../first-names.txt
perl -pi -e 'chomp if eof' ../first-names.txt
rm -fr names names.zip
printf "%s\n" "Done"