标题 简介 类型 公开时间
关联规则 关联知识 关联工具 关联文档 关联抓包
参考1(官网)
参考2
参考3
详情
[SAFE-ID: JIWO-2024-2756]   作者: 闲云野鸡 发表于: [2020-09-15]

本文共 [407] 位读者顶过

在内网渗透的过程中,经常会遇到需要查看域用户登陆了哪些机器,目前我们收集整理了三种方法,给大家分享出来。

1.使用vbs脚本来查询

' Script for getting current logged user name on Domain ' Author : mwpq ' www.sharecenter.net strDomainName = InputBox ("Please enter the internal Domain Name:","Script for getting current logged username","yourdomain.local") arrDomLevels = Split(strDomainName, ".") strADsPath = "dc=" & Join(arrDomLevels, ",dc=") Const ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider"' Set objCOmmand.ActiveConnection = objConnection objCommand.CommandText = _ "Select Name, Location from 'LDAP://"&strADsPath&"' " _ & "Where objectClass='computer'" objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst Set oFSO = CreateObject("Scripting.FileSystemObject") Set of = oFSO.CreateTextFile("LoggedUser.txt", True, True) Do Until objRecordSet.EOF On Error Resume Next sPC = objRecordSet.Fields("Name").Value of.writeline " " of.writeline "Machine Name: "&sPC Set objWMILocator = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & sPC & "\root\cimv2") If Err = 0 Then Set col = objWMILocator.ExecQuery _ ("Select * from win32_computersystem") For Each item In col of.writeline "Logged User: "&item.username Next Set col = Nothing Else of.writeline "!!! Cant connect to "&sPC&" !!!" End If objRecordSet.MoveNext Loop of.close MsgBox "Done! Cheers!"

2.使用Logondomaincomputersuser.exe来查询

3.使用powershell枚举远程主机登陆会话PowerQuinsta 是powerview里的一个模块,可以枚举远程主机的登录会话。

像这样:

但的英文这不是重点,重点是作者详细的介绍了从qwinsta命令到窗口API分析,然后再到PowerShell中的开发,之前想表明的PowerShell和净的关系,然后还可以借助的.Net和其他的联系开发出更多适合场景的小工具之类的。[出自:jiwo.org]
这里可以用下面的代码查找符合关键字的对象和方法。

补充一个@ xti9er提到的WMI对象:

get-wmiobject|get-member

但这个不完整,详细的搜索可以这样:

Get-WmiObject -List | Where-Object { $_.name -match 'domain'}

## 
【1】harmj0y.net/blog/powers报道
【2】harmj0y.net/blog/powers Powershell和win32 API

评论

暂无
发表评论
 返回顶部 
热度(407)
 关注微信