[Bug] Duplicate File Logs for Emulations
还没有人认领这个 Issue。
评估
调研方向
从 BaseEmulation 开始,检查控制台和文件处理器是如何附加到 self.elogger 的。使用 OOTB 仿真通过 SWAT Shell 重现该问题,然后检查其在 logs/ 中的文件。每个 self.elogger.* 调用仅在相应的仿真日志中出现一次即表示完成。
由索引模型根据 Issue 内容生成。
描述
🐛 Bug Report
Describe the bug
When running an emulation, there is a separate console and file handler set to self.elogger within BaseEmulation. This allows emulations to use a secondary logger to separate logging. The log files written to are within the logs/ directory where the log file name represents the emulation.
There is a bug currently that is duplicating logs within each respective emulation log file.
Steps to reproduce
Steps to reproduce the behavior:
- Start SWAT Shell
- Authenticate with OAuth credentials
- Run any OOTB emulation
- Review log file in
logs/
Expected behavior
The logging should only be happening once per self.elogger.* call.
Screenshots
2023-08-12 15:15:32,486 - initial_access.gmail_phishing_form_link - INFO - Created Google Form: 17b0DwhmBY0Ihv_q85zuZj2fJdPYOFQuiuhuZvbGSgAg (gmail_phishing_form_link.py:47)
2023-08-12 15:15:32,486 - initial_access.gmail_phishing_form_link - INFO - Created Google Form: 17b0DwhmBY0Ihv_q85zuZj2fJdPYOFQuiuhuZvbGSgAg (gmail_phishing_form_link.py:47)
2023-08-12 15:15:32,488 - initial_access.gmail_phishing_form_link - INFO - Created email with Google Form link (gmail_phishing_form_link.py:59)
2023-08-12 15:15:32,488 - initial_access.gmail_phishing_form_link - INFO - Created email with Google Form link (gmail_phishing_form_link.py:59)
2023-08-12 15:15:33,333 - initial_access.gmail_phishing_form_link - INFO - Sent email to [email protected] from [email protected] (gmail_phishing_form_link.py:65)
2023-08-12 15:15:33,333 - initial_access.gmail_phishing_form_link - INFO - Sent email to [email protected] from [email protected] (gmail_phishing_form_link.py:65)
SWAT version
0.0.1
Checklist
Please ensure you've completed the following tasks:
- I've described the bug in as much detail as possible
- I've provided steps to reproduce the bug
- I've added any relevant screenshots or other information
- 主要语言
- Python
- 星标
- 169
- 派生
- 8
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
elastic/SWAT 的其他 Issue
-
难度 5/5 一周以上 新手友好度 15/100
-
[Maintenance] Documentation Screenshots not Rendering可能重新可做 @terrancedejesus 于 1133 天前认领,目前没有进行中的 PR。 未关闭community maintenance
-
[Feature Request] Create `add-emulation` command可能重新可做 @brokensound77 于 1170 天前认领,目前没有进行中的 PR。 未关闭enhancement
-
[Feature Request] Add Python module for detecting T1098.003 - Additional Cloud Roles可能重新可做 @terrancedejesus 于 1238 天前认领,目前没有进行中的 PR。 未关闭API: Admin enhancement Subtechnique: 003 Tactic: Persistence Technique: T1098
-
API: Admin API: Gmail enhancement Subtechnique: 003 Tactic: Discovery Technique: T1087
难度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
BasedHardware/omi#20271 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 92/100
openai/openai-cookbook#3153 ·
维护者通常 1 天内回复
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
难度 2/5 1-3 小时 新手友好度 65/100
l3montree-dev/devguard#3146 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 76/100
open-webui/open-webui#31849 · 2 条评论 ·
维护者通常 1 天内回复