Git Product home page Git Product logo

java-deserialization-scanner's Introduction

Java Deserialization Scanner

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.

The plugin is made up of three different components:

  1. Integration with Burp Suite active and passive scanner
  2. Manual tester, for the detection of Java deserialization vulnerabilities on custom insertion points
  3. Exploiter, that allow to actively exploit Java deserialization vulnerabilies, using frohoff ysoserial (https://github.com/frohoff/ysoserial)

Author

  • Federico Dotta, Principal Security Analyst at HN Security

Contributors

  • Jeremy Goldstein
  • Andras Veres-Szentkiralyi

Mini walkthrough (24/05/17)

A brief article containing a mini walkthrough on how to use the various components of the plugin can be found at the following URL: https://web.archive.org/web/20201130104913/https://techblog.mediaservice.net/2017/05/reliable-discovery-and-exploitation-of-java-deserialization-vulnerabilities/

Integration with Burp Suite active and passive scanner

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:

  1. Payloads that execute a syncronous sleep function, in order to verify the presence of the issue depending on the time of the response
  2. Payloads that execute a DNS resolution, in order to verify the presence of the issue using the Burp Suite Collaborator integrated in Burp Suite

Currently, the passive checks of the Java Deserialiation Scanner reported the presence of serialized Java objects in the HTTP requests and the active checks actively scan for the presence of weak deserialization functions in conjuction with the presence of the following weak libraries:

  1. Apache Commons Collections 3 (up to 3.2.1), with five different chains
  2. Apache Commons Collections 4 (up to 4.4.0), with two different chains
  3. Spring (up to 4.2.2), with two different chains
  4. Java 6 and Java 7 (up to Jdk7u21) without any weak library
  5. Hibernate 5
  6. JSON
  7. Rome
  8. Java 8 (up to Jdk8u20) without any weak library
  9. Apache Commons BeanUtils
  10. Javassist/Weld
  11. JBoss Interceptors
  12. Mozilla Rhino (two different chains)
  13. Vaadin

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 for more details.

All the components of the plugin supports the following encodings:

  1. Raw
  2. Base64
  3. Ascii Hex
  4. GZIP
  5. Base64 GZIP

In the test folder there are some simple Java server applications that can be used to test the plugin. Every application employ a different vulnerable Java library.

Manual tester

The plugin offer a dedicated tab to launch the detection with the sleep and DNS payloads on custom insertion points, in order to check the Java deserialization vulnerabilities in particular situations in which strange entry points do not allow the detection with the scanner. The results of the manual tester can be inserted between Burp Suite scanner results.

The manual tester offers an extra detection method: CPU detection. The CPU detection method is based on Wouter Coekaerts’ SerialDOS work (https://gist.github.com/coekie/a27cc406fc9f3dc7a70d) and it is able to detect deserialization issues without the presence of any vulnerable library, using an object that employs many CPU cycles for the deserialization task and checking the time of the response. The CPU detection method is not included by default in the active scan checks, because it must be used with caution: sending a huge number of “light” SerialDOS payloads may still cause problems on old or highly-loaded systems.

Exploiter

After that a Java deserialization vulnerability has been found, it is possible to actively exploit the issue with the Exploiting dedicated tab. The “Exploiting” tab offers a comfortable interface to exploit deserialization vulnerabilities. This tab uses the ysoserial tool to generate exploitation vectors and includes the generated payload in a HTTP request. ysoserial takes as argument a vulnerable library and a command and generates a serialized object in binary form that can be sent to the vulnerable application to execute the command on the target system (obviously if the target application is vulnerable). The Exploiting tab supports the same encoding formats as the detection sections of the plugin.

Screenshot

alt tag

Installation

  1. Download Burp Suite: http://portswigger.net/burp/download.html
  2. Install Java Deserialization Scanner from the BApp Store or follow these steps:
  3. Download the last release of Java Deserialization Scanner
  4. Open Burp -> Extender -> Extensions -> Add -> Choose JavaDeserializationScannerXX.jar file

User Guide

  1. After installation, the Java Deserialization Scanner active and passive checks will be added to the Burp Suite scanner (it is possible to disable the checks in the options tab)
  2. Simply run the active or passive scanner in order to check also for weak Java deserialization
  3. With the dedicated tab "Manual testing" it is possible to set the injection point and executing the attack with all the payloads
  4. With the dedicated tab "Exploiting" it is possibile to actively exploit Java deserialization vulnerabilites
  5. The "Configuration" contains all the needed configuration for the correct working of the plugin

Improving Java Deserialization Scanner

In order to improve this extension, please report any issue founded in the plugin. Furthermore if you want report me any disclosed Java library usefull for the exploitation of this weakness and, if I have the time, I will add an active check for it in my plugin.

Disclaimer

This software has been created purely for the purposes of academic research and for the development of effective defensive techniques, and is not intended to be used to attack systems except where explicitly authorized. Project maintainers are not responsible or liable for misuse of the software. Use responsibly.

MIT License

Copyright (c) 2020 Java Deserialization Scanner

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

java-deserialization-scanner's People

Contributors

dnet avatar federicodotta avatar jg10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-deserialization-scanner's Issues

Error Newlines in headers are not allowed

So... This lab has a java deserialization in the cookie, which is base64 + url encoded
https://portswigger.net/web-security/deserialization/exploiting/lab-deserialization-exploiting-java-deserialization-with-apache-commons
When I send the request to Java deserialization scanner and I set the cookie as insertion point, and I do manual testing, it cannot find any vulnerability. Burp logger shows why: all requests return 403 forbidden and Newlines in headers are not allowed in the body.
The funny thing is that if I send the same request to Repeater, it receives a 500 Internal server error (correctly).
When I send the JavaDeserializationScanner request from Logger to Comparer, and I compare it with the one from Repeater, I can see the difference: in the one sent by Repeater there is an extra byte %0d before a %0a, exactly between the end of the serialized cookie and the beginning of the next Header (Cache-control). It looks like that just by sending the request that received 403 Forbidden, from Logger to Repeater, a %0d is added automatically and that fixes the "Newlines in headers are not allowed" error.
Very weird... not sure why JavaDeserializationScanner fails: I think it's related to setting the insertion point. Even more weird the fact that with an automatic scan (scan insertion points - extensions only), the extension correctly finds the deserialization vulnerability
Using the latest ysoserial-master-8eb5cbfbf6-1.jar and java 11.

Scanner detected wrong library

While doing a vulnerable lab the scanner detected RCE using CommonsCollections3 alt payloads 3 and 4 with gzip and base64. Exploitation was failing. A colleague suggested I brute force the library instead of trusting the scan results and I ended up exploiting the lab with CommonsCollections6.

I don't know a ton about java, or these libs, but I wanted to make an issue for this and dig into it, sharing my findings here for others that run into this issue.

How to use the test

sampleCommonsCollections3.war
sampleCommonsCollections4.war
sampleHibernate5.war
sampleJdk7.war
sampleJSON.war
sampleRome.war
sampleSpring.war
How to use DS to work?
Can you give me steps on one testcase?
Thank you

How was the Rhino1 (Sleep) payload generated?

Hi Federico,

I have been trying to reverse engineer some of the hard-coded payloads as a learning experience and I am stuck trying to figure out the Rhino1 (Sleep) payload. I attempted to modify the MozillaRhino1 ysyoserial payload (actually, the Gadgets.createTemplateImpl) to create a Javassist class that invokes java.lang.Thread.sleep(10000L).

This seems to work but the generated serialized payload is not exactly the same as the one used by the Burp plugin. Just wondering what I might be doing differently or if you have the original in a git repo somewhere :)

Thank you!
~~ Peter

How to generate Apache Commons Collections 3 Alternate payload 3 (sleep)?

Hello,

How did you manage to generate the payload for "Apache Commons Collections 3 Alternate payload 3"?

I'm trying to execute the example payload and I've seen that it works perfectly. What I mean by that is that the page keeps loading for 10 seconds. (Only with this payload).

I've also seen that the payload has been added in the following commit: c47dda4

Best Regards,
Alex

ASCII hex generating false positives

ascii hex magic selected for detection translates to "aced" in ASCII which could be very well be a variable name or portion of text in variable. example variable name placed would be detected as serialized object.

not sure how to tackle it

Building from source?

Hey there. Thank you for releasing this tool-- it seems quite useful and I appreciate the documentation in the README!

My apologies if this is an obvious question, but I'm having some difficulty building this tool from source.

  • I see the JARs one can download via the Releases tab, but I'd like to build from source if possible.
  • I see ant/antbuild.xml - but it seems to expect existing .class files to be in bin/, which it then zips up with JARs in libs/ into the final JAR.

Progress Building from Source

I believe I'm close, as I've compiled the Java source into bin/ with:

$ javac -d bin/ -cp src/burp/*

Then the JAR can be built with:

$ ant -f ant/antbuild.xml

Which successfully builds output/JavaDeserializationScanner_dev.jar.

Observed Errors

However, when I try to add this JAR via Burp Extender, I get the following error:

java.lang.ClassNotFoundException: burp.BurpExtender
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at burp.p3e.a(Unknown Source)
	at burp.p3e.<init>(Unknown Source)
	at burp.vz.a(Unknown Source)
	at burp.dre.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:745)

Environment

  • java - openjdk version "1.8.0_111"
  • javac - javac 1.8.0_111
  • OS - Ubuntu 14.04
  • Burp Suite Pro version 1.7.02beta

Any advice would be much appreciated, thanks!

How are payloads generated?

Hi,

I was wondering, how did you generate the initial payloads, e.g. Hibernate 5 (Sleep). I tried to recreate those by using ysoserial without any luck.

Thank you for your help!

Where can I find the payload source?

Hi Frederico,

sorry that I make this an issue - I wasn't able to find your contact details. I found a vulnerable service during a penetration test using your plugin - I wanted to ask you where I can find the source code of the test payloads? I would like to create a proof-of-concept exploit for the customer.

You say in the description that you expanded on the ysoserial test payloads - how exactly did you do that?

Thanks
Thomas

No indication of errors in the manual tab

When there is an error loading ysoserial, in the exploitation tab we can see the corresponding error message, but in the manual tab it just lists every payload as not vulnerable.

Different results with different payload encode method

Hi,

When we choose different payload encode methods, the results give us a different result.

If we choose "Attack(Base64)" or "Attack(Ascii Hex)", it will show "Apache Commons Collections 3 Alternate payload 2: NOT vulnerable."

However, if we choose "Attack", the result will show "Apache Commons Collections 3 Alternate payload 2: Potentially VULNERABLE!!!"

Does it indicate a false positive?

In addition, if convenient, could you tell how you generate this default payload? Is it using Commons Collections 5?

Thank you very much.

plain text format payload is needed

It will be really helpful to know what is the raw plain text decoded value of the below mentioned payload is. this is used as payload for deserialization scanner for burp in github.

rO0ABXNyAC5qYXZheC5tYW5hZ2VtZW50LkJhZEF0dHJpYnV0ZVZhbHVlRXhwRXhjZXB0aW9u1Ofaq2MtRkACAAFMAAN2YWx0ABJMamF2YS9sYW5nL09iamVjdDt4cgATamF2YS5sYW5nLkV4Y2VwdGlvbtD9Hz4aOxzEAgAAeHIAE2phdmEubGFuZy5UaHJvd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wpDh6O7NCAgAAeHB2cQB-ADJzcQB-ACt1cQB-AC8AAAACdXEAfgAyAAAAAXEAfgA1dXEAfgAvAAAAAXNyAA5qYXZhLmxhbmcuTG9uZzuL5JDMjyPfAgABSgAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAAAAAnEHQABmludm9rZXVxAH4AMgAAAAJ2cgAQamF2YS5sYW5nLk9iamVjdAAAAAAAAAAAAAAAeHB2cQB-AC9zcQB-ACdzcgARamF2YS5sYW5nLkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHEAfgBAAAAAAXNyABFqYXZhLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAB3CAAAABAAAAAAeHg

Invalid Payload makes attack buttons grayed out

Burp Version: Professional 2.0.11beta
Java Deserialization Scanner v0.5
ysoserial-0.0.6-SNAPSHOT-all.jar
compiled (on Windows) as follows:
mvn clean package -DskipTests -Dhibernate5

Noticed a problem where due to a typo, the extension gets into a state where the buttons are grayed out and there is no apparent way to bring them back

To Reproduce:
in "Exploiting" tab, type invalid payload name (like Hibernaee1) and click exploit. Buttons become gray as if it is working but they never come back until I restart Burp or uninstall the extension and re-install it.

Apache Commons Collections 3 Alternate payload 3 (Sleep) source code

Hello Federico,

Thanks for providing this awesome tool!

I've been testing an application where the only payload that seems to work is Apache Commons Collections 3 Alternate payload 3 (Sleep). All outbound traffic is blocked on my target, so I need to manually modify this payload to sleep conditionally based on variable values / execution results to prove RCE.

However, I can't seem to find the source code for it. I tried all the gadgets in your ysoserial fork with sleep 10 and none of them seem to work for me. Would you mind sharing the source code you used to generate Apache Commons Collections 3 Alternate payload 3?

Thank you,
Alex

Two errors. 1 newline after Content-length. 2 not removing Content-Length can create problems

Hi.

I love your extension and wonder why hasn't this showed up in the extender tab yet...

I have encountered two problems in manuel scanning:

  1. It doesn't update the content-length header if already present. Another content-length header is added. This can cause problems with webservers honoring the first and not the second content-length header. I've encountered one today :)

  2. A newline is inserted between the last header and content length. This can also cause problems with servers. I've encountered one today as well :)

Please see attached file.

error-with-deserializer

Question about Burp and the latest version of the extension

Hi,
just a couple of doubts:

  • why does Burp BAPP Store say you need Burp Pro for this extension, when I was able to download it and add the jar manually, and it seems to work?
  • why does the extension say version 0.5 (in the "Show in UI" output in Burp, when I load it), when it should be 0.6? Just a typo?

Cheers.

exploiting tab will not generate the payload

entering the command Hibernate1 "sleep 5" in the exploiting tab results in ERROR IN YSOSERIAL COMMAND. Entering the same command directly to ysoserial "java -jar /usr/share/java/ysoserial-v0.0.5.jar Hibernate1 "sleep 5" " works perfectly.

Java 8 payloads Generation

Hi,

Thank you for awesome extension, it is very helpful.

How did you generate Java 8 (with no library) payloads? could you please point me the tool you used?
ysoserial doesn't have java 8 payload.

Thanks.

Error when exploiting - lack of Java 8 support?

Does anyone else have this error when using the latest Burp release, 2020.4, on Windows? After clicking the "Attack" button in the "Exploiting" tab, I encountered the below error message:

Error while generating or serializing payload
com.nqzero.permit.Permit$InitializationFailed: initialization failed, perhaps you're running with a security manager
	at com.nqzero.permit.Permit.setAccessible(Permit.java:22)
	at ysoserial.payloads.util.Reflections.setAccessible(Reflections.java:17)
	at ysoserial.payloads.util.Reflections.getFirstCtor(Reflections.java:45)
	at ysoserial.payloads.util.Gadgets.createMemoizedInvocationHandler(Gadgets.java:72)
	at ysoserial.payloads.util.Gadgets.createMemoitizedProxy(Gadgets.java:67)
	at ysoserial.payloads.CommonsCollections1.getObject(CommonsCollections1.java:148)
	at ysoserial.payloads.CommonsCollections1.getObject(CommonsCollections1.java:43)
	at ysoserial.GeneratePayload.main(GeneratePayload.java:59)
Caused by: com.nqzero.permit.Permit$FieldNotFound: field "override" not found
	at com.nqzero.permit.Permit.<init>(Permit.java:222)
	at com.nqzero.permit.Permit.build(Permit.java:117)
	at com.nqzero.permit.Permit.<clinit>(Permit.java:16)
	... 7 more

I found this is already an open issue for the ysoserial project and can be fixed by using Java 8: (frohoff/ysoserial#136)

I did not use this extension before upgrading to the latest Burp Suite release, but the release notes state that Java 8 is no longer supported: https://portswigger.net/burp/releases/professional-community-2020-4

If other users encounter this error when running the latest Burp release, perhaps we must wait until ysoserial supporting newer Java versions.

Issue Installing Extension

BApp Version - 1.7.36
While installing The extension you uploaded after cloning I am facing an error stating:
BApp Verification failed- The BApp may have been tampered with.

Please resolve this issue.

Question about native Java sleep payload

Hi Federico!
I'm using your scanner and seems amazing! Thanks for your work.

I'm in a situation in which only the payload "Apache Commons Collections 3 Alternate payload 2" (added in commit: 4a29cc3 in src/burp/BurpExtender.java row 159 ) of you scanner causes the web application to sleep for 10 seconds, but I'm not able to replicate this payload.

To understand why only the "native sleep payload" fires, I'm trying to craft the chain myself, by modifying ysoserial's code. In particular I've tryied this chain in CommonsCollections5.java :

public BadAttributeValueExpException getObject(final String command) throws Exception {
		final Transformer transformerChain = new ChainedTransformer(
		        new Transformer[]{ new ConstantTransformer(1) });
		final Transformer[] transformers = new Transformer[] {
		new ConstantTransformer(Thread.class),
		new InvokerTransformer("getMethod",
		        new Class[]{
		                String.class, Class[].class
		        },
		        new Object[]{
		                "sleep", new Class[]{Long.TYPE}
		        }),
		new InvokerTransformer("invoke",
		        new Class[]{
		                Object.class, Object[].class
		        }, new Object[]
		        {
		                null, new Object[] {10000L}
		        }),
		new ConstantTransformer(1) };
		final Map innerMap = new HashMap();

		final Map lazyMap = LazyMap.decorate(innerMap, transformerChain);
		
		TiedMapEntry entry = new TiedMapEntry(lazyMap, "foo");
		
		BadAttributeValueExpException val = new BadAttributeValueExpException(null);
		Field valfield = val.getClass().getDeclaredField("val");
		valfield.setAccessible(true);
		valfield.set(val, entry);

		Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain

		return val;
	}

This gives me a payload quite identical to your, but it does not work!

I would like to know how you generated the payload, can you help me?
Many thanks!

py

Help generating a blind payload for Apache Commons Collections 3 Alternate Payload 2

Hi Federico,

First of all, thank you for your amazing scanner! It detected a vulnerability in my pentesting target using the Apache Commons Collections 3 Alternate Payload 2 (and 3) that I certainly would not have found otherwise. I was able to replicate its payload myself by modifying ysoserial's CommonsCollections5.java file based on the code snippet you included in #10 .

Unfortunately for me, my target appears to be firewalled and I have been unsuccessful in pinging my host or doing DNS lookups. For this reason, I am hoping to modify the gadget chain in the link above to sleep conditionally, as one might do with blind SQLi. For example, the payload would be of the following structure:

(read current directory name)
(if current directory name starts with "a", sleep 5 seconds)

or more generally

(execute commands to establish if a certain condition is true/false)
(sleep if true)

as opposed to just

(sleep 5 seconds).

I have been unsuccessful in doing this, despite a number of different attempts. I have tried to change one of the InvokerTransformers to a SwitchTransformer (in hopes of defining an appropriate predicate), but regardless of what I change ysoserial throws me a serialization error when I attempt to use my compiled .jar file.

I have also looked at the yolosec blind fork of ysoserial, which includes functionality for such cases. However, my Java knowledge is insufficient to understand the gadget chaining they are doing to the level where I can modify it for my own purposes.

For this reason, I am creating this issue here to ask if you have any advice or sample payloads for creating the above gadget chain using the structure of #10 . I recognize blind exfiltration is outside the scope of this scanner, but regardless I would appreciate any input on this issue. Hopefully it can also help others who find a similar issue in their testing.

Thank you for your time!

Incorrectly adds CRLF in front of content-length

I have a hard time using the plugin because with Burp Suite v2021.4-6901 the plugin adds a CRLF in front of the tools own calculated content-length. It does also not replace any existing content-length.

1

Extension is not working with new version of Burp

Hello,

First of all, thank you for creating such nice extension.

I used Deserialization-Scanner efficiently with applications which potentially are vulnerable to Insecure JAVA Deserialization. Although after update of Burp Suite to the recent version, extension is not working any more.

For a proof, application vulnerable to Insecure JAVA Deserialization was tested manually and in exploiting tab, but extension did not show the issue is present. For tested scope was used Practice Burp Exam, which is vulnerable to Insecure JAVA Deserialization definitely.
image
Manual testing tab

image
Exploiting tab

As I can see this problem is the same for other users, so the question is do you support this extension and can you help users to make it working?

Best Regards,
Lilia

needed payload for the vulnerability

I found this Apache Commons Collections 3 Alternate payload 2 (Sleep) as vulnerability while running the Burp . Can I know the command/payload (raw) used for this? Or how I can generate the payload using ysoserial.

Java version for each payload

Hello,

I wanted to point that it would be good to know what version of java was used to generate each payload. I think that i can help to craft some custom payloads.

Kind regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.