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
a9087776
Commit
a9087776
authored
Jul 05, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flexible exploit creation
parent
8f50b7c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
utils.py
routersploit/utils.py
+6
-9
rsf.py
rsf.py
+2
-1
No files found.
routersploit/utils.py
View file @
a9087776
...
...
@@ -441,21 +441,18 @@ def boolify(value):
return
bool
(
value
)
def
create_exploit
(
path
):
def
create_exploit
(
path
):
# TODO: cover with tests
from
.templates
import
exploit
try
:
module_type
,
vendor
,
name
=
path
.
split
(
os
.
sep
)
except
ValueError
:
print_error
(
"Invalid path. ;("
)
return
parts
=
path
.
split
(
os
.
sep
)
module_type
,
name
=
parts
[
0
],
parts
[
-
1
]
if
module_type
not
in
[
'creds'
,
'exploits'
,
'scanners'
]:
print_error
(
"Invalid module type. ;("
)
return
create_resource
(
name
=
os
.
path
.
join
(
module_type
,
vendor
),
name
=
os
.
path
.
join
(
*
parts
[:
-
1
]
),
content
=
(
Resource
(
name
=
"{}.py"
.
format
(
name
),
...
...
@@ -466,7 +463,7 @@ def create_exploit(path):
)
def
create_resource
(
name
,
content
=
(),
python_package
=
False
):
def
create_resource
(
name
,
content
=
(),
python_package
=
False
):
# TODO: cover with tests
""" Creates resource directory in current working directory. """
root_path
=
os
.
path
.
join
(
MODULES_DIR
,
name
)
mkdir_p
(
root_path
)
...
...
@@ -497,7 +494,7 @@ def create_resource(name, content=(), python_package=False):
print_success
(
"{} successfully created."
.
format
(
name
))
def
mkdir_p
(
path
):
def
mkdir_p
(
path
):
# TODO: cover with tests
"""
Simulate mkdir -p shell command. Creates directory with all needed parents.
:param path: Directory path that may include non existing parent directories
...
...
rsf.py
View file @
a9087776
...
...
@@ -9,7 +9,8 @@ from routersploit.utils import create_exploit
parser
=
argparse
.
ArgumentParser
(
description
=
'RouterSploit - Router Exploitation Framework'
)
parser
.
add_argument
(
'--add-exploit'
,
parser
.
add_argument
(
'-a'
,
'--add-exploit'
,
metavar
=
'exploit_path'
,
help
=
'Add exploit using default template.'
)
...
...
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