Skip to content

Commit

Permalink
Fix for an Issue #485 (failing back to single-thread mode if over som…
Browse files Browse the repository at this point in the history
…e bisection length)
  • Loading branch information
stamparm committed Jul 9, 2013
1 parent d7c0805 commit be5ce76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@
# Maximum response total page size (trimmed if larger)
MAX_CONNECTION_TOTAL_SIZE = 100 * 1024 * 1024

# Maximum (multi-threaded) length of entry in bisection algorithm
MAX_BISECTION_LENGTH = 50 * 1024 * 1024

# Mark used for trimming unnecessary content in large chunks
LARGE_CHUNK_TRIM_MARKER = "__TRIMMED_CONTENT__"

Expand Down
4 changes: 4 additions & 0 deletions lib/techniques/blind/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from lib.core.settings import INFERENCE_GREATER_CHAR
from lib.core.settings import INFERENCE_EQUALS_CHAR
from lib.core.settings import INFERENCE_NOT_EQUALS_CHAR
from lib.core.settings import MAX_BISECTION_LENGTH
from lib.core.settings import MAX_TIME_REVALIDATION_STEPS
from lib.core.settings import PARTIAL_HEX_VALUE_MARKER
from lib.core.settings import PARTIAL_VALUE_MARKER
Expand Down Expand Up @@ -135,6 +136,9 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
if length and (lastChar > 0 or firstChar > 0):
length = min(length, lastChar or length) - firstChar

if length and length > MAX_BISECTION_LENGTH:
length = None

showEta = conf.eta and isinstance(length, int)
numThreads = min(conf.threads, length)

Expand Down

0 comments on commit be5ce76

Please sign in to comment.