@@ -737,13 +737,14 @@ def getTabCaption(self):
737
737
def getUiComponent(self):
738
738
return self._main_jtabedpane
739
739
740
- def show_error_popup(self, error_details):
740
+ def show_error_popup(self, error_details, location, brr ):
741
741
try:
742
742
f = file("BappManifest.bmf", "rb").readlines()
743
743
for line in f:
744
744
if line.startswith("ScreenVersion: "):
745
745
error_details += "\n" + line.replace("ScreenVersion", "Upload Scanner Version")
746
746
break
747
+ error_details += "\nExtension code location: " + location
747
748
except:
748
749
print "Could not find plugin version..."
749
750
try:
@@ -767,13 +768,28 @@ def show_error_popup(self, error_details):
767
768
'Do you want to open a github issue with the details below now? \n' \
768
769
'Details: \n{}\n'.format(FloydsHelpers.u2s(error_details))
769
770
response = JOptionPane.showConfirmDialog(self._global_opts, full_msg, full_msg,
770
- JOptionPane.YES_NO_OPTION) # 'The Burp extension "Upload Scanner" just crashed'
771
+ JOptionPane.YES_NO_OPTION)
771
772
if response == JOptionPane.YES_OPTION:
773
+ # Ask if it would also be OK to send the request
774
+ request_msg = "Is it OK to send along the following request? If you click 'No' this request will not \n" \
775
+ "be sent, but please consider submitting an anonymized/redacted version of the request \n" \
776
+ "along with the bug report. \n"
777
+ request_content = repr(FloydsHelpers.jb2ps(brr.getRequest()))
778
+ if len(request_content) > 1500:
779
+ request_content = request_content[:1500] + "..."
780
+ request_msg += request_content
781
+ response = JOptionPane.showConfirmDialog(self._global_opts, request_msg, request_msg,
782
+ JOptionPane.YES_NO_OPTION)
783
+ if response == JOptionPane.YES_OPTION:
784
+ error_details += "\nRequest: " + request_content
785
+ else:
786
+ error_details += "\nRequest: None"
787
+
772
788
if Desktop.isDesktopSupported():
773
789
desktop = Desktop.getDesktop()
774
790
if desktop.isSupported(Desktop.Action.BROWSE):
775
791
github = "https://github.com/modzero/mod0BurpUploadScanner/issues/new?title=UploadScanner%20bug" \
776
- "&body=" + urllib.quote("```\n"+ error_details+ "\n```")
792
+ "&body=" + urllib.quote("```\n" + error_details + "\n```")
777
793
desktop.browse(URI(github))
778
794
#if desktop.isSupported(Desktop.Action.MAIL):
779
795
# mailto = "mailto:burpplugins" + 'QGZsb3lkLmNo'.decode("base64") + "?subject=UploadScanner%20bug"
@@ -927,7 +943,7 @@ def doActiveScan(self, base_request_response, insertionPoint, options=None):
927
943
else:
928
944
print "This is not a type file but something else in a multipart message:", insertionPoint.getInsertionPointName()
929
945
except:
930
- self.show_error_popup(traceback.format_exc())
946
+ self.show_error_popup(traceback.format_exc(), "doActiveScan", base_request_response )
931
947
if options and options.redl_enabled:
932
948
options.scan_was_stopped()
933
949
raise sys.exc_info()[1], None, sys.exc_info()[2]
@@ -966,7 +982,7 @@ def run_flexiinjector(self, base_request_response, options=None):
966
982
print "You did not specify the file you are going to upload, no FlexiInjector checks will be done"
967
983
self._warned_flexiinjector = True
968
984
except:
969
- self.show_error_popup(traceback.format_exc())
985
+ self.show_error_popup(traceback.format_exc(), "run_flexiinjector", base_request_response )
970
986
if fi and fi.opts.redl_enabled:
971
987
fi.opts.scan_was_stopped()
972
988
raise sys.exc_info()[1], None, sys.exc_info()[2]
@@ -4928,7 +4944,7 @@ def getInsertionPoints(self, base_request_response):
4928
4944
function = bf.get_exiftool_images
4929
4945
insertion_points.append(InsertionPointForActiveScan(injector, upload_type, function, args, kwargs))
4930
4946
except:
4931
- self.burp_extender.show_error_popup(traceback.format_exc())
4947
+ self.burp_extender.show_error_popup(traceback.format_exc(), "getInsertionPoints", base_request_response )
4932
4948
raise sys.exc_info()[1], None, sys.exc_info()[2]
4933
4949
return insertion_points
4934
4950
@@ -6862,10 +6878,11 @@ def __init__(self, helpers):
6862
6878
def add(self, dl_matcher):
6863
6879
brr = dl_matcher.issue.get_base_request_response()
6864
6880
iRequestInfo = self._helpers.analyzeRequest(brr)
6865
- url = FloydsHelpers.u2s(iRequestInfo.getUrl().toString())
6866
- host = self.add_collection(url)
6867
- with self._thread_lock:
6868
- self._collection[host].add(dl_matcher)
6881
+ if iRequestInfo.getUrl():
6882
+ url = FloydsHelpers.u2s(iRequestInfo.getUrl().toString())
6883
+ host = self.add_collection(url)
6884
+ with self._thread_lock:
6885
+ self._collection[host].add(dl_matcher)
6869
6886
6870
6887
def add_collection(self, url):
6871
6888
host = self._get_host(url)
0 commit comments