Skip to content

Fix URL-encoded command passed to shell execution modules - #3637

Open
Dev9269 wants to merge 1 commit into
beefproject:masterfrom
Dev9269:fix/1854-activex-urlencoded-command
Open

Fix URL-encoded command passed to shell execution modules#3637
Dev9269 wants to merge 1 commit into
beefproject:masterfrom
Dev9269:fix/1854-activex-urlencoded-command

Conversation

@Dev9269

@Dev9269 Dev9269 commented Aug 17, 2026

Copy link
Copy Markdown

Description

When a command module value is decoded with beef.encode.base64.decode, the result is URL-escaped, because decode uses escape(atob(input)) (core/main/client/encode/base64.js). Any command containing spaces or special characters (e.g. cmd.exe /c "echo Hello from BeEF!") was therefore delivered percent-encoded to the browser and never executed.

Fix

Wrap the decoded value in decodeURIComponent in the two modules that pass it to a shell/process runner, matching the pattern already used by the other command modules (deface_web_page, blockui, fake_notification, ...):

  • modules/exploits/local_host/activex_command_execution/command.js (WScript.Shell.Run)
  • modules/exploits/local_host/mozilla_nsiprocess_interface/command.js (nsIProcess)

Fixes #1854

beef.encode.base64.decode escapes its output (escape/atob), so commands
containing spaces or special characters were delivered percent-encoded
and never executed by WScript.Shell.Run / nsIProcess.

Wrap the decoded value in decodeURIComponent, matching the pattern used
by the other command modules (deface_web_page, blockui, ...).

Fixes beefproject#1854
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.

Error in ActiveX Command Execution module - urlencoded command

1 participant