Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
Xjar_tips — 获取加密程序的参数 | Kitploit
Tools/GitHubGitHub/jas502n/xjar_tips
Static AnalysisEncryption/Decryption ToolsReverse EngineeringCryptographyBinary Analysis
GitHubjas502n/xjar_tips

Xjar_tips

获取加密程序的参数

View Repository
13724 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Xjar_tips

Introduction:

root@kitploit:~
Spring Boot JAR 安全加密运行工具, 同时支持的原生JAR.
基于对JAR包内资源的加密以及拓展ClassLoader来构建的一套程序加密启动, 动态解密运行的方案, 避免源码泄露以及反编译.

功能特性
  无代码侵入, 只需要把编译好的JAR包通过工具加密即可.
  完全内存解密, 降低源码以及字节码泄露或反编译的风险.
  支持所有JDK内置加解密算法.
  可选择需要加解密的字节码或其他资源文件.
  支持Maven插件, 加密更加便捷.
  动态生成Go启动器, 保护密码不泄露.

其中xjar 二进制是go编写的,里面存储了秘钥等信息,xxx-1.0-SNAPSHOT.xjar 是AES 加密后的文件。

目的:为了获取xjar启动器 传给 jvm的参数,可以使用标准输出流打印出来。

Normal command for xjar to run the encrypted JAR:

root@kitploit:~
$ ps -ef |grep java |grep xjar

$ file xjar
xjar: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=xx-C, not stripped

$ ./xjar java -jar xxx-1.0-SNAPSHOT.xjar

Java version:

root@kitploit:~
public class f {

    static {
        try {
            java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));

            System.out.println("[+] Get Jvm Stdin Input: ");
            String input = br.readLine();
            while (input != null) {
                System.out.println("args = " + input);
                input = br.readLine();
            }


        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    public static void main(String[] args) {

    }

}
Download Tool

Compile:

root@kitploit:~
javac f
Get JVM parameters
root@kitploit:~
./xjar java f java -jar ./xxx-1.0-SNAPSHOT.xjar
Output information:
root@kitploit:~
[+] Get Jvm Stdin Input:
args = AES/CBC/PKCS5Padding
args = 128
args = 128
args = Passw0rd

Corresponding xjar Go code:

https://github.com/core-lib/xjar/blob/master/src/main/resources/xjar/xjar.go

root@kitploit:~
var xKey = XKey{
	algorithm: []byte{#{xKey.algorithm}}, =>> AES/CBC/PKCS5Padding
	keysize:   []byte{#{xKey.keysize}},   =>> 128
	ivsize:    []byte{#{xKey.ivsize}},    =>> 128
	password:  []byte{#{xKey.password}},  =>> Passw0rd
}

Aside:

This password can be found by searching for the keyword with strings xjar.

root@kitploit:~
$ strings xjar |grep -B 10 "AES/CBC/PKCS5Padding"

IDA analysis:

root@kitploit:~
.text:00000000004AB7BB	main.main	                mov     rbx, cs:off_573F48 ; "Passw0rd\t"
.noptrdata:0000000000560120	0000000A	C	Passw0rd\t

In main.main:

root@kitploit:~
lea     rbx, [rsp+170h+var_126]
mov     [rsp+170h+var_50], rbx
mov     rbx, cs:off_573F48 ; "Passw0rd\t"

Decrypt using the password:

Mainly divided into Spring Boot version JAR and standalone JAR.

Spring Boot version decryption:

root@kitploit:~
String password = "Passw0rd"; //设置密码
XKey xKey = XKit.key(password);
XBoot.decrypt("/path/to/read/encrypted.jar", "/path/to/save/decrypted.jar", xKey);

Standalone JAR decryption:

root@kitploit:~
String password = "Passw0rd";
XKey xKey = XKit.key(password);
XJar.decrypt("/path/encrypted.jar", "/path/decrypted.jar", xKey);

Reference link: Code Audit - xjar Encryption Cracking

https://mp.weixin.qq.com/s/donLtYHXz5BWsF5AnOOmYA

Go version:

root@kitploit:~
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	input := bufio.NewScanner(os.Stdin) //初始化一个扫表对象
	for input.Scan() {                  //扫描输入内容
		line := input.Text() //把输入内容转换为字符串
		fmt.Println(line)    //输出到标准输出
	}
}
Corresponding command:
root@kitploit:~
./xjar ./xjarCrack java -jar xxx-1.0-SNAPSHOT.xjar

PHP version:

root@kitploit:~
<?php var_dump(file_get_contents('php://stdin'));
Corresponding command:
root@kitploit:~
./xjar php test.php java -jar xxx-1.0-SNAPSHOT.xjar