mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-22 06:13:39 -07:00
Adds configurable server timeouts
This can be helpful if traffic is being routed back via a slow reverse proxy
This commit is contained in:
parent
af7d27ac8c
commit
e057f101ac
9 changed files with 23 additions and 9 deletions
|
@ -43,6 +43,13 @@ parser.add_option('-F','--ForceWpadAuth', action="store_true", help="Force NTLM
|
|||
parser.add_option('-P','--ProxyAuth', action="store_true", help="Force NTLM (transparently)/Basic (prompt) authentication for the proxy. WPAD doesn't need to be ON. This option is highly effective when combined with -r. Default: False", dest="ProxyAuth_On_Off", default=False)
|
||||
|
||||
parser.add_option('--lm', action="store_true", help="Force LM hashing downgrade for Windows XP/2003 and earlier. Default: False", dest="LM_On_Off", default=False)
|
||||
parser.add_option('--httptimeout', action="store", help="Configures the timeout in use by http(s) server threads", dest="HTTPTimeout", type=float, default=3)
|
||||
parser.add_option('--browsertimeout', action="store", help="Configures the timeout in use by smb browser fingerprinter", dest="BrowserTimeout", type=float, default=0.3)
|
||||
parser.add_option('--ldaptimeout', action="store", help="Configures the timeout in use by LDAP server threads", dest="LDAPTimeout", type=float, default=0.4)
|
||||
parser.add_option('--mssqltimeout', action="store", help="Configures the timeout in use by MSSQL server threads", dest="MSSQLTimeout", type=float, default=1)
|
||||
parser.add_option('--proxytimeout', action="store", help="Configures the timeout in use by proxy server threads", dest="ProxyTimeout", type=float, default=3)
|
||||
parser.add_option('--rdptimeout', action="store", help="Configures the timeout in use by RDP server threads", dest="RDPTimeout", type=float, default=30)
|
||||
parser.add_option('--smbtimeout', action="store", help="Configures the timeout in use by SMB server threads", dest="SMBTimeout", type=float, default=1)
|
||||
parser.add_option('-v','--verbose', action="store_true", help="Increase verbosity.", dest="Verbose")
|
||||
options, args = parser.parse_args()
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ def RapFinger(Host, Domain, Type):
|
|||
try:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((Host,445))
|
||||
s.settimeout(0.3)
|
||||
s.settimeout(settings.Config.BrowserTimeout)
|
||||
|
||||
Header = SMBHeader(cmd="\x72",mid="\x01\x00")
|
||||
Body = SMBNegoData()
|
||||
|
|
|
@ -269,7 +269,7 @@ class HTTP(BaseRequestHandler):
|
|||
try:
|
||||
Challenge = RandomChallenge()
|
||||
while True:
|
||||
self.request.settimeout(3)
|
||||
self.request.settimeout(settings.Config.HTTPTimeout)
|
||||
remaining = 10*1024*1024 #setting max recieve size
|
||||
data = ''
|
||||
while True:
|
||||
|
|
|
@ -148,7 +148,7 @@ def ParseLDAPPacket(data, client, Challenge):
|
|||
class LDAP(BaseRequestHandler):
|
||||
def handle(self):
|
||||
try:
|
||||
self.request.settimeout(0.4)
|
||||
self.request.settimeout(settings.Config.LDAPTimeout)
|
||||
data = self.request.recv(8092)
|
||||
Challenge = RandomChallenge()
|
||||
for x in range(5):
|
||||
|
|
|
@ -128,7 +128,7 @@ class MSSQL(BaseRequestHandler):
|
|||
self.ntry = 0
|
||||
while True:
|
||||
data = self.request.recv(1024)
|
||||
self.request.settimeout(1)
|
||||
self.request.settimeout(settings.Config.MSSQLTimeout)
|
||||
Challenge = RandomChallenge()
|
||||
|
||||
if not data:
|
||||
|
|
|
@ -104,7 +104,7 @@ class Proxy_Auth(BaseRequestHandler):
|
|||
try:
|
||||
Challenge = RandomChallenge()
|
||||
while True:
|
||||
self.request.settimeout(3)
|
||||
self.request.settimeout(settings.Config.ProxyTimeout)
|
||||
remaining = 10*1024*1024 #setting max recieve size
|
||||
data = ''
|
||||
while True:
|
||||
|
|
|
@ -95,7 +95,7 @@ class RDP(BaseRequestHandler):
|
|||
def handle(self):
|
||||
try:
|
||||
data = self.request.recv(1024)
|
||||
self.request.settimeout(30)
|
||||
self.request.settimeout(settings.Config.RDPTimeout)
|
||||
Challenge = RandomChallenge()
|
||||
|
||||
if data[11:12] == b'\x01':
|
||||
|
@ -106,7 +106,7 @@ class RDP(BaseRequestHandler):
|
|||
buffer1 = str(h)
|
||||
self.request.send(NetworkSendBufferPython2or3(buffer1))
|
||||
SSLsock = ssl.wrap_socket(self.request, certfile=cert, keyfile=key, ssl_version=ssl.PROTOCOL_TLS,server_side=True)
|
||||
SSLsock.settimeout(30)
|
||||
SSLsock.settimeout(settings.Config.RDPTimeout)
|
||||
data = SSLsock.read(8092)
|
||||
if FindNTLMNegoStep(data) == b'\x01\x00\x00\x00':
|
||||
x = RDPNTLMChallengeAnswer(NTLMSSPNtServerChallenge=NetworkRecvBufferPython2or3(Challenge))
|
||||
|
|
|
@ -194,7 +194,7 @@ class SMB1(BaseRequestHandler): # SMB1 & SMB2 Server class, NTLMSSP
|
|||
self.ntry = 0
|
||||
while True:
|
||||
data = self.request.recv(1024)
|
||||
self.request.settimeout(1)
|
||||
self.request.settimeout(settings.Config.SMBTimeout)
|
||||
Challenge = RandomChallenge()
|
||||
|
||||
if not data:
|
||||
|
@ -333,7 +333,7 @@ class SMB1(BaseRequestHandler): # SMB1 & SMB2 Server class, NTLMSSP
|
|||
class SMB1LM(BaseRequestHandler): # SMB Server class, old version
|
||||
def handle(self):
|
||||
try:
|
||||
self.request.settimeout(0.5)
|
||||
self.request.settimeout(settings.Config.SMBTimeout / 2)
|
||||
data = self.request.recv(1024)
|
||||
Challenge = RandomChallenge()
|
||||
if data[0] == b"\x81": #session request 139
|
||||
|
|
|
@ -179,6 +179,13 @@ class Settings:
|
|||
self.AnalyzeMode = options.Analyze
|
||||
self.Verbose = options.Verbose
|
||||
self.ProxyAuth_On_Off = options.ProxyAuth_On_Off
|
||||
self.HTTPTimeout = options.HTTPTimeout
|
||||
self.BrowserTimeout = options.BrowserTimeout
|
||||
self.LDAPTimeout = options.LDAPTimeout
|
||||
self.MSSQLTimeout = options.MSSQLTimeout
|
||||
self.ProxyTimeout = options.ProxyTimeout
|
||||
self.RDPTimeout = options.RDPTimeout
|
||||
self.SMBTimeout = options.SMBTimeout
|
||||
self.CommandLine = str(sys.argv)
|
||||
|
||||
if self.ExternalIP:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue