This document provides comprehensive testing procedures for the Secure Boot system using Kali Linux in VirtualBox.
- Download Kali Linux ISO from kali.org
- Create new VM in VirtualBox:
- Name: Kali-SecureBoot-Test
- Type: Linux
- Version: Debian (64-bit)
- Memory: 4096 MB (minimum 2048 MB)
- Hard Disk: 40 GB dynamically allocated
System:
- Enable EFI (for realistic secure boot testing)
- Processors: 2 or more
Storage:
- IDE: Kali Linux ISO
Network:
- Attached to: NAT (for internet access)
# Update system
sudo apt update && sudo apt upgrade -y
# Install build dependencies
sudo apt install -y build-essential libssl-dev git
# Copy project files to ~/SecBootKIVScd ~/SecBootKIVS
# Build and run all tests
make all
make test
# Run interactive demo
make demo
# Run attack simulation
make attack
# Generate HTML report
make report
# Run benchmarks
make benchmark
# Start recovery mode
make recoverymake clean
make allExpected: BUILD SUCCESSFUL message, binaries in bin/
make genkeysExpected: Keys created in keys/ directory
# Create and sign test kernel
dd if=/dev/urandom of=test_kernel.bin bs=1024 count=256
./bin/kernel_signer sign test_kernel.bin keys/private_key.pem test_kernel.sig
# Verify it
./bin/boot_verifier test_kernel.bin test_kernel.sig keys/public_key.pem --verboseExpected: BOOT AUTHORIZED
# Tamper with kernel
cp test_kernel.bin test_tampered.bin
echo "MALICIOUS" >> test_tampered.bin
# Try to verify
./bin/boot_verifier test_tampered.bin test_kernel.sig keys/public_key.pemExpected: BOOT DENIED - Tampering detected
make testExpected Output:
TEST GROUP: Key Generation
[PASS] Generate key pair
TEST GROUP: Kernel Signing
[PASS] Sign valid kernel
[PASS] Reject invalid key path
[PASS] Reject non-existent kernel
TEST GROUP: Signature Verification
[PASS] Verify valid signature
[PASS] Detect tampered kernel
[PASS] Reject wrong public key
[PASS] Reject missing signature
TEST GROUP: Integrity Checks
[PASS] Reject empty kernel
[PASS] Suspicious content check
TEST GROUP: Hash Computation
[PASS] Compute kernel hash
[PASS] Hash consistency check
Total tests: 12
Passed: 12
Failed: 0
ALL TESTS PASSED!
make attackSimulates 6 attack types:
- Single byte modification
- Rootkit code injection
- Complete kernel replacement (bootkit)
- Fake signature bypass
- Wrong signing key
- Missing signature
Expected: All attacks BLOCKED
make benchmarkExpected Output:
┌──────────────┬──────────┬──────────┬──────────┬──────────┐
│ Size (KB) │ Hash(ms) │ Sign(ms) │ Verify │ Total │
├──────────────┼──────────┼──────────┼──────────┼──────────┤
│ 64 │ 2 │ 12 │ 1 │ 15 │
│ 128 │ 3 │ 12 │ 1 │ 16 │
│ 256 │ 4 │ 13 │ 1 │ 18 │
│ 512 │ 5 │ 14 │ 2 │ 21 │
│ 1024 │ 8 │ 15 │ 2 │ 25 │
│ 2048 │ 14 │ 16 │ 2 │ 32 │
└──────────────┴──────────┴──────────┴──────────┴──────────┘
Results saved to reports/benchmark_results.csv
make reportExpected: Report generated at reports/test_report.html
Open in browser to view professional test results.
make recoveryInteractive menu with options:
- View verification failure details
- Re-sign kernel
- Generate new key pair
- Check key revocation status
- View security logs
- Restore from backup (simulation)
- Boot anyway (UNSAFE - simulation)
- Shutdown system
| Test | Description | Expected Result | Status |
|---|---|---|---|
| 1 | Build system | Compiles successfully | ⬜ |
| 2 | Key generation | Creates valid key pair | ⬜ |
| 3 | Signing/Verification | Boot authorized | ⬜ |
| 4 | Tamper detection | Boot denied | ⬜ |
| 5 | Automated test suite | 12/12 tests pass | ⬜ |
| 6 | Attack simulation | 6/6 attacks blocked | ⬜ |
| 7 | Performance benchmarks | Results generated | ⬜ |
| 8 | HTML report | Report created | ⬜ |
| 9 | Recovery mode | Menu displayed | ⬜ |
Mark ⬜ as ✅ (pass) or ❌ (fail) when running tests
sudo apt install libssl-devchmod +x scripts/*.sh tests/*.shCheck matching key pairs:
openssl rsa -in keys/private_key.pem -pubout 2>/dev/null | diff - keys/public_key.pemsudo apt install chkrootkit rkhunter
sudo chkrootkit
sudo rkhunter --checkThese complement our boot-time verification by checking the running system.
| File | Description |
|---|---|
logs/secure_boot.log |
Security event log |
logs/demo.log |
Demo session log |
reports/test_report.html |
HTML test results |
reports/benchmark_results.csv |
Performance data |
keys/revoked_keys.csv |
Revoked key list |