21

A bluetooth device that is not mine nor under my control asks my computer to pair, about every minute or so.

Interestingly, it's fairly effective as a DOS attack actually.

Disabling my BT is not an option, since I need it for my BT devices.

I want to tell OSX to ignore this particular BT device, but I can't figure out how.

user50849
  • 311
  • Is it your device? – Ruskes May 09 '13 at 08:48
  • 1
    Good question. No, it is not. – user50849 May 09 '13 at 10:38
  • If the device is attached to a person who owns it, why don't you ask that person to take care of the problem. BTW/ what kind of device is it? – IconDaemon May 09 '13 at 11:09
  • In my particular situation, that's not a problem. The problem even worked it self out already as a different computer nearby was turned on, and the device (a keyboard) happily attached itself to that computer instead. But assume this isn't feasibly. I'm in a cafe where I don't know which device it is, or I have complete control over all devices, but a Bluetooth implementation is buggy and I can't make it behave properly. – user50849 May 09 '13 at 11:41
  • There could also be real malicious intent behind the behavior. Like the question says, this works as a DOS-attack, as the window that pops up steals focus from whatever else the user is currently doing. – user50849 May 09 '13 at 12:17
  • was the device ever paired to your computer in the past? – dwightk Apr 07 '14 at 14:15
  • I'm guessing the answer is yes, but not by me, so I can't be sure. – user50849 Apr 07 '14 at 14:20
  • I have the same issue, every day "Samsung SM-N900A" jumps onto my list of connections and my mouse gets disconnected! No one in our office has this device but it could be someone else in a nearby office. I like that things can be easily connected but in cases like this it would be great if there was a blacklist option. – Andrew Oct 28 '15 at 17:31
  • This *bug* does still exist in macOS Sierra 10.12.5. – Itachi May 27 '17 at 09:35
  • I'm having the same problem, still. Disabling MAC addresses doesn't work for me because I'm getting hit from multiple addresses. Six so far this morning, with no end in sight. Isn't this a security issue? Why is my Mac allowing unpaired Bluetooth devices to take over my audio? – D Mac Jul 24 '19 at 17:12
  • @DMac Don't worry, it's clearly a bug. you are not supposed to know it's happening, just like your MRT updates. I'm sure Tim weeps with anguish that he got caught throttling batteries. Now a 2 year upgrade cycle is now 4. Sell me an AppleMobile? You know they don't have the chops for that, Plus routers and NAT are the problem. Solution? Silent passwordless connections, via BLE? Peer to peer? Any old peer? Barebackin Buggy Bluetooth Behind my Back? I'm in line at the store, listening to my tunes and my phone is telling every other phone the results of the enumeration of my network interfaces? – chiggsy Jul 27 '19 at 06:57
  • I don't really see why Apple thinks it's just fine to reach through my phone, communicate against my wishes and without even a signal and do things to improve their business, at my expense. They have been talking up iBeacons for a few years now, selling quite a few units. Why would you buy one? Well, how else am I going to see your spam? Filters on my email, ad blocking on my browsers, my firewalls stealth everything, i sabotaged webrtc, but Apple is going to ignore all that and use my data to get these merchants to buy beacons and beam ads at me on the street. Whore's work, but I still pay. – chiggsy Jul 27 '19 at 09:05

5 Answers5

9

The GUI way

Press and hold together the Option + Shift ( + ) and the click the Bluetooth icon in the topbar.

A Debug submenu will appear as shown below: macos reset bluetooth

You get the options to Remove all devices and Factory reset all connected Apple devices — pick whichever you need.

The terminal way

Open terminal and type:

  1. sudo rm /Library/Preferences/com.apple.Bluetooth.plist Enter
  2. rm ~/Library/Preferences/com.apple.Bluetooth.plist Enter
  3. Reboot OSX.

The commands above will remove the MAC addresses of the 'remembered' bluetooth devices from the systems settings. If you want to have a look at the actual contents of those files copy the original file to a user-writable folder and then do:

plutil -convert xml1 com.apple.Bluetooth.plist,

and then open it with a text editor (it is an XML file).

To convert it back to binary use

plutil -convert binary1 com.apple.Bluetooth.plist.

ccpizza
  • 2,995
  • 3
  • 36
  • 41
  • 2
    That looks promising, but any sort of details about what it does would be good. :) – user50849 Apr 07 '14 at 09:19
  • My changes to this plist get reverted by OS X all the time :/ (macOS Sierra 10.12.2) – rdrey Jan 16 '17 at 20:15
  • This doesn't work. New devices still get added to the plist somehow. How is it possible that a Bluetooth device can successfully connect to a Mac without going through pairing? This is a successful attack vector that it seems everybody is ignoring. – D Mac Jul 26 '19 at 17:18
8

Inspired by @ccpizza's answer.

Open terminal and type:

  1. sudo plutil -convert xml1 /Library/Preferences/com.apple.Bluetooth.plist
  2. Find the MAC address of the offending Bluetooth device. You can find it by searching /Library/Preferences/com.apple.Bluetooth.plist.
  3. Add this section to the plist:

    <key>IgnoredDevices</key>
    <array>
            <string>ff-ff-ff-ff-ff-ff</string>
    </array>
    

Where FF:FF:FF:FF:FF:FF is the MAC address of the offending Bluetooth device.

  1. sudo plutil -convert binary1 /Library/Preferences/com.apple.Bluetooth.plist
  2. Reboot OS X if necessary.
wjl
  • 1,358
  • 1
    does not work for me. when I restart the bluetooth and check the file, the ignored devices is empty again – Pyrolistical Oct 30 '14 at 18:59
  • I could not convert it back, did same as here: /Library/Preferences/com.apple.Bluetooth.plist: Property List error: Close tag on line 924 does not match open tag array / JSON error: JSON text did not start with array or object and option to allow fragments not set. – sevenfourk May 10 '17 at 13:06
  • Is it necessary to convert the plist back to binary format? I've never done, although I've also never edited this specific one... – Wowfunhappy Mar 10 '19 at 02:26
  • @wowfunhappy I think it is necessary, but if you check out edo42's answer below, using defaults write will do this without having to hand-edit the plist. – wjl Mar 13 '19 at 14:53
7
  1. Find the MAC address of the culprit Bluetooth device
  2. Disable Bluetooth
  3. Type sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices -array-add '<ENTER MAC ADDRESS HERE>' in the terminal
  4. Enable Bluetooth again
albianto
  • 171
  • 4
    After enabling Bluetooth the IgnoredDevices array is empty again for me. El Capitan 10.11.5 (15F34). – mgol May 24 '16 at 15:41
  • Doesn't work. A new device (with a different and new MAC addr) gets into the plist a few minutes later. – D Mac Jul 26 '19 at 17:18
1

Unfortunately cant comment here. I need to hide neighbours BT devices. None of this worked on MacOS 12. It's an old OS so shouldn't be complicated. I look at the com.apple.Bluetooth.plist file every time I did the changes as per instructions but the issue is the section where is supposed to include the ignored list of addresses stays blank. So I even used PlistEdit and manually edited that file by following the format required and then copied the plist back to Preferences folder and changed back permissions all correct.

Once I enabled Bluetooth again, the file was overwritten in front of my eyes by the original file so the Ignored list became again empty.

I am wondering if I need to temporary turn off System Integrity Protection? Could this be the reason the file gets restored back?

Or am I supposed to do in this sequence:

  1. turn of bluetooth
  2. edit the file / change permissions correctly
  3. reboot
  4. turn on bluetooth?

I spent quite a bit time with this so far, so before I continue fooling around even more, I need to ask if any of these additional steps are what would make sense to get the edited file to load.

That's what I am seeing regarding similar issues but not sure if this will work here.

0

I came across this post because I saw a mysterious Android device connecting and disconnecting with my desktop Mac and I wanted to figure out how to block it because I have no idea how my computer had allowed it to pair originally.

Anyway, none of the above solutions worked for me (although I didn't try the nuke all pairing information option) for the same reasons others cited, but I tried a slightly different approach:

  1. Turn off your Mac's Bluetooth
  2. Run sudo defaults write ~/Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices -array-add '<MAC_ADDRESS_HERE>' to add the device's MAC address to the user copy of the com.apple.Bluetooth.plist file instead of the system copy. You can run sudo defaults read ~/Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices to see that it was added.
  3. Turn on your Mac's Bluetooth
  4. Run sudo defaults read ~/Library/Preferences/com.apple.Bluetooth.plist IgnoredDevices again to confirm that the added MAC address stuck after Bluetooth was re-enabled.

It's been a few hours since I did this and I haven't seen any sign of the mysterious Android phone reconnecting with my Mac (I had stumbled upon a way to see how many times the mystery device connected with my computer).

webbower
  • 101
  • Well the mystery device tried to reconnect a few times since posting my above answer, but it's doing so with different MAC addresses so now I need to figure out if I can block a device by its name. But it was not with the MAC address I blocked – webbower Jun 21 '20 at 18:59