Git Product home page Git Product logo

enumjavalibs's Introduction

EnumJavaLibs

EnumJavaLibs: Remote Java classpath enumeration via deserialization.

Overview

EnumJavaLibs can be used to discover which libraries are loaded (i.e. available on the classpath) by a remote Java application when it supports deserialization.

-----------------
Serially - v1.1
by Stefan Broeder
-----------------
Usage:

EnumJavaLibs {MODE} [OPTIONS]

MODES:
base64                  Write base64 encoded serialized objects to CSV file in current directory
rmi {host} {port}       RMI mode. Connect to RMI endpoint and try deserialization.

OPTIONS:
-f {string}             Only serialize classes from packages which contain the given string (e.g. org.apache.commons)
-d                      Debug mode on

For more information about how to use the tool, please see this blog post.

Obtaining jar files

A local repository of jar files is required in ~/.serially/jars. You should run the JavaClassDB python3 script to index the jar files, before running EnumJavaLibs. One way to build a local repository is to download the most popular Java libraries from maven central. I provide a script getPopularJars.py that can be used as follows:

./getPopularJars.py 20 | while read x; do wget --quiet -P ~/.serially/jars $x; sleep 5; done

This command will scrape the 20 most popular jar files from mavenrepository.com.

Another way to bootstrap your local jar repository if you are using maven, is to copy the jar files you already have in the maven cache (~/.m2/repository)

RMI

To test RMI, I created a docker image you can fetch from [https://cloud.docker.com/repository/docker/summ1t/jmxrmi_vulnerable/general], which spins up a host listening to RMI on port 1617. It's running Java 8u40, which is vulnerable. It has library nanohttpd-2.2.0.jar loaded on the classpath to showcase that EnumJavaLibs is able to discover this library remotely (given that you prepared your local repository with this jar)

enumjavalibs's People

Contributors

redtimmy 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.