funcion baneo ip iptables ban.txt y desbaneo ip iptables unban.txt
def ban_ip(ip): os.system("iptables -A INPUT -s %s -j DROP" % ip) os.system("service iptables save") os.system("service iptables restart") def unban_ip(ip): os.system("iptables -D INPUT -s %s -j DROP" % ip) os.system("service iptables save") os.system("service iptables restart")