├── iplist.txt ├── README.md └── run.py /iplist.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SSHChecker 2 | It checks if it is possible to have ssh connection to the target ip list 3 | 4 | Copy a list of ips and paste in in iplist.txt 5 | Run the python script it will output ips that you can connect to in result.txt 6 | 7 | 8 | Video Tutorial: 9 | https://www.youtube.com/watch?v=XVoQ9oVKa40 10 | -------------------------------------------------------------------------------- /run.py: -------------------------------------------------------------------------------- 1 | import chilkat 2 | import re 3 | ssh = chilkat.CkSsh() 4 | ipfile = open("iplist.txt", "r").readlines() 5 | intVal = 3000 6 | ssh.put_ConnectTimeoutMs(intVal) 7 | result = open("result.txt", "a") 8 | 9 | pattern = re.compile(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})') 10 | lst = [] 11 | for line in ipfile: 12 | if pattern.search(line) != None: 13 | lst.append(pattern.search(line)[0]) 14 | 15 | 16 | for ip in lst: 17 | print("Testing " + ip) 18 | success = ssh.Connect(ip, 22) 19 | connected = ssh.get_IsConnected() 20 | if (connected == True): 21 | connected = ssh.SendIgnore() 22 | 23 | print("connected => " + ip) 24 | result.write(ip + "\n") 25 | ssh.Disconnect() 26 | 27 | if lst == []: 28 | print("No server found") 29 | --------------------------------------------------------------------------------