mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-07 21:41:21 -07:00
Check if the platform is macOS before trying to set a non-exported
TCP_KEEPIDLE option
This commit is contained in:
parent
4a7499df03
commit
bcac8c4166
1 changed files with 3 additions and 1 deletions
|
@ -140,7 +140,9 @@ def ConnectToTarget():
|
||||||
s.setsockopt(SOL_SOCKET, SO_KEEPALIVE, 1)
|
s.setsockopt(SOL_SOCKET, SO_KEEPALIVE, 1)
|
||||||
s.setsockopt(IPPROTO_TCP, TCP_KEEPCNT, 15)
|
s.setsockopt(IPPROTO_TCP, TCP_KEEPCNT, 15)
|
||||||
s.setsockopt(IPPROTO_TCP, TCP_KEEPINTVL, 5)
|
s.setsockopt(IPPROTO_TCP, TCP_KEEPINTVL, 5)
|
||||||
s.setsockopt(IPPROTO_TCP, TCP_KEEPIDLE, 5)
|
# macOS does not have TCP_KEEPIDLE
|
||||||
|
if sys.platform != 'darwin':
|
||||||
|
s.setsockopt(IPPROTO_TCP, TCP_KEEPIDLE, 5)
|
||||||
s.connect(Host)
|
s.connect(Host)
|
||||||
return s
|
return s
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue