Skip to content

Commit

Permalink
support gui mode
Browse files Browse the repository at this point in the history
  • Loading branch information
isayan committed Mar 6, 2021
1 parent cf2c246 commit 08d0c57
Show file tree
Hide file tree
Showing 12 changed files with 333 additions and 50 deletions.
8 changes: 7 additions & 1 deletion Readme-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ ViewState が URLEncode されている場合でも URLDecode 後に ViewState
java -jar ViewStateDecoder.jar -vs=%2FwEPDwUKLTM0MjUyMzM2OWRkmW75zyss5UROsLtrTEuOq7AGUDk%3D
```

また、-gui オプションで Burp sute を必要としないスタンドアローンで起動できます。

```
java -jar ViewStateDecoder.jar -gui
```

## ビルド

```
Expand All @@ -107,7 +113,7 @@ gradlew release

## 必須ライブラリ
ビルドには別途 [BurpExtensionCommons](https://github.com/raise-isayan/BurpExtensionCommons) のライブラリを必要とします。
* BurpExtensionCommons v0.4.0.0
* BurpExtensionCommons v0.4.x
* https://github.com/raise-isayan/BurpExtensionCommons

## 利用ライブラリ
Expand Down
8 changes: 7 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ example)
java -jar ViewStateDecoder.jar -vs=%2FwEPDwUKLTM0MjUyMzM2OWRkmW75zyss5UROsLtrTEuOq7AGUDk%3D
```

You can also launch it standalone with the -gui option, which does not require Burp sute.

```
java -jar ViewStateDecoder.jar -gui
```

## build

```
Expand All @@ -109,7 +115,7 @@ gradlew release

## Required libraries
Building requires a [BurpExtensionCommons](https://github.com/raise-isayan/BurpExtensionCommons) library.
* BurpExtensionCommons v0.4.0.0
* BurpExtensionCommons v0.4.x
* https://github.com/raise-isayan/BurpExtensionCommons

## Use Library
Expand Down
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ repositories {
jcenter()
}

sourceCompatibility = '1.8' // -source
targetCompatibility = '1.8' // -target
sourceCompatibility = '11' // -source
targetCompatibility = '11' // -target

mainClassName = 'aspx.viewstate.ViewStateDecoder'
//mainClassName = 'yagura.view.ViewStateMainFrame'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
Expand Down Expand Up @@ -64,7 +65,9 @@ task release(type: Zip, dependsOn: ['build']) {

dependencies {
// https://mvnrepository.com/artifact/net.portswigger.burp.extender/burp-extender-api
compileOnly 'net.portswigger.burp.extender:burp-extender-api:2.1'
// stand alone mode で実行させるため含める
// compileOnly 'net.portswigger.burp.extender:burp-extender-api:2.1'
implementation 'net.portswigger.burp.extender:burp-extender-api:2.1'
// https://github.com/raise-isayan/BurpExtlib
implementation fileTree(dir: 'libs', include: ['*.jar'])
// https://mvnrepository.com/artifact/com.google.code.gson/gson
Expand Down
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=0.5
release_version_minor=1.0
release_version_minor=2.0
Binary file not shown.
Binary file modified release/ViewStateDecoder-v0.5.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/aspx/viewstate/ViewState.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public JsonElement toJson() {
}

public boolean isMacEnabled() {
return this.digest.length > 0;
return this.digest.length > 0 && (getMacAlgorithm() != Algorithm.HMAC_UNKNOWN);
}

public Algorithm getMacAlgorithm() {
Expand Down
17 changes: 13 additions & 4 deletions src/main/java/aspx/viewstate/ViewStateDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import static yagura.view.ViewStateMainFrame.mainGUI;

/**
*
Expand All @@ -20,13 +21,16 @@ private static String getVersion() {
return RELEASE.getString("version");
}

/**
* @param args the command line arguments
*/
/**
* @param args the command line arguments
*/
public static void main(String[] args) {

String viewStateValue = null;
boolean debug = false;

try {
for (String arg : args) {
// single parameter
Expand All @@ -39,6 +43,10 @@ public static void main(String[] args) {
usage();
System.exit(0);
}
if ("-gui".equals(arg)) {
mainGUI(args);
return;
}
String[] param = arg.split("=", 2);
if (param.length < 2) {
// single parameter
Expand All @@ -50,7 +58,7 @@ public static void main(String[] args) {
// multi parameter
if ("-vs".equals(param[0])) {
viewStateValue = param[1];
}
}
}
}

Expand Down Expand Up @@ -92,10 +100,11 @@ private static void usage() {
System.out.println("[option]");
System.out.println("\t-h: output help.");
System.out.println("\t-v: output version.");
System.out.println("\t-gui: stand alone GUI mode.");
System.out.println("\t-d: output debug log.");
System.out.println("[command]");
System.out.println("\t=-vs: viewstate string");
System.out.println("\t-vs=<viewState>: viewstate string");
System.out.println("");
}

}
56 changes: 56 additions & 0 deletions src/main/java/yagura/view/ViewStateMainFrame.form
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Menu class="javax.swing.JMenuBar" name="menuBar">
<SubComponents>
<Menu class="javax.swing.JMenu" name="menuLookAndFeel">
<Properties>
<Property name="text" type="java.lang.String" value="Look and Feel"/>
</Properties>
</Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
<Properties>
<Property name="defaultCloseOperation" type="int" value="3"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[1024, 640]"/>
</Property>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="menuBar"/>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-122"/>
</AuxValues>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlMain">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[800, 600]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
</Constraint>
</Constraints>

<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
</Container>
</SubComponents>
</Form>
Loading

0 comments on commit 08d0c57

Please sign in to comment.