Skip to content

Commit

Permalink
Literal search and param update checked
Browse files Browse the repository at this point in the history
  • Loading branch information
hvqzao committed Nov 1, 2016
1 parent b4259e4 commit 543c3a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Requires Java 8

This extension _DOES NOT_ require Burp Suite Professional

## Download

https://github.com/hvqzao/burp-token-rewrite/releases/download/1.0/token-rewrite.jar

## License

[MIT License](LICENSE)
9 changes: 5 additions & 4 deletions src/hvqzao/rewrite/TokenRewriteExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) {
optionsTokensTableSplitPane.setUI(new GlyphSplitPaneUI(optionsPane.getBackground())); // each need separate instance
// add the custom tab to Burp's UI
callbacks.addSuiteTab(TokenRewriteExtension.this);
// register ourselves as an HTTP listener
callbacks.registerHttpListener(TokenRewriteExtension.this);
// get burp frame and tabbed pane handler
burpFrame = (JFrame) SwingUtilities.getWindowAncestor(optionsTab);
//
Expand Down Expand Up @@ -307,17 +309,16 @@ public String getValue() {
// byte[] message = helpers.buildHttpMessage(Arrays.asList(headers), helpers.stringToBytes(body));
// callbacks.makeHttpRequest(service, message);
//}

//
// misc
//
private boolean tokenEntrySearchDefined(TokenEntry tokenEntry) {
return ((tokenEntry.isLiteral() && (tokenEntry.getStartWith().length() == 0 || tokenEntry.getEndsWith().length() == 0))
|| (tokenEntry.isLiteral() == false && tokenEntry.getRegexMatch().length() == 0));
return ((tokenEntry.isLiteral() && (tokenEntry.getStartWith().length() != 0 && tokenEntry.getEndsWith().length() != 0))
|| (tokenEntry.isLiteral() == false && tokenEntry.getRegexMatch().length() != 0));
}

private String tokenSearch(TokenEntry tokenEntry) {
if (tokenEntrySearchDefined(tokenEntry)) {
if (tokenEntrySearchDefined(tokenEntry) == false) {
return "Undefined";
} else {
return tokenEntry.isLiteral() ? tokenEntry.getStartWith() + "[...]" + tokenEntry.getEndsWith() : tokenEntry.getRegexMatch();
Expand Down
2 changes: 1 addition & 1 deletion src/hvqzao/rewrite/TokenRewriteOptions.form
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<Component id="removeToken" pref="74" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="tokensTableSplitPane" pref="368" max="32767" attributes="0"/>
<Component id="tokensTableSplitPane" pref="383" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
</Group>
</Group>
Expand Down
2 changes: 1 addition & 1 deletion src/hvqzao/rewrite/TokenRewriteOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private void initComponents() {
.addComponent(addToken, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(removeToken, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tokensTableSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 368, Short.MAX_VALUE)
.addComponent(tokensTableSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
.addGap(9, 9, 9)))
.addContainerGap())
);
Expand Down

0 comments on commit 543c3a1

Please sign in to comment.