Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New expand-list command #1513

Closed
YamatoSecurity opened this issue Nov 27, 2024 · 2 comments · Fixed by #1526
Closed

New expand-list command #1513

YamatoSecurity opened this issue Nov 27, 2024 · 2 comments · Fixed by #1526
Assignees
Labels
enhancement New feature or request

Comments

@YamatoSecurity
Copy link
Collaborator

In order to help users understand what expand config files they need to create, we should include a command that lists up the placeholders.

Usage:
  hayabusa.exe expand-list <INPUT> [OPTIONS]

Input:
  -r, --rules <DIR>  Directory of rules (default: ./rules)

General Options:
  -h, --help                           Show the help menu

Display Settings:
  -K, --no-color  Disable color output
  -q, --quiet     Quiet mode: do not display the launch banner

Stdout:

5 unique expand placeholders found:

Admins_Workstations
DC-MACHINE-NAME
Workstations
internal_domains
domain_controller_hostnames

This command just recursively checks the .yml files in ./rules or the specified rules directory, extracts out Admins_Workstations, etc.. from IpAddress|expand: '%Admins_Workstations%' and does sort -u

@fukusuket Could I ask you to do this one?

@YamatoSecurity YamatoSecurity added the enhancement New feature or request label Nov 27, 2024
@fukusuket fukusuket self-assigned this Nov 27, 2024
@fukusuket
Copy link
Collaborator

Yes, I would love to implement it!💪

@fukusuket
Copy link
Collaborator

fukusuket commented Dec 3, 2024

@YamatoSecurity @Shirofune-Security
Please let me discuss two things! What do you think about the following two points?

1. Stdout

I think For users, outputting only a placeholder may be a little time-consuming🤔
How about the following stdout? (To make it easy to check which rule is the PlaceHolder)

+--------------------------------------+-------------------------------------------------------+-----------------------------+------------------------------------------+
| ID                                   | Title                                                 | Expand                      | Filepath                                 |
+--------------------------------------+-------------------------------------------------------+-----------------------------+------------------------------------------+
| 550e8400-e29b-41d4-a716-446655440001 | User with Privileges Logon                            | Admins_Workstations         | ./config/Admins_Workstations.txt         |
| 550e8400-e29b-41d4-a716-446655440002 | Potential Zerologon (CVE-2020-1472) Exploitation      | DC-MACHINE-NAME             | ./config/DC-MACHINE-NAME.txt             |
| 550e8400-e29b-41d4-a716-446655440003 | Potential Pass the Hash Activity                      | Workstations                | ./config/Workstations.txt                |
| 550e8400-e29b-41d4-a716-446655440004 | DNS Request From Windows Script Host                  | internal_domains            | ./config/internal_domains.txt            |
| 550e8400-e29b-41d4-a716-446655440005 | New RDP Connection Initiated From Domain Controller   | domain_controller_hostnames | ./config/domain_controller_hostnames.txt |
+--------------------------------------+-------------------------------------------------------+-----------------------------+------------------------------------------+

2. Creating txt file template with some option

I think it would be easier if you could also create a txt file template with some options. e.g --output option
(However, I think it is a bit unnatural behavior to create a file with the list-xxx* command...😅)

Usage:
  hayabusa.exe expand-list <INPUT> [OPTIONS]

Input:
  -r, --rules <DIR>  Directory of rules (default: ./rules)

General Options:
  -h, --help                           Show the help menu

Display Settings:
  -K, --no-color  Disable color output
  -q, --quiet     Quiet mode: do not display the launch banner

Output:
  -o, --output <FILE>        Save the template in TXT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants