0

Goal:

I want to run a web server that provides a Captive portal service on an Android Device, using the native Android Soft AP/Hotspot, Termux, NodeJs, and the "new" way to detect captive portals using a DHCP option: Captive-Portal Identification in DHCP and Router Advertisements (RAs),.

Approach:

I want to add an option on the DHCP handshake of my Android Device Soft AP as specified in the RFC, Apple and Android official forums.

(the old way to create a captive portal was to intercept and controll all DNS or HTTP requests of each device conected to the AccessPoint, but in order to do it I need to ROOT my Device and install a DNS server or change the IP tables, and I dont want to do it becouse is very similar of what I already did that on a RaspberryPi)

Current State:

Im able to run a local Http Server running Nodejs in Termux app on an NOT ROOTED Android device,I want to know if it is posible to ADD THAT SIMPLE DHCP OPTION to the Android DHCP native handshake, maybe creating an APP and using the wifi-softap-tethering utilities or changing some kind of DHCP config file in some location like /etc/dhcp/dhcp.conf to add the option.

If adding a DHCP option is not posible Im gonna change the IP tables or run a DNS server and intercept the trafic to provide the Captive Portal Detection as the OLD fashion way.

Previous Attempts:

I was able to create a captive portal using DNSMASQ and HOSTAPD on a RaspberryPi, I suppose that I can do the same on MY Android device, but I want to USe the "modern Way" using DHCP captive portal options.

Unknowns

  1. Where is the configuration of the local Android DHCP?, is it hardcoded in the source code or it exists in a /system/{some-dhcp-func}/dhcp.conf file?
  2. Is it posible to add a DHCP option to the native Android Soft AP functionality?
  3. Can I use or extend some offical Class of Android apk and create my app to add the DHCP Option in the Handshake?
  4. Do I really need to root my device, install a DNS server and intercept all the DNS /HTTP trafic to provide the captive portal functionality?
1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Jul 19, 2022 at 15:43

0

You must log in to answer this question.