βββ βββββββ ββββββββββββββββββββ βββββββ
βββ ββββββββ βββββββββββββββββββββββββββββ
βββ ββββββββββββββββββββββββββββ βββ
ββββ βββββββββββββββββββββββββββββ βββ
βββββββ βββ βββ βββββββββββββββββββββββββββ
βββββ βββ βββββββββββββββββββ βββββββ
VM Security Scanner β Kali Linux Edition
vmsec is a fully open-source, automated security scanning and remediation tool built specifically for Kali Linux virtual machines.
It integrates 10 scanner modules powered by industry-standard open-source tools (ClamAV, rkhunter, chkrootkit, Lynis, AIDE, auditd, and more) into one unified workflow that:
- Scans your VM for viruses, trojans, malware, rootkits, keyloggers, spyware, backdoors, C2 connections, suspicious processes, insecure configurations, and more
- Generates a comprehensive, sorted report (plain text + interactive HTML) β findings sorted CRITICAL β LOW, suggestions sorted MUST-DO β OPTIONAL
- Remediates β auto-fix or manually fix findings, then auto-apply or manually apply suggestions
Note: vmsec is designed for Kali Linux VMs. Many Kali tools (Metasploit, Aircrack-ng, etc.) will trigger false positives in antivirus scanners. vmsec accounts for this β its auto-remediator only touches files in safe locations (/tmp, /var/tmp, ~/Downloads) and never blindly deletes system binaries.
# 1. Clone the repository
git clone https://github.com/arif-offsec/vmsec.git
cd vmsec
# 2. Run the installer
sudo bash install.sh
# 3. Install all security tools
sudo vmsec install
# 4. Run your first full scan
sudo vmsec scanThat's it. vmsec will scan, report, and walk you through fixing anything it finds.
| Feature | Description |
|---|---|
| π 10 scanner modules | Modular, independently runnable scanners |
| π¦ Malware detection | ClamAV with auto-updated virus definitions |
| π Rootkit detection | rkhunter + chkrootkit (two independent engines) |
| β¨οΈ Keylogger detection | Process monitoring, /dev/input access, LKM checks |
| π Network scanning | Open ports, C2 connections, ARP poisoning, DNS hijacking |
| π Cron audit | Detects malicious persistence via cron jobs |
| π Filesystem checks | SUID/SGID audit, AIDE integrity, suspicious files |
| π€ User audit | UID-0 backdoors, SSH keys, sudo misconfig, empty passwords |
| βοΈ Service audit | Dangerous/unnecessary services, firewall status |
| π Dual reports | Sorted text report + dark-theme interactive HTML report |
| π§ Auto-remediation | Safe, priority-ordered auto-fix with path restrictions |
| π±οΈ Manual remediation | One-by-one interactive review of every finding |
| π‘ Suggestions | Auto-apply MUST-DOs or review one by one |
| π Man page | Full man vmsec documentation |
| βοΈ Configurable | Edit conf/vmsec.conf to tune behaviour |
sudo vmsec install # Install all security tools
sudo vmsec update # Update all tools + definitions
sudo vmsec scan # Full scan (all 10 modules)
sudo vmsec scan --quick # Quick scan (ClamAV, rkhunter, processes, network)
sudo vmsec scan --module NAME # Run one specific module
vmsec report # Print last report to terminal
vmsec report --html # Open HTML report in browser
sudo vmsec fix --auto # Auto-fix all findings (CRITICAL first)
sudo vmsec fix --manual # Review and fix findings one by one
sudo vmsec suggest --auto # Auto-apply all MUST-DO suggestions
sudo vmsec suggest --manual # Review suggestions one by one
vmsec list-modules # List all scanner modules
vmsec version # Show version
man vmsec # Full manual page| Module | Tools Used | Detects |
|---|---|---|
clamav |
ClamAV | Viruses, trojans, malware files |
rkhunter |
rkhunter | Rootkits, backdoors, hidden files |
chkrootkit |
chkrootkit | Rootkits (different engine), LKM, sniffers |
lynis |
Lynis | Full system audit, hardening index, config warnings |
processes |
ps, lsof, unhide | Keyloggers, crypto miners, hidden processes, suspicious LKMs |
network |
ss, iptables, arp | Open ports, C2 connections, DNS hijacking, ARP poisoning, promiscuous mode |
crontabs |
bash | Malicious cron persistence, reverse shells, obfuscated commands |
filesystem |
find, aide, stat | SUID/SGID, world-writable files, recently modified binaries, AIDE integrity |
users |
getent, passwd, sshd | UID-0 backdoors, empty passwords, NOPASSWD sudo, SSH misconfig |
services |
systemctl | Dangerous services (Telnet/RSH/TFTP), unnecessary services, missing auditd/fail2ban |
All tools are free, open-source, and installed from Kali's official apt repository.
| Tool | License | What it does |
|---|---|---|
| ClamAV | GPL v2 | Virus and malware scanner β maintained by Cisco Talos |
| rkhunter | GPL v2 | Rootkit, backdoor, and local exploit scanner |
| chkrootkit | BSD-like | Rootkit scanner with different detection engine |
| Lynis | GPL v3 | Comprehensive system security audit by CISOfy |
| AIDE | GPL v2 | File integrity monitoring β detects any unauthorized changes |
| auditd | GPL v2 | Linux kernel audit daemon β logs all system activity |
| UFW | GPL v3 | Uncomplicated Firewall β manages iptables rules |
| fail2ban | GPL v2 | Blocks brute-force login attempts automatically |
| unhide | GPL v3 | Detects processes hidden by rootkits |
| nethogs | GPL v2 | Real-time per-process network bandwidth monitor |
| ss / lsof / netstat | GPL | Network analysis (built into Linux) |
After a scan, vmsec generates two report files:
Text report (reports/vmsec_report_YYYY-MM-DD_HH-MM-SS.txt):
ββββββββββββββββββββββββββββββββββββββ
FINDINGS (CRITICAL β HIGH β MEDIUM β LOW)
ββββββββββββββββββββββββββββββββββββββ
ββ CRITICAL ββββββββββββββββββββββββ
[001] [CRITICAL] Module: clamav
Description : ClamAV detected: Trojan.Agent-12345
Location : /tmp/payload.elf
Fixable : yes
Fix command : shred -u -z '/tmp/payload.elf'
ββ HIGH ββββββββββββββββββββββββββββ
[002] [HIGH] Module: network
Description : Dangerous port 4444 is OPEN β known Metasploit listener
Location : port:4444
Fixable : yes
Fix command : fuser -k 4444/tcp
ββββββββββββββββββββββββββββββββββββββ
SUGGESTIONS (MUST β SHOULD β OPTIONAL)
ββββββββββββββββββββββββββββββββββββββ
[001] [MUST] Module: network
Suggestion : Enable UFW firewall
Command : ufw default deny incoming && ufw --force enable
HTML report β a dark-theme interactive page with color-coded severity badges, viewable in any browser.
sudo vmsec scan
β
βΌ
Report generated
(txt + HTML)
β
βΌ
ββββββββββββββββββββββββββββ
β FINDINGS REMEDIATION β
β [1] Auto (CRITICAL firstβ
β [2] Manual (one by one) β
β [3] Skip β
ββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββ
β SUGGESTIONS β
β [1] Auto (MUST-DO only) β
β [2] Manual (one by one) β
β [3] Skip β
ββββββββββββββββββββββββββββ
Auto-remediation safety rules:
- Files are only auto-deleted from:
/tmp,/var/tmp,~/Downloads,~/Desktop,~/.cache - System files, binaries, and config files are never auto-deleted
- All actions are logged to a timestamped log file
- Kali's built-in pentesting tools are never flagged as auto-removable
git clone https://github.com/arif-offsec/vmsec.git
cd vmsec
sudo bash install.shcurl -fsSL https://raw.githubusercontent.com/arif-offsec/vmsec/main/install.sh | sudo bash- Copies files to
/opt/vmsec/ - Creates
/usr/local/bin/vmsecsymlink (so you can runvmsecfrom anywhere) - Installs the man page (
man vmsec) - Copies config to
/etc/vmsec/vmsec.conf - Creates
/var/log/vmsec.log - Optionally runs
vmsec installto install all security tools
sudo bash uninstall.shEdit /etc/vmsec/vmsec.conf (system-wide) or conf/vmsec.conf (local):
# Update definitions before each scan (yes/no)
VMSEC_AUTO_UPDATE_DEFS="yes"
# Report format: txt | html | both
VMSEC_REPORT_FORMAT="both"
# Days to consider a system binary "recently modified"
VMSEC_RECENT_DAYS="7"- OS: Kali Linux (2022+), Parrot OS, or any Debian/Ubuntu-based distro
- Privileges: root (sudo) for scanning and remediation
- Internet: Required for first-time tool installation and definition updates
- VM Software: VMware Workstation Pro, VirtualBox, QEMU/KVM, or any hypervisor
Running vmsec inside your VM is only half the protection. Make sure your VMware settings are locked down first:
| VMware Setting | Value |
|---|---|
| Shared Folders (Options tab) | Disabled |
| Copy/Paste (Guest Isolation) | Disabled |
| Drag & Drop (Guest Isolation) | Disabled |
| Network Adapter | Host-Only or NAT (never Bridged) |
| USB Controller | Remove or restrict |
| Snapshots | Take one before every risky session |
Also add these lines to your .vmx file:
isolation.tools.copy.disable = "TRUE"
isolation.tools.paste.disable = "TRUE"
isolation.tools.dnd.disable = "TRUE"
isolation.tools.hgfs.disable = "TRUE"
Contributions are welcome! See CONTRIBUTING.md for guidelines.
To add a new scanner module:
- Create
scanners/scan_yourmodule.sh - Use
record_findingandrecord_suggestionfunctions fromlib/utils.sh - Register it in the
ALL_MODULESarray invmsecmain script - Submit a pull request
vmsec/
βββ vmsec β Main executable (entry point)
βββ install.sh β One-command installer
βββ uninstall.sh β Uninstaller
βββ README.md
βββ LICENSE β GPL v3
βββ CHANGELOG.md
βββ lib/
β βββ utils.sh β Colors, logging, record_finding(), record_suggestion()
β βββ config.sh β Configuration loader
β βββ installer.sh β apt tool installation + post-install setup
β βββ reporter.sh β Text + HTML report generation
β βββ remediator.sh β Auto and manual remediation engine
β βββ suggester.sh β Auto and manual suggestion engine
βββ scanners/
β βββ scan_clamav.sh β ClamAV virus/malware scan
β βββ scan_rkhunter.sh β rkhunter rootkit scan
β βββ scan_chkrootkit.sh β chkrootkit rootkit scan
β βββ scan_lynis.sh β Lynis system audit
β βββ scan_processes.sh β Suspicious processes + keyloggers
β βββ scan_network.sh β Network + C2 + firewall
β βββ scan_crontabs.sh β Malicious cron jobs
β βββ scan_filesystem.sh β SUID/AIDE/filesystem integrity
β βββ scan_users.sh β User accounts + SSH + sudo
β βββ scan_services.sh β Dangerous/unnecessary services
βββ conf/
β βββ vmsec.conf β Default configuration
βββ man/
β βββ vmsec.1 β Man page source
βββ reports/ β Generated reports saved here
GPL v3 β Free and open-source forever. See LICENSE for the full text.
vmsec is provided as-is for educational and defensive security purposes. It does not guarantee detection of all threats. Security scanning results may include false positives, especially on Kali Linux which ships many offensive security tools. Always review findings before applying remediation. The authors are not responsible for any system damage caused by misuse of the auto-remediation feature.