Skip to content

Commit

Permalink
Warn if the user tries to cause a gate-based deadlock, fix burp reque…
Browse files Browse the repository at this point in the history
…st engine
  • Loading branch information
albinowax committed Mar 19, 2019
1 parent f41cb35 commit 73f424c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/RequestEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ abstract class RequestEngine {
} else {
floodgates[gateName] = request.gate!!
}

if (this is ThreadedRequestEngine && request.gate!!.remaining.get() > (this as ThreadedRequestEngine).threads) {
throw Exception("You have queued more gated requests than concurrentConnections, so your attack will deadlock. Consider increasing concurrentConnections")
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/burp/Floodgate.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.concurrent.atomic.AtomicInteger;

public class Floodgate {
final private AtomicInteger remaining = new AtomicInteger(1);
final AtomicInteger remaining = new AtomicInteger(1);
final private AtomicBoolean isOpen = new AtomicBoolean(false);

// the python thread will set here
Expand Down
2 changes: 1 addition & 1 deletion src/fast-http.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class RequestEngine:
print('requestsPerConnection has been forced to 1 and pipelining has been disabled due to Burp engine limitations')
if(readCallback != None):
print('Read callbacks are not supported in the Burp request engine. Try Engine.THREADED instead.')
self.engine = burp.BurpRequestEngine(endpoint, concurrentConnections, maxQueueSize, maxRetriesPerRequest, callback, readCallback, readSize)
self.engine = burp.BurpRequestEngine(endpoint, concurrentConnections, maxQueueSize, maxRetriesPerRequest, callback, readCallback)
elif(engine == Engine.THREADED):
self.engine = burp.ThreadedRequestEngine(endpoint, concurrentConnections, maxQueueSize, readFreq, requestsPerConnection, maxRetriesPerRequest, callback, timeout, readCallback, readSize)
elif(engine == Engine.ASYNC):
Expand Down

0 comments on commit 73f424c

Please sign in to comment.