-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/conferences-changes' into develop
- Loading branch information
Showing
29 changed files
with
288 additions
and
34 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
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
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
57 changes: 57 additions & 0 deletions
57
src/main/java/de/usd/cstchef/operations/string/RemoveWhitespace.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,57 @@ | ||
package de.usd.cstchef.operations.string; | ||
|
||
import javax.swing.JComboBox; | ||
|
||
import burp.BurpUtils; | ||
import burp.api.montoya.core.ByteArray; | ||
import de.usd.cstchef.Utils.MessageType; | ||
import de.usd.cstchef.operations.Operation; | ||
import de.usd.cstchef.operations.OperationCategory; | ||
import de.usd.cstchef.operations.Operation.OperationInfos; | ||
|
||
@OperationInfos(name = "Remove Whitespace", category = OperationCategory.STRING, description = "Removes Spaces, Tabs or Newlines from input") | ||
public class RemoveWhitespace extends Operation { | ||
|
||
JComboBox<String> whitespaceSelection; | ||
|
||
@Override | ||
protected ByteArray perform(ByteArray input, MessageType messageType) throws Exception { | ||
try { | ||
if(input != null) { | ||
String inputStr = input.toString(); | ||
String selection = (String)this.whitespaceSelection.getSelectedItem(); | ||
switch(selection){ | ||
case "Space": | ||
inputStr = inputStr.replaceAll(" ", ""); | ||
break; | ||
case "Newline": | ||
inputStr = inputStr.replaceAll("\n", ""); | ||
break; | ||
case "Tab": | ||
inputStr = inputStr.replaceAll("\t", ""); | ||
break; | ||
case "All": | ||
inputStr = inputStr.replaceAll("[\n\t\s]*", ""); | ||
break; | ||
default: | ||
throw new IllegalArgumentException("Unkown whitespace type selection"); | ||
} | ||
|
||
return factory.createByteArray(inputStr); | ||
} | ||
else { | ||
return factory.createByteArray(""); | ||
} | ||
|
||
} catch (Exception e) { | ||
return input; | ||
} | ||
} | ||
|
||
@Override | ||
public void createUI() { | ||
this.whitespaceSelection = new JComboBox<>(new String[] { "Space", "Newline", "Tab", "All"}); | ||
this.whitespaceSelection.setSelectedIndex(1); | ||
this.addUIElement("Type: ", this.whitespaceSelection); | ||
} | ||
} |
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,54 @@ | ||
package de.usd.cstchef.operations.string; | ||
|
||
import javax.swing.JComboBox; | ||
|
||
import burp.BurpUtils; | ||
import burp.api.montoya.core.ByteArray; | ||
import de.usd.cstchef.Utils.MessageType; | ||
import de.usd.cstchef.operations.Operation; | ||
import de.usd.cstchef.operations.OperationCategory; | ||
import de.usd.cstchef.operations.Operation.OperationInfos; | ||
|
||
@OperationInfos(name = "Strip", category = OperationCategory.STRING, description = "Strip Whitespace at beginning, end or both") | ||
public class Strip extends Operation { | ||
|
||
JComboBox<String> stripLocationSelection; | ||
|
||
@Override | ||
protected ByteArray perform(ByteArray input, MessageType messageType) throws Exception { | ||
try { | ||
if(input != null) { | ||
String inputStr = input.toString(); | ||
String selection = (String)this.stripLocationSelection.getSelectedItem(); | ||
switch(selection){ | ||
case "Start": | ||
inputStr = inputStr.stripLeading(); | ||
break; | ||
case "End": | ||
inputStr = inputStr.stripTrailing(); | ||
break; | ||
case "Both": | ||
inputStr = inputStr.stripLeading().stripTrailing(); | ||
break; | ||
default: | ||
throw new IllegalArgumentException("Unkown location selection"); | ||
} | ||
|
||
return factory.createByteArray(inputStr); | ||
} | ||
else { | ||
return factory.createByteArray(""); | ||
} | ||
|
||
} catch (Exception e) { | ||
return input; | ||
} | ||
} | ||
|
||
@Override | ||
public void createUI() { | ||
this.stripLocationSelection = new JComboBox<>(new String[] { "Start", "End", "Both"}); | ||
this.stripLocationSelection.setSelectedIndex(0); | ||
this.addUIElement("Strip at: ", this.stripLocationSelection); | ||
} | ||
} |
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.