Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
routersploit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
czos-dpend
routersploit
Commits
1ab8e5f8
Unverified
Commit
1ab8e5f8
authored
Jun 02, 2018
by
Marcin Bury
Committed by
GitHub
Jun 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding SSDP MSEARCH module (#446)
parent
ed19c564
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
0 deletions
+77
-0
ssdp_msearch.md
docs/modules/generic/upnp/ssdp_msearch.md
+22
-0
__init__.py
routersploit/modules/generic/upnp/__init__.py
+0
-0
ssdp_msearch.py
routersploit/modules/generic/upnp/ssdp_msearch.py
+55
-0
No files found.
docs/modules/generic/upnp/ssdp_msearch.md
0 → 100644
View file @
1ab8e5f8
## Description
Module sends M-SEARCH request to target and retrieve information from UPnP enabled systems.
## Verification Steps
1.
Start
`./rsf.py`
2.
Do:
`use generic/upnp/ssdp_msearch`
3.
Do:
`set target [TargetIP]`
4.
Do:
`run`
5.
If target supports UPnP information are retrieved.
## Scenarios
```
rsf > use generic/upnp/ssdp_msearch
rsf (SSDP M-SEARCH Info Discovery) > set target 192.168.1.1
[+] target => 192.168.1.1
rsf (SSDP M-SEARCH Info Discovery) > run
[*] Running module...
[*] 192.168.1.1:1900 | Custom/1.0 UPnP/1.0 Proc/Ver | http://192.168.1.1:5431/dyndev/uuid:ec2280e5-e804-04e8-e580-22ec22e50400 | uuid:ec2280e5-e804-04e8-e580-22ec22e50400::upnp:rootdevice
```
routersploit/modules/generic/upnp/__init__.py
0 → 100644
View file @
1ab8e5f8
routersploit/modules/generic/upnp/ssdp_msearch.py
0 → 100644
View file @
1ab8e5f8
import
re
from
routersploit.core.exploit
import
*
from
routersploit.core.udp.udp_client
import
UDPClient
class
Exploit
(
UDPClient
):
__info__
=
{
"name"
:
"SSDP M-SEARCH Info Discovery"
,
"description"
:
"Sends M-SEARCH request to target and retrieve information from UPnP "
"enabled systems."
,
"authors"
:
(
"Marcin Bury <marcin[at]threat9.com>"
,
# routersploit module
),
"references"
:
(
"http://www.upnp-hacks.org/upnp.html"
,
),
}
target
=
OptIP
(
""
,
"Target IPv4 or IPv6"
)
port
=
OptPort
(
1900
,
"Target UPNP Port"
)
def
run
(
self
):
request
=
(
"M-SEARCH * HTTP/1.1
\r\n
"
+
"HOST: {}:{}
\r\n
"
.
format
(
self
.
target
,
self
.
port
)
+
"MAN:
\"
ssdp:discover
\"\r\n
"
+
"MX: 2
\r\n
"
+
"ST: upnp:rootdevice
\r\n\r\n
"
)
udp_client
=
self
.
udp_create
()
self
.
udp_send
(
udp_client
,
request
)
response
=
self
.
udp_recv
(
udp_client
,
1024
)
if
response
:
info
=
{}
regexps
=
{
"server"
:
r"Server:\s*(.*?)\r\n"
,
"location"
:
r"Location:\s*(.*?)\r\n"
,
"usn"
:
r"USN:\s*(.*?)\r\n"
,
}
for
key
in
regexps
.
keys
():
res
=
re
.
findall
(
regexps
[
key
],
response
,
re
.
IGNORECASE
)
if
res
:
info
[
key
]
=
res
[
0
]
else
:
info
[
key
]
=
""
print_status
(
"{}:{} | {} | {} | {}"
.
format
(
self
.
target
,
self
.
port
,
info
[
"server"
],
info
[
"location"
],
info
[
"usn"
]))
else
:
print_error
(
"Target did not respond to M-SEARCH request"
)
self
.
udp_close
(
udp_client
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment