前言
在拿到系统后,系统中可能存在连接其他服务器的软件,或浏览器等
这时候就需要去解密像ssh这类的连接软件,所有这里我对软件的密码获取做总结
ssh和ftp链接类
xshell
Xshell 是一个强大的安全终端模拟软件,它支持SSH1, SSH2, 以及Microsoft Windows 平台的TELNET 协议。
先找到xshell保存密码的位置,点打开会话文件夹

其中.xsh里面就是保存的链接信息包括账户密码

前提是登录的时候必须勾选了记住账户和密码

离线解密工具:https://github.com/HyperSine/how-does-Xmanager-encrypt-passwordpython XShellCryptoHelper.py -d -key 123123 zVi7hm/Nsk6y2BGpTNSvXlPRN+/1P+aQ
123132为主控密码在文件导出的时候设置 后面为.xsh文件中的password字段类容

另一种解法 未设置主控密码需要user和sidwhoami /user 查看user和sid

python XShellCryptoHelper.py -d -user aaaa -sid S-1-5-21-4217108860-1001 zVi7hm/Nsk6y2BGpTNSvXlPRN+/1P+aQ

使用在线工具https://github.com/uknowsec/SharpDecryptPwd

该工具只支持在线解密的方式,就是必须要将工具放到目标机器上运行。
xftp一样的
SecureCRT
SecureCRT和xshell一样,很多运维人员会将SSH的账号密码保存在上面。
前提时管理员登录时勾选了记住密码

SecureCRT密码密码存放位置
C:\Users\oneseven\AppData\Roaming\VanDyke\Config\Sessions

打开后 密码是加密的 我们需要对其进行解密

SecureCRT 离线解密工具:
https://github.com/HyperSine/how-does-SecureCRT-encrypt-passwordpython SecureCRTCipher.py dec -v2 <密码>

MobaXterm
MobaXterm是一款远程终端控制软件,集串口,SSH远程登录和FTP传输三合一的工具,便携版操作简单,使用非常方便。

连接过后会在当前目录生成一个.ini文件

其中就储存着我们登录的账户密码

离线工具:https://github.com/HyperSine/how-does-MobaXterm-encrypt-passwordpython MobaXtermCipher.py dec -sp <ini文件中的SessionP> <加密的Passwords>

finalshell
FinalShell是一体化的的服务器,网络管理软件,不仅是ssh客户端,还是功能强大的开发,运维工具,充分满足开发,运维需求

连接信息存储在C:\Users\oneseven\AppData\Local\finalshell\conn\ 目录下 有多少条连接就会有多少个xxx_connect_config.json文件


用户登录时必须勾选记住密码,否则不会在xxx_connect_config.json文件中保存密码

离线解密:别人已经写好了的java代码
FinalShellDecodePass.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(args[0]));
}
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;
}
}
先进行编译javac FinalShellDecodePass.java,在运行java FinalShellDecodePass <password>
其中password就是xxx_connect_config.json文件中的password字段类容

Winscp
一个 Windows 环境下使用的 SSH 的开源图形化 SFTP 客户端

解密:
密码是保存在注册表中reg query "HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions”

可以看到链接名称,但需要建站点时保存密码

离线工具https://github.com/anoopengineer/winscppasswdwinscppasswd.exe <主机> <用户名> <加密密码>

使用在线工具SharpDecryptPwd可直接获取密码

FileZilla
一款FTP操作类的软件

首先导出记录

导出后是一个xml文件 打开后base64就是密码 直接解密就行

使用在线工具SharpDecryptPwd