Skip to content
KitploitKITPLOIT
FerramentasBlog
Enviar
FerramentasBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

··Feeds·Contato·Privacidade·© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
Xjar_tips — 获取加密程序的参数 | Kitploit
Ferramentas/GitHubGitHub/jas502n/xjar_tips
Static AnalysisEncryption/Decryption ToolsReverse EngineeringCryptographyBinary Analysis
GitHubjas502n/xjar_tips

Xjar_tips

获取加密程序的参数

Ver Repositório
137há 4 anosAinda não revisado

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →
Compartilhar

Xjar_tips

Introdução:

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

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

O binário xjar é escrito em Go e armazena informações como a chave secreta; xxx-1.0-SNAPSHOT.xjar é o arquivo criptografado com AES.

Objetivo: obter os parâmetros que o iniciador xjar passa para a JVM, imprimindo-os usando o fluxo de saída padrão.

Comando normal para executar um JAR criptografado com xjar:

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

Versão Java:

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) {

    }

}

Compilação:

root@kitploit:~
javac f
Obtendo argumentos da JVM
root@kitploit:~
./xjar java f java -jar ./xxx-1.0-SNAPSHOT.xjar
Saída:
root@kitploit:~
[+] Get Jvm Stdin Input:
args = AES/CBC/PKCS5Padding
args = 128
args = 128
args = Passw0rd

Correspondente ao código Go do xjar:

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
}

Observação:

Esta senha pode ser encontrada pesquisando por palavras-chave com strings xjar:

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

Análise IDA:

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

Em main.main:

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

Descriptografando usando a senha:

Divide-se principalmente entre JARs da versão Spring Boot e JARs únicos.

Descriptografia da versão Spring Boot:

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

Descriptografia de um único JAR:

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

Link de referência: Auditoria de código - quebra de criptografia do xjar

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

Versão Go:

root@kitploit:~
package main

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

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

Versão PHP:

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