Skip to content

Commit 8dbadfa

Browse files
committed
Add configurable Java path in the Exploitation pane beacuse recent Java major versions do not allow to run ysoserial properly
1 parent 5315c68 commit 8dbadfa

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Java Deserialization Scanner
2-
Java Deserialization Scanner is a Burp Suite plugin aimed at detect and exploit Java deserialization vulnerabilities. It was written by Federico Dotta, a Security Advisor at @ Mediaservice.net.
2+
Java Deserialization Scanner is a Burp Suite plugin aimed at detect and exploit Java deserialization vulnerabilities. It was written by Federico Dotta, Principal Security Analyst at HN Security.
33

44
The plugin is made up of three different components:
55

@@ -8,15 +8,15 @@ The plugin is made up of three different components:
88
3. Exploiter, that allow to actively exploit Java deserialization vulnerabilies, using frohoff ysoserial (https://github.com/frohoff/ysoserial)
99

1010
# Author
11-
- Federico Dotta, Security Advisor at @ Mediaservice.net
11+
- Federico Dotta, Principal Security Analyst at HN Security
1212

1313
# Contributors
1414
- Jeremy Goldstein
1515
- Andras Veres-Szentkiralyi
1616

1717
# Mini walkthrough (24/05/17)
1818
A brief article containing a mini walkthrough on how to use the various components of the plugin can be found at the following URL:
19-
https://techblog.mediaservice.net/2017/05/reliable-discovery-and-exploitation-of-java-deserialization-vulnerabilities/
19+
https://web.archive.org/web/20201130104913/https://techblog.mediaservice.net/2017/05/reliable-discovery-and-exploitation-of-java-deserialization-vulnerabilities/
2020

2121
# Integration with Burp Suite active and passive scanner
2222
Java Deserialization Scanner uses custom payloads generated with a modified version of "ysoserial", tool created by frohoff and gebl, to detect Java deserialization vulnerabilities. The original tool (https://github.com/frohoff/ysoserial) generate payloads for the execution of commands on the system, using the Runtime.exec function. Usually, however, it is not possible to see the output of the command and consequently it is not simple to write a scanner based on this kind of function. For this reason, a modified version of ysoserial is used to generate different types of payloads, usefull for the detection of the issue instead of the exploitation:
@@ -40,7 +40,7 @@ Currently, the passive checks of the Java Deserialiation Scanner reported the pr
4040
12. Mozilla Rhino (two different chains)
4141
13. Vaadin
4242

43-
Furthermore, **URLSNDS payload has been introduced** to actively **detect Java deserialization without any vulnerable libraris**. If the plugin find only the URLDNS issue (and no vulnerable libraries), the attacker probably can execute DoS attacks but to achieve Remote Code Execution it is necessary more effort. Refer to [this link](https://techblog.mediaservice.net/2020/04/java-deserialization-scanner-0-6-is-out/) for more details.
43+
Furthermore, **URLSNDS payload has been introduced** to actively **detect Java deserialization without any vulnerable libraris**. If the plugin find only the URLDNS issue (and no vulnerable libraries), the attacker probably can execute DoS attacks but to achieve Remote Code Execution it is necessary more effort. Refer to [this link](https://web.archive.org/web/20210312114921/https://techblog.mediaservice.net/2020/04/java-deserialization-scanner-0-6-is-out/) for more details.
4444

4545
All the components of the plugin supports the following encodings:
4646

pom.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44

55
<groupId>org.fd</groupId>
66
<artifactId>JavaDeserializationScanner</artifactId>
7-
<version>0.6</version>
7+
<version>0.7</version>
88
<packaging>jar</packaging>
99

1010
<name>JavaDeserializationScanner</name>
1111
<url>http://maven.apache.org</url>
1212

1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<maven.compiler.source>1.8</maven.compiler.source>
16+
<maven.compiler.target>1.8</maven.compiler.target>
1517
</properties>
16-
18+
1719
<build>
1820
<plugins>
1921
<plugin>
@@ -77,13 +79,6 @@
7779
<artifactId>commons-codec</artifactId>
7880
<version>1.14</version>
7981
</dependency>
80-
81-
<dependency>
82-
<groupId>junit</groupId>
83-
<artifactId>junit</artifactId>
84-
<version>3.8.1</version>
85-
<scope>test</scope>
86-
</dependency>
8782

8883
</dependencies>
8984
</project>

src/main/java/burp/BurpExtender.java

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ public class BurpExtender implements IBurpExtender, IScannerCheck, ITab, ActionL
149149

150150
private JTabbedPane mainPanel;
151151

152+
private JTextField javaPath;
152153
private JTextField ysoserialPath;
153-
154+
154155
private String dialogTitle;
155156
private String dialogMessage;
156157
private String[] dialogButtonsMessages;
@@ -390,7 +391,7 @@ public void registerExtenderCallbacks(final IBurpExtenderCallbacks callbacks)
390391

391392
urlBodyAlreadyScanned = new ArrayList<String>();
392393

393-
stdout.println("Java Deserialization Scanner v0.5 - The all-in-one plugin for the detection and the exploitation of Java deserialization vulnerabilities");
394+
stdout.println("Java Deserialization Scanner v0.7 - The all-in-one plugin for the detection and the exploitation of Java deserialization vulnerabilities");
394395
stdout.println("Created by: Federico Dotta");
395396
stdout.println("Contributors: Jeremy Goldstein, Andras Veres-Szentkiralyi");
396397
stdout.println("");
@@ -802,12 +803,22 @@ public void run()
802803
configurationTitleExploiting.setFont(new Font("Nimbus", Font.BOLD, 16));
803804
configurationTitleExploiting.setAlignmentX(Component.LEFT_ALIGNMENT);
804805

806+
JPanel javaPathJPanel = new JPanel();
807+
javaPathJPanel.setLayout(new BoxLayout(javaPathJPanel, BoxLayout.X_AXIS));
808+
javaPathJPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
809+
JLabel labelJavaPath = new JLabel("Java path (recent Java major versions do not allow to run ysoserial properly): ");
810+
javaPath = new JTextField(200);
811+
javaPath.setText("java");
812+
javaPath.setMaximumSize( javaPath.getPreferredSize() );
813+
javaPathJPanel.add(labelJavaPath);
814+
javaPathJPanel.add(javaPath);
815+
805816
JPanel configurationPaneButtonJPanel = new JPanel();
806817
configurationPaneButtonJPanel.setLayout(new BoxLayout(configurationPaneButtonJPanel, BoxLayout.X_AXIS));
807818
configurationPaneButtonJPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
808819
JLabel labelConfigurationPaneYsoserialPath = new JLabel("Ysoserial path: ");
809820
ysoserialPath = new JTextField(200);
810-
ysoserialPath.setText("ysoserial-0.0.4-all.jar");
821+
ysoserialPath.setText("ysoserial.jar");
811822
ysoserialPath.setMaximumSize( ysoserialPath.getPreferredSize() );
812823
configurationPaneButtonJPanel.add(labelConfigurationPaneYsoserialPath);
813824
configurationPaneButtonJPanel.add(ysoserialPath);
@@ -828,7 +839,8 @@ public void run()
828839
mainPanelConfiguration.add(addManualIssueToScannerResultManualTesting);
829840
mainPanelConfiguration.add(verboseModeManualTesting);
830841
mainPanelConfiguration.add(separatorConfigurationManualTesting);
831-
mainPanelConfiguration.add(configurationTitleExploiting);
842+
mainPanelConfiguration.add(configurationTitleExploiting);
843+
mainPanelConfiguration.add(javaPathJPanel);
832844
mainPanelConfiguration.add(configurationPaneButtonJPanel);
833845
mainPanelConfiguration.add(enableExploitationHibernate5);
834846

@@ -1837,6 +1849,7 @@ public void insertInjectionCharacters(JTextArea requestArea) {
18371849

18381850
public byte[] generateYsoserialPayload() {
18391851

1852+
String pathJava = javaPath.getText().trim();
18401853
String pathYsoserial = ysoserialPath.getText().trim();
18411854

18421855
try {
@@ -1847,10 +1860,10 @@ public byte[] generateYsoserialPayload() {
18471860

18481861
String[] commands;
18491862
if(enableExploitationHibernate5.isSelected()) {
1850-
String[] temp = {"java","-Dhibernate5","-jar",pathYsoserial};
1863+
String[] temp = {pathJava,"-Dhibernate5","-jar",pathYsoserial};
18511864
commands = temp;
18521865
} else {
1853-
String[] temp = {"java","-jar",pathYsoserial};
1866+
String[] temp = {pathJava,"-jar",pathYsoserial};
18541867
commands = temp;
18551868
}
18561869
String[] fullCommands = ArrayUtils.addAll(commands, commandParts);

0 commit comments

Comments
 (0)