-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new When constraint: When In Scope. Allow Reshaper to be target…
…ed from Session Handler Rules. Use variable tags to access cookie jar items. Disable HTML in dynamic text displays.
- Loading branch information
Showing
24 changed files
with
259 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/synfron/reshaper/burp/core/rules/whens/WhenInScope.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package synfron.reshaper.burp.core.rules.whens; | ||
|
||
import burp.BurpExtender; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import synfron.reshaper.burp.core.messages.IEventInfo; | ||
import synfron.reshaper.burp.core.rules.RuleOperationType; | ||
import synfron.reshaper.burp.core.vars.VariableString; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
public class WhenInScope extends When<WhenInScope> { | ||
|
||
|
||
@Getter | ||
@Setter | ||
private VariableString url; | ||
|
||
@Override | ||
public boolean isMatch(IEventInfo eventInfo) { | ||
boolean isMatch = false; | ||
String url = VariableString.getTextOrDefault(eventInfo, this.url, eventInfo.getUrl()); | ||
try { | ||
isMatch = BurpExtender.getCallbacks().isInScope(new URL(url)); | ||
} catch (Exception ignored) { | ||
} | ||
if (eventInfo.getDiagnostics().isEnabled()) eventInfo.getDiagnostics().logValue(this, isMatch, url); | ||
return isMatch; | ||
} | ||
|
||
@Override | ||
public RuleOperationType<WhenInScope> getType() { | ||
return WhenType.InScope; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/synfron/reshaper/burp/ui/components/rules/whens/WhenInScopeComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package synfron.reshaper.burp.ui.components.rules.whens; | ||
|
||
import synfron.reshaper.burp.core.rules.whens.WhenInScope; | ||
import synfron.reshaper.burp.ui.models.rules.whens.WhenInScopeModel; | ||
import synfron.reshaper.burp.ui.utils.DocumentActionListener; | ||
|
||
import javax.swing.*; | ||
import java.awt.event.ActionEvent; | ||
|
||
public class WhenInScopeComponent extends WhenComponent<WhenInScopeModel, WhenInScope> { | ||
private JTextField url; | ||
|
||
public WhenInScopeComponent(WhenInScopeModel when) { | ||
super(when); | ||
initComponent(); | ||
} | ||
|
||
private void initComponent() { | ||
url = createTextField(); | ||
|
||
url.setText(model.getUrl()); | ||
|
||
url.getDocument().addDocumentListener(new DocumentActionListener(this::onUrlChanged)); | ||
|
||
mainContainer.add(getLabeledField("URL", url), "wrap"); | ||
getDefaultComponents().forEach(component -> mainContainer.add(component, "wrap")); | ||
mainContainer.add(getPaddedButton(validate)); | ||
} | ||
|
||
private void onUrlChanged(ActionEvent actionEvent) { | ||
model.setUrl(url.getText()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.