From 94c364dd4d1e742e5c1aacef99a33ced13554048 Mon Sep 17 00:00:00 2001 From: EvilOS Date: Mon, 30 Mar 2020 11:39:06 +0800 Subject: [PATCH] Fixed bug && Update --- .DS_Store | Bin 0 -> 8196 bytes HaE/HaE.py | 24 ++++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..eb46c114a585ff2a059d02ea5233207ad69c89bf GIT binary patch literal 8196 zcmeHM&2JM&6n~QsSUU~bgcw50VO0x(L=G_ptR5;hPC{d~Qle}W93^0O?TNGMddKXp z6GD>8syO#rksjN^AAq>^Qrb%|y|%X=`VaJyGrZXuecApC0w4}xbDXfQ^9rIN(UjN_ zh!RXhm?8>OB99nEm}9#k^-PHkfx;Y!JbVy2GLa_~5|57k8?ibNQ=lpp1B!v84Dhpi zKg@#-bIx|>`Q3BFXlm+D($_yQcS4|f*7(z+9c?8@pwSD(iP#zs$CCtnQb?xF1UhG%cYeiu%OvZYG+}}@V=PzYG%ipi=Jlfsc|N4pWh{(4BjP!VT(00!)ZOQ8i^4zHj z_x{%Prh|#(&HO`bdb* z=S$3A4Cod*T8QYw$Z{W{XspLziI(rRo0fNKs59Pfh&%l}pwwTh1a5g@V z51;|x!4L2Pet|#WA2@_pWSE>IACs$OlH4F!Vv=bxL*_}IED7tr=0aX<4keJRA`s9TRg9Mk zPzXC>=CHY`{vtAFa7!hI&I~2Gqo$}|lzaV-TaGrDsXyn@E$S}>U)m8BLG=~_sWUjW zv{^K9>Hy8)x}Lqk11j4aT-t@px0mkKzxnpy`yYRL`t0Seu@$u9Yg9b9%HOcoMaVIW z(fU(ux)Pz?Ns z86X3*)@%+PZ2tJ_^_8Es4b1m3^ThQU0%H>_x-J6nx%G!3)(uqUHm1aeKy1OJE&^g2 LRG}DnrwqIXX2eaJ literal 0 HcmV?d00001 diff --git a/HaE/HaE.py b/HaE/HaE.py index f276723..be818f9 100644 --- a/HaE/HaE.py +++ b/HaE/HaE.py @@ -111,14 +111,14 @@ class BurpExtender(IBurpExtender, ITab,IHttpListener, IMessageEditorTabFactory): if colorText in colors: with open(configFile, 'r+') as content: dicts = json.load(content) - # 解决r+写入问题 - content.seek(0,0) - content.truncate() if nameText in dicts: self.tipString.setText("Name is existed!") elif not(isHighlight or isExtract): self.tipString.setText("Highlight or Extract?") else: + # 解决r+写入问题 + content.seek(0,0) + content.truncate() dicts[nameText] = {"regex": regexText, "highlight": isHighlight, "extract": isExtract, "color": colorText} content.write(jsbeautifier.beautify(json.dumps(dicts))) #print(dicts) @@ -127,9 +127,18 @@ class BurpExtender(IBurpExtender, ITab,IHttpListener, IMessageEditorTabFactory): self.tipString.setText("Not in colors list.") def reloadConfig(self, event): + # 重新载入配置文件 with open(configFile, 'r') as content: self.configTextArea.setText(content.read()) + def saveConfig(self, event): + # 保存配置文件 + text = self.configTextArea.getText() + if text != "": + with open(configFile, 'w') as content: + content.write(text) + self.reloadConfig() + def getUiComponent(self): self.HaEPanel = JPanel() self.HaEPanel.setBorder(None) @@ -172,11 +181,8 @@ class BurpExtender(IBurpExtender, ITab,IHttpListener, IMessageEditorTabFactory): self.configPanel = JPanel() self.tabbedPane.addTab("Config", None, self.configPanel, None) self.configPanel.setLayout(BorderLayout(0, 0)) - self.configString = JLabel("This is config file content.") - self.configString.setHorizontalAlignment(SwingConstants.CENTER) - self.configPanel.add(self.configString, BorderLayout.NORTH) self.configTextArea = JTextArea() - self.configTextArea.setEnabled(False) + # self.configTextArea.setEnabled(False) self.configTextArea.setTabSize(4) self.configTextArea.setLineWrap(True) self.configTextArea.setRows(20) @@ -184,7 +190,9 @@ class BurpExtender(IBurpExtender, ITab,IHttpListener, IMessageEditorTabFactory): self.scrollPane = JScrollPane(self.configTextArea) self.configPanel.add(self.scrollPane, BorderLayout.SOUTH) self.reloadButton = JButton("Reload", actionPerformed=self.reloadConfig) - self.configPanel.add(self.reloadButton, BorderLayout.CENTER) + self.configPanel.add(self.reloadButton, BorderLayout.NORTH) + self.saveButton = JButton("Save", actionPerformed=self.saveConfig) + self.configPanel.add(self.saveButton, BorderLayout.CENTER) return self.HaEPanel class MarkINFOTab(IMessageEditorTab):