// La macro mágica #define DEBUG_PRINT(fmt, ...) \ do { \ if (DEBUG_LOGGING) { \ fprintf(stderr, "[DEBUG] %s:%d: " fmt "\n", \ __FILE__, __LINE__, ##__VA_ARGS__); \ } \ } while (0)
# Count attempts per IP counter = Counter(failed_ips) print("[+] Analysis complete. Suspicious IPs (>= 10 attempts):\n") for ip, count in counter.most_common(): if count >= 10: print(f" {ip:20} -> {count:4} failed attempts") print(f"\n[+] Total unique attacking IPs: {len([k for k,v in counter.items() if v >= 10])}")
#include <stdio.h>
Once you understand this logic, you can adapt it to any CSV, JSON, or text dump from OSINT tools (like theHarvester, Sublist3r, or even your own Nmap XML outputs).
int main() { int variable_critica = 42;
#!/usr/bin/env python3 """ Simple SSH Brute-Force Detector - For authorized log analysis only. Usage: python3 log_analyzer.py /var/log/auth.log """