Skip to content

Commit 4d078c3

Browse files
committed
Add macOS MAC spoof
1 parent 3bc9006 commit 4d078c3

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

MacOS/README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,42 @@
5858
sudo networksetup -setmanual AdHoc 192.168.1.88 255.255.255.255
5959
```
6060

61-
- **System Preferences** > **General** > **Sharing** > **Internet Sharing**, choose **AdHoc**, tick **Wi-Fi**, click **Wi-Fi Options** and set name/password, enable **Internet Sharing**
61+
- **System Preferences** > **General** > **Sharing** > **Internet Sharing**, choose **AdHoc**, tick **Wi-Fi**, click **Wi-Fi Options** and set name/password, enable **Internet Sharing**
62+
63+
4. #### Spoof WiFi MAC address
64+
65+
- `/usr/local/sbin/spoof.sh`
66+
```bash
67+
#!/bin/bash
68+
69+
mac_address="f0:2f:4b:12:34:56"
70+
71+
wifi_status=$(networksetup -getairportpower en0)
72+
networksetup -setairportpower en0 on
73+
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --disassociate
74+
sudo ifconfig en0 ether "$mac_address"
75+
networksetup -setairportpower en0 off
76+
77+
if echo "$wifi_status" | grep -q "On"; then
78+
networksetup -setairportpower en0 on
79+
fi
80+
```
81+
82+
- `/Library/LaunchDaemons/local.spoof.plist`
83+
```xml
84+
<?xml version="1.0" encoding="UTF-8"?>
85+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
86+
<plist version="1.0">
87+
<dict>
88+
<key>Label</key>
89+
<string>local.spoof</string>
90+
<key>ProgramArguments</key>
91+
<array>
92+
<string>/usr/local/sbin/spoof.sh</string>
93+
</array>
94+
<key>RunAtLoad</key>
95+
<true/>
96+
</dict>
97+
</plist>
98+
99+
```

0 commit comments

Comments
 (0)