<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Nmap%2FUPnP</id>
	<title>Nmap/UPnP - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Nmap%2FUPnP"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Nmap/UPnP&amp;action=history"/>
	<updated>2026-06-20T05:10:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Nmap/UPnP&amp;diff=20377&amp;oldid=prev</id>
		<title>Admin at 09:36, 12 August 2017</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Nmap/UPnP&amp;diff=20377&amp;oldid=prev"/>
		<updated>2017-08-12T09:36:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://charlesreid1.com/w/index.php?title=Nmap/UPnP&amp;amp;diff=20377&amp;amp;oldid=10272&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Nmap/UPnP&amp;diff=10272&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;UPnP Discovery With Nmap  In a previous segment I covered how you can use Nmap to enumerate hosts via broadcast protocols, such as UPnP with the following command:  nmap -Pn -...&quot;</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Nmap/UPnP&amp;diff=10272&amp;oldid=prev"/>
		<updated>2016-04-03T09:59:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;UPnP Discovery With Nmap  In a previous segment I covered how you can use Nmap to enumerate hosts via broadcast protocols, such as UPnP with the following command:  nmap -Pn -...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;UPnP Discovery With Nmap&lt;br /&gt;
&lt;br /&gt;
In a previous segment I covered how you can use Nmap to enumerate hosts via broadcast protocols, such as UPnP with the following command:&lt;br /&gt;
&lt;br /&gt;
nmap -Pn -n --script=broadcast&lt;br /&gt;
&lt;br /&gt;
It seems the Nmap team has added functionality (or I just have new stuff going on on my network, or both!). So check this out, it detect Dropbox in use:&lt;br /&gt;
&lt;br /&gt;
| broadcast-dropbox-listener: &lt;br /&gt;
| displayname  ip             port   version  host_int  namespaces&lt;br /&gt;
|_77339174     192.168.1.205  17500  1.8      77339174  69385827, 61346060, 82845516, 54162449, 69420146, 6768627, 58215509, 58372182&lt;br /&gt;
&lt;br /&gt;
UPnP Discovery and Control with Backtrack 5 and Miranda&lt;br /&gt;
&lt;br /&gt;
I am still fascinated with what information can be gathered from passive sniffing and broadcast traffic. I decided to take a deeper dive into UPnP, knowing that I have some deviced on my network that are running it (such as my TV, receivers, and Roku players). I found a tool called Miranda, written in 2008 it allows you to enumerate UPnP devices, gater information from them, and even make changes if the device allows that. My mission? From the network be able to mute my TV. Here&amp;#039;s how I did it:&lt;br /&gt;
&lt;br /&gt;
Miranda comes pre-installed on Backtrack 5, which is very handy. The first thing to do is fire it up (its located in /pentest/enumeration/miranda). First you need to execute a search for UPnP devices using the msearch command:&lt;br /&gt;
&lt;br /&gt;
upnp&amp;gt; msearch&lt;br /&gt;
&lt;br /&gt;
Entering discovery mode for &amp;#039;upnp:rootdevice&amp;#039;, Ctl+C to stop...&lt;br /&gt;
&lt;br /&gt;
****************************************************************&lt;br /&gt;
SSDP reply message from 192.168.1.213:8060&lt;br /&gt;
XML file is located at http://192.168.1.213:8060/&lt;br /&gt;
Device is running Roku UPnP/1.0 MiniUPnPd/1.4&lt;br /&gt;
****************************************************************&lt;br /&gt;
&lt;br /&gt;
****************************************************************&lt;br /&gt;
SSDP reply message from 192.168.1.224:52236&lt;br /&gt;
XML file is located at http://192.168.1.224:52236/rcr/RemoteControlReceiver.xml&lt;br /&gt;
Device is running Linux/9.0 UPnP/1.0 PROTOTYPE/1.0&lt;br /&gt;
****************************************************************&lt;br /&gt;
&lt;br /&gt;
****************************************************************&lt;br /&gt;
SSDP reply message from 192.168.1.214:52235&lt;br /&gt;
XML file is located at http://192.168.1.214:52235/dmr/SamsungMRDesc.xml&lt;br /&gt;
Device is running Linux/9.0 UPnP/1.0 PROTOTYPE/1.0&lt;br /&gt;
****************************************************************&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;ve pruned the list for brevity, but you can see one Roku, my receiver and my TV. Turns out the receiver and TV use the same commands. Interesting to think how you could generalize commands and script them on a network. Next you can list out all the hosts dicovered:&lt;br /&gt;
&lt;br /&gt;
upnp&amp;gt; host list&lt;br /&gt;
&lt;br /&gt;
	[0] 192.168.1.213:8060&lt;br /&gt;
	[1] 192.168.1.219:8060&lt;br /&gt;
	[2] 192.168.1.215:8060&lt;br /&gt;
	[3] 192.168.1.224:52236&lt;br /&gt;
	[4] 192.168.1.214:52235&lt;br /&gt;
	[5] 192.168.1.241:8888&lt;br /&gt;
	[6] 192.168.1.16:2869 &lt;br /&gt;
&lt;br /&gt;
Use the host get command to read the entire tree of UPnP commands. This needs to be successful if you are to be able to send commands to the device:&lt;br /&gt;
&lt;br /&gt;
 upnp&amp;gt; host get 5&lt;br /&gt;
&lt;br /&gt;
Requesting device and service info for 192.168.1.241:8888 (this could take a few seconds)...&lt;br /&gt;
&lt;br /&gt;
Host data enumeration complete!  &lt;br /&gt;
&lt;br /&gt;
Now review some information about the device using the host summary command:&lt;br /&gt;
&lt;br /&gt;
 upnp&amp;gt; host summary 5&lt;br /&gt;
&lt;br /&gt;
Host: 192.168.1.241:8888&lt;br /&gt;
XML File: http://192.168.1.241:8888/upnp_descriptor_0&lt;br /&gt;
MediaRenderer&lt;br /&gt;
	manufacturerURL: http://www.onkyo.com&lt;br /&gt;
	modelName: TX-NR509&lt;br /&gt;
	modelNumber: TX-NR509&lt;br /&gt;
	presentationURL: http://192.168.1.241/&lt;br /&gt;
	friendlyName: TX-NR509&lt;br /&gt;
	fullName: urn:schemas-upnp-org:device:MediaRenderer:1&lt;br /&gt;
	modelDescription: AV Receiver&lt;br /&gt;
	UDN: uuid:aeb01704-c117-04b9-db1e-0409c1b9c871&lt;br /&gt;
	modelURL: http://www.onkyo.com&lt;br /&gt;
	manufacturer: ONKYO &lt;br /&gt;
&lt;br /&gt;
The host info command gives you some further data:&lt;br /&gt;
&lt;br /&gt;
upnp&amp;gt; host info 5&lt;br /&gt;
&lt;br /&gt;
xmlFile : http://192.168.1.241:8888/upnp_descriptor_0&lt;br /&gt;
name : 192.168.1.241:8888&lt;br /&gt;
proto : http://&lt;br /&gt;
serverType : MediabolicMWEB/1.8.225&lt;br /&gt;
upnpServer : Linux/2.6.33-rc4 UPnP/1.0 MediabolicUPnP/1.8.225&lt;br /&gt;
dataComplete : True&lt;br /&gt;
deviceList : {}&lt;br /&gt;
&lt;br /&gt;
You can save all of this data to disk with the following commands:&lt;br /&gt;
&lt;br /&gt;
upnp&amp;gt; save data onkyo&lt;br /&gt;
&lt;br /&gt;
Host data saved to &amp;#039;struct_onkyo.mir&amp;#039;&lt;br /&gt;
&lt;br /&gt;
upnp&amp;gt; save info 5 onkyo&lt;br /&gt;
&lt;br /&gt;
Host info for &amp;#039;192.168.1.241:8888&amp;#039; saved to &amp;#039;info_onkyo.mir&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Inside the file info_onkyo is all the commands for reference:&lt;br /&gt;
&lt;br /&gt;
Device information:&lt;br /&gt;
        Device Name: MediaRenderer&lt;br /&gt;
                Service Name: AVTransport&lt;br /&gt;
                        controlURL: /upnp_control_2&lt;br /&gt;
                        eventSubURL: /upnp_event_2&lt;br /&gt;
                        serviceId: urn:upnp-org:serviceId:AVTransport&lt;br /&gt;
                        SCPDURL: /scpd/AVTransport_1&lt;br /&gt;
                        fullName: urn:schemas-upnp-org:service:AVTransport:1&lt;br /&gt;
                        ServiceActions:&lt;br /&gt;
                                SetNextAVTransportURI&lt;br /&gt;
                                        InstanceID&lt;br /&gt;
                                                A_ARG_TYPE_InstanceID:&lt;br /&gt;
                                                        dataType: ui4&lt;br /&gt;
                                                        sendEvents: N/A&lt;br /&gt;
                                                        allowedValueList: []&lt;br /&gt;
                                                direction: in &lt;br /&gt;
&lt;br /&gt;
Next we execute the command, pasing is the serviceID, tag, and command:&lt;br /&gt;
&lt;br /&gt;
 upnp&amp;gt;  host send 5 MediaRenderer RenderingControl GetMute&lt;br /&gt;
&lt;br /&gt;
Required argument:&lt;br /&gt;
	Argument Name:  InstanceID&lt;br /&gt;
	Data Type:      ui4&lt;br /&gt;
	Allowed Values: []&lt;br /&gt;
	Set InstanceID value to: 0&lt;br /&gt;
&lt;br /&gt;
Required argument:&lt;br /&gt;
	Argument Name:  Channel&lt;br /&gt;
	Data Type:      string&lt;br /&gt;
	Allowed Values: [&amp;#039;Master&amp;#039;, &amp;#039;LF&amp;#039;, &amp;#039;RF&amp;#039;]&lt;br /&gt;
	Set Channel value to: Master&lt;br /&gt;
&lt;br /&gt;
CurrentMute : 0&lt;br /&gt;
&lt;br /&gt;
We can see above the TV or receiver is not muted. Next, we can chenge the value:&lt;br /&gt;
&lt;br /&gt;
upnp&amp;gt;  host send 5 MediaRenderer RenderingControl SetMute&lt;br /&gt;
&lt;br /&gt;
Required argument:&lt;br /&gt;
	Argument Name:  InstanceID&lt;br /&gt;
	Data Type:      ui4&lt;br /&gt;
	Allowed Values: []&lt;br /&gt;
	Set InstanceID value to: 0&lt;br /&gt;
&lt;br /&gt;
Required argument:&lt;br /&gt;
	Argument Name:  DesiredMute&lt;br /&gt;
	Data Type:      boolean&lt;br /&gt;
	Allowed Values: []&lt;br /&gt;
	Set DesiredMute value to: 1&lt;br /&gt;
&lt;br /&gt;
Required argument:&lt;br /&gt;
	Argument Name:  Channel&lt;br /&gt;
	Data Type:      string&lt;br /&gt;
	Allowed Values: [&amp;#039;Master&amp;#039;, &amp;#039;LF&amp;#039;, &amp;#039;RF&amp;#039;]&lt;br /&gt;
	Set Channel value to: Master &lt;br /&gt;
&lt;br /&gt;
It was pretty neat to be able to mute the TV over the network. This is a documented &amp;quot;feature&amp;quot;, but should require some sort of authentication. Think about the devices on your nework that have this enabled, or could have this enabled. Good Lord, I hope there are no SCADA devices implementing this protocol, however if a control channel is left open without authentication, this is where things can go wrong.&lt;br /&gt;
&lt;br /&gt;
I should note, that in order to get this to work, I had to modify the source code. When commands were being sent to the device, it was not building the POST request correctly, and ignoring one of the directories. So I changed the following lines:&lt;br /&gt;
&lt;br /&gt;
if self.ENUM_HOSTS[index][&amp;#039;proto&amp;#039;] in service[&amp;#039;SCPDURL&amp;#039;]:&lt;br /&gt;
		-xmlFile = service[&amp;#039;SCPDURL&amp;#039;]&lt;br /&gt;
		+xmlFile = &amp;#039;dmr/&amp;#039; + service[&amp;#039;SCPDURL&amp;#039;]&lt;br /&gt;
	else:&lt;br /&gt;
		-xmlFile += service[&amp;#039;SCPDURL&amp;#039;]&lt;br /&gt;
		+xmlFile += &amp;#039;dmr/&amp;#039; + service[&amp;#039;SCPDURL&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
Yea, its a &amp;quot;wicked hack&amp;quot; and the logic needs to be changed to modify the path on the fly of the POST request.&lt;br /&gt;
UPnP Inspector&lt;br /&gt;
&lt;br /&gt;
This tool does not come with Backtrack 5, however use the following two commands to install it:&lt;br /&gt;
&lt;br /&gt;
# apt-get install python-setuptools&lt;br /&gt;
&lt;br /&gt;
# easy_install UPnP-Inspector&lt;br /&gt;
&lt;br /&gt;
Once installed it gives you a GUI to discover, browse, and send commands to devices. The neat part about this program is that you can browse files over UPnP if its configured to do so.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>