Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # colores
- cyan = '\033[1;36m'
- white = '\033[1;37m'
- red = '\033[1;31m'
- yellow = '\033[1;33m'
- blue = '\033[1;34m'
- green = '\033[1;32m'
- off_color = '\033[0;0m'
- # end colores
- def Erro():
- print(red+'Erro, an erro occurred'+off_color)
- def ipRange(IP_PRIMARY, IP_SECUNDARY):
- start = list(map(int, start_ip.split(".")))
- end = list(map(int, end_ip.split(".")))
- temp = start
- ip_range = []
- ip_range.append(start_ip)
- while temp != end:
- start[3] += 1
- for i in (3, 2, 1):
- if temp[i] == 256:
- temp[i] = 0
- temp[i-1] += 1
- ip_range.append(".".join(map(str, temp)))
- return ip_range
- class SSH():
- def __init__(self):
- self.ssh = SSHClient()
- self.ssh.load_system_host_keys()
- self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- def testing_conection(self, IP_ACTUALY):
- self.ssh.connect(hostname=IP,username='root',password='SENHA_DE_ROOT')
- stdin,stdout,stderr = self.ssh.exec_command(cmd)
- if stderr.channel.recv_exit_status() != 0:
- print stderr.read()
- else:
- print stdout.read()
- print(red+'By @Fs0usa\n\n\n'+off_color)
- try:
- from paramiko import SSHClient
- import paramiko
- except:
- Erro()
- IP_PRIMARY = raw_input(white+'Please enter whit IP primary[]: '+off_color)
- IP_SECONDARY = raw_input(white+'Please enter with IP secundary[]: '+off_color)
- ip_range = ipRange(IP_PRIMARY, IP_SECUNDARY)
- #for ip in ip_range:
- #conection = SSH.testing_conection(ip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement