From 943a6fd2266f2652e64885c499e8f8fb5735ac10 Mon Sep 17 00:00:00 2001 From: bcoles Date: Sat, 15 Apr 2023 18:05:26 +1000 Subject: [PATCH] Notifications: Slack: Fix config file WebHook validation (#2820) --- extensions/notifications/channels/slack_workspace.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/notifications/channels/slack_workspace.rb b/extensions/notifications/channels/slack_workspace.rb index a11c56121..8c0d2d4e0 100644 --- a/extensions/notifications/channels/slack_workspace.rb +++ b/extensions/notifications/channels/slack_workspace.rb @@ -18,8 +18,8 @@ module BeEF channel = @config.get('beef.extension.notifications.slack.channel') username = @config.get('beef.extension.notifications.slack.username') - if webhook_url.include?('your_webhook_url') || !webhook_url.start_with?('https://hook\.slack.com/services/') - print_error '[Notifications] Invalid Slack WebHook URL' + if webhook_url.include?('your_webhook_url') || !webhook_url.start_with?('https://hooks.slack.com/services/') + print_error('[Notifications] Invalid Slack WebHook URL') return end @@ -31,6 +31,8 @@ module BeEF ) notifier.ping message + + print_debug("[Notifications] Established Slack notification channel: #{webhook_url}") rescue StandardError => e print_error "[Notifications] Slack notification initialization failed: #{e.message}" end