vsm-rootkit-detector 0.1.0__py3-none-any.whl
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.
- rootkit_detector/__init__.py +0 -0
- rootkit_detector/cli.py +36 -0
- rootkit_detector/comparator/__init__.py +0 -0
- rootkit_detector/comparator/compare.py +10 -0
- rootkit_detector/main.py +32 -0
- rootkit_detector/views/__init__.py +0 -0
- rootkit_detector/views/library_view.py +7 -0
- rootkit_detector/views/system_view.py +19 -0
- rootkit_detector/views/user_view.py +9 -0
- vsm_rootkit_detector-0.1.0.dist-info/METADATA +25 -0
- vsm_rootkit_detector-0.1.0.dist-info/RECORD +14 -0
- vsm_rootkit_detector-0.1.0.dist-info/WHEEL +5 -0
- vsm_rootkit_detector-0.1.0.dist-info/entry_points.txt +2 -0
- vsm_rootkit_detector-0.1.0.dist-info/top_level.txt +1 -0
|
File without changes
|
rootkit_detector/cli.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
from .main import run_scan
|
|
6
|
+
|
|
7
|
+
def require_root():
|
|
8
|
+
if os.geteuid() != 0:
|
|
9
|
+
print("[!] Must be run as root")
|
|
10
|
+
sys.exit(1)
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
parser = argparse.ArgumentParser(
|
|
14
|
+
description="Educational Linux Rootkit Detection Tool"
|
|
15
|
+
)
|
|
16
|
+
parser.add_argument("--repeats", type=int, default=3)
|
|
17
|
+
parser.add_argument("--delay", type=int, default=1)
|
|
18
|
+
|
|
19
|
+
args = parser.parse_args()
|
|
20
|
+
|
|
21
|
+
require_root()
|
|
22
|
+
results = run_scan(args.repeats, args.delay)
|
|
23
|
+
|
|
24
|
+
print("\n========== ROOTKIT DETECTION REPORT ==========")
|
|
25
|
+
|
|
26
|
+
if results:
|
|
27
|
+
print("■ Consistently hidden processes detected:")
|
|
28
|
+
for pid in results:
|
|
29
|
+
print(f" - PID {pid}")
|
|
30
|
+
else:
|
|
31
|
+
print("✓ No hidden processes detected")
|
|
32
|
+
|
|
33
|
+
print("============== SCAN COMPLETE ==============\n")
|
|
34
|
+
|
|
35
|
+
if __name__ == "__main__":
|
|
36
|
+
main()
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
def compare_pids(user_pids, system_pids, library_pids):
|
|
2
|
+
"""
|
|
3
|
+
Cross-view PID comparison
|
|
4
|
+
"""
|
|
5
|
+
user_set = set(user_pids)
|
|
6
|
+
system_set = set(system_pids)
|
|
7
|
+
library_set = set(library_pids)
|
|
8
|
+
|
|
9
|
+
hidden = system_set - user_set - library_set
|
|
10
|
+
return sorted(hidden)
|
rootkit_detector/main.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from .views.user_view import get_user_pids
|
|
2
|
+
from .views.system_view import get_system_pids
|
|
3
|
+
from .views.library_view import get_library_pids
|
|
4
|
+
from .comparator.compare import compare_pids
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
def run_scan(repeats=3, delay=1, whitelist=None):
|
|
8
|
+
"""
|
|
9
|
+
Run multiple scans to reduce race-condition false positives
|
|
10
|
+
"""
|
|
11
|
+
whitelist = whitelist or []
|
|
12
|
+
seen = {}
|
|
13
|
+
|
|
14
|
+
for _ in range(repeats):
|
|
15
|
+
user = get_user_pids()
|
|
16
|
+
system = get_system_pids()
|
|
17
|
+
library = get_library_pids()
|
|
18
|
+
|
|
19
|
+
hidden = compare_pids(user, system, library)
|
|
20
|
+
|
|
21
|
+
for pid in hidden:
|
|
22
|
+
seen[pid] = seen.get(pid, 0) + 1
|
|
23
|
+
|
|
24
|
+
time.sleep(delay)
|
|
25
|
+
|
|
26
|
+
# Only flag consistently hidden PIDs
|
|
27
|
+
stable = [
|
|
28
|
+
pid for pid, count in seen.items()
|
|
29
|
+
if count == repeats and pid not in whitelist
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
return stable
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
|
|
3
|
+
def get_system_pids():
|
|
4
|
+
"""
|
|
5
|
+
Collect process IDs using ps
|
|
6
|
+
"""
|
|
7
|
+
pids = []
|
|
8
|
+
try:
|
|
9
|
+
output = subprocess.check_output(
|
|
10
|
+
["ps", "-e", "-o", "pid="],
|
|
11
|
+
text=True
|
|
12
|
+
)
|
|
13
|
+
for line in output.splitlines():
|
|
14
|
+
if line.strip().isdigit():
|
|
15
|
+
pids.append(int(line.strip()))
|
|
16
|
+
except Exception as e:
|
|
17
|
+
raise RuntimeError(f"ps execution failed: {e}")
|
|
18
|
+
|
|
19
|
+
return sorted(pids)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vsm-rootkit-detector
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: VSM Rootkit Detection Tool (Educational Linux Security Project)
|
|
5
|
+
Author-email: Vaishnavi S <vaishanvi@example.com>, Spoorthi <spoorthi@example.com>, Midarsha S <midarsha@example.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Trinity-2006/vsm-rootkit-detector
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: psutil
|
|
11
|
+
|
|
12
|
+
# VSM Rootkit Detector
|
|
13
|
+
|
|
14
|
+
VSM Rootkit Detector is an educational Linux security tool that demonstrates
|
|
15
|
+
basic rootkit detection techniques using cross-view process analysis.
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
- Cross-view process detection (/proc, ps, psutil)
|
|
19
|
+
- Repeated scans to reduce race-condition false positives
|
|
20
|
+
- Root privilege enforcement
|
|
21
|
+
- Command-line interface
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
```bash
|
|
25
|
+
pip install vsm-rootkit-detector
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
rootkit_detector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
rootkit_detector/cli.py,sha256=iQmIjJ2CXk-bpP1EQp6axjpRkfdCxv5NhB9O4yC1A_E,871
|
|
3
|
+
rootkit_detector/main.py,sha256=JSK3T3rpZY0xhknmGbrywJ57HUKx2mii3QXvRujHDJA,838
|
|
4
|
+
rootkit_detector/comparator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
rootkit_detector/comparator/compare.py,sha256=Jw-70v8rlcELjkDDE_PItwKAquZ6gJ_SAYMEoICvcq4,278
|
|
6
|
+
rootkit_detector/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
rootkit_detector/views/library_view.py,sha256=RIz5BtRt9clfYJZHIlVU0PcvgaWK1sc1Y9o9Dr2Z2qE,167
|
|
8
|
+
rootkit_detector/views/system_view.py,sha256=x0t-OrQ3C6vrydK6M5kT0sd48QyWLH20q6_xbMz3gIY,463
|
|
9
|
+
rootkit_detector/views/user_view.py,sha256=HrqE3OQwBnqwuSMCQeUr0GWIl-L-zP-8zSWglJ95wVM,180
|
|
10
|
+
vsm_rootkit_detector-0.1.0.dist-info/METADATA,sha256=6kgW27AZ2NT2j3seKisQKkou4fdUTRaa12dJMuF7g_c,835
|
|
11
|
+
vsm_rootkit_detector-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
vsm_rootkit_detector-0.1.0.dist-info/entry_points.txt,sha256=egZLuj_Xlj52sy8GEsXw56i0MMuRqo7RY9o9jG59viQ,58
|
|
13
|
+
vsm_rootkit_detector-0.1.0.dist-info/top_level.txt,sha256=EGzpGvS8GV4xauuRNEgqADoP9lZVJaNt-D6J9jaNUDc,17
|
|
14
|
+
vsm_rootkit_detector-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rootkit_detector
|