@@ -22,11 +22,11 @@ def getInput(opts):
22
22
ip = opts .ext
23
23
win = opts .win
24
24
# Get auth
25
- print "Welcome to Sherlock IP finder."
26
- username = raw_input ("Username: " )
25
+ print ( "Welcome to Sherlock IP finder." )
26
+ username = input ("Username: " )
27
27
password = getpass .getpass ()
28
28
if not ip :
29
- idx = int (raw_input ("Enter net interface: 1 - eth0, 2 - wlan0: " ))
29
+ idx = int (input ("Enter net interface: 1 - eth0, 2 - wlan0: " ))
30
30
netif = ['eth0' , 'wlan0' ]
31
31
# Get the IP address
32
32
f = os .popen ('ifconfig ' + netif [idx - 1 ] + ' | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1' )
@@ -57,14 +57,14 @@ def worker(host, username, password):
57
57
try :
58
58
ssh = paramiko .SSHClient ()
59
59
ssh .set_missing_host_key_policy (paramiko .AutoAddPolicy ())
60
- print "Trying for " + host + " ...."
60
+ print ( "Trying for " + host + " ...." )
61
61
ssh .connect (host , username = username , password = password )
62
- print "Connected for " + host
62
+ print ( "Connected for " + host )
63
63
found = host
64
64
return True
65
65
except (paramiko .ssh_exception .BadHostKeyException , paramiko .ssh_exception .AuthenticationException ,
66
66
paramiko .ssh_exception .SSHException , socket .error ) as e :
67
- print e
67
+ print ( e )
68
68
return False
69
69
70
70
def findMc (ip , username , password ):
@@ -78,12 +78,12 @@ def findMc(ip, username, password):
78
78
t .join ()
79
79
80
80
if found is not None :
81
- print "The correct destination is " + found
81
+ print ( "The correct destination is " + found )
82
82
83
83
if __name__ == '__main__' :
84
84
opts = parseCmd ()
85
85
[ip , username , password ] = getInput (opts )
86
86
hostname = findMc (ip , username , password )
87
87
if opts .red :
88
- print "Redirecting you to the SSH connection"
88
+ print ( "Redirecting you to the SSH connection" )
89
89
os .system ('sshpass -p ' + password + ' ssh ' + username + '@' + hostname )
0 commit comments