Skip to content

Commit f317cd8

Browse files
committed
release 1.0.0 Wildest Dreams
0 parents  commit f317cd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5134
-0
lines changed

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# IntelliJ project files
2+
.idea
3+
out
4+
gen
5+
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
env/
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
32+
# PyInstaller
33+
# Usually these files are written by a python script from a template
34+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
35+
*.manifest
36+
*.spec
37+
38+
# Installer logs
39+
pip-log.txt
40+
pip-delete-this-directory.txt
41+
42+
# Unit test / coverage reports
43+
htmlcov/
44+
.tox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*,cover
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
59+
# Sphinx documentation
60+
docs/_build/
61+
62+
# PyBuilder
63+
target/
64+
65+
# VS Code
66+
.vscode

LICENSE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Copyright 2016, The RouterSploit Framework (RSF) by Reverse Shell Security
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
* 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.
8+
* 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.
9+
10+
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.
11+
12+
The above licensing was taken from the BSD licensing and is applied to RouterSploit Framework as well.
13+
14+
Note that the RouterSploit Framework is provided as is, and is a royalty free open-source application.
15+
16+
Feel free to modify, use, change, market, do whatever you want with it as long as you give the appropriate credit.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# RouterSploit - Router Exploitation Framework
2+
3+
The RouteSploit Framework is an open-source exploitation framework dedicated to embedded devices.
4+
5+
It consists of various modules that aids penetration testing operations:
6+
7+
- exploits - modules that takes advantage of identified vulnerabilities
8+
- creds - modules designed to test credentials against network services
9+
- scanners - modules that check if target is vulnerable to any exploit
10+
11+
# Installation
12+
13+
sudo apt-get install python-requests python-paramiko python-netsnmp
14+
git clone https://github.com/reverse-shell/routersploit
15+
./rsf.py
16+
17+
# License
18+
19+
License has been taken from BSD licensing and applied to RouterSploit Framework.
20+
Please see LICENSE for more details.
21+

routersploit/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from routersploit.utils import print_error, print_status, print_success, print_table, sanitize_url, LockedIterator
2+
from routersploit import exploits
3+
from routersploit import wordlists
4+
5+
all = [
6+
print_error, print_status, print_success,
7+
exploits,
8+
]
9+

routersploit/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class RoutersploitException(Exception):
2+
pass

routersploit/exploits.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
from weakref import WeakKeyDictionary
2+
from itertools import chain
3+
import threading
4+
import time
5+
6+
from routersploit.utils import print_info
7+
8+
9+
class Option(object):
10+
""" Exploit attribute that is set by the end user. """
11+
12+
def __init__(self, default, description=""):
13+
self.default = default
14+
self.description = description
15+
self.data = WeakKeyDictionary()
16+
17+
def __get__(self, instance, owner):
18+
return self.data.get(instance, self.default)
19+
20+
def __set__(self, instance, value):
21+
self.data[instance] = value
22+
23+
24+
class ExploitOptionsAggregator(type):
25+
""" Metaclass for exploit base class.
26+
27+
Metaclass is aggregating all possible Attributes that user can set
28+
for tab completion purposes.
29+
"""
30+
def __new__(cls, name, bases, attrs):
31+
try:
32+
base_exploit_attributes = chain(map(lambda x: x.exploit_attributes, bases))
33+
except AttributeError:
34+
attrs['exploit_attributes'] = {}
35+
else:
36+
attrs['exploit_attributes'] = {k: v for d in base_exploit_attributes for k, v in d.iteritems()}
37+
38+
for key, value in attrs.iteritems():
39+
if isinstance(value, Option):
40+
attrs['exploit_attributes'].update({key: value.description})
41+
elif key == "__info__":
42+
attrs["_{}{}".format(name, key)] = value
43+
del attrs[key]
44+
elif key in attrs['exploit_attributes']: # Removing exploit_attribute that was overwritten
45+
del attrs['exploit_attributes'][key] # in the child and is not a Option() instance.
46+
return super(ExploitOptionsAggregator, cls).__new__(cls, name, bases, attrs)
47+
48+
49+
class Exploit(object):
50+
""" Base class for exploits. """
51+
52+
__metaclass__ = ExploitOptionsAggregator
53+
target = Option(default="", description="Target IP address.")
54+
# port = Option(default="", description="Target port.")
55+
56+
@property
57+
def options(self):
58+
""" Returns list of options that user can set.
59+
60+
Returns list of options aggregated by
61+
ExploitOptionsAggregator metaclass that user can set.
62+
63+
:return: list of options that user can set
64+
"""
65+
return self.exploit_attributes.keys()
66+
67+
def run(self):
68+
raise NotImplementedError("You have to define your own 'run' method.")
69+
70+
def check(self):
71+
raise NotImplementedError("You have to define your own 'check' method.")
72+
73+
def run_threads(self, threads, target, *args, **kwargs):
74+
workers = []
75+
threads_running = threading.Event()
76+
threads_running.set()
77+
for worker_id in xrange(int(threads)):
78+
worker = threading.Thread(
79+
target=target,
80+
args=chain((threads_running,), args),
81+
kwargs=kwargs,
82+
name='worker-{}'.format(worker_id),
83+
)
84+
workers.append(worker)
85+
worker.start()
86+
87+
start = time.time()
88+
try:
89+
while worker.isAlive():
90+
worker.join(1)
91+
except KeyboardInterrupt:
92+
threads_running.clear()
93+
94+
for worker in workers:
95+
worker.join()
96+
print_info('Elapsed time: ', time.time() - start, 'seconds')

0 commit comments

Comments
 (0)