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
b1e77def
Commit
b1e77def
authored
May 11, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding widgets functionality.
parent
9751ee5a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
__init__.py
routersploit/__init__.py
+1
-0
exploits.py
routersploit/exploits.py
+14
-4
widgets.py
routersploit/widgets.py
+10
-0
No files found.
routersploit/__init__.py
View file @
b1e77def
...
...
@@ -16,4 +16,5 @@ from routersploit.utils import (
from
routersploit
import
exploits
from
routersploit
import
wordlists
from
routersploit
import
widgets
routersploit/exploits.py
View file @
b1e77def
...
...
@@ -3,14 +3,19 @@ from itertools import chain
import
threading
import
time
from
routersploit.utils
import
print_status
from
routersploit.utils
import
print_status
,
NonStringIterable
class
Option
(
object
):
""" Exploit attribute that is set by the end user. """
def
__init__
(
self
,
default
,
description
=
""
):
self
.
default
=
default
def
__init__
(
self
,
default
,
description
=
""
,
widgets
=
()):
if
isinstance
(
widgets
,
NonStringIterable
):
self
.
widgets
=
widgets
else
:
self
.
widgets
=
(
widgets
,)
self
.
default
=
self
.
_apply_widgets
(
default
)
self
.
description
=
description
self
.
data
=
WeakKeyDictionary
()
...
...
@@ -18,7 +23,12 @@ class Option(object):
return
self
.
data
.
get
(
instance
,
self
.
default
)
def
__set__
(
self
,
instance
,
value
):
self
.
data
[
instance
]
=
value
self
.
data
[
instance
]
=
self
.
_apply_widgets
(
value
)
def
_apply_widgets
(
self
,
value
):
for
widget
in
self
.
widgets
:
value
=
widget
(
value
)
return
value
class
ExploitOptionsAggregator
(
type
):
...
...
routersploit/widgets.py
0 → 100644
View file @
b1e77def
def
url
(
address
):
"""Sanitize url.
Converts address to valid HTTP url.
"""
if
address
.
startswith
(
"http://"
)
or
address
.
startswith
(
"https://"
):
return
address
else
:
return
"http://{}"
.
format
(
address
)
\ No newline at end of file
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