原文地址:finalshell导出密码解密解密 - 简书 (jianshu.com)
connect_config.json中password为加密后的密码。
![](http://upload-images.jianshu.io/upload_images/2496446-04ac8377b8563cd0.png?imageMogr2/auto-orient/strip|imageView2/2/w/414/format/webp)
image.png
使用下面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);
byte