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