diff --git a/libs/BurpExtensionCommons-v3.1.3.2.jar b/libs/BurpExtensionCommons-v3.1.3.3.jar similarity index 87% rename from libs/BurpExtensionCommons-v3.1.3.2.jar rename to libs/BurpExtensionCommons-v3.1.3.3.jar index 7080134f..7e470789 100644 Binary files a/libs/BurpExtensionCommons-v3.1.3.2.jar and b/libs/BurpExtensionCommons-v3.1.3.3.jar differ diff --git a/release/YaguraExtension-v3.0.jar b/release/YaguraExtension-v3.0.jar index acfbd209..0fae2626 100644 Binary files a/release/YaguraExtension-v3.0.jar and b/release/YaguraExtension-v3.0.jar differ diff --git a/src/main/java/extend/util/external/TransUtil.java b/src/main/java/extend/util/external/TransUtil.java index 792c0a9e..2763c337 100644 --- a/src/main/java/extend/util/external/TransUtil.java +++ b/src/main/java/extend/util/external/TransUtil.java @@ -102,7 +102,7 @@ public static Pattern getEncodeTypePattern(EncodeType type) { } public enum EncodePattern { - NONE, BASE64, BASE64_URLSAFE, BASE64_MIME, BASE32, BASE16, UUENCODE, QUOTEDPRINTABLE, PUNYCODE, URL_STANDARD, HTML, BYTE_HTML, URL_UNICODE, UNICODE, UNICODE2, BYTE_HEX, BYTE_HEX1, BYTE_HEX2, BYTE_OCT, GZIP, ZLIB, ZLIB_NOWRAP, UTF7, UTF8_ILL, C_LANG, JSON, SQL_LANG, REGEX, + NONE, BASE64, BASE64_URLSAFE, BASE64_MIME, BASE32, BASE16, UUENCODE, QUOTEDPRINTABLE, PUNYCODE, URL_STANDARD, HTML, HTML_UNICODE, HTML_BYTE, URL_UNICODE, UNICODE, UNICODE2, BYTE_HEX, BYTE_HEX1, BYTE_HEX2, BYTE_OCT, GZIP, ZLIB, ZLIB_NOWRAP, UTF7, UTF8_ILL, C_LANG, JSON, SQL_LANG, REGEX, }; // private final static Pattern PTN_URLENCODE = Pattern.compile("(%[0-9a-fA-F][0-9a-fA-F]|[0-9a-zA-Z\\*_\\+\\.-])+"); @@ -389,7 +389,10 @@ public static String toSmartDecode(String value, TransUtil.EncodePattern encodeP case HTML: decode = SmartCodec.toHtmlDecode(value, SmartCodec.ENCODE_PATTERN_ALL); break; - case BYTE_HTML: { + case HTML_UNICODE: + decode = SmartCodec.toHtmlUnicodeDecode(value, SmartCodec.ENCODE_PATTERN_ALL); + break; + case HTML_BYTE: { String guessCode = (charset == null) ? HttpUtil.getUniversalGuessCode(StringUtil.getBytesRaw(SmartCodec.toHtmlDecode(value, StandardCharsets.ISO_8859_1.name()))) : charset; if (guessCode != null) { applyCharset = guessCode; diff --git a/src/main/java/yagura/model/SendToServer.java b/src/main/java/yagura/model/SendToServer.java index dfc38cce..654c9ef0 100644 --- a/src/main/java/yagura/model/SendToServer.java +++ b/src/main/java/yagura/model/SendToServer.java @@ -1,6 +1,5 @@ package yagura.model; -import burp.BurpExtender; import burp.BurpExtension; import burp.api.montoya.core.ByteArray; import burp.api.montoya.core.HighlightColor; @@ -614,10 +613,10 @@ public String getSendToParameter(SendToParameterType type, HttpRequestResponse m String body = wrapResponse.getBodyString(true, StandardCharsets.ISO_8859_1.name()); value = HttpUtil.extractHTMLTitle(body); if (value != null) { - value = SmartCodec.toHtmlDecode(value, wrapResponse.getGuessCharset(StandardCharsets.ISO_8859_1.name())); + value = SmartCodec.toHtmlUnicodeDecode(value); } } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, null, ex); + logger.log(Level.SEVERE, ex.getMessage(), ex); } } break; diff --git a/src/main/java/yagura/view/JTransCoderTab.form b/src/main/java/yagura/view/JTransCoderTab.form index d428effb..d3d33e80 100644 --- a/src/main/java/yagura/view/JTransCoderTab.form +++ b/src/main/java/yagura/view/JTransCoderTab.form @@ -299,7 +299,7 @@ - + @@ -307,7 +307,7 @@ - + diff --git a/src/main/java/yagura/view/JTransCoderTab.java b/src/main/java/yagura/view/JTransCoderTab.java index 5f89d569..c188d14d 100644 --- a/src/main/java/yagura/view/JTransCoderTab.java +++ b/src/main/java/yagura/view/JTransCoderTab.java @@ -424,7 +424,7 @@ private void initComponents() { rdoHtml = new javax.swing.JRadioButton(); rdoHtmlDec = new javax.swing.JRadioButton(); pnlHtmlHex = new javax.swing.JPanel(); - rdoHtmlHex = new javax.swing.JRadioButton(); + rdoHtmlUnicode = new javax.swing.JRadioButton(); rdoHtmlByteHex = new javax.swing.JRadioButton(); pnlJSUnicodeEnc = new javax.swing.JPanel(); rdoUnicodeHex = new javax.swing.JRadioButton(); @@ -794,14 +794,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { pnlHtmlHex.setLayout(new java.awt.GridLayout(1, 2)); - rdoEncodeDecodeGrp.add(rdoHtmlHex); - rdoHtmlHex.setText("&#xhh;(unicode)"); - rdoHtmlHex.addActionListener(new java.awt.event.ActionListener() { + rdoEncodeDecodeGrp.add(rdoHtmlUnicode); + rdoHtmlUnicode.setText("&#xhh;(unicode)"); + rdoHtmlUnicode.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - rdoHtmlHexActionPerformed(evt); + rdoHtmlUnicodeActionPerformed(evt); } }); - pnlHtmlHex.add(rdoHtmlHex); + pnlHtmlHex.add(rdoHtmlUnicode); rdoEncodeDecodeGrp.add(rdoHtmlByteHex); rdoHtmlByteHex.setText("&#xhh;(byte)"); @@ -2601,8 +2601,8 @@ private void btnEncodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR encode = TransUtil.toByteOctEncode(value, this.getSelectEncode(), TransUtil.getEncodeTypePattern(this.getEncodeType())); } else if (this.rdoHtmlDec.isSelected()) { encode = SmartCodec.toHtmlDecEncode(value, TransUtil.getEncodeTypePattern(this.getEncodeType())); - } else if (this.rdoHtmlHex.isSelected()) { - encode = SmartCodec.toHtmlHexEncode(value, TransUtil.getEncodeTypePattern(this.getEncodeType()), this.rdoUpperCase.isSelected()); + } else if (this.rdoHtmlUnicode.isSelected()) { + encode = SmartCodec.toHtmlUnicodeEncode(value, TransUtil.getEncodeTypePattern(this.getEncodeType()), this.rdoUpperCase.isSelected()); } else if (this.rdoHtmlByteHex.isSelected()) { encode = SmartCodec.toHtmlByteHexEncode(value, this.getSelectEncode(), TransUtil.getEncodeTypePattern(this.getEncodeType()), this.rdoUpperCase.isSelected()); } else if (this.rdoGzip.isSelected()) { @@ -2678,9 +2678,9 @@ private void btnDecodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR } else if (this.rdoHtmlDec.isSelected()) { encodePattern = TransUtil.EncodePattern.HTML; } else if (this.rdoHtmlByteHex.isSelected()) { - encodePattern = TransUtil.EncodePattern.BYTE_HTML; - } else if (this.rdoHtmlHex.isSelected()) { - encodePattern = TransUtil.EncodePattern.HTML; + encodePattern = TransUtil.EncodePattern.HTML_BYTE; + } else if (this.rdoHtmlUnicode.isSelected()) { + encodePattern = TransUtil.EncodePattern.HTML_UNICODE; } else if (this.rdoGzip.isSelected()) { encodePattern = TransUtil.EncodePattern.GZIP; } else if (this.rdoZLIB.isSelected()) { @@ -3115,9 +3115,9 @@ private void btnOutputCopyActionPerformed(java.awt.event.ActionEvent evt) {//GEN SwingUtil.systemClipboardCopy(this.txtOutputRaw.getText()); }//GEN-LAST:event_btnOutputCopyActionPerformed - private void rdoHtmlHexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoHtmlHexActionPerformed + private void rdoHtmlUnicodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoHtmlUnicodeActionPerformed // TODO add your handling code here: - }//GEN-LAST:event_rdoHtmlHexActionPerformed + }//GEN-LAST:event_rdoHtmlUnicodeActionPerformed private void rdoHtmlByteHexActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoHtmlByteHexActionPerformed // TODO add your handling code here: @@ -3788,7 +3788,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { private javax.swing.JRadioButton rdoHtml; private javax.swing.JRadioButton rdoHtmlByteHex; private javax.swing.JRadioButton rdoHtmlDec; - private javax.swing.JRadioButton rdoHtmlHex; + private javax.swing.JRadioButton rdoHtmlUnicode; private javax.swing.JRadioButton rdoILLUTF8; private javax.swing.JRadioButton rdoJSON; private javax.swing.JRadioButton rdoLF; diff --git a/src/main/java/yagura/view/ResultFilterDlg.java b/src/main/java/yagura/view/ResultFilterDlg.java index 6feb6e1a..97d3d96d 100644 --- a/src/main/java/yagura/view/ResultFilterDlg.java +++ b/src/main/java/yagura/view/ResultFilterDlg.java @@ -683,13 +683,13 @@ public static void main(String args[]) { } } } catch (ClassNotFoundException ex) { - logger.log(java.util.logging.Level.SEVERE, null, ex); + logger.log(java.util.logging.Level.SEVERE, ex.getMessage(), ex); } catch (InstantiationException ex) { - logger.log(java.util.logging.Level.SEVERE, null, ex); + logger.log(java.util.logging.Level.SEVERE, ex.getMessage(), ex); } catch (IllegalAccessException ex) { - logger.log(java.util.logging.Level.SEVERE, null, ex); + logger.log(java.util.logging.Level.SEVERE, ex.getMessage(), ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { - logger.log(java.util.logging.Level.SEVERE, null, ex); + logger.log(java.util.logging.Level.SEVERE, ex.getMessage(), ex); } // // diff --git a/src/test/java/yagura/model/okHttpClientTest.java b/src/test/java/yagura/model/okHttpClientTest.java index fbcfd8f3..842c154c 100644 --- a/src/test/java/yagura/model/okHttpClientTest.java +++ b/src/test/java/yagura/model/okHttpClientTest.java @@ -251,7 +251,7 @@ public void testSendtoProxy() { } } } catch (NoSuchAlgorithmException | KeyManagementException ex) { - logger.log(Level.SEVERE, null, ex); + logger.log(Level.SEVERE, ex.getMessage(), ex); } }