Skip to content

Commit

Permalink
Showing 19 changed files with 116 additions and 658 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
netbeans.org-netbeans-modules-javascript2-requirejs.enabled=true
release_version_major=2.2
release_version_minor=1.1
release_version_minor=2.0
22 changes: 17 additions & 5 deletions help/html5/help-ja.html
Original file line number Diff line number Diff line change
@@ -940,12 +940,21 @@ <h5 id="_proxy設定ダイヤログ">Proxy設定ダイヤログ</h5>
<div class="ulist">
<ul>
<li>
<p>Use Burp Proxy Settings
プロキシ設定にBurpの設定を利用します。</p>
<p>Use Burp Proxy Settings</p>
<div class="ulist">
<ul>
<li>
<p>プロキシ設定にBurpの設定を利用します。</p>
</li>
</ul>
</div>
</li>
<li>
<p>Use Custom Proxy Settings
プロキシ設定に独自の設定を利用します。</p>
<p>Use Custom Proxy Settings</p>
<div class="ulist">
<ul>
<li>
<p>プロキシ設定に独自の設定を利用します。</p>
<div class="dlist">
<dl>
<dt class="hdlist1">Protocol</dt>
@@ -973,6 +982,9 @@ <h5 id="_proxy設定ダイヤログ">Proxy設定ダイヤログ</h5>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<div class="sect4">
<h5 id="_サーバチェック時にサーバに送信される形式">サーバチェック時にサーバに送信される形式</h5>
@@ -1820,7 +1832,7 @@ <h3 id="_version">2.9. Version</h3>
<div id="footer">
<div id="footer-text">
Version unspecified<br>
Last updated 2021-03-07 18:56:07 +0900
Last updated 2021-03-07 19:58:20 +0900
</div>
</div>
</body>
22 changes: 17 additions & 5 deletions help/html5/help.html
Original file line number Diff line number Diff line change
@@ -941,12 +941,21 @@ <h5 id="_proxy_configuration_dialog">Proxy Configuration Dialog</h5>
<div class="ulist">
<ul>
<li>
<p>Use Burp Proxy Settings
Use Burp settings for proxy settings.</p>
<p>Use Burp Proxy Settings</p>
<div class="ulist">
<ul>
<li>
<p>Use Burp settings for proxy settings.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Use Custom Proxy Settings
Use custom proxy settings.</p>
<p>Use Custom Proxy Settings</p>
<div class="ulist">
<ul>
<li>
<p>Use custom proxy settings.</p>
<div class="dlist">
<dl>
<dt class="hdlist1">Protocol</dt>
@@ -974,6 +983,9 @@ <h5 id="_proxy_configuration_dialog">Proxy Configuration Dialog</h5>
</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<div class="sect4">
<h5 id="_the_format_sent_to_the_server_when_checking_the_server">The format sent to the server when checking the server</h5>
@@ -1826,7 +1838,7 @@ <h3 id="_version">2.9. Version</h3>
<div id="footer">
<div id="footer-text">
Version unspecified<br>
Last updated 2021-03-07 18:58:12 +0900
Last updated 2021-03-07 19:55:00 +0900
</div>
</div>
</body>
Binary file not shown.
Binary file modified release/YaguraExtender-v2.2.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/help/help-ja.adoc
Original file line number Diff line number Diff line change
@@ -298,10 +298,10 @@ image:images/custom_sendto_server_proxy.png[SendToItem編集 Proxy設定 ダイ
サーバにチェックされている場合に設定可能となります。

* Use Burp Proxy Settings
プロキシ設定にBurpの設定を利用します。
** プロキシ設定にBurpの設定を利用します。

* Use Custom Proxy Settings
プロキシ設定に独自の設定を利用します。
** プロキシ設定に独自の設定を利用します。

Protocol::
Proxyのプロトコルを指定します。HTTPとSOCKSを選択可能です。(SOCKSは現状動作しません)
10 changes: 5 additions & 5 deletions src/main/help/help.adoc
Original file line number Diff line number Diff line change
@@ -304,11 +304,11 @@ image:images/custom_sendto_server_proxy.png[SendToItem Edit Proxy Settings Dialo

This setting is only available if the server is checked.

* Use Burp Proxy Settings
Use Burp settings for proxy settings.

* Use Custom Proxy Settings
Use custom proxy settings.
* Use Burp Proxy Settings
** Use Burp settings for proxy settings.

* Use Custom Proxy Settings
** Use custom proxy settings.

Protocol::
protocol of the proxy, HTTP or SOCKS.
7 changes: 0 additions & 7 deletions src/main/java/aspx/viewstate/ViewStateParser.java
Original file line number Diff line number Diff line change
@@ -581,11 +581,4 @@ private String readTypeIdent(ByteBuffer bbf) {
return "Unknown";
}

private final static Pattern PTN_URL = Pattern.compile("%([0-9a-fA-F]{2})");

public static boolean isUrlencoded(String value) {
Matcher m = PTN_URL.matcher(value);
return m.find();
}

}
258 changes: 14 additions & 244 deletions src/main/java/extend/util/external/TransUtil.java

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions src/main/java/yagura/model/MatchAlertItem.java
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import extension.burp.NotifyType;
import extension.burp.Severity;
import extension.burp.TargetTool;
import extension.helpers.MatchUtil;
import extension.view.base.MatchItem;
import java.util.EnumSet;
import java.util.regex.Pattern;
@@ -25,9 +26,9 @@ public MatchAlertItem() {

@Override
public Pattern compileRegex(boolean quote) {
return TransUtil.compileRegex(this.getMatch(), this.isSmartMatch(), !quote, this.isIgnoreCase(), Pattern.MULTILINE);
return MatchUtil.compileRegex(this.getMatch(), this.isSmartMatch(), !quote, this.isIgnoreCase(), Pattern.MULTILINE);
}

public static String[] getTypes() {
return MESSAGE_TYPE;
}
@@ -42,7 +43,7 @@ public void setSmartMatch(boolean value) {
public boolean isSmartMatch() {
return this.smartMatch;
}

@Expose
private EnumSet<NotifyType> notifyTypes = EnumSet.noneOf(NotifyType.class);

@@ -62,7 +63,7 @@ public void setNotifyTypes(EnumSet<NotifyType> notifyTypes) {

@Expose
private EnumSet<TargetTool> targetTools = EnumSet.allOf(TargetTool.class);

/**
* @return the targetTools
*/
@@ -214,7 +215,7 @@ public void setProperty(MatchItem item) {
this.setRegexp(item.isRegexp());
this.setReplace(item.getReplace());
}

public void setProperty(MatchAlertItem item) {
this.setProperty((MatchItem)item);
this.setSmartMatch(item.isSmartMatch());
@@ -226,5 +227,5 @@ public void setProperty(MatchAlertItem item) {
this.setNotifyTypes(item.getNotifyTypes());
this.setComment(item.getComment());
}

}
13 changes: 7 additions & 6 deletions src/main/java/yagura/model/MatchReplaceItem.java
Original file line number Diff line number Diff line change
@@ -2,11 +2,12 @@

import com.google.gson.annotations.Expose;
import extend.util.external.TransUtil;
import extension.helpers.MatchUtil;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import extension.view.base.MatchItem;


/**
* @author isayan
*/
@@ -35,9 +36,9 @@ public static String[] getTypes() {

@Override
public Pattern compileRegex(boolean quote) {
return TransUtil.compileRegex(this.getMatch(), this.isSmartMatch(), !quote, this.isIgnoreCase(), Pattern.MULTILINE);
return MatchUtil.compileRegex(this.getMatch(), this.isSmartMatch(), !quote, this.isIgnoreCase(), Pattern.MULTILINE);
}

/**
* @param quote
* @param metachar
@@ -69,7 +70,7 @@ public void setSmartMatch(boolean value) {
public boolean isSmartMatch() {
return this.smartMatch;
}

@Expose
private boolean metaChar = false;

@@ -115,13 +116,13 @@ public void setProperty(MatchItem item) {
this.setRegexp(item.isRegexp());
this.setReplace(item.getReplace());
}

public void setProperty(MatchReplaceItem item) {
this.setProperty((MatchItem)item);
this.setMetaChar(item.isMetaChar());
this.setSmartMatch(item.isSmartMatch());
}

public static Object[] toObjects(MatchReplaceItem matchReplace) {
Object[] beans = new Object[8];
beans[0] = matchReplace.isSelected();
9 changes: 5 additions & 4 deletions src/main/java/yagura/view/GeneratePoCTab.java
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
import extension.helpers.HttpRequest;
import extension.helpers.HttpResponse;
import extension.helpers.HttpUtil;
import extension.helpers.MatchUtil;
import extension.helpers.StringUtil;
import extension.helpers.SwingUtil;
import java.awt.Component;
@@ -889,10 +890,10 @@ private String generatePoC(GenerateCsrfParameter csrfParam) {
paramValue = StringUtil.getStringCharset(StringUtil.getBytesRaw(paramValue), csrfEncoding);
}
else {
if (TransUtil.isUrlencoded(paramName)) {
if (MatchUtil.isUrlencoded(paramName)) {
paramName = TransUtil.decodeUrl(paramName, csrfEncoding);
}
if (TransUtil.isUrlencoded(paramValue)) {
if (MatchUtil.isUrlencoded(paramValue)) {
paramValue = TransUtil.decodeUrl(paramValue, csrfEncoding);
}
}
@@ -1056,10 +1057,10 @@ private String generateHTML5PoC(GenerateCsrfParameter csrfParam) {
paramValue = StringUtil.getStringCharset(StringUtil.getBytesRaw(paramValue), csrfEncoding);
}
else {
if (TransUtil.isUrlencoded(paramName)) {
if (MatchUtil.isUrlencoded(paramName)) {
paramName = TransUtil.decodeUrl(paramName, csrfEncoding);
}
if (TransUtil.isUrlencoded(paramValue)) {
if (MatchUtil.isUrlencoded(paramValue)) {
paramValue = TransUtil.decodeUrl(paramValue, csrfEncoding);
}
}
3 changes: 2 additions & 1 deletion src/main/java/yagura/view/JSearchTab.java
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
import javax.swing.table.TableRowSorter;
import extend.util.external.TransUtil;
import extension.burp.HighlightColor;
import extension.helpers.MatchUtil;
import extension.helpers.StringUtil;
import extension.view.base.DefaultObjectTableModel;
import extension.view.base.NamedColor;
@@ -694,7 +695,7 @@ private boolean isValidRegex(String text) {
// all clear
this.modelSearch.removeAll();
JSearchProperty searchProp = getProperty();
Pattern p = TransUtil.compileRegex(text, searchProp.isSmartMatch(), searchProp.isRegexp(), searchProp.isIgnoreCase());
Pattern p = MatchUtil.compileRegex(text, searchProp.isSmartMatch(), searchProp.isRegexp(), searchProp.isIgnoreCase());

IHttpRequestResponse messageInfo[] = BurpExtender.getCallbacks().getProxyHistory();
try {
3 changes: 2 additions & 1 deletion src/main/java/yagura/view/JTransCoderTab.java
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@
import extension.helpers.FileUtil;
import extension.helpers.HashUtil;
import extension.helpers.HttpUtil;
import extension.helpers.MatchUtil;
import extension.helpers.StringUtil;
import extension.helpers.SwingUtil;
import extension.view.base.CustomTableModel;
@@ -2760,7 +2761,7 @@ private void rdoByteOctActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
private void btnSmartMatchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSmartMatchActionPerformed
try {
String enc = (this.chkWithByte.isSelected()) ? this.getSelectEncode() : null;
String inputText = TransUtil.toSmartMatch(getInputText(), enc);
String inputText = MatchUtil.toSmartMatch(getInputText(), enc);
this.setOutput(inputText);
} catch (UnsupportedEncodingException e1) {
logger.log(Level.SEVERE, null, e1);
9 changes: 5 additions & 4 deletions src/main/java/yagura/view/ParamsViewTab.java
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import extend.util.external.TransUtil;
import extension.helpers.HttpMessage;
import extension.helpers.HttpRequest;
import extension.helpers.HttpUtil;
import extension.helpers.StringUtil;
import extension.helpers.SwingUtil;
import extension.view.base.CustomTableModel;
@@ -266,7 +267,7 @@ public void tableChanged(TableModelEvent e) {
TableColumn colorColumn = this.tableParams.getColumnModel().getColumn(1);
colorColumn.setCellEditor(new DefaultCellEditor(this.cmbParamType));

// Data
// Data
this.tableParams.getColumnModel().getColumn(0).setMinWidth(0);
this.tableParams.getColumnModel().getColumn(0).setPreferredWidth(0);
this.tableParams.getColumnModel().getColumn(0).setMaxWidth(0);
@@ -397,9 +398,9 @@ protected void done() {
final HttpRequest request = HttpRequest.parseHttpRequest(content);
HttpMessage httpmessage = request;
if (reqInfo.getContentType() == IRequestInfo.CONTENT_TYPE_URL_ENCODED) {
guessCharset = TransUtil.getUniversalGuessCode(StringUtil.getBytesRaw(TransUtil.decodeUrl(request.getBody(), StandardCharsets.ISO_8859_1.name())));
guessCharset = HttpUtil.getUniversalGuessCode(StringUtil.getBytesRaw(TransUtil.decodeUrl(request.getBody(), StandardCharsets.ISO_8859_1.name())));
} else {
guessCharset = TransUtil.getUniversalGuessCode(request.getBodyBytes());
guessCharset = HttpUtil.getUniversalGuessCode(request.getBodyBytes());
}

if (guessCharset == null) {
@@ -423,7 +424,7 @@ protected void done() {
}
}
};
swParam.execute();
swParam.execute();

}

17 changes: 9 additions & 8 deletions src/main/java/yagura/view/QuickSearchTab.java
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
import javax.swing.DefaultComboBoxModel;
import javax.swing.text.JTextComponent;
import extend.util.external.TransUtil;
import extension.helpers.MatchUtil;
import extension.view.base.RegexItem;
import javax.swing.event.EventListenerList;
import yagura.model.QuickSearchEvent;
@@ -230,7 +231,7 @@ private void popQuickPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent
}//GEN-LAST:event_popQuickPopupMenuWillBecomeVisible

private IKeywordHighlighter highlightKeyword;

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnQuckOption;
private javax.swing.JButton btnQuickBack;
@@ -257,10 +258,10 @@ public void setMessageFont(Font font) {

public void setSelectedTextArea(javax.swing.text.JTextComponent textArea) {
this.txtTextArea = textArea;
this.highlightKeyword = new KeywordHighlighter();
this.highlightKeyword = new KeywordHighlighter();
this.txtTextArea.setHighlighter(this.highlightKeyword);
}

public void setSelectedTextArea(org.fife.ui.rtextarea.RTextArea textArea) {
this.txtTextArea = textArea;
this.highlightKeyword = new RSyntaxKeywordHighlighter();
@@ -317,7 +318,7 @@ private void quickSearchPerformed(boolean forward, boolean appendHistory) {
&& this.ignoreCase == this.mnuIgnoreCase.isSelected()
&& (this.keyword.equals(searchText)
|| (this.mnuSmartMatch.isSelected()
&& keyword.equals(TransUtil.toSmartMatch(searchText))))) {
&& keyword.equals(MatchUtil.toSmartMatch(searchText))))) {
high.searchPosition(forward);
} else {
if (isValidRegex(searchText)) {
@@ -372,7 +373,7 @@ protected void quickSearch(javax.swing.text.JTextComponent ta, String keyword) {
this.regex = this.mnuRegex.isSelected();
this.ignoreCase = this.mnuIgnoreCase.isSelected();
if (this.mnuSmartMatch.isSelected()) {
this.keyword = TransUtil.toSmartMatch(keyword);
this.keyword = MatchUtil.toSmartMatch(keyword);
hc.setHighlightKeyword(ta.getDocument(), this.keyword, false, this.ignoreCase, Color.YELLOW);
} else {
this.keyword = keyword;
@@ -394,7 +395,7 @@ public void clearView() {
public void clearViewAndSearch() {
clearView();
this.quickSearchPerformed(true);
this.fireForwardPerformedhEvent(newQuickSearchEvent(true));
this.fireForwardPerformedhEvent(newQuickSearchEvent(true));
}

@SuppressWarnings("unchecked")
@@ -407,7 +408,7 @@ public void renewEncodingList(String defaultCharset, List<String> encodingLiest)
}

private final EventListenerList quickSearchEventList = new EventListenerList();

protected void fireBackPerformedhEvent(QuickSearchEvent evt) {
Object[] listeners = this.quickSearchEventList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
@@ -437,5 +438,5 @@ public void removeQuickSearchListener(QuickSearchListener l) {
private QuickSearchEvent newQuickSearchEvent(boolean clearView) {
return new QuickSearchEvent(this, this.keyword, this.smartMatch, this.regex, this.ignoreCase, clearView);
}

}
3 changes: 2 additions & 1 deletion src/main/java/yagura/view/ViewStateTab.java
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
import burp.IMessageEditorTabFactory;
import burp.IParameter;
import burp.IRequestInfo;
import extension.helpers.MatchUtil;
import extension.helpers.StringUtil;
import extension.helpers.SwingUtil;
import extension.helpers.json.JsonUtil;
@@ -266,7 +267,7 @@ public void setViewState(String viewStateValue) {
}
try {
this.clearViewState();
if (ViewStateParser.isUrlencoded(viewStateValue)) {
if (MatchUtil.containsUrlencoded(viewStateValue)) {
viewStateValue = URLDecoder.decode(viewStateValue, StandardCharsets.ISO_8859_1);
}
final ViewStateParser vs = new ViewStateParser();
2 changes: 2 additions & 0 deletions src/test/java/extend/util/external/FormatUtilTest.java
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ public void testURL() {
System.out.println(url.getPort());
} catch (MalformedURLException ex) {
Logger.getLogger(FormatUtilTest.class.getName()).log(Level.SEVERE, null, ex);
fail();
}

}
@@ -194,6 +195,7 @@ public void testIsXML() {
assertEquals(expResult, result);
try {
FormatUtil.prettyXml(plainXML, false);
fail();
} catch (IOException ex) {
assertTrue(true);
}
377 changes: 19 additions & 358 deletions src/test/java/extend/util/external/TransUtilTest.java

Large diffs are not rendered by default.

0 comments on commit f5a73e4

Please sign in to comment.