An educational antimalware simulator built in Nim to demonstrate detection techniques and their bypasses.
Features β’ Quick Start β’ Challenge β’ Examples β’ Resources
MostShittyAVScanner is a deliberately simplistic antimalware engine designed for security research, education, and red team training. It implements basic heuristic detection methods that mirror real-world AV enginesβbut with intentional weaknesses to explore.
β οΈ Disclaimer: This is NOT production security software. It's an educational tool for understanding antimalware evasion techniques.
|
|
# Windows with Nim 2.0.4
winget install nim-lang.Nim# Clone the repository
git clone https://github.com/yourusername/AMSI-raaccoon-lab.git
cd AMSI-raaccoon-lab
# Allow script execution (if needed)
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# Generate test files
.\create_test_files.ps1
# Optional: Generate bypass test files
.\test\create_bypass_files.ps1# Compile and scan files
nim c -r nim_antimalware_sim.nim testfile.txt infected.txt
# Or use the Makefile
make test_allCan you bypass the engine?
This scanner uses common detection heuristics found in real AV products.
Your mission: Evade detection while executing your "payloads"!
- π Extension checking doesn't enforce blocking
- π Limited signature database
- π Uncommon extensions not flagged (
.hta,.com,.wsf,.pif) - π No deep content inspection
- π Case sensitivity issues
- π No archive/container scanning
Try it yourself! Use create_bypass_files.ps1 to generate test cases.
# Scan single file
nim c -r nim_antimalware_sim.nim suspicious.exe
# Scan multiple files
nim c -r nim_antimalware_sim.nim *.txt *.exe *.bat[2025-11-08 21:33:26] AMSI: Starting scan for file: infected.txt
[2025-11-08 21:33:26] AMSI: Reading file content...
[2025-11-08 21:33:26] AMSI: File successfully read (41 bytes)
[2025-11-08 21:33:26] AMSI: Checking for known malware signatures...
[2025-11-08 21:33:26] AMSI: Threat detected - Signature found in infected.txt
--------------------------------------------
Result for infected.txt: MALICIOUS β# Generate bypass test files
.\test\create_bypass_files.ps1
# Test double extensions
nim c -r nim_antimalware_sim.nim test\document.pdf.exe
# Test uncommon extensions
nim c -r nim_antimalware_sim.nim test\help.hta test\legacy.com
# Test no extension
nim c -r nim_antimalware_sim.nim test\malwareAMSI-raaccoon-lab/
βββ π nim_antimalware_sim.nim # Main scanner engine
βββ π create_test_files.ps1 # Test file generator
βββ π Makefile # Build automation
βββ π README.md # This file
βββ π test/
βββ π create_bypass_files.ps1 # Bypass technique generator
βββ π 01_clean.txt # Clean test file
βββ π 02_malware.ps1 # Malicious test file
βββ π ... # Various test cases
const signatures = [
"malware", "virus", "trojan", "evil_payload",
"dropper", "ransomware", "payload.exe"
]Simple string matching against known malicious patterns.
const suspicious = [
".exe", ".dll", ".bat", ".cmd", ".sh",
".ps1", ".scr", ".js", ".vbs", ".jar", ".lnk"
]Flags files with potentially dangerous extensions.
# Threshold: 40% non-printable bytes
if ratio > 0.40:
# Possibly packed/obfuscatedDetects binary/encoded content that might be malicious.
if size < 32 and isSuspiciousExtension:
# Suspicious tiny scriptsCatches unusually small executable files.
| Category | Files | Purpose |
|---|---|---|
| Clean | clean.txt, umlaut.txt |
Baseline benign files |
| Infected | infected.txt, trojan_sample.txt |
Signature matches |
| Binary | packed.bin, mixed.bin |
High entropy content |
| Small Scripts | tiny.bat |
Tiny executable detection |
| Encoding | utf16.txt |
Character encoding tests |
| Bypass | *.hta, *.com, no-ext |
Evasion techniques |
This project demonstrates:
- β Basic AV Architecture - Provider pattern, scan engines
- β Signature Detection - Pattern matching limitations
- β Heuristic Analysis - Behavioral detection methods
- β Evasion Techniques - Common bypass strategies
- β AMSI Integration - Windows antimalware interface
- β Nim Programming - Systems programming in Nim
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and research purposes only.
- β Do not use on systems you don't own or have explicit permission to test
- β Do not use for malicious purposes
- β Not a replacement for real security software
- β Use in controlled lab environments only
- β Understand applicable laws and regulations in your jurisdiction
The author assumes no liability for misuse of this software.
Made with β€οΈ and Nim for the security research community
β Star this repo β’ π Report Bug β’ π‘ Request Feature
