ELK5.5elasticsearchxpack破解

2023年 7月 15日 79.6k 0

ELK 6.3.2 x-pack破解参考 https://www.linuxea.com/1895.html

创建LicenseVerifier.java文件

[root@linuxea.com-Node61 /elk/]# cat LicenseVerifier.java
package org.elasticsearch.license;

import java.nio.*;
import java.util.*;
import java.security.*;
import org.elasticsearch.common.xcontent.*;
import org.apache.lucene.util.*;
import org.elasticsearch.common.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;
    }
}

编译class文件

[root@linuxea.com-Node49 ~/elk]# javac -cp "/usr/share/elasticsearch/lib/elasticsearch-5.5.1.jar:/usr/share/elasticsearch/lib/lucene-core-6.6.0.jar:/usr/share/elasticsearch/plugins/x-pack/x-pack-5.5.1.jar" LicenseVerifier.java 
[root@linuxea.com-Node49 ~/elk]# ls
LicenseVerifier.class 
LicenseVerifier.java  
[root@linuxea.com-Node49 ~/elk]# cd /usr/share/elasticsearch/plugins/x-pack/
[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack]# mkdir test
[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack]# mv x-pack-5.5.1.jar test/
[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack]# 

备份下x-pack-5.5.1.jar

[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test]# cp xvf x-pack-5.5.1.jar /opt

解压

[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test]# jar xvf x-pack-5.5.1.jar 

替换class

[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test]# cd org/elasticsearch/license
[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test/org/elasticsearch/license]# cp /root/elk/LicenseVerifier.class ./

回到test目录打包

[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test/org/elasticsearch/license]# cd /usr/share/elasticsearch/plugins/x-pack/test/
[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test]# jar cvf x-pack-5.5.1.jar .

将打包好的文件放回x-pack目录下

[root@linuxea.com-Node49 /usr/share/elasticsearch/plugins/x-pack/test]# cp x-pack-5.5.1.jar ../

申请license

https://license.elastic.co/registration

申请完成后很快会发送到邮箱,而后修改license文件它分有不同的版本,版本有不同的权限,如下:open source开源版本basic基础版本gold是黄金版PLATINUM铂金版 x-pack收费.pngcurl -XPUT -u elastic 'http://<host>:<port>/_xpack/license' -H "Content-Type: application/json" -d @license.json

修改license

申请一个license后会发到邮箱,然后修改下即可

{"license":{"uid":"d13W1FM-ef9XWi-45eAKLH6-afT5b4-b8erC7460","type":"platinum","issue_date_in_millis":11042324000000,"expiry_date_in_millis":2535123399999,"max_nodes":100,"issued_to":"sean wang (alibaba)","issuer":"Web Form","signature":"AAAAAwAAAA2kxmZrvpZZohthD/HAAAABmC9ZN0hjZDBGYnVyRXpCOW5Bb3FjZDAxOWpSbTVoMVZwUzRxVk1PSmkxaktJRVl5MUYvUWWpBbmlWRmRZb25KNFlBR2x0TXc2K2p1Y1VtMG1UQU9TRGZVSGRwaEJGUjE3bXd3LzRqZ05iLzRteWFNekNUs0U1hTVlJK2E1AD93AD04A03C3DF7565FA377223916FA881A19A675E9BD2F78680EE545265lESDc3MWhlY3hSQmdKSjJ2ZTcvYlBFOHhPQlV3ZHdDQ0tHcG5uOElCaDJ4K1hob29xSG85N0kvTWV3THhlQk9NL01VMFRjNDZpZEVXeUtUMXIyMlIveFpJUkk2WUdveEZaME9XWitGUi9WNTZVQW1FMG1DenhC8rWVVUYzMwRGVySHpIdURzKzFiRDl4TmM1TUp2VTBOUlJZUlAyV0ZVL2kvVk10L0NsbXNFYVZwT3NSU082dFNNa2prQ0ZsclZ4NTltbU1CVE5lR09Bck93V2J1Y3c9PQAAAQBvSGrvXPAAtLbErFH431nJyyyuZ1A5Mqnq2mmEY2NiFA1GUTjzEorVn9rWD20vTAZaR/EUbdQ1xAKLH1/WK/Ur4ct5Gpv3KwPVI1Lvn7q5BqoO5F4AYGcaUJqu8erCuGYz9XHGipAYpCUDVppRC294MsR/o6XJLNn7VTp+FHXRIVAbgWidQQHxaT3MQo/y38t7pKZvMQQ7l5DEp0foPhgW9Nm4coK4WXoT87/LkhCwMtH5NLmD80rZKy0XKX8AXEK+usf+gtv1iIY35t7wB8EbHPO+mUlBT5rAb","start_date_in_millis":1504224000000}}

将文件保存license.json没修改前:

[root@linuxea.com-Node49 ~/elk]# curl -XGET -u elastic:linuxea 'http://10.0.1.49:9200/_license'
{
  "license" : {
    "status" : "active",
    "uid" : "427cbb8e-9d96-435f-b56d-fa2efeb438c5",
    "type" : "trial",
    "issue_date" : "2017-09-01T14:28:04.736Z",
    "issue_date_in_millis" : 1504276084736,
    "expiry_date" : "2017-10-01T14:28:04.736Z",
    "expiry_date_in_millis" : 1506868084736,
    "max_nodes" : 1000,
    "issued_to" : "linuxea-app",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1
  }
}

j20170901223140.png输入密码进行修改:

[root@linuxea.com-Node49 ~/elk]# curl -XPUT -u elastic 'http://10.0.1.49:9200/_xpack/license' -H "Content-Type: application/json" -d @license.json
Enter host password for user 'elastic':
{"acknowledged":true,"license_status":"valid"}

修改完成后查看

[root@linuxea.com-Node49 ~/elk]# curl -XPUT -u elastic 'http://10.0.1.49:9200/_xpack/license' -H "Content-Type: application/json"curl -XGET -u elastic:linuxea 'http://10.0.1.49:9200/_license'
{
  "license" : {
    "status" : "active",
    "uid" : "d13W1FM-ef9XWi-45eAKLH6-afT5b4-b8erC7460",
    "type" : "platinum",
    "issue_date" : "2017-09-01T00:00:00.000Z",
    "issue_date_in_millis" : 11042324000000,
    "expiry_date" : "2050-05-11T01:46:39.999Z",
    "expiry_date_in_millis" : 2535123399999,
    "max_nodes" : 100,
    "issued_to" : "sean wang (alibaba)",
    "issuer" : "Web Form",
    "start_date_in_millis" : 11042324000000
  }
}
[root@linuxea.com-Node49 ~/elk]# 

2050.png

相关文章

对接alertmanager创建钉钉卡片(1)
手把手教你搭建OpenFalcon监控系统
无需任何魔法即可使用 Ansible 的神奇变量“hostvars”
openobseve HA本地单集群模式
基于k8s上loggie/vector/openobserve日志收集
openobseve单节点和查询语法

发布评论