Disable captive portal detection
- macOS onlyThis script improves your privacy on macOS
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Impact: Medium
System Functionality / Data Loss Risk: Moderate
This action improves privacy with minimal impact when you run the recommended script.
This action improves privacy with some impact when you run the recommended script. - Bash (Shell script)These changes use macOS system commands to update your settings.
- Administrative (sudo) access requiredThis script requires privilege access to do the system changes
- Fully reversible
You can fully restore this action (revert back to the original behavior) using this website.
The restore/revert methods provided here can help you fix issues.
Overview
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 is only recommended if you understand its implications.
Some non-critical or features may no longer function correctly after running this script.
This script can be fully reversed to restore changes if something goes wrong.
Sources
- Force captive portal sign in page to open - Apple Community. discussions.apple.com. (2024).
Original: https://discussions.apple.com/thread/250195103
Archived: https://archive.ph/2024.06.07-084600/https://discussions.apple.com/thread/250195103?sortBy=best - Use captive Wi-Fi networks on your iPhone or iPad - Apple Supportsupport.apple.com. (2024).
Original: https://support.apple.com/en-us/102554
Archived: https://web.archive.org/web/20240604205332/https://support.apple.com/en-us/102554 - How Captive Portals Interfere With Wireless Security and Privacy. Electronic Frontier Foundation. eff.org. (2024).
Original: https://www.eff.org/deeplinks/2017/08/how-captive-portals-interfere-wireless-security-and-privacy
Archived: https://web.archive.org/web/20240530092050/https://www.eff.org/deeplinks/2017/08/how-captive-portals-interfere-wireless-security-and-privacy - An undocumented change to Captive Network Assistant settings in OS X 10.10 Yosemite. On the Subject Of Macs. grpugh.wordpress.com. (2017).
Original: https://grpugh.wordpress.com/2014/10/29/an-undocumented-change-to-captive-network-assistant-settings-in-os-x-10-10-yosemite
Archived: https://web.archive.org/web/20170622064304/https://grpugh.wordpress.com/2014/10/29/an-undocumented-change-to-captive-network-assistant-settings-in-os-x-10-10-yosemite/ - Disabling Mac OS Captive Portal Redirection. www.divertednetworks.net. (2013).
Original: http://www.divertednetworks.net/apple-captiveportal.html
Archived: https://web.archive.org/web/20130407200745/http://www.divertednetworks.net/apple-captiveportal.html - wifi - How to automatically login to captive portals on OS X? - Ask Different. apple.stackexchange.com. (2024).
Original: https://apple.stackexchange.com/questions/45418/how-to-automatically-login-to-captive-portals-on-os-x/74473
Archived: https://web.archive.org/web/20240604205338/https://apple.stackexchange.com/questions/45418/how-to-automatically-login-to-captive-portals-on-os-x/74473#74473 - Technical notes, my online memory: Disable Captive Network Support in OS X. ilostmynotes.blogspot.com. (2024).
Original: https://ilostmynotes.blogspot.com/2012/09/disable-captive-network-support-in-os-x.html
Archived: https://web.archive.org/web/20240604205756/https://ilostmynotes.blogspot.com/2012/09/disable-captive-network-support-in-os-x.html - blog.erratasec.com. (2024).
Original: https://blog.erratasec.com/2010/09/apples-secret-wispr-request.html
Archived: https://web.archive.org/web/20240609154113/https://blog.erratasec.com/2010/09/apples-secret-wispr-request.html#.WdnPa5OyL6Y
Apply Now
Choose one of three ways to apply:
Help
How to apply or restore "Disable captive portal detection" using script
- ≈ 3 min to complete
- Tools: Web Browser
- Difficulty: Medium
- ≈ 5 instructions
- 1
Download
Download the script file by clicking on thebutton above.
Use button above to restore changes. - 2
Keep the file
If warned by your browser, keep the file. - 3
Open
Open the downloaded file. - 4
Exit
Once it's done, press any key to exit the window. - 5
Restart
Restart your computer for all changes to take effect.
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
Help
How to apply or restore "Disable captive portal detection" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2
Choose script
- Search for the script name: Disable captive portal detection
- Check the script by clicking on the checkbox.
- 3
Run
Click on ▶️ Run button at the bottom of the page.This button only appears on desktop version (recommended). On browser, use 💾 Save button.
- Apply
- Revert
sudo defaults write '/Library/Preferences/SystemConfiguration/com.apple.captive.control.plist' Active -bool false
InN1ZG8gZGVmYXVsdHMgZGVsZXRlICcvTGlicmFyeS9QcmVmZXJlbmNlcy9TeXN0ZW1Db25maWd1cmF0aW9uL2NvbS5hcHBsZS5jYXB0aXZlLmNvbnRyb2wucGxpc3QnIEFjdGl2ZSI=
Help
How to apply or restore "Disable captive portal detection" using commands
- ≈ 2 min to complete
- Tools: Terminal app
- Difficulty: undefined
- ≈ 3 instructions
- 1
Open terminal
Open Terminal app. - 2
Copy code
Copy the code: - 3
Paste & run
Paste the code into Terminal and press Enter to run.Some changes require a system restart to take effect
Similar Guides
Wider Goal
The guide below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.
These plans combine multiple privacy settings, including this one, for stronger protection.
This document —security improvements— provides guidance on how to establish robust privacy protection on macOS. What's more, you'll learn how to reset the changed ...
Same Goal
Other guides in Security improvementsSee settings that are in the same category as this guide.
Using other actions in the same category may help you achieve your goal better.
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:Expert review by undergroundwires
- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
Public review by large community
- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
History
We continually monitor our guides, their impact and all other privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.