1. 程式人生 > >x-pack-crack

x-pack-crack

enc lfw latin apach crypt 文件 str byte --

破解x-pack
-----------
1. 編輯文件: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;
}
}

2. 編譯生成class文件
javac -cp "/data/elk/elasticsearch/lib/elasticsearch-5.5.0.jar:/data/elk/elasticsearch/lib/lucene-core-6.6.0.jar:/data/elk/elasticsearch/plugins/x-pack/x-pack-5.5.0.jar" LicenseVerifier.java

3. 替換x-pack中的LicenseVerifier.class
cd /data/elk/elasticsearch/plugins/x-pack/
mkdir test
cp x-pack-5.5.0.jar test/
cd test/
jar xvf x-pack-5.5.0.jar
rm -rf x-pack-5.5.0.jar
cd org/elasticsearch/license/
rm -rf LicenseVerifier.class
cp /root/LicenseVerifier.class .
cd /data/elk/elasticsearch/plugins/x-pack/test/
jar cvf x-pack-5.5.0.jar .
cp x-pack-5.5.0.jar ../
cd ../; rm -rf test

3. 申請證書
https://license.elastic.co/registration
註冊即可獲得試用證書

4. 修改證書
{"license":{"uid":"58bf0ac1-1f4d-4e61-b8bd-bc3390332203","type":"platinum","issue_date_in_millis":1502150400000,"expiry_date_in_millis":9532563199999,"max_nodes":100,"issued_to":"jonjon zhao (lshen)","issuer":"Web Form","signature":"AAAAAwAAAA0hwabZEs6XiKMLRH5PAAABmC9ZN0hjZDBGYnVyRXpCOW5Bb3FjZDAxOWpSbTVoMVZwUzRxVk1PSmkxaktJRVl5MUYvUWh3bHZVUTllbXNPbzBUemtnbWpBbmlWRmRZb25KNFlBR2x0TXc2K2p1Y1VtMG1UQU9TRGZVSGRwaEJGUjE3bXd3LzRqZ05iLzRteWFNekdxRGpIYlFwYkJiNUs0U1hTVlJKNVlXekMrSlVUdFIvV0FNeWdOYnlESDc3MWhlY3hSQmdKSjJ2ZTcvYlBFOHhPQlV3ZHdDQ0tHcG5uOElCaDJ4K1hob29xSG85N0kvTWV3THhlQk9NL01VMFRjNDZpZEVXeUtUMXIyMlIveFpJUkk2WUdveEZaME9XWitGUi9WNTZVQW1FMG1DenhZU0ZmeXlZakVEMjZFT2NvOWxpZGlqVmlHNC8rWVVUYzMwRGVySHpIdURzKzFiRDl4TmM1TUp2VTBOUlJZUlAyV0ZVL2kvVk10L0NsbXNFYVZwT3NSU082dFNNa2prQ0ZsclZ4NTltbU1CVE5lR09Bck93V2J1Y3c9PQAAAQAkeIT4OVVhwnz0s5FiO73LzATuFZfGHao9WH/xlAowalMBI6RcJcNezP8Vv0PSTfBWxaGRbC3nv9yd1GLao6Z1/jZLwiZ+fqJ+WnYMBQId498Y52EDW1hFhLgrrMwRzy5r8JNWVrgkidiSW6MtZmO4D7ZcFBX3SG8qYP/iFclTv7UO8YCBVaF6X0R7O3+e41DMNZNQP+dymailHNoyyLr7uTOIT4tMNqC5RsRAgKtRWxpM9xmO6IM9eXyo1drw79gEd2bGe+lQrWzgYsFX0SDYpKuq9Tmt2+QP4GTU7RfF26Tnc4vpSrta7nXahsV9MD7kLV6pKrWTbmZE52dhD9Ai","start_date_in_millis":1502150400000}}

註明:主要是兩個地方,一個是type,修改為platinum版本,一個是expiry_date_in_millis時間。

5. 導入證書
註:在導入證書之前,必須先重啟elasticsearch,不然會報證書invalid
curl -XPUT -u elastic:Lishen12345 ‘http://127.0.0.1:9200/_xpack/license?acknowledge=true‘ -H "Content-Type: application/json" -d @jonjon-zhao-58bf0ac1-1f4d-4e61-b8bd-bc3390332203-v5.json
查看證書: curl -XGET -u elastic:Lishen12345 ‘http://127.0.0.1:9200/_xpack/license‘
{
"license" : {
"status" : "active",
"uid" : "58bf0ac1-1f4d-4e61-b8bd-bc3390332203",
"type" : "platinum",
"issue_date" : "2017-08-08T00:00:00.000Z",
"issue_date_in_millis" : 1502150400000,
"expiry_date" : "2272-01-28T14:13:19.999Z",
"expiry_date_in_millis" : 9532563199999,
"max_nodes" : 100,
"issued_to" : "jonjon zhao (lshen)",
"issuer" : "Web Form",
"start_date_in_millis" : 1502150400000
}
}

6. 刷新kibana,到monitor裏面查看證書是否更新成功。
技術分享





x-pack-crack