Post-Exploitation in Windows: From Local Admin To Domain Admin (efficiently)

简介: There are some excellent tools and techniques available to pentesters trying to convert their local admin rights into domain admin rights.

There are some excellent tools and techniques available to pentesters trying to convert their local admin rights into domain admin rights.  This page seeks to provide a reminder of some of the most common and useful techniques as well as rating their effectiveness to suggest which ones to try first.

The premise of all the techniques is to obtain access to as many domain accounts as possible using the credentials stored on the domain member you’ve compromised.

Tools are briefly discussed for each technique.  This page is really about the techniques, though, not the tools.  While tools will change, I suspect these techniques will be with us for some considerable time yet.

I’ve tried to rate each technique in order of how much effort it is for the pentester.  Some technqiues give almost instant results and are therefore worth trying first.  Others require password cracking and are a last resort really if nothing else works.

Very Quick: Duplicate Access Tokens (Incognito)

Incognito, either as a standalone tool, or via metasploit’s meterpreter will scan through all the running processes on the box and list you the delegation tokens it finds.  Without doing any analysis yourself you can try creating a domain admin account with each token.  If it succeeds without any effort on your part, so much the better.

If you don’t succeed in getting a domain admin account straight away, you may still be able to abuse the privileges of a normal domain user (e.g. to list domain accounts and group memberships).  Perhaps try the techniques below before trying too hard…

Quick: Dump LSA Secrets (lsadump)

If any Windows services are running under a domain account, then the passwords for those accounts must be stored locally in a reversible format.  LSAdump2LSASecretsDumppwdumpx, gsecdump or Cain & Abel can recover these.

You might have to stare at the output of lsadump and the list of services in services.msc before you can correlate the two.  Once you do, you have a list of domain accounts and cleartext passwords.

Investigate your new found accounts and see if you’re domain admin yet.

Quick: Dump SAM-Style Hashes for Access Tokens (WCE)

Windows Credentials Editor (a more mature version of the now obsolete Pass The Hash Toolkit) recovers the SAM-style password hash for each process from LSASS – including domain accounts.  Initially, this has a similar effect to Incognito.  But has a couple of advantages:

  • You can authenticate using the hash long after the corresponding process has terminated or the system has been rebooted.  Tools like smbshell and metasploit’s psexec allow you to authenticate using a password hash instead of a password.
  • You can try the password hash in conjunction with a different username (or all usernames) using keimpx, or similar.  You’re hoping for password reuse at this stage.

Gsecdump is an alternative tool for obtaining password hashes for running processes.

Quick: Dump SAM, Spray Hashes

Dumping the password hashes from the local SAM using fgdumppwdump7Cain & Abel, etc. won’t necessarily get you a domain account, but if one of the local passwords is the same as one of the domain passwords, you might be in luck.  Keimpx will help you try the hashes again the domain accounts.

Careful not to lock the domain accounts out, though!

It’s probably worth spraying the hashes against the local accounts on other systems.  If you fail to get domain admin, you might get local admin on every other system if the local admin passwords are the same.  You can then rinse and repeat the techniques on this page until you get your domain admin account.

Slow: Cracking SAM-Style Password Hashes Crack Passwords

If you’ve already tried authenticating using the hashes you’ve collected and you’ve tried hashes against other accounts, there’s probably little value in cracking the passwords.  John the RipperCain & Abel and ophcrack are just a few of the password crackers available.

You might find a pattern in the passwords used.  Possibly crack hashes from the password history too.

Another reason to crack passwords is if you’re targeting a service that insists on you knowing the password – e.g. Terminal Services.

It’s starting to feel like a longshot now…

Very Slow: Dump Cached Domain Logons, Crack

If the domain member has cached domain logons, you might be able to recover passwords from the corresponding hashes (e.g. using  fgdumppwdumpxcachedumpmeterpreter).  However, hashes are salted and they’re case sensitive.  If there’s a reasonable password policy, you’re going to need some luck.

You can’t use these hashes without cracking them – unlike the SAM-style hashes.

Other Techniques

There are of course other many other techniques you could try.  Some are more open-ended or less likely to succeed in the general case.  Here are a few ideas:

  • Trawling the filesystem looking for passwords.  Unattend.txt might have an admin password in it if present.  You can probably recover the SAM from .vhd files.  Other backup files may also yield passwords.
  • Trawling the registry.  Credentials such as VNC password and SNMP community string can be recovered.  They might be useful on your quest for domain admin.
  • Protected Storage.   This might yield passwords that are reused elsewhere.

Reference:http://pentestmonkey.net/uncategorized/from-local-admin-to-domain-admin


目录
相关文章
|
4月前
|
Linux Windows
Linux01---目录结构,Linux系统下只有一个最顶级的树/,Windows系统有盘符概念,而Linux系统没有盘符概念,整个系统都在/根目录下,Linux 系统写法 /user/local
Linux01---目录结构,Linux系统下只有一个最顶级的树/,Windows系统有盘符概念,而Linux系统没有盘符概念,整个系统都在/根目录下,Linux 系统写法 /user/local
|
6月前
|
网络安全 开发工具 git
Windows下VSCode使用SSH连报错 Bad owner or permissions on C:\\Users\\admin/.ssh/config
Windows下VSCode使用SSH连报错 Bad owner or permissions on C:\\Users\\admin/.ssh/config
112 0
|
Windows
Microsoft Windows "keybd_event" Local Privilege Escalation Exploit
文章整理:天天安全网   作者:佚名   发布时间:2005-09-09 漏洞资料:http://www.haxorcitos.com/MSRC-6005bgs-EN.
832 0
|
分布式数据库 Windows
Microsoft Windows CSRSS Local Privilege Escalation Exploit (MS05-018)
文章整理:天天安全网   作者:佚名   发布时间:2005-09-09 漏洞资料:http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0551危险程度:中等影响范围:Microsoft Windows 2000/XP/2003解决办法:http://www.
802 0
|
3天前
|
存储 安全 网络安全
Windows Server 本地安全策略
由于广泛使用及历史上存在的漏洞,Windows服务器成为黑客和恶意行为者的主要攻击目标。这些系统通常存储敏感数据并支持关键服务,因此组织需优先缓解风险,保障业务的完整性和连续性。常见的威胁包括勒索软件、拒绝服务攻击、内部威胁、恶意软件感染等。本地安全策略是Windows操作系统中用于管理计算机本地安全性设置的工具,主要包括用户账户策略、安全选项、安全设置等。实施强大的安全措施,如定期补丁更新、网络分段、入侵检测系统、数据加密等,对于加固Windows服务器至关重要。
|
1月前
|
边缘计算 安全 网络安全