Captive portal

本文介绍了Captive Portal技术,一种在网络中强制客户端通过特殊网页进行认证的方法。文章详细解释了其实施方式,包括通过HTTP重定向、IP重定向及DNS重定向实现的技术细节,并列举了一些常用的Captive Portal软件。

Captive portal

From Wikipedia, the free encyclopedia

Jump to: navigation, search

The captive portal technique forces an HTTP client on a network to see a special web page (usually for authentication purposes) before surfing the Internet normally. Captive portal turns a Web browser into a secure authentication device.[1] This is done by intercepting all packets, regardless of address or port, until the user opens a browser and tries to access the Internet. At that time the browser is redirected to a web page which may require authentication and/or payment, or simply display an acceptable use policy and require the user to agree. Captive portals are often employed at most Wi-Fi hotspots, and it can be used to control wired access (e.g. apartment houses, hotel rooms, business centers, "open" Ethernet jacks) as well.

Since the login page itself must be presented to the client, either that login page is locally stored in the gateway, or the web server hosting that page must be "whitelisted" via a walled garden to bypass the authentication process. Depending on the feature set of the gateway, multiple web servers can be whitelisted (say for iframes or links within the login page). In addition to whitelisting the URLs of web hosts, some gateways can whitelist TCP ports. The MAC address of attached clients can also be set to bypass the login process.

Contents

[hide]

[edit] Implementation

There is more than one way to implement a captive portal.

[edit] Redirection by HTTP

If an unauthenticated client requests a website, DNS is queried by the browser and the appropriate IP resolved as usual. The browser then sends an HTTP request to that IP address. This request, however, is intercepted by a firewall and forwarded to a redirect server. This redirect server responds with a regular HTTP response which contains HTTP status code 302 to redirect the client to the Captive Portal. To the client, this process is totally transparent. The client assumes that the website actually responded to the initial request and sent the redirect.

[edit] IP Redirect

Client traffic can also be redirected using IP redirect on the layer 3 level. This is not recommended as the content served to the client does not match the URL

[edit] Redirection by DNS

When a client requests a website, DNS is queried by the browser. The firewall will make sure that only the DNS server(s) provided by DHCP can be used by unauthenticated clients (or, alternatively, it will forward all DNS requests by unauthenticated clients to that DNS server). This DNS server will return the IP address of the Captive Portal page as a result of all DNS lookups.

Some naive implementations don't block outgoing DNS requests from clients, and therefore are very easy to bypass; a user simply needs to configure their computer to use another, public, DNS server. Implementing a firewall or ACL that ensures no inside clients can use an outside DNS server is critical.

[edit] Software Captive Portals

  • ChilliSpot - linksys firmware (open source) [abandoned]
  • CoovaChilli - both an open source linksys firmware and linux daemon
  • FirstSpot - commercial Windows based hotspot software
  • Hotspotexpress - software based for Linux platform (commercial)
  • WiFiDog Captive Portal Suite - small C based kernel solution (embeddable)
  • Wilmagate - C++ based and is executable both in Linux and Windows/Cygwin environments
  • pfSense - FreeBSD 6.1 based firewall software derived from m0n0wall
  • SweetSpot - Linux user-space, layer-3 daemon (open source)
  • Air Marshal - software based for Linux platform (commercial)
  • "TocToc" - software based for Linux platform generated by the Technical University of Valencia (open source).
  • "DNS Redirector" - software based for Windows servers, now freeware.

Captive portals are gaining increasing use on free open wireless networks where instead of authenticating users, they often display a message from the provider along with the terms of use. Although the legal standing is still unclear (especially in the USA) common thinking is that by forcing users to click through a page that displays terms of use and explicitly releases the provider from any liability, any potential problems are mitigated. They also allow enforcement of payment structures.

[edit] Limitations

Most of these implementations merely require users to pass an SSL encrypted login page, after which their IP and MAC address are allowed to pass through the gateway. This has been shown to be exploitable with a simple packet sniffer. Once the IP and MAC addresses of other connecting computers are found to be authenticated, any machine can spoof the MAC address and IP of the authenticated target, and be allowed a route through the gateway. For this reason some captive portal solutions created extended authentication mechanisms to limit the risk for usurpation.

Platforms that have Wi-Fi and a TCP/IP stack but do not have a web browser that supports HTTPS cannot use many captive portals. Such platforms include the Nintendo DS running a game that uses Nintendo Wi-Fi Connection. Non browser authentication is possible using WISPr, an XML-based authentication protocol for this purpose, or MAC-based authentication or authentications based on other protocols.

There also exists the option of the platform vendor entering into a service contract with the operator of a large number of captive portal hotspots to allow free or discounted access to the platform vendor's servers via the hotspot's walled garden, such as the deal between Nintendo and Wayport. For example, VoIP SIP ports could be allowed to bypass the gateway to allow phones to work.

[edit] See also

[edit] References

  1. ^ CaptivePortal
源码来自:https://pan.quark.cn/s/41b9d28f0d6d 在信息技术领域中,jQuery作为一个广受欢迎的JavaScript框架,显著简化了诸多操作,包括对HTML文档的遍历、事件的管理、动画的设计以及Ajax通信等。 本篇文档将深入阐释如何运用jQuery达成一个图片自动播放的功能,这种效果常用于网站的轮播展示或幻灯片演示,有助于优化用户与页面的互动,使网页呈现更加动态的视觉体验。 为了有效实施这一功能,首先需掌握jQuery的核心操作。 通过$符号作为接口,jQuery能够迅速选取DOM组件,例如$("#id")用于选取具有特定ID的元素,而$(".class")则能选取所有应用了某类class的元素。 在选定元素之后,可以执行多种行为,诸如事件监听、样式的变更、内容的更新以及动画的制作等。 关于“一个基于jQuery的图片自动播放功能”,首要任务是准备一组图片素材,这些素材将被整合至一个容器元素之中。 例如,可以构建一个div元素,将其宽度设定为单张图片的尺寸,再借助CSS实现溢出内容的隐藏,从而构建出水平滚动的初始框架。 ```html<div id="slider"> <img src="image1.jpg" alt="Image 1"> <img src="image2.jpg" alt="Image 2"> <!-- 更多图片内容... --></div>```接着,需要编写jQuery脚本以实现图片的自动切换。 这通常涉及到定时器的运用,以设定周期性间隔自动更换当前显示的图片。 通过使用`.fadeOut()`和`.fadeIn()`方法,能够实现图片间的平滑过渡,增强视觉效果。 ```javascript$(document).re...
### 如何通过命令行禁用或关闭Captive Portal 系统 在 Linux 系统中,可以通过调整系统设置或使用特定命令来禁用 Captive Portal 的检测机制。以下是一些方法和相关命令: #### 方法一:通过 `settings` 命令禁用 Captive Portal 检测 对于 Android 或基于 Linux 的设备,可以使用 `adb shell` 命令修改全局设置以禁用 Captive Portal 的 HTTP 和 HTTPS 检测 URL: ```bash adb shell settings delete global captive_portal_http_url adb shell settings delete global captive_portal_https_url ``` 这些命令将删除系统中用于检测 Captive Portal 的默认 URL 配置,从而禁用该功能[^3]。 #### 方法二:通过 `NetworkManager` 禁用 Captive Portal 检测 在 Ubuntu 或其他使用 `NetworkManager` 的 Linux 发行版中,可以通过停止和禁用 `NetworkManager` 服务来间接禁用 Captive Portal 检测: ```bash sudo systemctl stop NetworkManager sudo systemctl disable NetworkManager ``` 需要注意的是,禁用 `NetworkManager` 服务可能会导致网络管理功能受限,因此建议仅在必要时使用此方法[^1]。 #### 方法三:修改配置文件禁用 Captive Portal 在某些系统中,Captive Portal 的检测机制可以通过修改配置文件来禁用。例如,在 `/etc/NetworkManager/NetworkManager.conf` 文件中添加以下内容: ```ini [connectivity] uri= response= ``` 这将禁用 `NetworkManager` 的连通性检查功能,从而避免 Captive Portal 的自动检测[^1]。 #### 方法四:通过 AC 控制器禁用 Captive Portal 如果 Captive Portal 是由 AC 控制器(如 UniFi 控制器)管理的,则需要登录到控制器界面或通过命令行禁用相关功能。例如,在 UniFi 控制器中,可以通过以下步骤禁用来宾 Portal 的重定向功能: 1. 登录 UniFi 控制器。 2. 进入网络设置,找到来宾网络配置。 3. 禁用来宾 Portal 的重定向功能[^2]。 此外,如果使用了 Localuser 模式或其他认证方式,确保相关账号和密码配置正确,以避免不必要的限制[^4]。 ### 注意事项 - 在执行上述命令之前,请确保已备份重要数据。 - 修改系统设置可能会影响网络连接功能,请谨慎操作。 - 如果设备未启用 ADB 功能,需先通过 `adb devices` 检查设备是否被识别。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值