Skip to content

Commit

Permalink
release 1.0.0 Wildest Dreams
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyoa committed Mar 30, 2016
0 parents commit f317cd8
Show file tree
Hide file tree
Showing 58 changed files with 5,134 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .gitignore
@@ -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
16 changes: 16 additions & 0 deletions LICENSE
@@ -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.
21 changes: 21 additions & 0 deletions README.md
@@ -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.

9 changes: 9 additions & 0 deletions routersploit/__init__.py
@@ -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,
]

2 changes: 2 additions & 0 deletions routersploit/exceptions.py
@@ -0,0 +1,2 @@
class RoutersploitException(Exception):
pass
96 changes: 96 additions & 0 deletions routersploit/exploits.py
@@ -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')

0 comments on commit f317cd8

Please sign in to comment.