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 before the user has made
209 a decision about whether to use MAC spoofing or not. In fact, someone
211 [alluded](https://mailman.boum.org/pipermail/tails-dev/2013-January/002491.htm)
212 to this being possible for wireless NICs although without any
213 references (this may refer to so called "active probing"; see section
214 below). If this is the case it at the very least implies that we must
215 enforce the MAC spoofing setting as early as possible.
217 However, since we (obviously) cannot foresee the user's decision we get
218 a problematic time frame between when a network device is added during
219 early boot and when the user makes the decision later on. Enforcing a
220 default MAC spoofing setting immediately when a network device is
221 added, that then potentially is reversed when the user makes the
222 decision, leads to problems in some scenarios if we assume these early
225 * If MAC spoofing is enabled before the user has made the decision, a
226 fake MAC address would leak before the user made the decision, and
227 the decision was to disable MAC spoofing. The sudden switch of MAC
228 address may result in a breach of AvoidIdMacSpoof.
230 * If MAC spoofing is disabled before the user has made the decision, the
231 real MAC address would leak even if the user wanted MAC spoofing
232 enabled, which leaks to breaches of AvoidTracking and AvoidIdTails.
233 The sudden switch of MAC address may result in a breach of
236 The first is clearly less bad than the second, but the ideal, which
237 avoids these problems altogether.
239 The real solution is therefore to eliminate the problematic this time
240 frame completely by preventing any network devices from being enabled
241 at all until the decision has been made, and have the MAC spoofing
242 setting applied immediately when the device is added.
244 # User interface design
246 This option, which is of the on/off variety, will be implemented as a
247 check box in Tails Greeter. The problem is to formulate a concise
248 description that's clear and informative enough to guide the user to
249 make an informed decision.
251 In our previous blueprint we state that we want a user interface that
252 presents the option using "simple words such as 'I am using a public
253 computer' instead of speaking geek-language about mac addresses or
254 whatever". However, in the use case analysis above it's obvious that
255 simply "public or not" isn't enough to differentiate between the
256 different use cases, and it seems unlikely to be the case for any
257 other easily understood concept.
259 Therefore it seems that the label of the option isn't what we should
260 focus on, so we might just as well call it "Spoof all MAC addresses",
261 which at least can help advanced users that know what they're
262 doing. Beyond a concise summary in Tails Greeter, it's also highly
263 important that we have clear and complete documentation about this,
264 and that we make this documentation easily available from inside
267 # Active probe fingerprinting
269 **NO PREVENTION AGAINST THIS IS IMPLEMENTED YET**
271 There's an opportunity for an adversary to achieve AdvGoalTracking and
272 AdvGoalProfiling due to "active probing" performed by NetworkManager
273 for Wi-Fi connections. This puts AvoidTracking at risk.
275 Wi-Fi has both a passive and active scanning mode. Passive scanning,
276 as the name suggests, passively listens for broadcasted wireless
277 networks, which is entirely safe. Active scanning, however, actively
278 sends probes for any known networks. In our case these are the saved
279 connections in NetworkManager, so this turns especially problematic
280 when persistent NM-connections are used; the (potentially long) list of
281 networks actively probed for can be used as a fingerprint by an
282 adversary, breaching AvoidTracking.
284 While this has nothing to do with MAC spoofing, it does strongly
285 affect the (arguably) most important user goal of this feature, namely
286 AvoidTracking. Because of this, active scanning should be disabled in
287 NetworkManager when MAC spoofing is enabled.
291 The current implementation spoofs the non-vendors bits of any network
292 device's MAC address immediately after it is added by udev. Furthermore, to
293 deal with potential network leaks before the user has chosen whether
294 to enable MAC spoofing or not, the addition of network devices is delayed
295 until after Tails Greeter knows the user's final decision.
299 As suggested in the "Leak prevention" section, we block all network
300 devices' modules from being loaded until the user has made the decision about
301 whether to enable MAC spoofing or not. The way we do this is by
302 generating a list of all network device modules during build time, and
303 add these to a `modprobe.d`-type blacklist. In Tails Greeter's
304 post-login script (when we know the user's decision) we unblock the
305 network by simply removing that list, and then we have udev "re-probe"
306 for network devices and load their modules.
309 * [[!tails_gitweb config/chroot_local-hooks/80-block-network]] (run at
311 * [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-unblock-network]]
312 (run right after Tails Greeter logs in)
316 We use udev as the trigger that hooks MAC address spoofing. Because of
317 that, it happens for every Ethernet device automatically, as early as
318 possible (i.e. immediately after it's added), so even if there's some
319 kind of weird leak before a device is up:ed the real MAC address
323 [[!tails_gitweb config/chroot_local-includes/etc/udev/rules.d/00-mac-spoof.rules]]
325 ### Discarded approaches
327 All other triggers that were considered do not deal with the "early"
328 leaks issue, in addition to other reasons for being discarded:
330 * ifupdown hook: A if-pre-up hook would probably work but since we use
331 NetworManager the exact behaviour is blurred and not particularly
332 well-documented. It doesn't feel robust for this reason.
334 * NetworkManager hook: NM doesn't trigger events equivalent to
335 if-pre-up, so this isn't possible. See the commented parts in:
336 /etc/NetworkManager/dispatcher.d/01ifupdown
338 * systemd integration: We don't use this yet.
340 * NetworkManager plugin: While this certainly would have a nice impact
341 outside of Tails, the added maintenance burden makes it less
346 The tool used to change the MAC address is simply macchanger, mostly
347 because it's in Debian (where the known vulnerabilities are patched)
348 and macchiato isn't (and it's not as well tested, yet). macchanger is
349 used in a very straightforward way, so if we want to switch tool in
350 the future it's a simple task.
353 [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-spoof-mac]]
355 ## Connection failure detection
357 This section deals with AvoidConnectionProbs. The goal is to somehow
358 identify connection errors that are related to MAC spoofing, and
359 notify the user when this happens.
361 Due to lack of hooks into NetworkManager's connection error handling
362 we currently use a simple monitoring script that's started when MAC
363 spoofing is enabled. It scans syslog for the error message patterns
364 from NetworkManager and `wpa_supplicant` expected when the connection
365 fails due to MAC spoofing. When such a pattern is found, a
366 notification is shown to the user, stating that the connection problem
367 *may* be MAC spoofing related. Due to the uncertainty and lack of
368 information available for this approach, there certainly will be false
371 At the moment this script only deals with wireless connections. It
372 successfully distinguishes between MAC-spoof related errors and errors
373 when entering the wrong passphrase, so no false positives in that
374 (relatively common) case.
376 For details, see the script:
377 [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-blocked-network-detector]]
379 ## MAC spoofing and virtual machine networking issues
381 Some virtualization tools seem to behave poorly when spoofing virtual NIC
382 MAC addresses. For instance, VirtualBox's networking completely breaks
383 when using bridge- and NAT-based adapters in combination with
384 MAC-spoofing, and those two are probably the two most common scenarios
385 (NAT-based in particular). Therefore, if it is detected (using
386 `virt-what`) that Tails is running inside a virtual machine, then make
387 MAC spoofing default to being disabled. If the user still enables the
388 option, a warning is immediately shown.
390 When running Tails inside a virtual machine, MAC spoofing is mostly
391 useless, at least when NAT-based (and similar) approaches to network
392 sharing are used, since only the host system will see the MAC address.
393 However, that's not the case with bridged connections, but on the other
394 hand only the virtual NICs MAC address is leaked, which usually is
395 randomised upon creation any way. Still, this could leak to breaking
396 AvoidTracking, since the MAC address usually is persistent. We may
397 want to document this, and advice users to preferably use NAT-based
398 virtual adapters (which usually is the default). Users that must use
399 bridged connection will have to manually randomise the MAC address
404 ## Using NetwokManager for AvoidConnectionProbs?
406 Instead of our current hack, we'd ideally want to hook into
407 NetworkManager's error handling, which certainly would be more robust,
408 and hopefully would provide more information about the error, but this
409 currently seems unsupported.
411 An experiment has showed that when connecting to a password-protected
412 (WPA-PSK) wireless network with MAC address white-listing, spoofed
413 (and hence blocked) MAC addresses resulted in an endless cycle of NM
414 asking for passphrase. When cancelled, NM displays a "Disconnected"
415 notification, and during this time no NM dispatcher events were
418 Some bugs of interest that may bring some hope:
420 * <https://bugzilla.gnome.org/show_bug.cgi?id=387832>
421 * <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518368>
422 * <https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/336736>
424 ## Vendor bit randomisation with macchiato
426 These are the current relevant OUI counts from macchiato's git:
428 5 oui/bluetooth_laptop.sh
429 2 oui/bluetooth_misc.sh
430 12 oui/bluetooth_mobile.sh
431 1 oui/bluetooth_pmp.sh
432 2 oui/wired_console.sh
433 3 oui/wired_desktop_dedicated.sh
434 11 oui/wired_desktop_onboard.sh
435 8 oui/wired_infrastructure.sh
436 17 oui/wired_laptop.sh
438 4 oui/wired_printer.sh
439 2 oui/wireless_camera.sh
440 1 oui/wireless_console.sh
441 4 oui/wireless_desktop_dedicated.sh
442 2 oui/wireless_desktop_onboard.sh
443 4 oui/wireless_handheld.sh
444 6 oui/wireless_infrastructure.sh
445 1 oui/wireless_laptop_dedicated.sh
446 21 oui/wireless_laptop.sh
447 17 oui/wireless_mobile.sh
448 7 oui/wireless_pmp.sh
449 4 oui/wireless_printer.sh
450 8 oui/wireless_usb.sh
452 In particular there's ~20 each in wireless_laptop and wired_laptop,
453 which is what we should care about most (desktops rarely need MAC
454 spoofing). However, after investigating the sources for some OUI:s
455 (via git history), some OUI:s are (according to the submitter) only
456 common in certain geographical areas. This makes the lists too small
457 and unreliable at the moment.
459 # Questions, remaining issues, and other random stuff
463 In the current implementation there's no failsafe that verifies that
464 the selected MAC spoofing setting has been enforced before
465 connecting. This would be easy if there was something like pre-up NM
466 dispatcher hooks but just like in the section about "Connection
467 failure detection", there's none yet.
469 An alternative would be to do this in
470 [[!tails_gitweb config/chroot_local-includes/usr/local/sbin/tails-spoof-mac]], which
471 is run by the udev hook. In the end of the script we could try to
472 verify that the spoofing indeed happened for the NIC in question, and
473 if it didn't we could go into full-out panic mode:
475 1. Down the interface
476 2. Kill NetworkManager
477 3. Try to unload the module used by the NIC
478 4. Show a scary error message to the user
480 It would obviously require to drop `set -e`, because errors are indeed
481 what could cause this to happen.
483 ## Detecting MAC-spoof related connection errors for wired NICs
485 While Wi-Fi connection are covered, this gets trickier for wired
486 connections. The problem is that there's no strong concept of being
487 "associated" to a wired network (at least a "standard" one, perhaps
488 there is with 802.1x security...). It'll probably be hard to identify
489 blocking without confusing it with other types of wired connection
490 failures (i.e. false positives). How does wired MAC address blocking
491 usually work? On which level? DHCP? Lower layer?
493 # Old stuff from blueprint
495 ## Improving macchanger
497 Some of our goals would be easier to achieve by patching macchanger
498 itself. Since it's been unmaintained upstream for a while, we've been
499 discussing and working with someone who has taken its maintenance over
500 and has already started patching it to better suit our needs:
502 * [Redmine project](https://labs.riseup.net/code/projects/show/macchanger)
503 * Git repository: `git://labs.riseup.net/backupninja.git`
504 * Debian packages: the maintainer of the macchanger package in
505 Debian has already integrated some of these patches (uploaded to
506 sid: 1.5.0-8) and is likely to go on this way. Tails has been
507 using this improved version for a while.
509 ## Inspiration sources
513 Haven does not automatically start network-manager at boot time.
514 It provides shortcuts in the application menu to run macchanger-gtk
515 and start the network if desired.
519 Liberte Linux randomises wireless MAC addresses at boot time and
520 allows changing wired interfaces' MAC addresses after boot, see their
521 `src/usr/local/sbin/mac-randomize` that uses `ifconfig IFACE hw ether`
522 rather than macchanger.
526 Investigate and possibly document the kind of information that could
527 still be seen on the LAN about the system. Such as the manufacturer (ex:
528 Sony), model number, BIOS and version, etc.?