captive-portal | simple captive portal that uses iptables | Firewall library
kandi X-RAY | captive-portal Summary
kandi X-RAY | captive-portal Summary
This is a very simple cpative portal that uses IPTABLES and python's BaseHTTPServer. When it is executed it blocks all traffic except DNS and redirects all HTTP traffic to a login page. When a user enters the correct credentials a new IPTABLES entry is added and all the traffic originating from the IP address of that user is allowed.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Handle POST request .
- Handle GET request .
captive-portal Key Features
captive-portal Examples and Code Snippets
Community Discussions
Trending Discussions on captive-portal
QUESTION
I am looking for a way to implement a captive portal for the windows 10 - mobile hotspot. The idea is to redirect all devices that connect to the hotspot to a webpage.
I was able to find this article which shows how to do it in linux.
But I have been unsuccessful in finding a similar one for windows. Posts like this one proved to be dead ends.
I am okay with using a simple nginx server to give 302 redirect response to clients if needed, but prefer not to use any existing software that implements a captive portal.
UPDATE
I have succeeded in triggering a captive portal on clients (linux laptop, android device etc) using a workaround.
Whenever a device connects to the hotspot it sends a request to some predefined websites to check if the wifi connection has internet access. If it gets a 302 response it generates the captive portal window.
So I added the following entries to the hosts file on windows machine.
...ANSWER
Answered 2020-Mar-13 at 07:43The setup I mentioned in the UPDATE above was tweaked finally to get where I wanted. I used dnschef, an open-source dns server that works perfectly as a command line client. The steps followed.
Start windows mobile hotspot.
Go to Network adapters => Select hotspot adapter => Change IPv4 settings => set 127.0.0.1 as DNS server.
- Start dnschef with
--fakeip = 192.168.137.1
- Start an http server on 192.168.137.1 and give 302 redirect response to all requests.
And that's it! Whenever a device connects to the hotspot, it will attempt to connect to any one of the preset websites used to determine internet connectivity. These requests will be resolved locally by dnschef to our Nginx server. The Nginx server then gives a 302 redirect which triggers captive portal on the client.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install captive-portal
You can use captive-portal like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page