Skip to content

Commit

Permalink
Ensure content-length is set correctly on requests with malformed hea…
Browse files Browse the repository at this point in the history
…ders
  • Loading branch information
albinowax committed Aug 14, 2019
1 parent f84a33b commit 4dbbad7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Request.kt
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ open class Request(val template: String, val words: List<String?>, val learnBori
val end = request.size
while (i < end) {
val line_start = i

// Make ' foo: bar' get interpreted as 'foo: bar'
if (request[i] == ' '.toByte()) {
i++
}

while (i < end && request[i++] != ' '.toByte()) {
}
val header_name = Arrays.copyOfRange(request, line_start, i - 2)
Expand Down
2 changes: 1 addition & 1 deletion src/RequestEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ abstract class RequestEngine: IExtensionStateListener {
if (Utils.gotBurp && !Utils.unloaded) {
Utils.callbacks.removeExtensionStateListener(this)
}

if (attackState.get() != 3) {
attackState.set(3)
Utils.out("Cancelled attack")
Expand Down
9 changes: 9 additions & 0 deletions src/fast-http.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ def randstr(length=12, allow_digits=True):
candidates += string.digits
return ''.join(random.choice(candidates) for x in range(length))
def queueForever(engine, req):
# infinitely-running bruteforce (a, b ... aaa, aab etc)
seed = 0
while True:
batch = []
seed = wordlists.bruteforce.generate(seed, 5000, batch)
for word in batch:
engine.queue(target.req, word)
class Engine:
BURP = 1
THREADED = 2
Expand Down

0 comments on commit 4dbbad7

Please sign in to comment.