File size: 785 Bytes
b46a892
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
#!/usr/bin/env python3

import os
import socket
import datetime

def get_ip_info():
    hostname = socket.gethostname()
    local_ip = socket.gethostbyname(hostname)
    return hostname, local_ip

def log_clone_attempt():
    timestamp = datetime.datetime.now().isoformat()
    hostname, ip = get_ip_info()

    log_entry = f"""--- CLONE WATCH ---
Timestamp: {timestamp}
Hostname: {hostname}
IP Address: {ip}
Environment: {os.environ.get('USER', 'unknown')}
Shell: {os.environ.get('SHELL', 'unknown')}
-------------------
"""

    log_path = "clone-monitor/WITNESS_LOGS/clone_activity.log"
    with open(log_path, "a") as log_file:
        log_file.write(log_entry)
        print("[🛡] Clone Sentinel triggered. Activity logged.")

if __name__ == "__main__":
    log_clone_attempt()