99- ** Scan multiple detection categories** 🔍:
1010
1111 - ** Network** : Detect potentially malicious IPv4/IPv6 addresses and URLs
12- - ** Crypto** : Find cryptographic implementations and sensitive material
1312 - ** Malicious** : Identify suspicious code patterns (backdoors, exploits, etc.)
1413 - ** Obfuscation** : Detect obfuscated code, high entropy, and suspicious naming patterns
1514
2423 - ** Multi-threading** : Parallel processing of files for faster scanning
2524 - ** Fast mode** : Stop processing after first suspicious item
2625 - ** Path filtering** : Include or exclude paths matching patterns
27- - ** Custom ignore lists** : Skip specified suspicious or crypto keywords
26+ - ** Custom ignore lists** : Skip specified suspicious keywords
2827
2928## ⚙️ Installation
3029
@@ -55,7 +54,6 @@ collapsescanner directory
5554
5655# Different detection modes
5756collapsescanner file.jar --mode network
58- collapsescanner file.jar --mode crypto
5957collapsescanner file.jar --mode malicious
6058collapsescanner file.jar --mode obfuscation
6159
@@ -78,24 +76,26 @@ collapsescanner file.jar --threads 8
7876collapsescanner file.jar --exclude " assets/**" --exclude " *.log" --find " com/example/*"
7977
8078# Skip specific keywords
81- collapsescanner file.jar --ignore_keywords_file ignore_keywords.txt
79+ collapsescanner file.jar --ignore_keywords ignore_keywords.txt
8280```
8381
8482## 🔍 Command-line Options
8583
86- | Option | Description |
87- | ------------------------ | ----------------------------------------------------------------------------------- |
88- | ` path ` | Path to a JAR file, class file, or directory to scan |
89- | ` --mode ` | Detection mode: ` network ` , ` crypto ` , ` malicious ` , ` obfuscation ` , or ` all ` (default) |
90- | ` --extract ` | Extract all resources from JAR files |
91- | ` --strings ` | Extract all strings from class files |
92- | ` --output ` | Specify the output directory (default: ./extracted) |
93- | ` --json ` | Export results in JSON format |
94- | ` -v, --verbose ` | Enable verbose output (shows size/entropy, etc.) |
95- | ` --threads ` | Number of threads to use for parallel processing (0 = automatic based on CPU cores) |
96- | ` --exclude ` | Exclude paths matching the wildcard pattern (can be used multiple times) |
97- | ` --find ` | Only scan paths matching the wildcard pattern (can be used multiple times) |
98- | ` --ignore_keywords_file ` | Path to a .txt file with keywords to ignore (one per line) |
84+ | Option | Description |
85+ | ------------------- | ----------------------------------------------------------------------------------- |
86+ | ` path ` | Path to a JAR file, class file, or directory to scan |
87+ | ` --mode ` | Detection mode: ` network ` , ` malicious ` , ` obfuscation ` , or ` all ` (default) |
88+ | ` --extract ` | Extract all resources from JAR files |
89+ | ` --strings ` | Extract all strings from class files |
90+ | ` --output ` | Specify the output directory (default: ./extracted) |
91+ | ` --json ` | Export results in JSON format |
92+ | ` -v, --verbose ` | Enable verbose output (shows size/entropy, etc.) |
93+ | ` --threads ` | Number of threads to use for parallel processing (0 = automatic based on CPU cores) |
94+ | ` --exclude ` | Exclude paths matching the wildcard pattern (can be used multiple times) |
95+ | ` --find ` | Only scan paths matching the wildcard pattern (can be used multiple times) |
96+ | ` --ignore_keywords ` | Path to a .txt file with keywords to ignore (one per line) |
97+ | ` --show ` | Print a detailed findings report to the terminal (useful for interactive runs) |
98+ | ` --max_file_size ` | Maximum file size to scan (in MB). Files larger than this will be skipped. |
9999
100100## 🛡️ Detection Capabilities
101101
@@ -114,7 +114,6 @@ CollapseScanner analyzes Java class files to find:
114114 - Key management and password handling
115115
116116- ** Obfuscation indicators** :
117- - Excessively long names
118117 - Suspicious character sequences
119118 - Unicode characters in identifiers
120119 - High entropy (potentially obfuscated) files
@@ -151,30 +150,43 @@ cargo run --bin remapper input.jar output.jar
151150<details ><summary >📋 Example Output</summary >
152151
153152```
154- ==== CollapseScanner - Enhanced Analysis ====
155- 🎯 Target: suspicious.jar
156- 🔧 Mode: All
157- 🚀 Starting scan...
158-
159- ⚠️ Findings Report:
153+ ╔══════════════════════════════════════════════════════════════════════════════╗
154+ ║ FINDINGS REPORT ║
155+ ╚══════════════════════════════════════════════════════════════════════════════╝
160156
161157📄 File: suspicious.jar/com/example/malicious/Payload.class
162- 🌐 IPv4 Address: 192.168.1.100
163- 🌐 IPv6 Address: 9e53:c40f:5969:6a04:68b6:2c98:5c80:25fb
164- 🔗 URL: http://malicious-domain.com/c2
165- 🔒 Crypto Keyword: 'encrypt' in "AES encryption used here"
166- ❗ Suspicious Keyword: 'payload' in "Executing payload"
167-
168- ==== Scan Summary ====
169- 📈 Total Findings: 4
170- - Crypto Keyword: 1
171- - IPv4 Address: 1
172- - IPv6 Address: 1
173- - Suspicious Keyword: 1
174- - URL: 1
175-
176- 📦 Resources extracted to ./extracted
177- 🔤 Strings extracted to ./extracted
158+ 🌐 IPv4 Address: 192.168.1.100
159+ 🔗 URL: http://malicious-domain.com/c2
160+ 🤖 Discord Webhook: https://discord.com/api/webhooks/12345/abcdef
161+ ❗ Suspicious Keyword: 'payload' in "Executing payload"
162+ 🔥 High Entropy: Very High entropy value: 8.45 (threshold: 7.20) - suggests possible encryption or compression
163+
164+ ╔══════════════════════════════════════════════════════════════════════════════╗
165+ ║ SCAN SUMMARY ║
166+ ╚══════════════════════════════════════════════════════════════════════════════╝
167+
168+ 📊 Total Findings: 5 | Files with Findings: 1 | Risk Level: HIGH RISK (9/10)
169+ ⏱️ Scan Time: 1.23s | Total Files Scanned: 12 | Processing Rate: 9.8 files/sec
170+
171+ 🔍 Findings Breakdown:
172+
173+ 🌐 IPv4 Address (1)
174+ • 192.168.1.100
175+
176+ 🔗 URL (1)
177+ • http://malicious-domain.com/c2
178+
179+ 🤖 Discord Webhook (1)
180+ • https://discord.com/api/webhooks/12345/abcdef
181+
182+ ❗ Suspicious Keyword (1)
183+ • 'payload' in "Executing payload"
184+
185+ 🔥 High Entropy (1)
186+ • Very High entropy value: 8.45
187+
188+ 👻 Custom JVM Warning: Files with unusual magic bytes detected. These may require a custom ClassLoader.
189+
178190```
179191
180192</details >
0 commit comments