-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f317cd8
Showing
58 changed files
with
5,134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# IntelliJ project files | ||
.idea | ||
out | ||
gen | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# VS Code | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Copyright 2016, The RouterSploit Framework (RSF) by Reverse Shell Security | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* Neither the name of RouterSploit Framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The above licensing was taken from the BSD licensing and is applied to RouterSploit Framework as well. | ||
|
||
Note that the RouterSploit Framework is provided as is, and is a royalty free open-source application. | ||
|
||
Feel free to modify, use, change, market, do whatever you want with it as long as you give the appropriate credit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# RouterSploit - Router Exploitation Framework | ||
|
||
The RouteSploit Framework is an open-source exploitation framework dedicated to embedded devices. | ||
|
||
It consists of various modules that aids penetration testing operations: | ||
|
||
- exploits - modules that takes advantage of identified vulnerabilities | ||
- creds - modules designed to test credentials against network services | ||
- scanners - modules that check if target is vulnerable to any exploit | ||
|
||
# Installation | ||
|
||
sudo apt-get install python-requests python-paramiko python-netsnmp | ||
git clone https://github.com/reverse-shell/routersploit | ||
./rsf.py | ||
|
||
# License | ||
|
||
License has been taken from BSD licensing and applied to RouterSploit Framework. | ||
Please see LICENSE for more details. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from routersploit.utils import print_error, print_status, print_success, print_table, sanitize_url, LockedIterator | ||
from routersploit import exploits | ||
from routersploit import wordlists | ||
|
||
all = [ | ||
print_error, print_status, print_success, | ||
exploits, | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class RoutersploitException(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
from weakref import WeakKeyDictionary | ||
from itertools import chain | ||
import threading | ||
import time | ||
|
||
from routersploit.utils import print_info | ||
|
||
|
||
class Option(object): | ||
""" Exploit attribute that is set by the end user. """ | ||
|
||
def __init__(self, default, description=""): | ||
self.default = default | ||
self.description = description | ||
self.data = WeakKeyDictionary() | ||
|
||
def __get__(self, instance, owner): | ||
return self.data.get(instance, self.default) | ||
|
||
def __set__(self, instance, value): | ||
self.data[instance] = value | ||
|
||
|
||
class ExploitOptionsAggregator(type): | ||
""" Metaclass for exploit base class. | ||
Metaclass is aggregating all possible Attributes that user can set | ||
for tab completion purposes. | ||
""" | ||
def __new__(cls, name, bases, attrs): | ||
try: | ||
base_exploit_attributes = chain(map(lambda x: x.exploit_attributes, bases)) | ||
except AttributeError: | ||
attrs['exploit_attributes'] = {} | ||
else: | ||
attrs['exploit_attributes'] = {k: v for d in base_exploit_attributes for k, v in d.iteritems()} | ||
|
||
for key, value in attrs.iteritems(): | ||
if isinstance(value, Option): | ||
attrs['exploit_attributes'].update({key: value.description}) | ||
elif key == "__info__": | ||
attrs["_{}{}".format(name, key)] = value | ||
del attrs[key] | ||
elif key in attrs['exploit_attributes']: # Removing exploit_attribute that was overwritten | ||
del attrs['exploit_attributes'][key] # in the child and is not a Option() instance. | ||
return super(ExploitOptionsAggregator, cls).__new__(cls, name, bases, attrs) | ||
|
||
|
||
class Exploit(object): | ||
""" Base class for exploits. """ | ||
|
||
__metaclass__ = ExploitOptionsAggregator | ||
target = Option(default="", description="Target IP address.") | ||
# port = Option(default="", description="Target port.") | ||
|
||
@property | ||
def options(self): | ||
""" Returns list of options that user can set. | ||
Returns list of options aggregated by | ||
ExploitOptionsAggregator metaclass that user can set. | ||
:return: list of options that user can set | ||
""" | ||
return self.exploit_attributes.keys() | ||
|
||
def run(self): | ||
raise NotImplementedError("You have to define your own 'run' method.") | ||
|
||
def check(self): | ||
raise NotImplementedError("You have to define your own 'check' method.") | ||
|
||
def run_threads(self, threads, target, *args, **kwargs): | ||
workers = [] | ||
threads_running = threading.Event() | ||
threads_running.set() | ||
for worker_id in xrange(int(threads)): | ||
worker = threading.Thread( | ||
target=target, | ||
args=chain((threads_running,), args), | ||
kwargs=kwargs, | ||
name='worker-{}'.format(worker_id), | ||
) | ||
workers.append(worker) | ||
worker.start() | ||
|
||
start = time.time() | ||
try: | ||
while worker.isAlive(): | ||
worker.join(1) | ||
except KeyboardInterrupt: | ||
threads_running.clear() | ||
|
||
for worker in workers: | ||
worker.join() | ||
print_info('Elapsed time: ', time.time() - start, 'seconds') |
Oops, something went wrong.