DBeaverUE 23.2.0 分析说明
通过学习DBeaver Ultimate Edition License验证分析得到此文档,仅供研究学习使用,请勿用于非法用途,请支持正版!
一、直接使用分析过的密钥
- 确保是修改过的DBeaverUE压缩包
打开后输入如下授权码:
ZQPAWY+1asXI9i/XcDDQBx68YO6DnBQtsKOiLjHUQxOKS9mRE2o2/ynTvyW+w4jMwEem+YlUNUEd 9C/+9u21IoqUHg9NqFHjOarOmkISIfs5BwBhBI/VGEa5xV8Zvn65yIonioNkeeUDaIYvDsgGDvR7 gJsovjCZf+XXhl+gwdQTbuZiBVNG28ylbXdXuIAWNhsmrWlVmAC46Y9eaf8I28C6DVov9R2iW9c5 5PyrwOA7phzbMfBTvgDvDWDQY6+obL4zZm/KRMaXOVsNRTF3xB4aFHKZ+Zsm8vTeSgJVLIaz2S8V kr49KOrCKzWMjpmA4WWbhiSOcykC4kRXT21w0Q==
二、分析过程
- 下载官方DBeaverUE压缩包压缩包:https://download.dbeaver.com/ultimate/23.2.0/dbeaver-ue-23.2.0-win32.win32.x86_64.zip
- 解压到软件需要安装的位置,打开目录:plugins
找到这三个文件,后面的数字版本号可能不同:
org.jkiss.utils_2.1.196.202309120446.jar org.jkiss.lm_1.0.166.202309120446.jar org.jkiss.dbeaver.core_23.2.0.202309120446.jar
- 同时需要知道
com.dbeaver.app.ultimate
这个jar包在哪,后续需要修改里面的公钥文件 - 把
DBeaverLicenseActiveMain.java
文件和上面三个jar文件放进去 - 打开vscode,安装插件”Extension Pack for Java”后左下角有Java项目栏,在”Referenced Libraries”添加jar,把上面的三个jar添加进去
- 打开
DBeaverLicenseActiveMain.java
文件,点击右上角的运行,终端中会输出无报错的信息,即为环境正常; - 复制终端的运行命令,在命令后面追加参数
gen-keys
,会生成公钥和私钥; - 创建文件public-key.txt,private-key.txt,dbeaver-ue-public.key,将私钥复制到private-key.txt中,将公钥复制到public-key.txt和dbeaver-ue-public.key中;
- 将public-key.txt和private-key.txt文件放到用户目录下的.jkiss-lm文件夹中,用dbeaver-ue-public.key文件替换com.dbeaver.app.ultimate_22.1.0.202206121739.jar内的keysdbeaver-ue-public.key文件;
- 复制终端的运行命令,在命令后面追加参数
encrypt-license
,生成License字符串,此时License为授权码,已经可用; - 修改配置文件dbeaver.ini,增加lm.debug.mode=true配置,在最后一行添加:
-Dlm.debug.mode=true
- 打开DBeaver,导入License,即可完成分析;
三、DBeaverLicenseActiveMain.java 代码
import org.jkiss.lm.*;
import org.jkiss.utils.Base64;
import java.io.*;
import java.security.Key;
import java.security.KeyPair;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.util.Date;
public class DBeaverLicenseActiveMain {
private static final LMProduct TEST_PRODUCT;
static {
TEST_PRODUCT = new LMProduct(
"dbeaver-ue",
"DB",
"DBeaver Ultimate",
"DBeaver Ultimate Edition",
"23.2",
LMProductType.DESKTOP,
new Date(),
new String[0]);
}
public static void main(String[] args) throws Exception {
System.out.println("LM 2.0");
// 生成RAS密钥对
if (args.length > 0 && args[0].equals("gen-keys")) {
System.out.println("Test key generation");
generateKeyPair();
// 生成加密License
} else if (args.length > 0 && args[0].equals("encrypt-license")) {
System.out.println("Encrypt license");
encryptLicense();
// 解密License
} else if (args.length > 0 && args[0].equals("decrypt-license")) {
System.out.println("Decrypt license");
decryptLicense();
// 导入License测试
} else {
System.out.println("Test license generation");
generateLicense();
}
}
private static void encryptLicense() throws Exception {
PrivateKey privateKey = readPrivateKey();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String licenseID = LMUtils.generateLicenseId(TEST_PRODUCT);
System.out.println("License ID: " + licenseID);
System.out.println("Product ID (" + TEST_PRODUCT.getId() + "):");
String productID = in.readLine();
if (productID.isEmpty()) {
productID = TEST_PRODUCT.getId();
}
System.out.println("Product version (" + TEST_PRODUCT.getVersion() + "):");
String productVersion = in.readLine();
if (productVersion.isEmpty()) {
productVersion = TEST_PRODUCT.getVersion();
}
System.out.println("Owner ID (10000):");
String ownerID = in.readLine();
if (ownerID.isEmpty()) {
ownerID = "10000";
}
System.out.println("Owner company (JKISS):");
String ownerCompany = in.readLine();
if (ownerCompany.isEmpty()) {
ownerCompany = "JKISS";
}
System.out.println("Owner name (Serge Rider):");
String ownerName = in.readLine();
if (ownerName.isEmpty()) {
ownerName = "Serge Rider";
}
System.out.println("Owner email (serge@jkiss.org):");
String ownerEmail = in.readLine();
if (ownerEmail.isEmpty()) {
ownerEmail = "serge@jkiss.org";
}
LMLicense license = new LMLicense(
licenseID,
LMLicenseType.ULTIMATE,
new Date(),
new Date(),
(Date) null,
LMLicense.FLAG_UNLIMITED_SERVERS,
productID,
productVersion,
ownerID,
ownerCompany,
ownerName,
ownerEmail);
byte[] licenseData = license.getData();
byte[] licenseEncrypted = LMEncryption.encrypt(licenseData, privateKey);
System.out.println("--- LICENSE ---");
System.out.println(Base64.splitLines(Base64.encode(licenseEncrypted), 76));
}
private static void decryptLicense() throws Exception {
PublicKey publicKey = readPublicKey();
System.out.println("License:");
byte[] encryptedLicense = LMUtils.readEncryptedString(System.in);
LMLicense license = new LMLicense(encryptedLicense, publicKey);
System.out.println(license);
}
private static void generateKeyPair() throws LMException {
KeyPair keyPair = LMEncryption.generateKeyPair(2048);
PublicKey publicKey = keyPair.getPublic();
PrivateKey privateKey = keyPair.getPrivate();
System.out.println("--- PUBLIC KEY ---");
System.out.println(Base64.splitLines(Base64.encode(publicKey.getEncoded()), 76));
System.out.println("--- PRIVATE KEY ---");
System.out.println(Base64.splitLines(Base64.encode(privateKey.getEncoded()), 76));
}
private static void generateLicense() throws LMException {
System.out.println("Gen keys");
KeyPair keyPair = LMEncryption.generateKeyPair(2048);
PublicKey publicKey = keyPair.getPublic();
PrivateKey privateKey = keyPair.getPrivate();
System.out.println("Gen Test license");
String licenseID = LMUtils.generateLicenseId(TEST_PRODUCT);
LMLicense license = new LMLicense(
licenseID,
LMLicenseType.ULTIMATE,
new Date(),
new Date(),
(Date) null,
LMLicense.FLAG_UNLIMITED_SERVERS,
TEST_PRODUCT.getId(),
TEST_PRODUCT.getVersion(),
"10000",
"JKISS",
"Serge Rider",
"serge@jkiss.org");
byte[] subData = license.getData();
byte[] encrypted = LMEncryption.encrypt(subData, privateKey);
String encodedBase64 = Base64.splitLines(Base64.encode(encrypted), 76);
byte[] encodedBinary = Base64.decode(encodedBase64);
LMLicense licenseCopy = new LMLicense(encodedBinary, publicKey);
System.out.println(licenseCopy);
System.out.println("Gen subscription");
LMSubscription subscription = new LMSubscription(
licenseID,
LMSubscriptionPeriod.MONTH,
new Date(),
new Date(),
1,
true);
subData = LMEncryption.encrypt(subscription.getData(), privateKey);
String subBase64 = Base64.splitLines(Base64.encode(subData), 76);
byte[] subBinary = Base64.decode(subBase64);
LMSubscription subCopy = new LMSubscription(subBinary, publicKey);
System.out.println(subCopy);
}
private static PrivateKey readPrivateKey() throws LMException {
File keyFile = new File(new File(System.getProperty("user.home"), ".jkiss-lm"), "private-key.txt");
if (!keyFile.exists()) {
throw new LMException("Cannot find private key file (" + keyFile.getAbsolutePath() + ")");
} else {
try {
Throwable var1 = null;
Object var2 = null;
try {
InputStream keyStream = new FileInputStream(keyFile);
PrivateKey var10000;
try {
byte[] privateKeyData = LMUtils.readEncryptedString(keyStream);
var10000 = LMEncryption.generatePrivateKey(privateKeyData);
} finally {
if (keyStream != null) {
keyStream.close();
}
}
return var10000;
} catch (Throwable var12) {
if (var1 == null) {
var1 = var12;
} else if (var1 != var12) {
var1.addSuppressed(var12);
}
throw var1;
}
} catch (Throwable var13) {
throw new LMException(var13);
}
}
}
private static PublicKey readPublicKey() throws LMException {
File keyFile = new File(new File(System.getProperty("user.home"), ".jkiss-lm"), "public-key.txt");
if (!keyFile.exists()) {
throw new LMException("Cannot find public key file (" + keyFile.getAbsolutePath() + ")");
} else {
try {
Throwable var1 = null;
try {
InputStream keyStream = new FileInputStream(keyFile);
PublicKey var10000;
try {
byte[] keyData = LMUtils.readEncryptedString(keyStream);
var10000 = LMEncryption.generatePublicKey(keyData);
} finally {
if (keyStream != null) {
keyStream.close();
}
}
return var10000;
} catch (Throwable var12) {
if (var1 == null) {
var1 = var12;
} else if (var1 != var12) {
var1.addSuppressed(var12);
}
throw var1;
}
} catch (Throwable var13) {
throw new LMException(var13);
}
}
}
}
后记
仅供研究学习使用,请勿用于非法用途,请支持正版!
3 条评论
终极关怀的缺失可尝试补充升华。
终极关怀的缺失可尝试补充升华。
可以提供一下你修改后的文件吗?