generated from skills/copilot-codespaces-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_security_check.py
More file actions
24 lines (20 loc) · 827 Bytes
/
run_security_check.py
File metadata and controls
24 lines (20 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from src.system_lockdown import audit_open_ports, check_insecure_permissions
def print_security_report():
print("=== SECURITY STATUS REPORT ===")
print("\n[+] Checking Open Ports...")
ports = audit_open_ports()
if not ports:
print(" No listening ports found. (Stealth Mode: ON)")
else:
for p in ports:
print(f" ALERT: Port {p['port']} is OPEN on {p['ip']} (PID: {p['pid']}, Proc: {p['process']})")
print("\n[+] Checking File Permissions...")
insecure = check_insecure_permissions(".")
if not insecure:
print(" No insecure (world-writable) files found.")
else:
for f in insecure:
print(f" WARNING: World-writable file found: {f}")
print("\n=== END REPORT ===")
if __name__ == "__main__":
print_security_report()