windows: wmic product get name,version Powershell版本: powershell.exe "Get-WmiObject -class Win32_Product | Select-Object -Property name,Version Linux: Ls -alh /usr/bin/ Ls -alh /sbin/ Dpkg -l Rpm -qa Ls -alh /var/cache/apt/archivesO Ls -alh /var/cache/yum/
3.查询本机服务信息
1 2 3 4 5 6 7 8 9 10
windows: wmic service list brief
Linux: service --status-all chkconfig --list ps aux 进入init.d目录查看 netstat -lntp ntsysv
4.查询进程列表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
windows: tasklist//或者wmic process list brief Linux: ps aux 常见杀毒软件进程: 360sd.exe 360tray.exe ZhuDongFangYu.exe KSafeTray.exe SafeDogUpdateCenter.exe McAfee McShield.exe egui.exe //NOD32 AVP.EXE //卡巴斯基 avguard.exe //小红伞 bdagent.exe //BitDefender
5.查看启动程序信息
1 2 3 4 5 6 7 8 9 10
windows: wmic startup get command,caption Linux: PS ps aux | less top pstree htop atop
6.查看计划任务
1 2 3 4 5
windows: schtasks /query /fo LIST /v Linux: crontab -l
7.查看主机开机时间
1 2 3 4 5 6 7 8 9 10
windows: net statistics workstation Linux: last reboot //查看历史启动时间 W//系统到目前运行了多久时间。反过来推算系统重启时间 uptime TOP//up后表示系统到目前运行了多久时间。反过来推算时间 who -b 查看最后一次系统启动的时间。 who -r 查看当前系统运行时间
8.查询用户列表
1 2 3 4 5 6 7 8 9
windows: net user net localgroup adinistrators//获取本地管理员组成员 query user || qwinsta//查看当前再线用户 Linux: cat /etc/passwd cat /etc/group 延申:cat /etc/passwd|grep -v nologin|grep -v halt|grep -v shutdown|awk -F":"'{ print $1"|"$3"|"$4 }'|more
9.列出或断开本地计算机与所连接的客户端之间的会话
1 2 3 4 5
windows: net session Linux: who -a
10.查询端口列表
1
netstat -ano
11.查询补丁列表
1 2 3 4 5 6 7 8 9 10
windows: systeminfo //查找提权补丁信息 systeminfo>C:\Temp>micropoor.txt&(for %i in ( KB977165 KB2160329 KB2503665 KB2592799 KB2707511 KB2829361 KB2850851 KB3000061 KB3045171 KB3077657 KB3079904 KB3134228 KB3143141 KB3141780 ) do @type micropoor.txt|@find /i "%i"|| @echo %i you can fuck)&del /f /q /a micropoor.txt //里面可以任意添加删除补丁编号
Linux: linux需要查看内核版本信息,查看安装的软件包,然后进行对比
12.查询本机共享列表
1 2 3 4 5 6
windows: net share//wmic: wmic share get name,path,status
windows: //windows server 2003之前 netsh firewall set opmode disable //Windows server 2003之后 netsh advfirewall set allprofile state off Linux: //暂时关闭防火墙 systemctl stop firewalld service iptables stop //永久关闭防火墙 systemctl disable firewalld chkconfig iptables off
2)查看防火墙配置
1 2 3 4 5
windows: netsh firewall show config Linux: Iptables-save >ipt.txt
windows: whoami /all //查询指定用户的详细信息 net user xxx /domain Linux: id whoami
03-域内的信息收集
1.判断是否存在域
1 2 3 4 5 6 7 8 9 10
查看dns服务器 ipconfig /all nslookup dc.test.local//将查看到的DNS服务器用nslookup进行解析 查看系统详细信息 systeminfo | findstr /B /C:"登录服务器"//如果结果不为"WORKGROUP"则主机为域主机 //查询当前登录域及登录用户信息 net group workstation //判断主域 net time /domain//命令用于查看域内时间,同时也可以查看域控制器
Metasploit端口扫描: auxiliary/scanner/portscan/tcp set ports 1-1000 set RHOST 192.168.1.1 set THREADS 10 run PowerSploit、NiShang的Invoke-portscan脚本
注:msf记得添加路由或代理 autoroute添加路由 run autoroute –h #查看帮助 run autoroute -s 192.168.159.0/24 #添加到目标环境网络 run autoroute –p #查看添加的路由 当然msf不止有扫描端口的脚本,这里在列举几个其他脚本: 1. use auxiliary/scanner/http/dir_scanner 2. use auxiliary/scanner/http/jboss_vulnscan 3. use auxiliary/scanner/mssql/mssql_login 4. use auxiliary/scanner/mysql/mysql_version 5. use auxiliary/scanner/oracle/oracle_login //扫描的脚本位于: /usr/share/metasploit-framework/modules/auxiliary/scanner/
4. 收集域内基础信息
1 2 3 4 5 6
net view /domain//查询域 net view /domain:test//查询域内所有计算机 net group /domain//查询域内所有用户组列表 net group "domain computers" /domain//查询所有域成员计算机列表 net accounts /domain//获取域内密码信息 nltest /domain_trusts//域内信任信息
5. 查找域控
1 2 3 4 5 6 7 8 9
nltest /DCLIST:test
net time /domain Nslookup -type=SRV _ldap._tcp net group "Domain Controllers" /domain netdom query pdc//查看主控制器
6. 获取域内的用户和管理员信息
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//查询所有域用户列表 net user /domain //获取域内用户的详细信息 wmic useraccount get /all //查看存在的用户,但是这个只能在域控或者安装了对应服务的主机使用,否则会提示命令不存在 dsquery user //查找目录中的计算机 dsquery computer //查询本地管理员组用户 net localgroup administrators //查询域管理员用户组 net group "domain admins" /domain //查询管理员用户组 net group "Enterprise Admins" /domain
本机检查: //获取域管理员列表 net group "Domain Admins" /domain //列出本机的所有进程和进程用户 tasklist /v //查询域控的域用户会话 //查询域控列表 net group "Domain Controllers" /domain //收集所有活动域的会话列表 netsess -h