Advertisement
Guest User

IB-TELNET

a guest
Jun 26th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #IB_TELNET
  2. import telnetlib
  3.  
  4. #List ALL Tigbur IP Addresses
  5. ip_tigbur = open("ip_list.txt",r) #
  6. for HOST in ip_tigbur:
  7.     #Enter Our Cred
  8.     user = "will be added after"
  9.     password = "will be added after"
  10.     tn = telnetlib.Telnet(HOST)
  11.     tn.read_until("Username: ")
  12.     tn.write(user + "\n")
  13.     if password:
  14.         tn.read_until("Password: ")
  15.         tn.write(password + "\n")
  16.     tn.write("show mac address-table dynamic\n")
  17.     OUTPUT tn.read_all()
  18.     FILE=open(C:\\IB_TIGBUR_MACS.txt", "w")
  19.     FILE.write(OUTPUT)
  20.     FILE.close()
  21.     tn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement