Pwnspoof仓库

作者:Sec-Labs | 发布时间:

项目介绍

pwnSpoof(来自Punk Security)为普通网络服务器生成真实的欺骗性日志文件,并可定制攻击方案

每个日志包都是独一无二的,而且完全可定制,这使其成为生成CTF场景和培训序列的完美选择。

你能找到攻击者会话并建立事件图片吗?

3f12bb2fe6184109

项目地址

https://github.com/punk-security/pwnspoof#

关于该项目

pwnSpoof 是在为客户提供的威胁追踪培训练习 Punk Security 的基础上创建的。 培训练习是使用 Splunk 等日志分析工具(其他日志分析工具可用)和 IIS 日志来查找登录暴力攻击和命令注入。

pwnSpoof 应用程序背后的想法是:

  • 提供快速的CTF风格训练环境
  • 每次运行创建唯一的日志
  • 在 IIS、Apache 和 NGINX 日志中测试威胁搜寻

创建一组日志后,想法是将它们加载到 Splunk 并使用各种技术来回答以下问题;

  • 攻击者的 IP 地址和 user_agent 是什么?
  • 攻击者是否进行了身份验证,如果是,使用什么帐户?
  • 攻击者的地理位置在哪里?
  • 袭击发生在什么时候?
  • 那是怎样的攻击?
  • 袭击期间发生了什么?
  • 服务器上可能保留哪些工件?
  • 可以采取哪些措施进行补救?

入门

下面将解释如何开始使用 pwnSpoof

先决条件

pwnSpoof 是用 python 编写的,并使用 python3 进行了测试。 不需要额外的模块,我们只使用标准库。

如果您收到以下错误消息,请在运行 pwnSpoof 时指定 python3。 不支持 Python2。

  File "pwnspoof.py", line 176
    print("{:6.2f}% ".format(y * x), end="\r", flush=True)
                                        ^
SyntaxError: invalid syntax

安装

  1. Git 克隆 pwnSpoof 存储库

git clone https://github.com/punk-security/pwnspoof

  1. 将目录更改为 pwnSpoof

cd pwnspoof

  1. 运行 pwnSpoof

python pwnspoof.py --help

用法

开关

positional arguments:
  {banking,wordpress,generic}
                        App to emulate

optional arguments:
  -h, --help            show this help message and exit
  --out OUT             Output file (default: pwnspoof.log)
  --iocs                Do you want to know the attackers iocs for easier searching? (default: False)

log generator settings:
  --log-start-date LOG_START_DATE
                        Initial start of logs, in the format YYYYMMDD i.e. "20210727"
  --log-end-date LOG_END_DATE
                        End date for logs, in the format YYYYMMDD i.e. "20210727"
  --session-count SESSION_COUNT
                        Number of legitimate sessions to spoof (default: 2000)
  --max-sessions-per-user MAX_SESSIONS_PER_USER
                        Max number of legitimate sessions per user (default: 3)
  --server-fqdn SERVER_FQDN
                        Override the emulated web apps default fqdn
  --server-ip SERVER_IP
                        Override the emulated web apps randomised IP
  --server-type {IIS,NGINX,CLF}
                        Server to spoof (default: IIS)
  --uri-file URI_FILE   File containing web uris to override defaults, do not include extensions
  --noise-file NOISE_FILE
                        File containing noise uris to override defaults, include extensions

attack settings:
  --spoofed-attacks SPOOFED_ATTACKS
                        Number of attacker sequences to spoof (default: 1)
  --attack-type {bruteforce,command_injection}
                        Number of attacker sequences to spoof (default: bruteforce)
  --attacker-geo ATTACKER_GEO
                        Set the attackers geo by 2 letter region. Use RD for random (default: RD)
  --attacker-user-agent ATTACKER_USER_AGENT
                        Set the attackers user-agent. Use RD for random (default: RD)

例子

以下示例将为针对 pwnedbank.co.uk 的暴力破解创建一组 IIS 日志。

python pwnspoof.py banking --server-fqdn pwnedbank.co.uk --attack-type bruteforce --server-type IIS --out iis-output.log

以下示例将为针对 pwnedbank.co.uk 的 command_injection 创建一组 NGINX 日志。

python pwnspoof.py banking --server-fqdn pwnedbank.co.uk --attack-type command_injection --server-type NGINX

以下示例将创建一组包含 5000 个常规会话和 3 个攻击会话的日志

python pwnspoof.py banking --session-count 5000 --spoofed-attacks 3

以下示例将创建一组日志并输出攻击者 IP 地址

python pwnspoof.py banking --spoofed-attacks 3 --iocs 

演示

演示

路线图

pwnSpoof 旨在生成真实的 Web 攻击日志,它做得非常好。 目前,我们专注于重构代码、构建我们的测试套件并首次推送到 PyPi,但我们对 pwnSpoof 抱有 很大 的野心。

标签:工具分享