先正常安装 elasticSearch, kibana。

1. 如果是6.5.2版本,可以直接下载jar文件:https://download.csdn.net/download/bigben0123/10932740。跳过此步。

重写x-pack下的2个类:LicenseVerifier.java和XPackBuild.java

直接拿走重写完的类链接: https://pan.baidu.com/s/1ESqoZW8eieO7Zdgs31hxsQ 密码: uqnd

覆盖流程

1.用zip软件打开 找到的目标jar包 elasticsearch-6.5.2\modules\x-pack\x-pack-core\x-pack-core-6.5.2.jar。
2.用LicenseVerifier.class 覆盖x-pack-core-6.5.2.jar\org\elasticsearch\license目录下的同名文件
3.同理用 XPackBuild.class 覆盖 x-pack-core-6.5.2.jar\org\elasticsearch\xpack\core 目录下的同名文件

直接保存成新的jar。替换以前的即可。

2. 在elasticsearch.yml 中 添加一下配置

xpack.security.enabled:false

重启elasticsearch

3. 在kibana的左边菜单 Management-> Licence -> apply trail license。等待几个小时后收到 license,修改如下两项:

"type":"platinum","issue_date_in_millis":1548115200000,"expiry_date_in_millis":3107746200000

4,在kibana的左边菜单 Management-> Licence ->update license即可。

参考:

https://www.plaza4me.com/article/20180825223849878 靠谱

https://www.jianshu.com/p/6acfeabb44f8?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

https://www.jianshu.com/p/1ff67bb363dd

https://blog.csdn.net/q258523454/article/details/82426837


破解原理:

用Luyten 反编译x-pack-core-6.5.2.jar文件。Luyten下载地址:https://github.com/deathmarine/Luyten/releases/tag/v0.5.3。

软件下载下来,打开软件,把x-pack-core-6.5.2.jar 丢进去,就能看到我们jar包的源代码了。
我们需要把2个文件提取出来进行修改。
org.elasticsearch.license.LicenseVerifier
org.elasticsearch.xpack.core.XPackBuild

1、修改LicenseVerifier
LicenseVerifier 中有两个静态方法,这就是验证授权文件是否有效的方法,我们把它修改为全部返回true.

package org.elasticsearch.license;
 
import java.nio.*;
import org.elasticsearch.common.bytes.*;
import java.util.*;
import java.security.*;
import org.elasticsearch.common.xcontent.*;
import org.apache.lucene.util.*;
import org.elasticsearch.core.internal.io.*;
import java.io.*;
 
public class LicenseVerifier
{
    public static boolean verifyLicense(final License license, final byte[] encryptedPublicKeyData) {
        return true;
    }
 
    public static boolean verifyLicense(final License license) {
        return true;
    }
}
View Code

相关文章: