banner
lca

lca

真正的不自由,是在自己的心中设下牢笼。

windows应急响应手册笔记记录

系统账号#

服务器是否存在弱口令(询问、工具爆破)

可疑账号 

lusrmgr.msc

net user/wmic UserAccount get

隐藏账号 

HKEY_LOCAL_MACHINE/SAM/SAM/Domains/Account/Users/Names/

D 盾账号检测

端口、进程#

netstat -ano

tasklist | findstr <pid>

netstat -ano | findstr <port>

任务管理器可查看进程对应的 PID,选择相应的进程可查看文件位置

进程查看:msinfo32

服务:services.msc

火绒剑、Process Explorer

进程观察#

  • 无签名信息
  • 无描述信息
  • 进程的属主
  • 进程路径

结束可疑进程

taskkill /f /pid <pid>

启动项、计划任务、服务#

启动项#

启动文件夹

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

C:\Users\当前用户\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

注册表

REG query HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

REG query HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Runonce

REG query HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\Explorer\Run

REG query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

REG query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce

REG query HKLM\Software\Microsoft\Windows\CurrentVersion\RunonceEx

msconfig

组策略:gpedit.msc

计划任务#

taskschd.msc

自动动服务#

services.msc

可疑文件#

对可疑目录进行时间排序

是否新增用户目录

find /var/www/ -name "*.php" |xargs egrep 'assert|phpspy|c99sh|milw0rm|eval|(gunerpress|(base64_decoolcode|spider_bc|shell_exec|passthru|($_\POST[|eval (str_rot13|.chr(|${"_P|eval($_R|file_put_contents(.*$_|base64_decode'

grep -i -r eval($_post /app/website/*

find /app/website/ -type f|xargs grep eval($_post

临时文件:c:\windows\temp\

最近文件:% UserProfile%\Recent

查看特定时间内对上传目录的访问请求

findstr /s /m /I “UploadFiles” *.log

补丁信息#

systeminfo

病毒查杀#

杀毒软件

D 盾 - webshell 查杀

日志分析#

前提:有日志留存,服务器本身的日志,安全设备留存的攻击日志

系统日志:eventvwr.msc,工具:log parser

日志位置:

%SystemRoot%\System32\Winevt\Logs\

image.png

主要日志包括应用程序、安全、系统日志等,日志默认大小 20484K(20M),超出的部分将覆盖过期的日志。

事件 ID#

见扩展 1

每个登录成功的事件都会标记一个登录类型,不同的登录类型代表不同的登录方式

登录类型描述说明
2交互式登录(Interactive)用户在本地进行登录。
3网络(Network)最常见的情况就是连接到共享文件夹或共享打印机时。
4批处理(Batch)批处理(为批处理程序保留)
5服务(Service)服务启动(服务登录)
7解锁(Unlock)屏保解锁。
8网络明文(NetworkCleartext)登录的密码在网络上是通过明文传输的,如 FTP、IIS 登录验证。
9新凭证(NewCredentials)使用带 / Netonly 参数的 RUNAS 命令运行一个程序。
10远程交互,(RemoteInteractive)通过终端服务、远程桌面或远程协助访问计算机。
11缓存交互(CachedInteractive)缓存域证书登录

web (中间件) 日志:日志分析工具,脚本过滤分析

工具#

杀毒软件

http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe

火绒:https://www.huorong.cn

微步威胁情报:https://x.threatbook.cn

安恒云沙箱:https://sandbox.dbappsecurity.com.cn/

D 盾 - webshell 查杀:http://www.d99net.net/index.asp

深信服 webshell 检测:http://edr.sangfor.com.cn/backdoor_detection.html

河马查杀:http://www.shellpub.com/

thor-lite:https://www.nextron-systems.com/thor-lite/

内存马扫描:https://github.com/c0ny1/java-memshell-scanner

日志#

EVTX-ATTACK-SAMPLES

https://docs.google.com/spreadsheets/d/12V5T9j6Fi3JSmMpAsMwovnWqRFKzzI9l2iXS5dEsnrs/edit#gid=164587082

日志分析工具 logparser:https://www.microsoft.com/en-us/download/details.aspx?id=24659

LogParser Lizard:http://www.lizard-labs.com/log_parser_lizard.aspx

Event Log Explorer:https://www.majorgeeks.com/files/details/event_log_explorer.html

Win-Logs-Parse-tool:https://github.com/Clayeee/Win-Logs-Parse-tool

360 星图:可自动识别 iis/apache/nginx 日志

下图为 iis 日志:

image.png

下图为 apache 日志

image.png

ioc#

参考#

https://github.com/Lorna-Dane/Blue-Team/tree/8e0e2e9dde536bc3941b56f915165db764d7119e

https://github.com/Blue-number/Security/blob/9ade37050b1f8e164208191545d457d14a1e341d/1earn/Integrated/Windows/Secure-Win.md

扩展 1 事件 ID#

攻击类型事件 ID
策略更改1102: 清理审计日志
4719:系统审计策略修改
账户和组枚举4798:本地用户组成员已被枚举
4799:启用安全的本地组成员已被枚举
4720:创建用户
4726:删除账户
4728:将成员添加到启用安全的全局组中
4729:将成员从安全的全局组中移除
AdminSDHolder4780:ACL 已设置在属于管理员组的帐户上
Kekeo4624:帐户登录
4672:管理员登录
4768:Kerberos TGS 请求
Silver Ticket4624:帐户登录
4634:帐户注销
4672:管理员登录
Golden Ticket4624:帐户登录
4672:管理员登录
PowerShell4103:脚本块日志记录
400:引擎生命周期
403:引擎生命周期
4103:模块日志记录
600:提供程序生命周期
DCShadow4742:计算机帐户已更改
5137:已创建目录服务对象
5141:已删除目录服务对象
4929:活动目录复制源命名上下文已删除
Skeleton Keys4673:调用了特权服务
4611:已向本地安全性身份验证注册了一个受信任的登录进程
4688:已创建新进程
4689:进程已退出
PYKEK MS14-0684672:管理员登录
4624:帐户登录
4768:Kerberos TGS 请求
Kerberoasting4769:已请求 Kerberos 票据
S4U2Proxy4769:已请求 Kerberos 票据
DCSync4662:已对对象执行操作
Password Spraying4625:帐户登录失败
4771:Kerberos 预身份验证失败
4648:尝试使用明确的凭据登录
Lateral Movement4688:已创建新进程
4689:已退出进程
4624:成功登录帐户
4625:帐户登录失败
NTLM4776:NTLM 身份验证
DNSAdmin770:DNS 服务器插件 DLL 已加载
541:已将设置 serverlevelplugindll 在范围上设置为
150:DNS 服务器无法加载或初始化插件 DLL
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.