5 The uniqueness of [[!wikipedia MAC addresses]] introduce two types of
6 potential issues for Tails users, in particular if the MAC address can
7 be linked to the user's identity:
9 1. Geographical location tracking: A time-stamped log of a MAC address
10 ties a device to a certain location at a particular time. If the
11 device's owner is known, his or her movements are also known. In
12 case an unknown owner, the tracked movements leak information about
13 the owner, which eventually may lead to identification.
15 2. Identify Tails (or Tor) users: If the usage of Tails (or Tor) can
16 be fingerprinted on the network (despite other measures taken), and
17 the owner of a device is known, it can be determined that the owner
18 also is a Tails (or Tor) user.
20 Spoofing the MAC address is the natural solution. Unfortunately, in
21 some cases MAC spoofing may cause network connection issues or even
22 raise alarms; care should be taken to prevent MAC spoofing in such
27 ## Adversary capabilities
29 The adversary's capabilities are assumed to be:
31 1. Omniscient wireless snooping of when and where (via triangulation)
32 all MAC addresses are used. Also access to Time-stamped logs of the
33 presence of MAC addresses on all wired networks (think compromised
34 routers and/or ISP:s). [AdvCapSniff]
36 2. Has access, on specific request, to all user/customer records and
37 surveillance data of any public network. [AdvCapRecords]
39 3. Knows who owns which MAC address according to the last traceable
40 transaction (e.g. credit card trail). Cash purchase, trade, trash
41 salvaging or theft are ways to potentially avoid this but the
42 adversary can interrogate the previous owner to obtain that
43 information if remembered (or at all known). [AdvCapOwners]
47 We assume an adversary whose goals are the following, which all
48 happens on a global, omniscient level thanks to AdvCapSniff:
50 1. Monitoring of when and where a particular MAC address with a known
51 owner is used. In other words, monitoring of an individual's
52 geographical movement while using a certain device (thanks to
53 AdvCapOwners). [AdvGoalTracking]
55 2. Dragnet-style logging of when and where MAC addresses with unknown
56 owners are used for large-scale social graphing and profiling which
57 leaks information owners' identities. [AdvGoalProfiling]
59 3. Identify Tails (and Tor) users. If Tails (or Tor) usageAdv can be
60 fingerprinted, then that fact is documented about a particular
61 individual (thanks to AdvCapOwners). [AdvGoalIdTails]
63 4. Identify MAC spoofing individuals. We assume that our adversary has
64 bought into the "nothing to hide" argument, which makes such
65 suspicious behaviour valuable information. [AdvGoalIdMacSpoof]
67 Note that none of the goals deal with other types of unique
68 identifiers than MAC addresses. In particular, logging of IMEI:s [1],
69 used by mobile NIC:s, are omitted (mostly due to lack of proper
72 [1] http://en.wikipedia.org/wiki/IMEI
76 1. Hide geographical movement, i.e. prevent AdvGoalTracking and
77 AdvGoalProfiling. [AvoidTracking]
79 2. No unspoofed usage of Tails (or Tor), i.e. prevent AdvGoalIdTails.
82 3. Not raising alarms on the network, i.e. prevent AdvGoalIdMacSpoof,
83 but also avoid alarming the local administrators (imagine a
84 situation where security guards are sent to investigate an "alien
85 computer" at your workplace, or similar). [AvoidIdMacSpoof]
87 4. Avoid network connection problems due to MAC address white-listing,
88 fixed ARP tables, hardware or driver issues, or
89 similar. [AvoidConnectionProbs]
93 Below we analyse how MAC address spoofing relates to each user goal
94 for the given situation.
96 ## Using Tails at home
98 First, note that the user's relation (owner, family member's,
99 friend's, work's, borrowed, etc.) to the computer running Tails
100 doesn't matter; the location is already directly related to the user's
101 identity. Similarly, because of this, MAC spoofing is of very limited
102 value for both AvoidTracking and AvoidIdTails value.
104 MAC spoofing could hinder AvoidIdMacSpoof if detected by the ISP's
105 hardware (i.e. no trusted router in the way). Similarly, ISP-provided
106 hardware may employ some sort of MAC address white-listing (e.g. only
107 X unique ones are allowed) that can prevent AvoidConnectionProbs.
109 Summary: MAC spoofing should be avoided but isn't terribly dangerous
112 ## Using Tails at a friend's place
114 ### Using your computer
116 MAC spoofing should be enabled for both AvoidTracking and
117 AvoidIdTails. AvoidIdMacSpoof won't be your problem but your friend's
118 (which isn't a problem at all unless you're there spoofing all the
119 time). AvoidConnectionProbs can be problematic for the same reasons as
120 in "Using Tails at home".
122 Summary: Enable MAC spoofing!
124 ### Using any other computer
126 Since the computer you use isn't tied to you, AvoidTracking and
127 AvoidIdTails aren't relevant. AvoidIdMacSpoof won't be your problem but
128 your friend's. AvoidConnectionProbs can be problematic for the same
129 reasons as in "Using Tails at home".
131 Summary: MAC spoofing should be avoided but isn't terribly dangerous
134 ## Using Tails at a restricted public network
136 Access is restricted to registered users' identities only. We use
137 "registration" a bit loosely, but example of networks like these are:
139 * paid-for access when there's a money trail (e.g. credit cards).
140 * captive portals requiring logging in with an identity-tied account.
141 * locations requiring a identity-tied key card (e.g. university
142 computer labs and workplaces) to access.
144 This should probably also cover otherwise unrestricted networks that
145 snoops on users in other ways, e.g. a library with video camera
148 ### Using your computer
150 Since the user is registered for network access, both AvoidTracking
151 and AvoidIdTails are hard to get. However, AdvCapRecords requires
152 explicit targeting (more expensive), while AdvCapSniff isn't, and MAC
153 spoofing would defeat the latter, so it's not without merit.
155 AvoidIdMacSpoof could be problematic if your registered presence on the
156 network is correlated to constantly new MAC addresses. A quite likely
157 situation for this case is that you login via some captive portal, and
158 these often use your MAC address for access control purposes, so a log
159 of which you have used
161 AvoidConnectionProbs is a problem if your MAC address becomes part of
162 your registration, and is assumed to not change (maybe a place where
163 you have to pay for each device you connect with). This seems pretty
166 Summary: There's no easy choice here but in most scenarios
167 AvoidTracking is probably more valuable than AvoidIdMacSpoof, so MAC
168 spoofing should be enabled.
170 ### Using a public computer
172 Since the computer isn't tied to you, MAC spoofing does nothing to
173 AvoidTracking and AvoidIdTails. It could cause problems to both
174 AvoidIdMacSpoof and AvoidConnectionProbs.
176 Summary: MAC spoofing should be avoided but isn't terribly dangerous
179 ## Using Tails at an open public network
181 Access is completely open, and no kind of registration is needed.
183 ### Using your computer
185 MAC spoofing should be enabled for both AvoidTracking and
186 AvoidIdTails. Such a network should expect to see many unique MAC
187 addresses daily, and be ready to deal with it, so AvoidIdMacSpoof and
188 AvoidConnectionProbs are of no consequence.
190 Summary: Enable MAC spoofing!
192 ### Using a public computer
194 Same as using a public computer at a restricted public network.
196 Summary: MAC spoofing should be avoided but isn't terribly dangerous
201 The strong requirement of enabling MAC spoofing in a few cases, and
202 the low risk of keeping it enabled even in the cases where it should
203 be avoided, warrants for making this feature enabled by default, with
204 the possibility to opt-out.
208 It is conceivable that NICs may send packets even before the user has
209 made a decision about whether to use MAC spoofing or not. If this is
210 the case it would lead to either of the following problematic
211 scenarios, depending on which point MAC spoofing is enabled:
213 * If MAC spoofing is enabled before the user has made the decision, a
214 fake MAC address would leak before the user made the decision, and
215 the decision was to disable MAC spoofing. The sudden switch of MAC
216 address may result in a breach of AvoidIdMacSpoof.
218 * If MAC spoofing is enabled after the user has made the decision, the
219 real MAC address would leak even if the user wanted MAC spoofing
220 enabled, which leaks to breaches of AvoidTracking and AvoidIdTails.
221 The sudden switch of MAC address may result in a breach of
224 The first is clearly less bad than the second, but the ideal,
225 which avoids these problems altogether, would be to prevent any
226 network devices from being enabled at all until the decision has
229 # User interface design
231 This option, which is of the on/off variety, will be implemented as a
232 check box in Tails Greeter. The problem is to formulate a concise
233 description that's clear and informative enough to guide the user to
234 make an informed decision.
236 In our previous blueprint we state that we want a user interface that
237 presents the option using "simple words such as 'I am using a public
238 computer' instead of speaking geek-language about mac addresses or
239 whatever". However, in the use case analysis above it's obvious that
240 simply "public or not" isn't enough to differentiate between the
241 different use cases, and it seems unlikely to be the case for any
242 other easily understood concept.
244 Therefore it seems that the label of the option isn't what we should
245 focus on, so we might just as well call it "Spoof all MAC addresses",
246 which at least can help advanced users that know what they're
247 doing. Beyond a concise summary in Tails Greeter, it's also highly
248 important that we have clear and complete documentation about this,
249 and that we make this documentation easily available from inside
252 # Active probe fingerprinting
254 **NO PREVENTION AGAINST THIS IS IMPLEMENTED YET**
256 There's an opportunity for an adversary to achieve AdvGoalTracking and
257 AdvGoalProfiling due to "active probing" performed by NetworkManager
258 for Wi-Fi connections. This puts AvoidTracking at risk.
260 Wi-Fi has both a passive and active scanning mode. Passive scanning,
261 as the name suggests, passively listens for broadcasted wireless
262 networks, which is entirely safe. Active scanning, however, actively
263 sends probes for any known networks. In our case these are the saved
264 connections in NetworkManager, so this turns especially problematic
265 when persistent NM-connections are used; the (potentially long) list of
266 networks actively probed for can be used as a fingerprint by an
269 While this has nothing to do with MAC spoofing, it does strongly
270 affect the (arguably) most important user goal of this feature, namely
271 AvoidTracking. Because of this, active scanning should be disabled in
272 NetworkManager when MAC spoofing is enabled.
276 The current implementation spoofs the non-vendors bits of any network
277 device's MAC address immediately after it is added by udev. Furthermore, to
278 deal with potential network leaks before the user has chosen whether
279 to enable MAC spoofing or not, the addition of network devices is delayed
280 until after Tails Greeter knows the user's final decision.
284 As suggested in the "Leak prevention" section, we block all network
285 devices' modules from being loaded until the user has made the decision about
286 whether to enable MAC spoofing or not. The way we do this is by
287 generating a list of all network device modules during build time, and
288 add these to a `modprobe.d`-type blacklist. In Tails Greeter's
289 post-login script (when we know the user's decision) we unblock the
290 network by simply removing that list, and then we have udev "re-probe"
291 for network devices and load their modules.
294 * [[!tails_gitweb config/chroot_local-hooks/80-block-network]] (run at
296 * [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-unblock-network]]
297 (run right after Tails Greeter logs in)
301 We use udev as the trigger that hooks MAC address spoofing. Because of
302 that, it happens for every Ethernet device automatically, as early as
303 possible (i.e. immediately after it's added), so even if there's some
304 kind of weird leak before a device is up:ed the real MAC address
305 shouldn't leak. Someone on tails-dev@
306 [alluded](https://mailman.boum.org/pipermail/tails-dev/2013-January/002491.htm)
307 to this being possible for wireless NICs although without any
308 references. This shouldn't be a problem since we block all network
309 devices until when we known whether the user needs MAC spoofing or
313 [[!tails_gitweb config/chroot_local-includes/etc/udev/rules.d/00-mac-spoof.rules]]
315 ### Discarded approaches
317 All other triggers that were considered do not deal with the "early"
318 leaks issue, in addition to other reasons for being discarded:
320 * ifupdown hook: A if-pre-up hook would probably work but since we use
321 NetworManager the exact behaviour is blurred and not particularly
322 well-documented. It doesn't feel robust for this reason.
324 * NetworkManager hook: NM doesn't trigger events equivalent to
325 if-pre-up, so this isn't possible. See the commented parts in:
326 /etc/NetworkManager/dispatcher.d/01ifupdown
328 * systemd integration: We don't use this yet.
330 * NetworkManager plugin: While this certainly would have a nice impact
331 outside of Tails, the added maintenance burden makes it less
336 The tool used to change the MAC address is simply macchanger, mostly
337 because it's in Debian (where the known vulnerabilities are patched)
338 and macchiato isn't (and it's not as well tested, yet). macchanger is
339 used in a very straightforward way, so if we want to switch tool in
340 the future it's a simple task.
343 [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-spoof-mac]]
345 ## Connection failure detection
347 This section deals with AvoidConnectionProbs. The goal is to somehow
348 identify connection errors that are related to MAC spoofing, and
349 notify the user when this happens.
351 Due to lack of hooks into NetworkManager's connection error handling
352 we currently use a simple monitoring script that's started when MAC
353 spoofing is enabled. It scans syslog for the error message patterns
354 from NetworkManager and `wpa_supplicant` expected when the connection
355 fails due to MAC spoofing. When such a pattern is found, a
356 notification is shown to the user, stating that the connection problem
357 *may* be MAC spoofing related. Due to the uncertainty and lack of
358 information available for this approach, there certainly will be false
361 At the moment this script only deals with wireless connections. It
362 successfully distinguishes between MAC-spoof related errors and errors
363 when entering the wrong passphrase, so no false positives in that
364 (relatively common) case.
366 For details, see the script:
367 [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-blocked-network-detector]]
369 ## MAC spoofing and virtual machine networking issues
371 Some virtualization tools seem to behave poorly when spoofing virtual NIC
372 MAC addresses. For instance, VirtualBox's networking completely breaks
373 when using bridge- and NAT-based adapters in combination with
374 MAC-spoofing, and those two are probably the two most common scenarios
375 (NAT-based in particular). Therefore, if it is detected (using
376 `virt-what`) that Tails is running inside a virtual machine, then make
377 MAC spoofing default to being disabled. If the user still enables the
378 option, a warning is immediately shown.
380 When running Tails inside a virtual machine, MAC spoofing is mostly
381 useless, at least when NAT-based (and similar) approaches to network
382 sharing are used, since only the host system will see the MAC address.
383 However, that's not the case with bridged connections, but on the other
384 hand only the virtual NICs MAC address is leaked, which usually is
385 randomised upon creation any way. Still, this could leak to breaking
386 AvoidTracking, since the MAC address usually is persistent. We may
387 want to document this, and advice users to preferably use NAT-based
388 virtual adapters (which usually is the default). Users that must use
389 bridged connection will have to manually randomise the MAC address
394 ## Using NetwokManager for AvoidConnectionProbs?
396 Instead of our current hack, we'd ideally want to hook into
397 NetworkManager's error handling, which certainly would be more robust,
398 and hopefully would provide more information about the error, but this
399 currently seems unsupported.
401 An experiment has showed that when connecting to a password-protected
402 (WPA-PSK) wireless network with MAC address white-listing, spoofed
403 (and hence blocked) MAC addresses resulted in an endless cycle of NM
404 asking for passphrase. When cancelled, NM displays a "Disconnected"
405 notification, and during this time no NM dispatcher events were
408 Some bugs of interest that may bring some hope:
410 * <https://bugzilla.gnome.org/show_bug.cgi?id=387832>
411 * <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518368>
412 * <https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/336736>
414 ## Vendor bit randomisation with macchiato
416 These are the current relevant OUI counts from macchiato's git:
418 5 oui/bluetooth_laptop.sh
419 2 oui/bluetooth_misc.sh
420 12 oui/bluetooth_mobile.sh
421 1 oui/bluetooth_pmp.sh
422 2 oui/wired_console.sh
423 3 oui/wired_desktop_dedicated.sh
424 11 oui/wired_desktop_onboard.sh
425 8 oui/wired_infrastructure.sh
426 17 oui/wired_laptop.sh
428 4 oui/wired_printer.sh
429 2 oui/wireless_camera.sh
430 1 oui/wireless_console.sh
431 4 oui/wireless_desktop_dedicated.sh
432 2 oui/wireless_desktop_onboard.sh
433 4 oui/wireless_handheld.sh
434 6 oui/wireless_infrastructure.sh
435 1 oui/wireless_laptop_dedicated.sh
436 21 oui/wireless_laptop.sh
437 17 oui/wireless_mobile.sh
438 7 oui/wireless_pmp.sh
439 4 oui/wireless_printer.sh
440 8 oui/wireless_usb.sh
442 In particular there's ~20 each in wireless_laptop and wired_laptop,
443 which is what we should care about most (desktops rarely need MAC
444 spoofing). However, after investigating the sources for some OUI:s
445 (via git history), some OUI:s are (according to the submitter) only
446 common in certain geographical areas. This makes the lists too small
447 and unreliable at the moment.
449 # Questions, remaining issues, and other random stuff
453 In the current implementation there's no failsafe that verifies that
454 the selected MAC spoofing setting has been enforced before
455 connecting. This would be easy if there was something like pre-up NM
456 dispatcher hooks but just like in the section about "Connection
457 failure detection", there's none yet.
459 An alternative would be to do this in
460 [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-spoof-mac]], which
461 is run by the udev hook. In the end of the script we could try to
462 verify that the spoofing indeed happened for the NIC in question, and
463 if it didn't we could go into full-out panic mode:
465 1. Down the interface
466 2. Kill NetworkManager
467 3. Try to unload the module used by the NIC
468 4. Show a scary error message to the user
470 It would obviously require to drop `set -e`, because errors are indeed
471 what could cause this to happen.
473 ## Detecting MAC-spoof related connection errors for wired NICs
475 While Wi-Fi connection are covered, this gets trickier for wired
476 connections. The problem is that there's no strong concept of being
477 "associated" to a wired network (at least a "standard" one, perhaps
478 there is with 802.1x security...). It'll probably be hard to identify
479 blocking without confusing it with other types of wired connection
480 failures (i.e. false positives). How does wired MAC address blocking
481 usually work? On which level? DHCP? Lower layer?
483 # Old stuff from blueprint
485 ## Improving macchanger
487 Some of our goals would be easier to achieve by patching macchanger
488 itself. Since it's been unmaintained upstream for a while, we've been
489 discussing and working with someone who has taken its maintenance over
490 and has already started patching it to better suit our needs:
492 * [Redmine project](https://labs.riseup.net/code/projects/show/macchanger)
493 * Git repository: `git://labs.riseup.net/backupninja.git`
494 * Debian packages: the maintainer of the macchanger package in
495 Debian has already integrated some of these patches (uploaded to
496 sid: 1.5.0-8) and is likely to go on this way. Tails has been
497 using this improved version for a while.
499 ## Inspiration sources
503 Haven does not automatically start network-manager at boot time.
504 It provides shortcuts in the application menu to run macchanger-gtk
505 and start the network if desired.
509 Liberte Linux randomises wireless MAC addresses at boot time and
510 allows changing wired interfaces' MAC addresses after boot, see their
511 `src/usr/local/sbin/mac-randomize` that uses `ifconfig IFACE hw ether`
512 rather than macchanger.
516 Investigate and possibly document the kind of information that could
517 still be seen on the LAN about the system. Such as the manufacturer (ex:
518 Sony), model number, BIOS and version, etc.?