From 76c690f3bbfef890e866dc7ab62d7c29eea185cf Mon Sep 17 00:00:00 2001 From: admin <esemaan@etu.unistra.fr> Date: Thu, 23 Jul 2020 11:10:23 +0200 Subject: [PATCH] RFD Script (beta version) #1 --- RFD_BETA.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 RFD_BETA.py diff --git a/RFD_BETA.py b/RFD_BETA.py new file mode 100644 index 0000000..95cb8cc --- /dev/null +++ b/RFD_BETA.py @@ -0,0 +1,49 @@ +import getpass +import sys +import telnetlib +import time + + +def flap(): + tn.write(b"shut\n") + tn.write(b"\x0D") + tn.write(b"no shut\n") + tn.write(b"\x0D") + + +#Fonction sert pas a grand chose +def peer_connection(): + tn.write(b"telnet 192.168.1.1\n") + tn.write(b"\x0D") + tn.write(b"cisco") + tn.write(b"\x0D") + tn.write(b"cisco") + tn.write(b"\x0D") + tn.write(b"exit") + tn.write(b"\x0D") + dampening() + +def dampening(): + tn.write(b"conf t\n") + tn.write(b"\x0D") + tn.write(b"interface fastethernet 0/0\n") + tn.write(b"\x0D") + flap() + while True: + time.sleep(10) + flap() + + +HOST = "localhost" +tn = telnetlib.Telnet(HOST,5000) +dampening() + + + + + + + + + + -- GitLab