-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmonitor_messages.sh
More file actions
executable file
·30 lines (28 loc) · 1.17 KB
/
monitor_messages.sh
File metadata and controls
executable file
·30 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
echo "=== MeshC2 Message Monitor ==="
echo "Channel: [Configure channel name in config.yml]"
echo "Encryption: [Channel encryption configured via MeshC2 service]"
echo ""
echo "Monitoring for received messages..."
echo "Press Ctrl+C to stop"
echo ""
# Monitor the log file for relevant messages
tail -f /var/log/meshc2/meshc2.log | while read line; do
# Check if line contains message processing info
if echo "$line" | grep -qE "(Processing command|Created command|ID:|Sent message|Error)"; then
# Color code different types of messages
if echo "$line" | grep -q "Processing command"; then
echo -e "\033[32m📥 RECEIVED: $line\033[0m"
elif echo "$line" | grep -q "ID:.*received"; then
echo -e "\033[33m📤 ACK SENT: $line\033[0m"
elif echo "$line" | grep -q "ID:.*Output"; then
echo -e "\033[34m📤 RESPONSE: $line\033[0m"
elif echo "$line" | grep -q "Sent message"; then
echo -e "\033[36m📡 TRANSMITTED: $line\033[0m"
elif echo "$line" | grep -q "Error"; then
echo -e "\033[31m❌ ERROR: $line\033[0m"
else
echo "$line"
fi
fi
done