mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-21 05:43:35 -07:00
Update utils.py
Use elif
This commit is contained in:
parent
063b31e6ca
commit
0b4f961b79
1 changed files with 11 additions and 13 deletions
24
utils.py
24
utils.py
|
@ -101,19 +101,17 @@ def FindLocalIP(Iface, OURIP):
|
|||
return '0.0.0.0'
|
||||
|
||||
try:
|
||||
|
||||
if IsOsX():
|
||||
return OURIP
|
||||
else:
|
||||
if OURIP == None:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.setsockopt(socket.SOL_SOCKET, 25, Iface+'\0')
|
||||
s.connect(("127.0.0.1",9))#RFC 863
|
||||
ret = s.getsockname()[0]
|
||||
s.close()
|
||||
return ret
|
||||
else:
|
||||
return OURIP
|
||||
if IsOsX():
|
||||
return OURIP
|
||||
elif OURIP == None:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.setsockopt(socket.SOL_SOCKET, 25, Iface+'\0')
|
||||
s.connect(("127.0.0.1",9))#RFC 863
|
||||
ret = s.getsockname()[0]
|
||||
s.close()
|
||||
return ret
|
||||
else:
|
||||
return OURIP
|
||||
|
||||
except socket.error:
|
||||
print color("[!] Error: %s: Interface not found" % Iface, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue