-
Notifications
You must be signed in to change notification settings - Fork 1
/
com.example.loopback1.plist
36 lines (31 loc) · 1.09 KB
/
com.example.loopback1.plist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
In macOS, replace the .99 octects in `<string>127.99.99.99</string>` with your own, e.g., 127.1.2.3
sudo cp com.example.loopback1.plist /Library/LaunchDaemons/
sudo ifconfig lo0 alias 127.209.56.84
What for? It mitigates localhost spies.
https://news.ycombinator.com/item?id=20028108
http://http.jameshfisher.com/2019/05/26/i-can-see-your-local-web-servers/
Picking a custom, non-common, IP address and port number
is equivalent to ~40 bits password to mitigate localhost spies.
24 on the IP
+ 16 on the port
= 40 bits
Even if you CORS stylesheets and images could be reached by a malicious website.
-->
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.loopback1</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/ifconfig</string>
<string>lo0</string>
<string>alias</string>
<string>127.99.99.99</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>