added method utils before socket

This commit is contained in:
R3DDY97 2017-11-21 13:38:42 +05:30
parent d114861fb1
commit d351b4acde

4
kickthemout.py Normal file → Executable file
View file

@ -163,7 +163,7 @@ def kickoneoff():
for host in hostsList: for host in hostsList:
if host[0] == onlineIPs[i]: if host[0] == onlineIPs[i]:
mac = host[1] mac = host[1]
hostname = socket.gethostbyaddr(onlineIPs[i])[0] hostname = utils.socket.gethostbyaddr(onlineIPs[i])[0]
vendor = resolveMac(mac) vendor = resolveMac(mac)
print(" [{0}" + str(i) + "{1}] {2}" + str(onlineIPs[i]) + "{3}\t"+ vendor + " (" + hostname + ")""{4}").format(YELLOW, WHITE, RED, GREEN, END) print(" [{0}" + str(i) + "{1}] {2}" + str(onlineIPs[i]) + "{3}\t"+ vendor + " (" + hostname + ")""{4}").format(YELLOW, WHITE, RED, GREEN, END)
@ -228,7 +228,7 @@ def kicksomeoff():
for host in hostsList: for host in hostsList:
if host[0] == onlineIPs[i]: if host[0] == onlineIPs[i]:
mac = host[1] mac = host[1]
hostname = socket.gethostbyaddr(onlineIPs[i])[0] hostname = utils.socket.gethostbyaddr(onlineIPs[i])[0]
vendor = resolveMac(mac) vendor = resolveMac(mac)
print(" [{0}" + str(i) + "{1}] {2}" + str(onlineIPs[i]) + "{3}\t" + vendor + " (" + hostname + ")" "{4}").format(YELLOW, WHITE, RED, GREEN, END) print(" [{0}" + str(i) + "{1}] {2}" + str(onlineIPs[i]) + "{3}\t" + vendor + " (" + hostname + ")" "{4}").format(YELLOW, WHITE, RED, GREEN, END)