Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug] Duplicate File Logs for Emulations

未关闭
#73 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

从 BaseEmulation 开始,检查控制台和文件处理器是如何附加到 self.elogger 的。使用 OOTB 仿真通过 SWAT Shell 重现该问题,然后检查其在 logs/ 中的文件。每个 self.elogger.* 调用仅在相应的仿真日志中出现一次即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug

🐛 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:

  1. Start SWAT Shell
  2. Authenticate with OAuth credentials
  3. Run any OOTB emulation
  4. 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

elastic/SWAT 的其他 Issue

查看 elastic/SWAT 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。