|
67 | 67 | from lib.core.settings import DEFAULT_GET_POST_DELIMITER |
68 | 68 | from lib.core.settings import HTTP_ACCEPT_HEADER_VALUE |
69 | 69 | from lib.core.settings import HTTP_ACCEPT_ENCODING_HEADER_VALUE |
70 | | -from lib.core.settings import HTTP_SILENT_TIMEOUT |
71 | 70 | from lib.core.settings import MAX_CONNECTION_CHUNK_SIZE |
72 | 71 | from lib.core.settings import MAX_CONNECTIONS_REGEX |
73 | 72 | from lib.core.settings import MAX_CONNECTION_TOTAL_SIZE |
@@ -204,6 +203,7 @@ def getPage(**kwargs): |
204 | 203 | multipart = kwargs.get("multipart", False) |
205 | 204 | silent = kwargs.get("silent", False) |
206 | 205 | raise404 = kwargs.get("raise404", True) |
| 206 | + timeout = kwargs.get("timeout", conf.timeout) |
207 | 207 | auxHeaders = kwargs.get("auxHeaders", None) |
208 | 208 | response = kwargs.get("response", False) |
209 | 209 | ignoreTimeout = kwargs.get("ignoreTimeout", kb.ignoreTimeout) |
@@ -248,10 +248,7 @@ def getPage(**kwargs): |
248 | 248 | url = unicodeencode(url) |
249 | 249 |
|
250 | 250 | try: |
251 | | - if silent: |
252 | | - socket.setdefaulttimeout(HTTP_SILENT_TIMEOUT) |
253 | | - else: |
254 | | - socket.setdefaulttimeout(conf.timeout) |
| 251 | + socket.setdefaulttimeout(timeout) |
255 | 252 |
|
256 | 253 | if direct_: |
257 | 254 | if "?" in url: |
@@ -529,14 +526,16 @@ def getPage(**kwargs): |
529 | 526 | if "BadStatusLine" not in tbMsg: |
530 | 527 | warnMsg += " or proxy" |
531 | 528 |
|
532 | | - if "forcibly closed" in tbMsg: |
| 529 | + if silent: |
| 530 | + return None, None, None |
| 531 | + elif "forcibly closed" in tbMsg: |
533 | 532 | logger.critical(warnMsg) |
534 | 533 | return None, None, None |
535 | | - elif silent or (ignoreTimeout and any(_ in tbMsg for _ in ("timed out", "IncompleteRead"))): |
| 534 | + elif ignoreTimeout and any(_ in tbMsg for _ in ("timed out", "IncompleteRead")): |
536 | 535 | return None, None, None |
537 | 536 | elif threadData.retriesCount < conf.retries and not kb.threadException: |
538 | 537 | warnMsg += ". sqlmap is going to retry the request" |
539 | | - logger.log(logging.CRITICAL if not conf.identifyWaf else logging.DEBUG, warnMsg) |
| 538 | + logger.critical(warnMsg) |
540 | 539 | return Connect._retryProxy(**kwargs) |
541 | 540 | elif kb.testMode: |
542 | 541 | logger.critical(warnMsg) |
|
0 commit comments