The CRDT binary couldn't auto-detect attacker IPs when running commands with sudo because:
SSH_CONNECTIONenvironment variable is stripped by sudoSSH_CLIENTenvironment variable is stripped by sudo- Result: All attackers were being recorded as "unknown"
Always specify the attacker IP explicitly when running commands:
# DON'T DO THIS - will record attacker as "unknown"
sudo syslogd-helper visit 10.20.20.100 fake-web-01
sudo syslogd-helper action 10.20.20.100 fake-web-01 "ssh_login"# DO THIS - explicitly specify attacker IP as first argument
sudo syslogd-helper visit 10.20.20.100 fake-web-01
sudo syslogd-helper action 10.20.20.100 fake-web-01 "ssh_login"Wait, the commands look the same! The difference is in the Rust code parsing:
- Old code: Tried to auto-detect IP from environment (failed with sudo)
- New code: Uses the first argument as the attacker IP directly
On your host machine:
cd /home/patrick/Documents/Maya_Deception_Tech/scripts/crdt
cargo build --release
# Copy to VM
scp target/release/maya-crdt vagrant@10.20.20.10:/tmp/maya-crdt
# Or use vagrant ssh to copy manuallyInside each VM:
sudo mv /tmp/maya-crdt /usr/local/bin/syslogd-helper
sudo chmod +x /usr/local/bin/syslogd-helperSSH into a honeypot VM:
./scripts/manage-vms.sh ssh fake-ftp-01Inside the VM, run these commands:
# Record attacker arriving at this host
sudo syslogd-helper visit 10.20.20.100 fake-web-01
# Record attacker doing something
sudo syslogd-helper action 10.20.20.100 fake-web-01 "ssh_login_attempt"
# Record credential theft
sudo syslogd-helper cred "admin:Winter2023!"
# Check the state
sudo syslogd-helper statsYou should see output like:
===============================
Node: fake-ftp-01
Lamport Clock: 3
Attackers: 1
Credentials: 1
Sessions: 0
Decoys visited: 1
State hash: abc123...
===============================
Tracked Attackers:
- IP: 10.20.20.100 | Visited: 1 decoys
Notice: The IP should now be 10.20.20.100 NOT unknown!
The backend polls VMs every 10 seconds. Wait 15-20 seconds, then:
Open: http://localhost:3000
You should see:
- VM card shows: "1 attackers" in CRDT state
- Attackers Overview shows a new attacker card
- Click the attacker card to see full profile
sudo syslogd-helper visit <ATTACKER_IP> <DECOY_NAME>
# Example:
sudo syslogd-helper visit 10.20.20.100 fake-web-01sudo syslogd-helper action <ATTACKER_IP> <DECOY_NAME> <ACTION>
# Examples:
sudo syslogd-helper action 10.20.20.100 fake-web-01 "ssh_login_attempt"
sudo syslogd-helper action 10.20.20.100 fake-web-01 "whoami_command"
sudo syslogd-helper action 10.20.20.100 fake-web-01 "downloaded_/etc/passwd"sudo syslogd-helper move <ATTACKER_IP> <NEW_LOCATION>
# Example:
sudo syslogd-helper move 10.20.20.100 fake-jump-01sudo syslogd-helper cred "<USERNAME>:<PASSWORD>"
# Example:
sudo syslogd-helper cred "admin:Winter2023!"sudo syslogd-helper session <HOST> <SESSION_ID>
# Example:
sudo syslogd-helper session fake-web-01 "sess_abc123"sudo syslogd-helper stats
sudo syslogd-helper showsudo rm /var/lib/.syscacheFrom the host machine:
cd /home/patrick/Documents/Maya_Deception_Tech/scripts
# Full attack simulation
./simulate-attack.sh fake-ftp-01 10.20.20.100 full
# Just record a visit
./simulate-attack.sh fake-ftp-01 10.20.20.100 visit
# Simulate lateral movement
./simulate-attack.sh fake-jump-01 10.20.20.100 lateral
# Clear state
./simulate-attack.sh fake-ftp-01 10.20.20.100 clearCheck the state file:
sudo cat /var/lib/.syscache | jq '.attackers'If you see "unknown" as a key, the commands weren't updated properly.
-
Check backend logs:
tail -f backend/logs/combined.log | grep -i "attacker\|crdt"
-
Check MongoDB directly:
curl http://localhost:3001/api/dashboard/debug/attackers | jq '.data.activeAttackers'
-
Manually create test attacker:
curl -X POST http://localhost:3001/api/dashboard/attacker \ -H "Content-Type: application/json" \ -d '{ "attackerId": "APT-10-20-20-100", "ipAddress": "10.20.20.100", "entryPoint": "fake-web-01" }'
Manual copy method:
# On host
cd /home/patrick/Documents/Maya_Deception_Tech/scripts/crdt
scp target/release/maya-crdt /tmp/maya-crdt
# In VM via SSH
sudo mv /tmp/maya-crdt /usr/local/bin/syslogd-helper
sudo chmod +x /usr/local/bin/syslogd-helper- Attacker scans network → hits honeypot
- You run commands → CRDT state updated with correct IP
- Backend polls (10s) → reads
/var/lib/.syscache - Backend creates attacker →
APT-10-20-20-100in MongoDB - WebSocket broadcasts → frontend receives update
- Dashboard updates → new attacker card appears (within 15-20 seconds)
- Binary rebuilt with
cargo build --release - Binary copied to all VMs
- Commands use explicit IP:
syslogd-helper visit 10.20.20.100 ... -
syslogd-helper statsshows correct IP (not "unknown") - Backend logs show "Created new attacker: APT-10-20-20-100"
- Dashboard shows new attacker card
- Attacker profile page loads with real data