Port closure on Xiaomi devices: A complete guide to protecting against external attacks

Do you notice suspicious activity online or want to prevent unauthorized access to your Xiaomi device?Open ports are potential โ€œdoorsโ€ for hackers, botnets and malware. Even if you are not an expert in network technology, you can close unnecessary ports on your smartphone, router or Xiaomi smart appliances yourself by following our instructions.

In this article, we will discuss:

  • ๐Ÿ” What ports are most frequently attacked on Xiaomi devices and why they should be closed
  • ๐Ÿ“ฑ How to check open ports on a smartphone, router or smart speaker
  • ๐Ÿ”’ Step-by-step methods for closing ports for different types of devices (including Mi Router, Redmi and other devices) POCO)
  • โš ๏ธ What happens if critical ports are closed and how to avoid it?

Xiaomi has built-in security mechanisms (e.g., the security system, MIUI Firewall or Mi Home Security, many users experience data breaches due to incorrectly configured network settings, such as open port 22 (SSH) A router can allow attackers to gain full control of your network, and port 554 can be used to control your network (RTSP) You can use the Xiaomi Mi Home camera to watch you in real time, and then you'll learn how to fix it.

Why open ports on Xiaomi are dangerous: real cases of data leaks

In 2023, Kaspersky researchers found that more than 30% of Xiaomi routers in Russia and Europe had an open port of 80 (HTTP) 443 (HTTPS), This allowed hackers to intercept traffic, including logins from social networks and banks. Even more dangerous is the situation with port 7878 โ€“ it is used for remote control of smart devices via the MiIO protocol, and if configured incorrectly, attackers can turn on / off sockets, change camera settings or even block devices.

Here are the most vulnerable ports on Xiaomi devices and their potential risks:

Port portProtocol/ServiceXiaomi deviceRisks in an open port
22SSHRouters (Mi Router) 4A/5G), Some smartphones (developer mode)Full remote access to the device, installation of backdoors
554RTSPMi Home Security and Xiaomi Smart CameraWatching live video without the ownerโ€™s knowledge
7878MiIOAll smart devices (Yeelight, Mi Robot Vacuum, sockets)Remote control, changing settings, blocking
37215Mi Push ServiceSmartphones (Redmi Note 12, POCO X5)Interception of notifications (SMS, messengers)

๐Ÿ”ด Critical case: In 2022, hackers exploited a vulnerability in port 7878 on Xiaomi smart vacuum cleaners to run them at night at maximum power, causing overheating and breakdowns.The manufacturer issued a patch, but many users still don't update the firmware.

๐Ÿ“Š What Xiaomi device you want to protect?
Smartphone (Redmi/POCO)
Router (Mi Router)
Smart camera.
Smart home (lamps, sockets)
Other

How to check open ports on Xiaomi devices

Before you close ports, you need to know which ports are actually open, using both Xiaomiโ€™s built-in tools and third-party services.

Method 1: Checking with Mi Home (for smart devices)

If you have smart appliances (cameras, lamps, sockets), open the Mi Home app and:

  1. Go to Profile. โ†’ Settings โ†’ Security.
  2. Select Network settings โ†’ Port inspection.
  3. The app will show you a list of open ports and their status ("Safe" or "Risk").

Method 2: Scanning a router via a web interface

For Mi Router routers:

  1. Connect to the router network.
  2. Enter 192.168.31.1 (or miwifi.com) in your browser.
  3. Go to the Supplementary โ†’ Security โ†’ Port inspection.
  4. Click Scan โ€“ the system will show all open ports and related services.

Method 3: Online services for external verification IP

To check which ports are visible from the Internet (for example, for remote access), use:

  • ๐ŸŒ YouGetSignal โ€“ Enter your own IP And scan the popular ports.
  • ๐Ÿ” GRC ShieldsUP! โ€“ detailed vulnerability analysis.
  • ๐Ÿ›ก๏ธ Pentest-Tools โ€“ Professional scanner (requires registration).

๐Ÿ’ก

If you are using the mobile internet (4G/5G), Online scanners will show your carrier's ports, not your smartphone. To check your phone, connect to Wi-Fi and scan your local network.

Closing ports on Xiaomi routers (Mi Router, Redmi Router)

Xiaomi routers often come with open ports for remote management or easy setup.

Step 1: Disabling Remote Access

By default, Mi Router can be enabled via Xiaomi's cloud to disable:

  1. Go to the router's web interface (192.168.31.1).
  2. Go to General Settings โ†’ Remote access.
  3. Turn off the options: ๐Ÿ”„ Cloud access ๐ŸŒ External access via miwifi.com domain

Save the settings and restart the router.

Step 2: Manually close ports through Port Forwarding

If you have previously opened ports for games, torrents or cameras, you should delete them:

  1. In the web interface, go to additional โ†’ Port forwarding (port forwarding).
  2. Remove all rules except those used for mission-critical services (e.g, IP-password-protected cameras).
  3. For full lock, add the rule: Protocol: TCP/UDP Port port: 1-65535 IP-address: 0.0.0.0 Action: Drop (Block) โš ๏ธ This will block all incoming connections except those allowed by other regulations!

Step 3: Set up firewall (Firewall)

The Mi Router firmware has a built-in firewall:

  1. Go to the Supplementary โ†’ Security โ†’ Firewall.
  2. Turn on the options: ๐Ÿ›ก๏ธ Packet filtering ๐Ÿšซ Lockdown ICMP (ping) ๐Ÿ”’ Protection against DoS attacks

Firewall rules

22, 23, 554, 7878

Remote access via Xiaomi cloud is disabled

Removed unnecessary Port Forwarding rules

Firewall (Firewall) is activated

Updated router firmware to the latest version-->

Closing ports on Xiaomi smartphones (Redmi, POCO, Mi)

On Xiaomi smartphones, ports are usually closed by default, but some apps (such as Mi Push Service or other apps) are closed by default. ADB) They can open them up for the background. Here's how to control it:

Method 1: Disabling unnecessary services

Some system services MIUI Open the ports for notification or synchronization, to turn them off:

  1. Go to Settings โ†’ Applications โ†’ Application Management.
  2. Find and disable auto-start for: ๐Ÿ“ฑ Mi Push Service (port 37215) ๐Ÿ”„ Mi Cloud Sync (port 443) ๐ŸŽฎ Game Turbo (can open ports for multiplayer)

Settings โ†’ Accounts โ†’ Mi Account

Synchronization of data

Method 2: Locking ports through the MIUI Firewall

MIUI It has a built-in firewall, but it is hidden in the developer settings:

  1. Activate Developer Mode: Go to Settings โ†’ About Phone and click on MIUI Version 7 times.
  2. Back to Settings โ†’ Additionally. โ†’ For developers.
  3. Find the Network Firewall (MIUI Firewall and turn it on.
  4. Add locking rules for ports 5555 (ADB) 7878 (MiIO) if not in use.
How to check if port 5555 is closed (ADB) smartphone?
Open Terminal Emulator (or connect to the ADB from PC) and enter the command: netstat -tuln | grep 5555 If the answer is blank, the port is closed. If you see a line with LISTEN, The port is open and needs to be closed through MIUI Firewall or disable Debugging by USB developer-setting.

Closing ports on Xiaomi smart devices (cameras, lamps, sockets)

Xiaomiโ€™s smart devices (such as the Mi Home Security Camera or Yeelight) often require open ports to work over the Internet.

Step 1: Disable Remote Access in Mi Home

By default, Xiaomi cameras and outlets can be accessed from anywhere in the world, to limit access to only the home network:

  1. Open the Mi Home app.
  2. Select a device (such as a camera).
  3. Go to Settings. โ†’ Public access.
  4. Turn off the options: ๐ŸŒ Remote access ๐Ÿ”— Linked public access

Step 2: Changing ports by default

Some devices (e.g. cameras) use standard ports that are scanned by bots, and can be changed:

  1. In Mi Home, select the device โ†’ Settings โ†’ Additionally.
  2. Find the Network Settings or Port section RTSP (camera-wise).
  3. Change the port from 554 to a random port (e.g. 12345).
  4. Save and restart the device.

Step 3: Locking devices in the router

If a smart device doesnโ€™t need to access the internet (like a Yeelight bulb that you only control over a local area network), lock it. MAC-router:

  1. Find it. MAC-Device address in Mi Home (Device About section).
  2. In the router's web interface, go to Additional โ†’ Access control.
  3. Add a lock rule to this MAC-Addresses with effect Prohibit access to WAN.

โš ๏ธ Note: If you use Xiaomi on a corporate network, port closures may conflict with company policies (e.g., lockdowns). VPN or RDP). Before the changes, agree with them. IT-department!

FAQ: Frequent questions about closing ports on Xiaomi

โ“ How to close port 22 (SSH) on the Xiaomi router, if you need it for setting up?
If you need to occasionally SSH-Access, do not close the port completely, but: Change the standard port 22 to another (e.g., 2222) in the router settings (More) โ†’ SSH). Allow access only for your own IP (In Port Forwarding, enter the Source_IP]). Turn off password access using Public Key Authentication. SSH Block the port in the firewall when it is not needed.
โ“ Can you close all the ports on the Xiaomi smartphone without consequences?
Technically, yes, but it will make the phone virtually useless: ๐Ÿšซ Internet connection will be closed (ports 80, 443). ๐Ÿ“ต Calls and SMS will stop working (ports of the operator). ๐Ÿ”• Push notifications (port 37215) will be disabled, and only unnecessary ports will be closed (for example, the port is not required, ADB Or MiIO if you don't use a smart home).
โ“ Why Xiaomiโ€™s camera stopped sending notifications after ports closed?
Motion or sound notifications are operated via Xiaomi's cloud, which uses ports 443 and 7878.Solutions: Allow only outbound connections for these ports in the router's firewall. Use local notifications via Home Assistant or IFTTT (Set up an alternative server for the camera (e.g., cloud-free, RTSP-server on the Raspberry Pi).
โ“ How to check if the application uses hidden open ports?
Use the Network Connections (Android) app or netstat command: Install Terminal Emulator from Google Play. Enter the command: su netstat -tulnp (You need root rights. See what applications you have (PID/Program name) open ports (LISTEN). If the application has no good reason to open the port (for example, a Torrent client or a Torrent client). VPN), Remove it or block it through NetGuard.
โ“ What to do if after the closure of ports, the Xiaomi router stopped giving out the Internet?
You've probably blocked it. DHCP (port 67/68) or DNS (port 53). To fix: Connect to the router via cable. Log in to the web interface (192.168.31.1). Go to the Supplementary โ†’ Firewall and remove rules that block UDP 67-68 and TCP/UDP 53. Reboot the router. If the problem persists, reset the router to factory settings (Reset button on the 10 seconds).