From a0aa74ee5f174daf53e202c22f6a84a4a697281b Mon Sep 17 00:00:00 2001 From: Randy Gingeleski Date: Fri, 8 Jun 2018 15:21:04 -0400 Subject: [PATCH] #1 work in progress --- NBFS.exe => bin/NBFS.exe | Bin wcf_binary_soap.py | 24 ++++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) rename NBFS.exe => bin/NBFS.exe (100%) diff --git a/NBFS.exe b/bin/NBFS.exe similarity index 100% rename from NBFS.exe rename to bin/NBFS.exe diff --git a/wcf_binary_soap.py b/wcf_binary_soap.py index e09dec9..de3eaa2 100644 --- a/wcf_binary_soap.py +++ b/wcf_binary_soap.py @@ -21,9 +21,10 @@ from burp import IMessageEditorTab from datetime import datetime +from subprocess import PIPE, Popen class CustomDecoderTab(IMessageEditorTab): - + def __init__(self, extender, controller, editable): self._extender = extender self._editable = editable @@ -66,13 +67,20 @@ def setMessage(self, content, isRequest): headers = requestInfo.getHeaders() for h in headers: if 'application/soap+msbin' in h: - # TODO do something here then set this content - content = 'PLACEHOLDER' - if content: - self._txtInput.setText(content) - self._currentMessage = content - else: - self._currentMessage = '' + decodedContent = '' + requestBodyOffset = int(requestInfo.getBodyOffset()) + requestBody = content[requestBodyOffset:] + requestBody64 = self._extender._helpers.base64Encode(requestBody) + try: + p1 = Popen(['NBFS','DECODE',requestBody64],stdout=PIPE) + print(p1.communicate()) + except Exception, e: + print('Call to NBFS failed - is \{repo\}/bin is on your path??') + print(e.__doc__) + print(e.message) + decodedContent = requestBody64 + self._txtInput.setText(decodedContent) + self._currentMessage = decodedContent except Exception, e: print(e.__doc__) print(e.message)