vamp-entropy-watch 2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vamp_entropy_watch-2.0/PKG-INFO +156 -0
- vamp_entropy_watch-2.0/README.md +136 -0
- vamp_entropy_watch-2.0/pyproject.toml +36 -0
- vamp_entropy_watch-2.0/setup.cfg +4 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.egg-info/PKG-INFO +156 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.egg-info/SOURCES.txt +10 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.egg-info/dependency_links.txt +1 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.egg-info/entry_points.txt +2 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.egg-info/requires.txt +1 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.egg-info/top_level.txt +2 -0
- vamp_entropy_watch-2.0/vamp_entropy_watch.py +635 -0
- vamp_entropy_watch-2.0/vampsec_report.py +959 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vamp-entropy-watch
|
|
3
|
+
Version: 2.0
|
|
4
|
+
Summary: High-entropy file and process monitor for authorized security assessments
|
|
5
|
+
Author-email: VampSecure Studios <contact@vampsecurestudios.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Vampsecure-Labs/vamp-entropy-watch
|
|
8
|
+
Project-URL: Repository, https://github.com/Vampsecure-Labs/vamp-entropy-watch
|
|
9
|
+
Keywords: security,pentest,audit,cybersecurity,vampsecure,entropy,malware-detection,file-monitoring,ransomware
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Information Technology
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: rich>=13.7.0
|
|
20
|
+
|
|
21
|
+
<h1 align="center">vamp-entropy-watch</h1>
|
|
22
|
+
<p align="center">
|
|
23
|
+
<strong>Real-time Shannon entropy monitor for early ransomware detection and encrypted file analysis</strong><br>
|
|
24
|
+
<em>VampSecure Labs · Security Research Division</em>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square&logo=python&logoColor=white">
|
|
29
|
+
<img src="https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey?style=flat-square">
|
|
30
|
+
<img src="https://img.shields.io/badge/license-research%20only-red?style=flat-square">
|
|
31
|
+
<img src="https://img.shields.io/badge/VampSecure-Labs-8B0000?style=flat-square">
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
`vamp-entropy-watch` monitors directories for ransomware activity by computing the Shannon entropy of files as they are created or modified. Encrypted content approaches the theoretical maximum of 8 bits/byte and is statistically distinguishable from plaintext (~3–5 bits/byte) and even from legitimately compressed data (~7–7.5 bits/byte). When a file exceeds the configured entropy threshold, the tool raises an alert and optionally moves the file to a quarantine directory with read-only permissions to contain further damage.
|
|
39
|
+
|
|
40
|
+
It operates in two modes: a continuous `monitor` mode with a live Rich terminal table, and a one-shot `scan` mode for point-in-time audits and CI/CD pipeline integration.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **Shannon entropy calculation** per file: H(X) = −Σ P(xᵢ) · log₂ P(xᵢ) over all 256 byte values; reads up to 1 MB per file for performance on large datasets
|
|
45
|
+
- **Four entropy levels**: ENCRYPTED (≥ threshold, default 7.0) / HIGH (≥ 88% of threshold) / MEDIUM (≥ 5.0) / SAFE (< 5.0)
|
|
46
|
+
- **Continuous `monitor` mode** with mtime/size change detection and configurable polling interval; displays a live-updating Rich table sorted by entropy descending
|
|
47
|
+
- **Automatic quarantine** — moves alert-triggering files to a configurable quarantine directory and sets them read-only (0o444) to prevent further modification; collision-safe naming with timestamp prefix
|
|
48
|
+
- **One-shot `scan` mode** — processes all files in the target directory once, prints the entropy table, and optionally exports JSON output sorted by entropy descending
|
|
49
|
+
- **Recursive directory support** via `--recursive` flag in both modes
|
|
50
|
+
- **Default extension exclusions** for already-compressed/binary formats (`.jpg`, `.zip`, `.gz`, `.exe`, `.dll`, etc.) that would generate spurious alerts
|
|
51
|
+
- **Configurable entropy threshold** — adjust to match the specific file corpus: `--threshold 7.5` for stricter detection, `--threshold 6.5` for broader coverage
|
|
52
|
+
- **JSON export** with per-file entropy, status label, size in bytes, and scan metadata
|
|
53
|
+
- **Unified VSL client report** (HTML/PDF) via `--report-html` / `--report-pdf` in both modes
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
pip install -r requirements.txt
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
| Package | Version |
|
|
62
|
+
|---------|---------|
|
|
63
|
+
| `rich` | >= 13.7.0 |
|
|
64
|
+
|
|
65
|
+
Standard library: `argparse`, `json`, `math`, `os`, `shutil`, `sys`, `time`, `datetime`, `pathlib`.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/belky-me/vamp-entropy-watch.git
|
|
71
|
+
cd vamp-entropy-watch
|
|
72
|
+
pip install -r requirements.txt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python vamp_entropy_watch.py --help
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Two subcommands are available: `monitor` and `scan`.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
usage: vamp-entropy-watch {monitor,scan} ...
|
|
85
|
+
|
|
86
|
+
subcommands:
|
|
87
|
+
monitor Continuous directory surveillance
|
|
88
|
+
scan One-shot entropy audit
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Examples
|
|
92
|
+
|
|
93
|
+
**Continuously monitor the current directory with default threshold (7.0):**
|
|
94
|
+
```bash
|
|
95
|
+
python vamp_entropy_watch.py monitor
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Monitor a specific path, recursive, with quarantine enabled:**
|
|
99
|
+
```bash
|
|
100
|
+
python vamp_entropy_watch.py monitor -p /data/uploads -r --quarantine /data/quarantine
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Monitor without automatic quarantine (alert-only mode):**
|
|
104
|
+
```bash
|
|
105
|
+
python vamp_entropy_watch.py monitor -p /var/www --no-quarantine
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Monitor with a stricter threshold and 5-second polling interval:**
|
|
109
|
+
```bash
|
|
110
|
+
python vamp_entropy_watch.py monitor -p /home --threshold 7.5 --interval 5
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**One-shot scan, recursive, export results to JSON:**
|
|
114
|
+
```bash
|
|
115
|
+
python vamp_entropy_watch.py scan -p /srv/data -r -o entropy_report.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**One-shot scan with lowered threshold for broader suspicious-file coverage:**
|
|
119
|
+
```bash
|
|
120
|
+
python vamp_entropy_watch.py scan -p . --threshold 6.5
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Entropy Level Reference
|
|
124
|
+
|
|
125
|
+
| Label | Entropy Range | Typical Content |
|
|
126
|
+
|-------|--------------|----------------|
|
|
127
|
+
| ENCRYPTED | ≥ 7.0 (configurable) | Ransomware output, AES/ChaCha ciphertext |
|
|
128
|
+
| HIGH | ≥ ~6.2 | Dense binary, some archive formats |
|
|
129
|
+
| MEDIUM | ≥ 5.0 | Mixed binary/text, executables |
|
|
130
|
+
| SAFE | < 5.0 | Plaintext, source code, HTML |
|
|
131
|
+
|
|
132
|
+
## Output Formats
|
|
133
|
+
|
|
134
|
+
| Format | Flag | Description |
|
|
135
|
+
|--------|------|-------------|
|
|
136
|
+
| Console (Rich) | _(default)_ | Live table with per-file entropy, status, size, and detection time |
|
|
137
|
+
| JSON | `-o FILE` (scan mode) | Structured report with scan metadata and file list sorted by entropy |
|
|
138
|
+
|
|
139
|
+
## Exit Codes
|
|
140
|
+
|
|
141
|
+
| Code | Meaning |
|
|
142
|
+
|------|---------|
|
|
143
|
+
| `0` | No files exceeded the alert threshold |
|
|
144
|
+
| `1` | One or more files exceeded the alert threshold |
|
|
145
|
+
|
|
146
|
+
## Part of VampSecure Labs Toolkit
|
|
147
|
+
|
|
148
|
+
This tool is part of the **VampSecure Labs Security Toolkit** — a collection of research-grade security tools for authorized penetration testing and red/blue team exercises.
|
|
149
|
+
|
|
150
|
+
- Full toolkit: [github.com/belky-me](https://github.com/belky-me)
|
|
151
|
+
- Orchestrator: [github.com/belky-me/vamp-orchestrator](https://github.com/belky-me/vamp-orchestrator)
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
© VampSecure Studios — VampSecure Labs Security Research Division
|
|
156
|
+
For authorized security testing only.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<h1 align="center">vamp-entropy-watch</h1>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<strong>Real-time Shannon entropy monitor for early ransomware detection and encrypted file analysis</strong><br>
|
|
4
|
+
<em>VampSecure Labs · Security Research Division</em>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square&logo=python&logoColor=white">
|
|
9
|
+
<img src="https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey?style=flat-square">
|
|
10
|
+
<img src="https://img.shields.io/badge/license-research%20only-red?style=flat-square">
|
|
11
|
+
<img src="https://img.shields.io/badge/VampSecure-Labs-8B0000?style=flat-square">
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
`vamp-entropy-watch` monitors directories for ransomware activity by computing the Shannon entropy of files as they are created or modified. Encrypted content approaches the theoretical maximum of 8 bits/byte and is statistically distinguishable from plaintext (~3–5 bits/byte) and even from legitimately compressed data (~7–7.5 bits/byte). When a file exceeds the configured entropy threshold, the tool raises an alert and optionally moves the file to a quarantine directory with read-only permissions to contain further damage.
|
|
19
|
+
|
|
20
|
+
It operates in two modes: a continuous `monitor` mode with a live Rich terminal table, and a one-shot `scan` mode for point-in-time audits and CI/CD pipeline integration.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Shannon entropy calculation** per file: H(X) = −Σ P(xᵢ) · log₂ P(xᵢ) over all 256 byte values; reads up to 1 MB per file for performance on large datasets
|
|
25
|
+
- **Four entropy levels**: ENCRYPTED (≥ threshold, default 7.0) / HIGH (≥ 88% of threshold) / MEDIUM (≥ 5.0) / SAFE (< 5.0)
|
|
26
|
+
- **Continuous `monitor` mode** with mtime/size change detection and configurable polling interval; displays a live-updating Rich table sorted by entropy descending
|
|
27
|
+
- **Automatic quarantine** — moves alert-triggering files to a configurable quarantine directory and sets them read-only (0o444) to prevent further modification; collision-safe naming with timestamp prefix
|
|
28
|
+
- **One-shot `scan` mode** — processes all files in the target directory once, prints the entropy table, and optionally exports JSON output sorted by entropy descending
|
|
29
|
+
- **Recursive directory support** via `--recursive` flag in both modes
|
|
30
|
+
- **Default extension exclusions** for already-compressed/binary formats (`.jpg`, `.zip`, `.gz`, `.exe`, `.dll`, etc.) that would generate spurious alerts
|
|
31
|
+
- **Configurable entropy threshold** — adjust to match the specific file corpus: `--threshold 7.5` for stricter detection, `--threshold 6.5` for broader coverage
|
|
32
|
+
- **JSON export** with per-file entropy, status label, size in bytes, and scan metadata
|
|
33
|
+
- **Unified VSL client report** (HTML/PDF) via `--report-html` / `--report-pdf` in both modes
|
|
34
|
+
|
|
35
|
+
## Requirements
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
pip install -r requirements.txt
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
| Package | Version |
|
|
42
|
+
|---------|---------|
|
|
43
|
+
| `rich` | >= 13.7.0 |
|
|
44
|
+
|
|
45
|
+
Standard library: `argparse`, `json`, `math`, `os`, `shutil`, `sys`, `time`, `datetime`, `pathlib`.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/belky-me/vamp-entropy-watch.git
|
|
51
|
+
cd vamp-entropy-watch
|
|
52
|
+
pip install -r requirements.txt
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
python vamp_entropy_watch.py --help
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Two subcommands are available: `monitor` and `scan`.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
usage: vamp-entropy-watch {monitor,scan} ...
|
|
65
|
+
|
|
66
|
+
subcommands:
|
|
67
|
+
monitor Continuous directory surveillance
|
|
68
|
+
scan One-shot entropy audit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Examples
|
|
72
|
+
|
|
73
|
+
**Continuously monitor the current directory with default threshold (7.0):**
|
|
74
|
+
```bash
|
|
75
|
+
python vamp_entropy_watch.py monitor
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Monitor a specific path, recursive, with quarantine enabled:**
|
|
79
|
+
```bash
|
|
80
|
+
python vamp_entropy_watch.py monitor -p /data/uploads -r --quarantine /data/quarantine
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Monitor without automatic quarantine (alert-only mode):**
|
|
84
|
+
```bash
|
|
85
|
+
python vamp_entropy_watch.py monitor -p /var/www --no-quarantine
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Monitor with a stricter threshold and 5-second polling interval:**
|
|
89
|
+
```bash
|
|
90
|
+
python vamp_entropy_watch.py monitor -p /home --threshold 7.5 --interval 5
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**One-shot scan, recursive, export results to JSON:**
|
|
94
|
+
```bash
|
|
95
|
+
python vamp_entropy_watch.py scan -p /srv/data -r -o entropy_report.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**One-shot scan with lowered threshold for broader suspicious-file coverage:**
|
|
99
|
+
```bash
|
|
100
|
+
python vamp_entropy_watch.py scan -p . --threshold 6.5
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Entropy Level Reference
|
|
104
|
+
|
|
105
|
+
| Label | Entropy Range | Typical Content |
|
|
106
|
+
|-------|--------------|----------------|
|
|
107
|
+
| ENCRYPTED | ≥ 7.0 (configurable) | Ransomware output, AES/ChaCha ciphertext |
|
|
108
|
+
| HIGH | ≥ ~6.2 | Dense binary, some archive formats |
|
|
109
|
+
| MEDIUM | ≥ 5.0 | Mixed binary/text, executables |
|
|
110
|
+
| SAFE | < 5.0 | Plaintext, source code, HTML |
|
|
111
|
+
|
|
112
|
+
## Output Formats
|
|
113
|
+
|
|
114
|
+
| Format | Flag | Description |
|
|
115
|
+
|--------|------|-------------|
|
|
116
|
+
| Console (Rich) | _(default)_ | Live table with per-file entropy, status, size, and detection time |
|
|
117
|
+
| JSON | `-o FILE` (scan mode) | Structured report with scan metadata and file list sorted by entropy |
|
|
118
|
+
|
|
119
|
+
## Exit Codes
|
|
120
|
+
|
|
121
|
+
| Code | Meaning |
|
|
122
|
+
|------|---------|
|
|
123
|
+
| `0` | No files exceeded the alert threshold |
|
|
124
|
+
| `1` | One or more files exceeded the alert threshold |
|
|
125
|
+
|
|
126
|
+
## Part of VampSecure Labs Toolkit
|
|
127
|
+
|
|
128
|
+
This tool is part of the **VampSecure Labs Security Toolkit** — a collection of research-grade security tools for authorized penetration testing and red/blue team exercises.
|
|
129
|
+
|
|
130
|
+
- Full toolkit: [github.com/belky-me](https://github.com/belky-me)
|
|
131
|
+
- Orchestrator: [github.com/belky-me/vamp-orchestrator](https://github.com/belky-me/vamp-orchestrator)
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
© VampSecure Studios — VampSecure Labs Security Research Division
|
|
136
|
+
For authorized security testing only.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vamp-entropy-watch"
|
|
7
|
+
version = "2.0"
|
|
8
|
+
description = "High-entropy file and process monitor for authorized security assessments"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [{ name = "VampSecure Studios", email = "contact@vampsecurestudios.com" }]
|
|
13
|
+
keywords = ["security", "pentest", "audit", "cybersecurity", "vampsecure", "entropy", "malware-detection", "file-monitoring", "ransomware"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Information Technology",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Topic :: Security",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"rich>=13.7.0",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
[project.scripts]
|
|
29
|
+
vamp-entropy-watch = "vamp_entropy_watch:main"
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/Vampsecure-Labs/vamp-entropy-watch"
|
|
33
|
+
Repository = "https://github.com/Vampsecure-Labs/vamp-entropy-watch"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools]
|
|
36
|
+
py-modules = ["vamp_entropy_watch", "vampsec_report"]
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vamp-entropy-watch
|
|
3
|
+
Version: 2.0
|
|
4
|
+
Summary: High-entropy file and process monitor for authorized security assessments
|
|
5
|
+
Author-email: VampSecure Studios <contact@vampsecurestudios.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Vampsecure-Labs/vamp-entropy-watch
|
|
8
|
+
Project-URL: Repository, https://github.com/Vampsecure-Labs/vamp-entropy-watch
|
|
9
|
+
Keywords: security,pentest,audit,cybersecurity,vampsecure,entropy,malware-detection,file-monitoring,ransomware
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Information Technology
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Security
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: rich>=13.7.0
|
|
20
|
+
|
|
21
|
+
<h1 align="center">vamp-entropy-watch</h1>
|
|
22
|
+
<p align="center">
|
|
23
|
+
<strong>Real-time Shannon entropy monitor for early ransomware detection and encrypted file analysis</strong><br>
|
|
24
|
+
<em>VampSecure Labs · Security Research Division</em>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<img src="https://img.shields.io/badge/python-3.10%2B-blue?style=flat-square&logo=python&logoColor=white">
|
|
29
|
+
<img src="https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey?style=flat-square">
|
|
30
|
+
<img src="https://img.shields.io/badge/license-research%20only-red?style=flat-square">
|
|
31
|
+
<img src="https://img.shields.io/badge/VampSecure-Labs-8B0000?style=flat-square">
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
`vamp-entropy-watch` monitors directories for ransomware activity by computing the Shannon entropy of files as they are created or modified. Encrypted content approaches the theoretical maximum of 8 bits/byte and is statistically distinguishable from plaintext (~3–5 bits/byte) and even from legitimately compressed data (~7–7.5 bits/byte). When a file exceeds the configured entropy threshold, the tool raises an alert and optionally moves the file to a quarantine directory with read-only permissions to contain further damage.
|
|
39
|
+
|
|
40
|
+
It operates in two modes: a continuous `monitor` mode with a live Rich terminal table, and a one-shot `scan` mode for point-in-time audits and CI/CD pipeline integration.
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- **Shannon entropy calculation** per file: H(X) = −Σ P(xᵢ) · log₂ P(xᵢ) over all 256 byte values; reads up to 1 MB per file for performance on large datasets
|
|
45
|
+
- **Four entropy levels**: ENCRYPTED (≥ threshold, default 7.0) / HIGH (≥ 88% of threshold) / MEDIUM (≥ 5.0) / SAFE (< 5.0)
|
|
46
|
+
- **Continuous `monitor` mode** with mtime/size change detection and configurable polling interval; displays a live-updating Rich table sorted by entropy descending
|
|
47
|
+
- **Automatic quarantine** — moves alert-triggering files to a configurable quarantine directory and sets them read-only (0o444) to prevent further modification; collision-safe naming with timestamp prefix
|
|
48
|
+
- **One-shot `scan` mode** — processes all files in the target directory once, prints the entropy table, and optionally exports JSON output sorted by entropy descending
|
|
49
|
+
- **Recursive directory support** via `--recursive` flag in both modes
|
|
50
|
+
- **Default extension exclusions** for already-compressed/binary formats (`.jpg`, `.zip`, `.gz`, `.exe`, `.dll`, etc.) that would generate spurious alerts
|
|
51
|
+
- **Configurable entropy threshold** — adjust to match the specific file corpus: `--threshold 7.5` for stricter detection, `--threshold 6.5` for broader coverage
|
|
52
|
+
- **JSON export** with per-file entropy, status label, size in bytes, and scan metadata
|
|
53
|
+
- **Unified VSL client report** (HTML/PDF) via `--report-html` / `--report-pdf` in both modes
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
pip install -r requirements.txt
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
| Package | Version |
|
|
62
|
+
|---------|---------|
|
|
63
|
+
| `rich` | >= 13.7.0 |
|
|
64
|
+
|
|
65
|
+
Standard library: `argparse`, `json`, `math`, `os`, `shutil`, `sys`, `time`, `datetime`, `pathlib`.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/belky-me/vamp-entropy-watch.git
|
|
71
|
+
cd vamp-entropy-watch
|
|
72
|
+
pip install -r requirements.txt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python vamp_entropy_watch.py --help
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Two subcommands are available: `monitor` and `scan`.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
usage: vamp-entropy-watch {monitor,scan} ...
|
|
85
|
+
|
|
86
|
+
subcommands:
|
|
87
|
+
monitor Continuous directory surveillance
|
|
88
|
+
scan One-shot entropy audit
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Examples
|
|
92
|
+
|
|
93
|
+
**Continuously monitor the current directory with default threshold (7.0):**
|
|
94
|
+
```bash
|
|
95
|
+
python vamp_entropy_watch.py monitor
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Monitor a specific path, recursive, with quarantine enabled:**
|
|
99
|
+
```bash
|
|
100
|
+
python vamp_entropy_watch.py monitor -p /data/uploads -r --quarantine /data/quarantine
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Monitor without automatic quarantine (alert-only mode):**
|
|
104
|
+
```bash
|
|
105
|
+
python vamp_entropy_watch.py monitor -p /var/www --no-quarantine
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Monitor with a stricter threshold and 5-second polling interval:**
|
|
109
|
+
```bash
|
|
110
|
+
python vamp_entropy_watch.py monitor -p /home --threshold 7.5 --interval 5
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**One-shot scan, recursive, export results to JSON:**
|
|
114
|
+
```bash
|
|
115
|
+
python vamp_entropy_watch.py scan -p /srv/data -r -o entropy_report.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**One-shot scan with lowered threshold for broader suspicious-file coverage:**
|
|
119
|
+
```bash
|
|
120
|
+
python vamp_entropy_watch.py scan -p . --threshold 6.5
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Entropy Level Reference
|
|
124
|
+
|
|
125
|
+
| Label | Entropy Range | Typical Content |
|
|
126
|
+
|-------|--------------|----------------|
|
|
127
|
+
| ENCRYPTED | ≥ 7.0 (configurable) | Ransomware output, AES/ChaCha ciphertext |
|
|
128
|
+
| HIGH | ≥ ~6.2 | Dense binary, some archive formats |
|
|
129
|
+
| MEDIUM | ≥ 5.0 | Mixed binary/text, executables |
|
|
130
|
+
| SAFE | < 5.0 | Plaintext, source code, HTML |
|
|
131
|
+
|
|
132
|
+
## Output Formats
|
|
133
|
+
|
|
134
|
+
| Format | Flag | Description |
|
|
135
|
+
|--------|------|-------------|
|
|
136
|
+
| Console (Rich) | _(default)_ | Live table with per-file entropy, status, size, and detection time |
|
|
137
|
+
| JSON | `-o FILE` (scan mode) | Structured report with scan metadata and file list sorted by entropy |
|
|
138
|
+
|
|
139
|
+
## Exit Codes
|
|
140
|
+
|
|
141
|
+
| Code | Meaning |
|
|
142
|
+
|------|---------|
|
|
143
|
+
| `0` | No files exceeded the alert threshold |
|
|
144
|
+
| `1` | One or more files exceeded the alert threshold |
|
|
145
|
+
|
|
146
|
+
## Part of VampSecure Labs Toolkit
|
|
147
|
+
|
|
148
|
+
This tool is part of the **VampSecure Labs Security Toolkit** — a collection of research-grade security tools for authorized penetration testing and red/blue team exercises.
|
|
149
|
+
|
|
150
|
+
- Full toolkit: [github.com/belky-me](https://github.com/belky-me)
|
|
151
|
+
- Orchestrator: [github.com/belky-me/vamp-orchestrator](https://github.com/belky-me/vamp-orchestrator)
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
© VampSecure Studios — VampSecure Labs Security Research Division
|
|
156
|
+
For authorized security testing only.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
vamp_entropy_watch.py
|
|
4
|
+
vampsec_report.py
|
|
5
|
+
vamp_entropy_watch.egg-info/PKG-INFO
|
|
6
|
+
vamp_entropy_watch.egg-info/SOURCES.txt
|
|
7
|
+
vamp_entropy_watch.egg-info/dependency_links.txt
|
|
8
|
+
vamp_entropy_watch.egg-info/entry_points.txt
|
|
9
|
+
vamp_entropy_watch.egg-info/requires.txt
|
|
10
|
+
vamp_entropy_watch.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rich>=13.7.0
|