UnixDroid

Lesson 5 of 5 · 7 min

Network tools in Termux

Use ping, Nmap, curl and whois from your phone to explore your own home network safely.

Your phone is connected to a network all day. With Termux you can look at that network the same way a security tester would, as long as it's your own.

Only scan your own home network, or a network you have written permission to test. Scanning office, college or public Wi-Fi without permission can get you into serious trouble.

Network commands to try in Termux
Network commands to try in Termux

Step 1: Install the tools

pkg install nmap whois curl

Step 2: Find your network

Open Android Settings → Wi-Fi, tap your network, and look for the IP address (something like 192.168.1.7) and the gateway or router (usually 192.168.1.1). If your IP starts with 192.168.1., your network is most likely 192.168.1.0/24.

Step 3: Check your connection

ping -c 4 8.8.8.8

Four replies with low times means your internet works. Press Volume Down + C to stop it if you leave out -c 4.

Step 4: Find devices at home

nmap -sn 192.168.1.0/24

You'll see your phone, your router, and every laptop, TV and smart plug that's online. Many people are surprised how many devices they have.

Step 5: Scan your own router

nmap 192.168.1.1

Typical results are 53 (DNS), 80 and 443 (the router's admin page). Without root, Termux uses a TCP connect scan, which is a bit slower than a SYN scan but works fine.

If you find something like 23/tcp open telnet on your router, that's worth fixing: log in to the router and turn it off, or update its firmware.

Step 6: Look at websites and domains

curl -I https://example.com
whois example.com

curl -I shows the server's response headers. whois shows who registered the domain and when.

Try it yourself
  1. Find your phone's IP and your router's IP from Wi-Fi settings.
  2. Run nmap -sn on your home network and count the devices. Can you identify each one?
  3. Scan your router with nmap and write down every open port and what it's for.

Quick check

Without root, Nmap in Termux uses a TCP what scan instead of a SYN scan?

Need a hint?

It completes the full handshake.

Finished this lesson?

Done lessons keep your daily streak going 🔥

0 day streak

0 lessons done

best 0 days

Log in to keep your streak on every device →