Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko, time
- hostname = "10.104.1.50"
- username = "admin"
- password = "123"
- port = 22
- command = "copy boot screen voip"
- countries = ["argentina", "australia", "austria", "bahrain", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "czechrepublic", "denmark", "finland", "france", "germany", "greece", "hongkong", "hungary", "iceland", "india", "ireland", "israel", "italy", "japan", "kuwait", "latvia", "luxembourg", "macao", "malaysia", "mexico", "netherlands", "newzealand", "norway", "peru", "poland", "portugal", "romania", "russia", "saudiarabia", "singapore", "slovakia", "slovenia", "southafrica", "southkorea", "spain", "sweden", "switzerland", "taiwan", "thailand", "uae", "uk", "usa"]
- try:
- client = paramiko.SSHClient()
- #client.load_host_keys()
- client.set_missing_host_key_policy(paramiko.WarningPolicy())
- for country in countries:
- client.connect(hostname, port, username, password)
- chan = client.invoke_shell()
- print("Country: " + country)
- chan.sendall('voip id 1 country %s\r' % country)
- chan.sendall('copy progress boot\r')
- #s = chan.recv(4096)
- #print(s)
- time.sleep(3)
- client.close()
- client.connect(hostname, port, username, password)
- cstdin, stdout, stderr = client.exec_command("copy boot screen voip")
- print(stdout.read())
- finally:
- client.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement