Hash injection Attacks in a Windows Network

来源:互联网 发布:淘宝美图用什么软件 编辑:程序博客网 时间:2024/05/16 19:52

Hash injection Attacks in a Windows Network (links to the tools used to do this below)

Why an exposed LM/NTLM Hash is comparable to a clear-text password

Why a 127 character long password is not necessarily stronger than a 4 character long password

Why generating LM/NTLM rainbow tables is a complete waste of time

Passing-the-hash for direct authentication to remote systems

Why one vulnerable system can compromise the entire Active directory forest

One of the scariest Windows authentication hacks you ever saw.......

During a Microsoft MVP summit in Redmond I demonstrated some of the work done by my group (Truesec Security Team) to some fellow security MVPs.

I was asked to write a blog on one of the “hash injection”-demos I demonstrated, so here we go:

Conceptual:

This is the concept of injecting a compromized hash into a local session and then use the hash to authenticate to network resources. This method eliminates the need for password cracking in a windows environment.

Description of the demo below:

1.     Hacker compromises one server/workstation using a remote/local exploit. (This is not demonstrated in this demo)

2.     The hacker extracts logged on hashes and finds a logged on domain admin account hash

3.     The hackers use the hash to log on to the domain controller

4.     The hacker extracts all the hashes in the Active Directory database and can now impersonate any account in the domain.

Demonstration:

The starting point of this attack is that an attacker has control over at least one computer using for example a client/server-side exploit. (Since this demo is not about exploits I will leave that out in order to keep focus on the authentication attack)

To simulate a remote exploit, I´m simply using a psexec connection connecting to the compromised server:

In this first scenario I´m running a Truesec tool named Gsecdump to dump the logged on hashes. I can see that both a user from the hell-domain named marcus is logged on as well as a local account named service1.

My next step will be to use the domain-joined password hash to connect to the domain controller.

Before I do that I will try to connect to the domain controller without the hash to prove that I do not currently have credentials to access the domain controller:

I´m trying to set up a net use session and just as expected, my current credentials doesn´t allow me to mount the hard drive on the domain controller.

So, my approach would be to start a new session on our local attack-machine and inject the hash into that session:

The Msvctl tool is a Truesec internal tool that we use in this case to create something similar to a “runas”-session, but instead of using a username and a password we are simply injecting the hash.

The Truesec Msvctl tool will initiate a new cmd session in the context of the user marcus with the injected hash:

Now when we run the net use command again I´m allowed mounting the hard drive on the domain controller. This works since the Marcus account is a member of the Domain Admins group.

The natural finish would be to run the Gsecdump tool again and extract the password hashes from the entire active directory database:

This means that since we can extract all the password hashes we now can impersonate any account in the entire domain using the Msvctl tool.

Another thing that deserves to be mentioned is that the exact same method can be used to extract the local hashes stored in the SAM (Security Account Manager) database of a client or a server:

In my experience as a pen tester, most environments still use identical local administrative accounts and passwords between servers and clients. The effect of this is that I can use the local hashes from this computer and use it to gain full access to other servers or clients. This drastically increases the chance that I will be able to extract logged on hashes from any member of the Domain admins group since I will control a greater number of computers.

(In this demo I have deliberately left out a lot of info on what the Truesec-tools do exactly and we will not make the msvctl tool publicly available.)

Conclusion:

This attack proves that if one computer is fully compromised then the attacker can directly impersonate all the logged on accounts and the accounts stored in the local SAM database or Active Directory Database.

Other important things that needs to be mentioned:

PKI/Smartcards

The first natural reaction would be to think that PKI-based smart card logon would solve the problem. Even though I´m personally a big fan of PKI/Smartcard-based authentication it doesn’t prevent this attack.

The issue is that LM/NTLM can still be used for network logon event if the users are using smartcards to authenticate

(The security settings in Windows can´t force smart-card-based logon for network access, only interactive.)

The fact that passwords will be changed into long randomized passwords when you implement smartcard doesn´t change anything. The hash is still there and we are simply using that hash, not the password.

Using the same password for different users

It´s really easy to try the extracted hashed passwords for different user accounts. My experience from the field is that it´s very common that admins reuse passwords between service accounts, their regular user accounts and their administrative accounts. This means that the low privileged user account that we extract from the admins desktop often gives us control over important servers and sometimes even the entire domain.

The length of the password it not of importance in this scenario

In this scenario it doesn´t really matter if a password is a one character password or a complex 127 character password since we are only using the hash.

A simple security or registry setting is NOT all it takes to get rid of LM/NTLM hashes for network authentication

The highest setting (Even in Windows Vista) is “Network Security:LAN Manager Authentication Level=Sent NTLMv2 response only”.

If we could enforce Kerberos or native PKI/smartcard authentication for network authentication this could solve the problem. You can actually do this but it will require an IPSEC authentication implementation in the network.

The purpose of this post is to generate a discussion on potential countermeasures. I have many thoughts of my own on this topic, but before I post them I´m very interested in ideas from others.

Credits

This work is a team effort and the biggest credit should rightfully go to Johannes Gumbel for research and coding. Jonas Ländin for researching and testing. Hasain Ashakarti for his fantastic intelligence and support.

Guys, being in the same team as you in not only educating and stimulating, it´s also incredibly fun!

-           Marcus Murray, Truesec Security Team

A post on countermeasures and my personal thoughts will be posted shortly.


Go to source web page>>

MSVCTL and GSECdump

Pass-the-hash tool MSVCTL released to public

 

After long consideration and due to the fact that tools with similar functionality has been published recently we have decided to release MSVCTL to the community.

 Author: Johannes Gumbel, Truesec Security Team.

Find it on the Truesec Public Tools Download Page

http://www.truesec.com/PublicStore/catalog/Downloads,223.aspx

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 淘宝改登录密码忘记了怎么办 三星s8应用闪退怎么办 淘宝购物商家不发货怎么办 淘宝商家迟迟不发货怎么办 买家地址写错了怎么办 买家写错快递地址怎么办 淘宝退款选择服务类型出不来怎么办 网购东西发错了怎么办 拒签商家不退款怎么办 红米手机无响应怎么办 淘宝网登录密码忘记了怎么办 淘宝网密码忘记了怎么办 京东抢购不发货怎么办 微商不想做了怎么办 减肥过程中饿了怎么办 滴滴车龄超过6年怎么办 网络公选课没过怎么办 大学网络课挂了怎么办 淘宝虚拟订单买家恶意退款怎么办 淘宝卖家虚拟发货怎么办 淘宝买虚拟产品被骗了怎么办 哈尔滨暖气低于十八度怎么办 淘客店铺没人买怎么办 淘宝商家不给退货怎么办 淘宝卖家拒绝退款申请怎么办 运费险赔付少了怎么办 买了运费险退货怎么办 卖家运费险退货怎么办 京东生鲜有坏的怎么办 与上级意见不一致时你将怎么办 物金所倒闭投资怎么办 电商平台欺骗客户怎么办 pdf电脑打开是乱码怎么办 excel表格打开是乱码怎么办 win10安装软件出现乱码怎么办 华为手机速度越来越慢怎么办 oppo手机速度越来越慢怎么办 安卓手机速度越来越慢怎么办 青桔单车忘了锁怎么办 华为手机反应太慢了怎么办 魅族关机键失灵怎么办