Disable captive portal detection
Overview
This script improves your privacy on macOS.
These changes use Mac system commands to update your settings.
This script enhances your privacy and security by disabling automatic detection of captive portals, preventing unintended network connections. However, this change requires users to manually open a web browser to access such networks 1.
Overview of captive portals
Captive portals are also known as subscription or Wi-Fi Hotspot networks 2. These are common in public places like coffee shops, hotels, and airports 2 3 4. These portals redirect users to specific webpages where they must log in 2 3 4 5 6. Typically, this page requires users to enter personal details, like email and phone number, and agree to terms of service 2 3 5 6. This poses privacy risks because your personal details may be used for marketing or other purposes.
macOS captive portal flow
On macOS, when connecting to a WiFi network:
- The system checks for captive portals by sending requests to specific URLs 5 6:
- If the request gets redirected, then Apple knows there is a portal 5.
- macOS opens a limited browser to allow login 4 5 6.
The browser used for this, called the 'Captive Network Assistant' 4 7,
is found at
/System/Library/CoreServices/Captive Network Assistant.app
7. This browser is based on Safari 4. Its limitation may cause issues with some networks 4.
Security and privacy concerns with captive portals
Using captive portals raises security and privacy issues:
- Data Collection and Monitoring: Captive portals often require you to submit personal details such as email and phone numbers 2 3 5, which may be used for marketing or sales 3. Additionally, they facilitate the tracking of your behaviors and activities, linking these to your identity 3.
- Data Leakage: Devices send data about network connections to Apple without user consent 5 6, compromising privacy.
- False Sense of Security: The login window may falsely imply that networks with captive portals are more secure, which is not necessarily true 3.
- Misplaced Trust: Captive portals can alter HTTPS connections, causing frequent security warnings 3. Ignoring these alerts can lower your security awareness 3.
- WISPr: Credential Theft and XML Attacks: Captive portals that use WISPr technology might expose users to risks of credential theft and attacks based on XML 5.
- False Captive Portals (Evil Twins): Fake captive portals, designed to look like legitimate ones, can steal sensitive information such as credit card data and user credentials 6.
- Fraud/Fake Website due to MiTM Attacks: Attackers may exploit captive portals using HTML injection and cross-site scripting to deploy malicious code 6, directing users to harmful sites or stealing data.
- Captive Portal Detection Interference: Some captive portals hinder or manipulate devices' built-in mechanisms for detecting and managing them 3. This manipulation can broaden your device's exposure to attacks, potentially compromising its security.
- Unintended Application Launch: Devices may automatically open applications for captive portal logins without user consent 4 6 7, risking unauthorized access and exposure to threats like malware.
Solution and impact
Disabling captive portal detection stops automatic login page prompts. It requires users to manually navigate to these pages when needed 1. This change reduces the risk of automatic data collection and unwanted network interactions but may inconvenience users frequently connecting to public networks.
This script disables the captive portal detection by modifying the system setting
/Library/Preferences/SystemConfiguration/com.apple.captive.control.plist!Active
8.
This script does not:
- Alter the system application (
/System/Library/CoreServices/Captive Network Assistant.app
), which is protected by "System Integrity Protection (SIP)" 7. - Block captive portal hosts by manipulating DNS records 4 6. Instead, it disables automatic checks but allows manual access when needed 1.
After disabling this feature, you must manually access network login pages at places like airports and cafes. This may involve some technical steps.
This script uses Bash (Shell script) scripting language.
This script is only recommended if you understand its implications. Some non-critical or features may no longer function correctly after running this script.
Implementation Details
-
Language: bash
-
Required Privileges: Administrative (sudo) access
-
Compatibility: macOS only
-
Reversibility: Can be undone using provided revert script
Explore Categories
This action belongs to Security improvements category. This category configures macOS using 18 scripts. These scripts are organized in 6 categories. The category includes 1 subscripts and 5 subcategories that include more scripts and categories. Read more on category page ▶
Apply now
Choose one of three ways to apply:
- Automatically via privacy.sexy: The easiest and safest option.
- Manually by downloading: Requires downloading a file.
- Manually by copying: Advanced flexibility.
Alternative 1. Apply with Privacy.sexy
privacy.sexy is free and open-source application that lets securely apply this action easily.
You can fully restore this action (revert back to the original behavior) using the application.
privacy.sexy instructions
- Open or download the desktop application
- Search for the script name:
Disable captive portal detection
. - Check the script by clicking on the checkbox.
- Click on Run button at the bottom of the page.
Alternative 2. Download
This script is irreversible, meaning there is no straightforward method to restore changes once applied. Exercise caution before running, restoring it may not be possible.
-
Download the script file by clicking on the button below:
-
Run the script file by clicking on it.
Download revert script
This file restores your system to its original state, before this script is applied.
Alternative 3. Copy
This is for advanced users. Consider automatically applying or downloading the script for simpler way.
-
Open Terminal app
-
Copy the following code:
sudo defaults write '/Library/Preferences/SystemConfiguration/com.apple.captive.control.plist' Active -bool false
- Paste the code into terminal.
- Press Enter to apply the code.
Some scripts requires restarting your computer to take affect.
Copy restore code
Copy and run the following code to restore changes:
sudo defaults delete '/Library/Preferences/SystemConfiguration/com.apple.captive.control.plist' Active
Support
This website relies on your support.
Your donation helps keep the project alive and improves its content ❤️.
Share this page: