Skip to content

Conversation

@kaitozaw
Copy link
Collaborator

@kaitozaw kaitozaw commented Dec 19, 2025

Pull Request

Category

Bug, Documentation

Feature/Issue Description

Q: Please give a brief summary of your feature/fix
A: The CLI options defined in core/main/console/commandline.rb, the output of ./beef --help, and the Wiki documentation were inconsistent.

Q: Give a technical rundown of what you have changed (if applicable)
A:
There were two separate issues:

  1. ./beef --help was not showing BeEF CLI options defined in commandline.rb, but instead displayed Rack’s help menu.
  2. The Wiki has not been updated to reflect the current CLI options.

This PR addresses (1) by parsing BeEF CLI options early in the startup script (beef) before loading the core framework and (2) by updating the Wiki to reflect the current CLI options.

In addition, this PR includes minor CLI style improvements:

  • Long option names were normalized to use dashes instead of underscores.
  • Short options were reduced to a single character, as required by Ruby’s OptionParser.

Wiki Page

https://github.com/beefproject/beef/wiki/Configuration#launching-beef

@kaitozaw kaitozaw temporarily deployed to Integrate Pull Request December 19, 2025 06:57 — with GitHub Actions Inactive
@kaitozaw
Copy link
Collaborator Author

Issue (2) can be addressed by updating the Wiki; please grant edit access if you would like me to follow up with that change.

@kaitozaw kaitozaw changed the title Fixes issue #2174 Fixes issue/wiki-and-helpmenu (#2174) Dec 22, 2025
@zinduolis zinduolis linked an issue Dec 30, 2025 that may be closed by this pull request
@kaitozaw kaitozaw force-pushed the issue/2174-wiki-and-helpmenu branch from 39b7fa0 to 85d8d78 Compare December 30, 2025 04:16
@kaitozaw kaitozaw temporarily deployed to Integrate Pull Request December 30, 2025 04:17 — with GitHub Actions Inactive
@options[:verbose] = true
end

opts.on('-a', '--ascii_art', 'Prints BeEF ascii art') do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed there still --ascii_art in the documentation: https://github.com/beefproject/beef/wiki/Configuration#launching-beef

Could you please update the document? Thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for confusion, but '--ascii_art' command is still there. It's in line 43.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's now '--ascii-art', with the dash in the middle, not underscore 😎

Copy link
Collaborator Author

@kaitozaw kaitozaw Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit 0
end

# opts.on('-i', '--interactive', 'Starts with the Console Shell activated') do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please remove the no longer needed code rather than commenting out? It'll keep the code clean. In case we need it in the future, we should figure it out quickly with AI

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting this part? Or also exit 0?

            # opts.on('-i', '--interactive', 'Starts with the Console Shell activated') do
            #  @options[:interactive] = true
            # end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a part of help, thus redundant, please delete, thanks

@kaitozaw kaitozaw deployed to Integrate Pull Request December 30, 2025 05:00 — with GitHub Actions Active
@zinduolis
Copy link
Contributor

Summary
This PR fixes the issue where Rack hijacked the -h flag, preventing BeEF's help menu from showing. It also standardizes flags to kebab-case (e.g., --ascii-art) while maintaining full backward compatibility.

Verification (Manual Testing) ✅
I have manually verified the following on Linux:

  • Help Menu: ./beef -h now correctly shows BeEF options instead of Rack options.
  • Refactored Flags:
    • --ascii-art / -a: Works (Banner prints).
    • --update-disabled / -d: Works (Update check skipped).
    • --update-auto / -u: Works (Auto-update triggered).
  • Backward Compatibility: Verified that legacy snake_case flags (e.g. --ascii_art) still work.
  • Issue Update ./beef launch flags in wiki and --help menu #2174: Validated that the Wiki is now fully aligned with these code changes.

@kaitozaw kaitozaw merged commit 0680a51 into beefproject:master Dec 30, 2025
5 checks passed
@kaitozaw kaitozaw deleted the issue/2174-wiki-and-helpmenu branch December 30, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update ./beef launch flags in wiki and --help menu

2 participants