1. Current Location: Home >  Router Encyclopedia >  After opening the router and UPnP in three steps, the game console plugged in and connected to the game

After opening the router and UPnP in three steps, the game console plugged in and connected to the game

UPnP three-step code schematic: SSDP shouting, obtaining the manual, and SOAP commands automatically map ports

Last time I wrote about UPnP, I counted a count in the backend: there were eleven maps lying in the AX3000T list, and none of the ones I manually opened myself. The PS5 has five drives, while the remaining ones have notes labeled as qBittorrent and WeChat, all opened by them themselves. At the time, I was only focused on whether to turn it off, but after I got back, the more I thought about it, the more uneasy it felt—these apps didn't even know my router's management password, so how did they open the door? This time, I opened the secret passage and saw that it was actually just a three-step code, and each step could clearly explain the message to the message.

The name is a wish from 1999, and now

the work is just a small part of it

UPnP stands for Universal Plug and Play, which is plug-and-play. The name was inspired by the Plug and Play model from Windows 1995—back then, you could insert a sound card and connect a printer, and the system could recognize it on its own without manually assigning the interrupt number, which was revolutionary. In 1999, Microsoft wanted to bring this blessing to the internet: devices plugged in a network cable would recognize and cooperate with each other, without needing to be matched by anyone. This wish was realized with Windows ME back then, and the UPnP Forum was established in October 1999, initiated by both Microsoft and Intel. Later, in 2016, this matter was merged into the Open Connection Foundation, and the regulations have always been maintained.

After more than twenty years, this big wish has been halfway through: the DLNA system for screen casting is indeed the underlying mechanism. The TV at home can be found by the phone, following the same discovery mechanism. But if we talk about what the home uses frequently every day in 2026, it's actually a small part—automatic port mapping. Routers package themselves as devices called IGD (Internet Gateway Device), and software attached to the internal network can remotely control them to open ports. Whether the PS5 connects smoothly and whether the download port status lights up green are all behind the scenes, this small part is at work.

To understand why it can be "automatic," you need to break down the three-step code one by one. The following formats aren't rhetorical words I copied from a tutorial; they look like black-and-white messages in the specification. You can just grab a packet and match them yourself.

Step one: Announce the message. Same voice as mDNS, but different passwords

The first thing the software did to get the router door was to shout into the room. This call is called SSDP, following the same approach as mDNS—both call to a fixed multicast address, and whoever is there responds. mDNS is the voice of port 5353 at 224.0.0.251, which manages "ask name" (Who is nas.local); The SSDP is the 1900 port at 239.255.255.250, which handles "finding services" and asks "Is there a gateway device in this room?"

The original text of that voice looks like this:

M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 3
ST: upnp:rootdevice

Translated: Find the device (ssdp:discover must be in quotation marks; without it, it won't be recognized), wait at most 3 seconds (MX line), find a device (ST line). When the router heard its name, it unicast back with a single message of 200 OK, containing a key line of information—LOCATION, a URL. I previously discussed the group broadcast action in the group broadcast post; the whole room could hear it loudly, but it was unrelated and unresponsive.

By the way

, this port 1900 is also registered in the port number dictionary. Normally, it's a domestic matter on the internal network, but if some dumb device exposes it to the public network, that voice becomes a reflex and amplified attack—you shout and it responds, the attacker forges the victim's address to shout, and the one getting hit becomes the one replying. This is one of the accounts where UPnP was named; we'll count them all together.

Step 2: Get the manual. The router handed over an XML

What is the LOCATION website for? When the software is obtained, it will be accessed like a browser. What the router returned was an XML "manual"—describing itself as an IGD: what my name is, what services I have, what actions each service can be remotely controlled, and which address the remote sends commands.

The

most valuable section of this manual is a service entry called WANIPConnection. To put it simply, the router admits: "I have a row of switches on my door, each switch has its own port forwarding, and you can dial it." The manual also provided the control link—the software now not only knew where the door was, but also got the keyhole location.

This step is quite carefully designed: the call only addresses "Where are you?", while the manual addresses "What can you do?" The two steps are separate, so the same discovery process can serve screen casting, printers, gateways, and various devices, each with its own manual and service. The software only needs the page related to ports in the manual; it doesn't read anything else.

Step 3: Issue the order. With an AddPortMapping slot, the door opens

Now it's time for remote control. The software sends a command in SOAP format to the address provided in the manual, with the action called AddPortMapping. The parameters are laid out in just a few panels:

in is ported on the or Which device is
What parameters to fill—give an example
NewExternalPortpublic network side 3074
NewProtocolTCP or UDPUDP
NewInternalPort to which port inside the house3074
NewInternalClient to? 192.168.31.50
NewPortMappingDescription Note, written to the owner to see PS5
NewLeaseDuration: The lease period is 0 seconds, meaning permanent

The router received it, followed instructions, and from now on, there will be an extra item in the mapping list. This is how the PS5 connects to the internet when powered on—it reports its own IP and port, the router is opened, and when the connection is detected, the NAT type is on, so you don't need to dig into the background and click a rule. qBittorrent shows a green light in the port column when seeding, which is also the result of the same action. When the lease expires or the equipment is released off the line, some will even reclaim it themselves, which is cleaner than the manual one.

The note section is reserved for you. Looking at the mapping list, almost every open grid had the owner's name written on it—that's why, when I counted eleven items back then, not a single one was mine: each had a factory-written note and registered it myself.

What is its relationship to manual port forwarding and DMZ

?

All three things govern the same door; the difference lies in who opens it and how wide

needed, and you can use it all Specify how many and specify how many ports. . If . and downloading software
Manual port forwarding UPnPDMZ
Who will open it for you? Go to the backend and fill in the rules. The software can open it asat once.
ports to openTear down the entire wall
the ports are correct, fill in the wrong ports, and it's for nothingYou know which software you want, so it doesn't matter. It's fully accessible
It's suitable for NAS, monitoring fixed devices like gaming consoles,if you can avoid it

I explained the manual part in the

There's a scenario it can't fix: under double NAT, it malfunctions. The previous AddPortMapping command uses multicast calls to find the router that "directly connects to that hop," and the command only goes down to that point. If your optical modem is also in router mode, with a layer in front, and the software opens the door on the inner router, the outer optical modem is still closed, but the outside cannot get in—this is one of the four deadly sins of double NAT. It's precisely the half that many people get stuck in online NAT checks: UPnP is enabled but only half is enabled; the root cause is not the switch but the topology.

Why is it always mentioned in security articles

?

Once the mechanism is dismantled, the security issue is no longer just a "risk" issue; the accounts can be calculated very specifically.

First point: Calling out not to identify others. Anyone can shout the SSDP command M-SEARCH, and anyone can send the AddPortMapping command—as long as it's running on your intranet. PS5 can run it, and even a program of unknown origin can be launched. After opening it, it even pretends to write "system" in the remarks. The router never asked "Who are you?" from start to finish. That's why veterans get nervous when they see unclear entries in the mapping list: When a router is hacked for self-checking, that list is one of the five must-check places.

The second point is on the public network side: if the 1900's voice leaks to the external network by the device, it becomes a reflection amplification turret in someone else's hands, as mentioned earlier. This isn't your responsibility, but the router's firmware default setting like "disable UPnP response on the WAN side" is meant to prevent this.

To be fair, you have to say: the command program in the intranet is already standing in your living room. If you really want to do bad things, you might not have to go this way. So it's a 'trade-off between convenience and access control,' not a 'naked run.' My compromise is three—check the mapping list every so often, identify the owner by the notes, and delete anything I don't understand; All fixed devices (NAS, monitoring) must be turned on manually, leaving no room for automation; If you activate double NAT and it just wastes your time, just don't worry about it.

Whether to shut it down completely or keep it is another matter. I wrote about the full decision to turn off UPnP, including the plan to strike WeChat video and PS5 multiplayer first after shutting down. This article is only responsible for thoroughly explaining the mechanism: once you know which door it opens and who opened it, you'll only understand what you're deleting when you browse the list.

If you want to see it in person, there are two entry points: the router's backend UPnP mapping list, where you can view the ready-made ledger; Or install a packet capture tool on your computer, fill in ssdp as filter conditions, wait for the device to go online or the software launch, and then those M-SEARCH and 200 OK sentences will pop up on their own. Match the code in three steps, and this secret passage won't be mysterious to you.

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《After opening the router and UPnP in three steps, the game console plugged in and connected to the game》
Article URL: https://www.shunot.com/en/lybk/1329.html
Unless otherwise stated, all articles are original by 《SHUNOT》. Reposting is welcome! Please indicate the original URL when reposting, thank you.

Contact Us

Online Consultation: Click here to send me a message

WeChat ID: master_135

Scan to follow