设为首页 收藏本站
查看: 632|回复: 0

[经验分享] windows 信息收集脚本

[复制链接]

尚未签到

发表于 2018-6-17 10:48:49 | 显示全部楼层 |阅读模式
  @echo off
  REM ---------------------------------------------
  REM Host Information Gathering Script (Windows Edition)
  REM Written by hash <1401354763@qq.com>
  REM ---------------------------------------------
  REM Version: 0.3
  REM Last Modified: 2014.06.03
  REM ---------------------------------------------
  REM Simple Windows batch file to gather system
  REM information for use during a host config
  REM review, or as an aid to Incident Response.
  REM All output goes into a folder which named
  REM whatever the %COMPUTERNAME% variable is set to.
  REM ---------------------------------------------
  REM Depends on the psloglist tool from SysInternals
  REM (now Microsoft). It's part of the PSTools suite
  REM http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
  REM ---------------------------------------------
  REM Tested on the following platforms:
  REM Server:
  REM    Windows 2003 SP2
  REM    Windows Server 2012
  REM Desktop:
  REM    Windows 7 Professional (32 bit)
  REM    Windows 7 Professional (64 bit)
  REM    Windows XP SP3
  REM    Windows XP SP2
  REM ---------------------------------------------
  REM TODO: update this to check for powershell
  REM       and use that to perform more robust
  REM       checks. Also needs to be updated badly
  REM       to utilize the newer features of IIS
  REM ---------------------------------------------
  REM This program is free software: you can redistribute it and/or modify
  REM it under the terms of the GNU General Public License as published by
  REM the Free Software Foundation, either version 3 of the License, or
  REM (at your option) any later version.
  REM
  REM This program is distributed in the hope that it will be useful,
  REM but WITHOUT ANY WARRANTY; without even the implied warranty of
  REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  REM GNU General Public License for more details.
  REM
  REM You should have received a copy of the GNU General Public License
  REM along with this program.  If not, see <http://www.gnu.org/licenses/>.
  REM ---------------------------------------------
  REM Copyright 2010-2014 Jason Ross <algorythm /at/ gmail /dot/ com>
  REM ---------------------------------------------
  md %COMPUTERNAME%
  cd %COMPUTERNAME%
  echo =================
  echo Gathering basic information
  echo =================
  echo Host Configuration Tool >> basic-info.txt
  echo Output Created on %DATE% at %TIME% >> basic-info.txt
  echo ================= >> basic-info.txt
  echo Domain: %USERDOMAIN% >> basic-info.txt
  echo This host: %COMPUTERNAME% >> basic-info.txt
  echo This script running as: %USERNAME% >> basic-info.txt
  echo ================= >> basic-info.txt
  echo Environment Variables: >> basic-info.txt
  set >> basic-info.txt
  echo ================= >> basic-info.txt
  echo System Info: >> basic-info.txt
  systeminfo >> basic-info.txt
  echo Done!
  echo.
  echo =================
  echo Detecting installed software
  echo =================
  reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall reg.txt
  find &quot;DisplayName&quot; reg.txt |find /V &quot;ParentDisplayName&quot; > tmplist.txt
  for /f &quot;tokens=2,3 delims==&quot; %%a in (tmplist.txt) do (echo %%a >> software.txt)
  echo Done!
  echo.
  echo =================
  echo Detecting installed hotfixes
  echo =================
  wmic qfe list >hotfixes.txt
  echo Done!
  echo.
  echo =================
  echo Creating list of registered services
  echo =================
  sc query state= all >> services.txt
  echo Done!
  echo.
  echo Enumerating network servers visible to this host
  echo ================= > net-view.txt
  net view >> net-view.txt
  echo Done!
  echo.
  echo =================
  echo Gathering local user and group information
  echo =================
  net localgroup >> localgroups.txt
  net user >> localusers.txt
  net localgroup administrators >> localadminusers.txt
  echo Done!
  echo.
  echo =================
  echo Gathering shared folder information
  echo =================
  net view /a \%COMPUTERNAME% >> shares.txt
  echo Done!
  echo.
  echo =================
  echo Gathering IP configuration
  echo =================
  ipconfig /all >> ipconfig.txt
  echo Done!
  echo.
  echo =================
  echo Detecting open ports
  echo =================
  netstat -ban >> netstat.txt
  echo Done!
  echo.
  echo =================
  echo Checking scheduled jobs
  echo =================
  at >> at.txt
  echo Done!
  echo.
  echo =================
  echo Checking IIS sites
  echo =================
  %windir%\system32\inetsrv\AppCmd.exe list site > IIS_sites.txt
  echo Done!
  echo.
  echo =================
  echo Dumping the registry
  echo =================
  reg export HKLM hklm.reg
  reg export HKCU hkcu.reg
  reg export HKCU hkcr.reg
  reg export HKCU hku.reg
  reg export HKCU hkcc.reg
  echo Done!
  echo.
  echo =================
  echo Collecting logs, this may take a bit...
  echo =================
  ..\psloglist -x system > system.log
  ..\psloglist -x security > security.log
  ..\psloglist -x application > application.log
  echo Done!
  echo.
  echo =================
  echo Cleaning up temporary files
  echo =================
  del reg.txt tmplist.txt
  echo Done!
  echo.
  echo =================
  echo Host Information Gathering Script finished.
  echo =================
  echo.
DSC0000.jpg

DSC0001.jpg

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-524874-1-1.html 上篇帖子: 日常总结——Windows域的部署 下篇帖子: windows服务搭建及命令总结
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表