Skip to content

Commit

Permalink
* Corrects syntax error "parser.add_argument ..." that occurs in pyth…
Browse files Browse the repository at this point in the history
…on 2.6.

* Instructions for installing dependencies.
  • Loading branch information
joaomatosf committed May 25, 2016
1 parent f162502 commit 8989063
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,34 @@ Requirements
----
* Python >= 2.7.x
* [urllib3](https://pypi.python.org/pypi/urllib3)
* [ipaddress](https://pypi.python.org/pypi/ipaddress)

Installation
----
To install the latest version of JexBoss, please use the following commands:

git clone https://github.com/joaomatosf/jexboss.git
cd jexboss
pip install -r requires.txt
python jexboss.py -h

OR:

Download the latest version at: https://github.com/joaomatosf/jexboss/archive/master.zip
unzip master.zip
cd jexboss-master
pip install -r requires.txt
python jexboss.py -h


If you are using CentOS with Python 2.6, please install Python2.7.
Installation example of the Python 2.7 on CentOS using Collections Software scl:

yum -y install centos-release-scl
yum -y install python27
scl enable python27 bash


Features
----
The tool and exploits were developed and tested for versions 3, 4, 5 and 6 of the JBoss Application Server.
Expand Down
5 changes: 2 additions & 3 deletions _updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
from urllib3.util.timeout import Timeout
disable_warnings()
except ImportError:
ver = version_info[0] if version_info[0] >= 3 else ""
print(RED1 + BOLD + "\n * Package urllib3 not installed. Please install the package urllib3 before continue.\n"
print(RED1 + BOLD + "\n * Package urllib3 not installed. Please install the dependencies before continue.\n"
"" + GREEN + " Example: \n"
" # apt-get install python%s-pip ; easy_install%s urllib3\n" % (ver, ver) + ENDC)
" # pip install -r requires.txt\n" + ENDC)
exit(0)

timeout = Timeout(connect=3.0, read=6.0)
Expand Down
27 changes: 18 additions & 9 deletions jexboss.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@
ENDC = '\033[0m'

__author__ = "João Filho Matos Figueiredo <[email protected]>"
__version = "1.0.10"
__version = "1.0.11"

import signal
from sys import argv, exit, version_info

if version_info[0] == 2 and version_info[1] < 7:
print(RED1 + BOLD + "\n * You are using the Python version 2.6. The JexBoss requires version >= 2.7.\n"
"" + GREEN + " Please install the Python version >= 2.7. \n\n"
" Example for CentOS using Software Collections scl:\n"
" # yum -y install centos-release-scl\n"
" # yum -y install python27\n"
" # scl enable python27 bash\n" + ENDC)
exit(0)

import signal
from _exploits import *
from _updates import *
from os import name, system
Expand All @@ -45,6 +55,7 @@
from random import randint
import argparse, socket


try:
from urllib.parse import urlencode
except ImportError:
Expand All @@ -55,19 +66,17 @@
from urllib3 import disable_warnings, PoolManager
from urllib3.util.timeout import Timeout
except ImportError:
ver = version_info[0] if version_info[0] >= 3 else ""
print(RED1 + BOLD + "\n * Package urllib3 not installed. Please install the package urllib3 before continue.\n"
print(RED1 + BOLD + "\n * Package urllib3 not installed. Please install the dependencies before continue.\n"
"" + GREEN + " Example: \n"
" # apt-get install python%s-pip ; easy_install%s urllib3\n" % (ver, ver) + ENDC)
" # pip install -r requires.txt\n" + ENDC)
exit(0)

try:
import ipaddress
except:
ver = version_info[0] if version_info[0] >= 3 else ""
print(RED1 + BOLD + "\n * Package ipaddress not installed. Please install the package ipaddress before continue.\n"
print(RED1 + BOLD + "\n * Package ipaddress not installed. Please install the dependencies before continue.\n"
"" + GREEN + " Example: \n"
" # apt-get install python%s-pip ; easy_install%s ipaddress\n" % (ver, ver) + ENDC)
" # pip install -r requires.txt\n" + ENDC)
exit(0)

from urllib3 import disable_warnings, PoolManager
Expand Down Expand Up @@ -496,7 +505,7 @@ def main():
action='store_true')
parser.add_argument("--disable-check-updates", "-D", help="Disable the check for updates performed by JSP Webshell at: http:https://webshell.jexboss.net/jsp_version.txt",
action='store_true')
parser.add_argument('-mode', help="Operation mode", choices={'standalone','auto-scan', 'file-scan'}, default='standalone')
parser.add_argument('-mode', help="Operation mode", choices=['standalone', 'auto-scan', 'file-scan'], default='standalone')

group_standalone.add_argument("-host", help="Host address to be checked (eg. http:https://192.168.0.10:8080)",
type=str)
Expand Down
3 changes: 2 additions & 1 deletion requires.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
urllib3
urllib3
ipaddress

0 comments on commit 8989063

Please sign in to comment.