GitHub RadarBlue team tool
A wireless access point orchestration framework that leverages Linux networking subsystems to create software-defined network infrastructure with captive portal authentication, NAT routing capabilities, and DHCP services directly from Android terminal environments. (termux) Primary language: Shell. 53 stars.
Project links:Open GitHub projectBack to radar
SECURITY ADVISORY: This software creates network infrastructure that can potentially be exploited for phishing attacks, unauthorized device access, or malicious application distribution. Exercise extreme caution and understand all security implications before deployment. This tool hasn't been tested either
Compilation page for Termux: [termux/termux-packages#10160](https://github.com/termux/termux-packages/issues/10160)
Termux-Hotspot is an networking utility that enables Android devices to function as a wireless access points with authentication capabilities. The solution leverages low-level networking subsystems to implement:
The system architecture employs a multi-layered approach:
┌───────────────────────────────────────────┐
│ Termux Environment │
├───────────┬───────────────┬───────────────┤
│ hostapd │ dnsmasq │ Python HTTP │
│ (802.11) │ (DHCP/DNS) │ Server │
├───────────┴───────────────┴───────────────┤
│ Linux Networking Subsystem │
│ (IP Tables, Routing, Interface Mgmt) │
├───────────────────────────────────────────┤
│ Android Network Infrastructure │
└───────────────────────────────────────────┘# Clone the repository
git clone https://github.com/CPScript/Termux-Hotspot.git
cd Termux-Hotspot
# Set execution permissions
chmod +x software/hotspot.sh# Install required packages
pkg update
pkg install root-repo
pkg install tsu hostapd dnsmasq python
# Verify installations
command -v hostapd >/dev/null 2>&1 || echo "hostapd not installed"
command -v dnsmasq >/dev/null 2>&1 || echo "dnsmasq not installed"
command -v python >/dev/null 2>&1 || echo "python not installed"The repository provides an automated configuration script for rapid deployment:
# Navigate to software directory
cd software
# Execute the main script with root privileges
sudo ./hotspot.shDuring execution, you'll be prompted to configure:
For environments requiring customized deployment, follow this systematic implementation procedure:
First, identify your device's wireless interface and internet-connected interface:
# List network interfaces
ip link
# Identify default route interface
ip route | grep default# Create virtual AP interface (if supported)
iw dev wlan0 interface add wlan0ap type __ap
# If virtual interface creation fails, use physical interface
# Set interface in AP mode
ip link set wlan0 down
ip link set wlan0 upCreate a configuration file at /etc/hostapd/hostapd.conf:
interface=wlan0ap # Or wlan0 if virtual interface not supported
driver=nl80211
ssid=YourNetworkName # Customize this
hw_mode=g
channel=7 # Select optimal channel for your environment
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=YourStrongPassword # Customize this
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMPCreate a configuration file at /etc/dnsmasq.conf:
interface=wlan0ap # Must match hostapd interface
dhcp-range=192.168.1.2,192.168.1.100,255.255.255.0,12hStart the required services:
# Kill any existing instances
killall hostapd dnsmasq 2>/dev/null
# Start hostapd
hostapd /etc/hostapd/hostapd.conf &
# Start dnsmasq
dnsmasq &Enable IP forwarding and configure NAT:
# Enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Detect internet-connected interface
WAN_IF=$(ip route | grep default | awk '{print $5}')
# Set up NAT routing
iptables -t nat -A POSTROUTING -o $WAN_IF -j MASQUERADE
iptables -A FORWARD -i wlan0ap -o $WAN_IF -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i $WAN_IF -o wlan0ap -j ACCEPTFor environments requiring authentication:
# Start the captive portal server
python server.py &This implementation presents several security considerations:
For production deployments, implement these hardening measures:
| Issue | Diagnostic Approach | Resolution Strategy | |-------|---------------------|---------------------| | hostapd fails to start | Check hostapd -dd /etc/hostapd/hostapd.conf for detailed errors | Verify interface exists, no conflicting Wi-Fi services, and correct driver support | | No IP addresses assigned | Examine logcat -b all \| grep dnsmasq | Verify dnsmasq is running and configured correctly | | No internet connectivity | Check ip route and iptables -t nat -L -v | Ensure IP forwarding is enabled and NAT rules are correct | | Clients can connect but no portal | Check netstat -tulpn \| grep python | Verify the Python server is running and accessible |
For persistent deployment across reboots:
# Create init script
cat > /data/local/hotspot_init.sh <<EOF
#!/system/bin/sh
# Startup script for hotspot
/path/to/hostapd /etc/hostapd/hostapd.conf &
/path/to/dnsmasq &
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o [WAN_INTERFACE] -j MASQUERADE
EOF
# Make executable
chmod +x /data/local/hotspot_init.sh
# Add to init.rc or use Magisk for persistent startupFor high-density environments:
# hostapd performance tuning
beacon_int=100
dtim_period=2
rts_threshold=2347
fragm_threshold=2346---
© 2025 Termux-Hotspot | Maintained by CPScript (Not Tested)