Skip to content

Instantly share code, notes, and snippets.

@Decencies
Last active May 30, 2024 17:10
Show Gist options
  • Save Decencies/d44bc4ca353beaa1f8c548e68c5f497f to your computer and use it in GitHub Desktop.
Save Decencies/d44bc4ca353beaa1f8c548e68c5f497f to your computer and use it in GitHub Desktop.

Introduction

This small document will explain how I cracked version 3.3.1 of JNIC. (https://jnic.dev)

Motive

The motive of this crack was simply to test the strength of "DRM" applied to JNIC.

Methodology

Discovering the funny :trollface:

Upon opening the JNIC JAR in a decompiler, I quickly discovered a 'JNICLoader' class, which contained methods whos first parameter were MethodHandles (all of these methods were named 'invoke'). Instinctively I started logging the parameters passed into these methods, along with the MethodHandle's 'descriptor'.

Authentication

After some logging, I found where it contacts the authentication server, and simply reproduced a local proxy server to return the same results. Obviously it wasn't as simple as just proxying the server. After digging a little deeper I found where the server's auth response was passed through one of the invoke methods in JNICLoader. I simply tweaked the function to forcefully use a predefined auth string for authentication. To my surprise it actually worked!

Certificates

I tested JNIC on a sample JAR, and somewhere down the line, it threw an exception as it was verifying it's own (the JAR's) certificates. After forcefully returning the original JAR's certificates the program worked normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment