finalShell 查看已保存的服务连接密码

您所在的位置:网站首页 vivo查看已存密码 finalShell 查看已保存的服务连接密码

finalShell 查看已保存的服务连接密码

2024-07-17 05:03| 来源: 网络整理| 查看: 265

第一步:打开服务连接

第二步:右击服务连接->点击导出->然后获得一个json文件 第三部:找到password字段,获取值,放到下方代码执行输出明文密码

package org.example; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; 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; public class FinalShell { /** * 破解FinalShell密码 * @param args * @throws Exception */ public static void main(String[] args)throws Exception { System.out.println(decodePass("导出json的 password字段值")); } 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[] d = new byte[buf.length - head.length]; System.arraycopy(buf, head.length, d, 0, d.length); byte[] bt = desDecode(d, ranDomKey(head)); rs = new String(bt); return rs; } } 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(); DataOutputStream dos = new DataOutputStream(bos); long[] var15 = ld; int var14 = ld.length; for(int var13 = 0; var13 < var14; ++var13) { long l = var15[var13]; try { dos.writeLong(l); } catch (IOException var18) { var18.printStackTrace(); } } try { dos.close(); } catch (IOException var17) { var17.printStackTrace(); } byte[] keyData = bos.toByteArray(); keyData = md5(keyData); return keyData; } public static byte[] md5(byte[] data) { String ret = null; byte[] res=null; try { MessageDigest m; m = MessageDigest.getInstance("MD5"); m.update(data, 0, data.length); res=m.digest(); ret = new BigInteger(1, res).toString(16); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return res; } }



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3