[转]finalshell导出密码解密
原文地址:finalshell导出密码解密解密 - 简书 (jianshu.com)
------202307更新------
新版本密码位置: 安装目录\conn\下,登录一下,然后选择修改日期最新的 json文件打开,找到name项你的连接名,password就是加密的密码
----------------------------
connect_config.json中password为加密后的密码。
使用下面java程序可以解密
TVE5YhZeGxyOCxxxxxxCUAnkVWgAeJ3L替换为自己服务器的密文
https://c.runoob.com/compile/10/
可以将下面代码贴到在线编辑器中运行,不用安装java程序
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Base64;
import java.util.Random;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
public class FinalShellDecodePass {
public static void main(String[] args)throws Exception {
System.out.println(decodePass("TVE5YhZeGxyOCxxxxxxCUAnkVWgAeJ3L"));
}
public static byte[] desDecode(byte[] data, byte[] head) throws Exception {
SecureRandom sr = new SecureRandom();
DESKeySpec dks = new DESKeySpec(head);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey securekey = keyFactory.generateSecret(dks);
Cipher cipher = Cipher.getInstance("DES");
cipher.init(2, securekey, sr);
return cipher.doFinal(data);
}
public static String decodePass(String data) throws Exception {
if (data == null) {
return null;
} else {
String rs = "";
byte[] buf = Base64.getDecoder().decode(data);
byte[] head = new byte[8];
System.arraycopy(buf, 0, head, 0, head.length)