Path: blob/master/extensions/notifications/notifications.rb
1154 views
#1# Copyright (c) 2006-2025 Wade Alcorn - [email protected]2# Browser Exploitation Framework (BeEF) - https://beefproject.com3# See the file 'doc/COPYING' for copying permission4#56require 'extensions/notifications/channels/email'7require 'extensions/notifications/channels/pushover'8require 'extensions/notifications/channels/slack_workspace'9require 'extensions/notifications/channels/ntfy'101112module BeEF13module Extension14module Notifications15#16# Notifications class17#18class Notifications19def initialize(from, event, time_now, hb)20@config = BeEF::Core::Configuration.instance21return unless @config.get('beef.extension.notifications.enable')2223@from = from24@event = event25@time_now = time_now26@hb = hb2728message = "#{from} #{event} #{time_now} #{hb}"2930if @config.get('beef.extension.notifications.email.enable') == true31to_address = @config.get('beef.extension.notifications.email.to_address')32BeEF::Extension::Notifications::Channels::Email.new(to_address, message)33end3435BeEF::Extension::Notifications::Channels::Pushover.new(message) if @config.get('beef.extension.notifications.pushover.enable') == true3637BeEF::Extension::Notifications::Channels::SlackWorkspace.new(message) if @config.get('beef.extension.notifications.slack.enable') == true3839BeEF::Extension::Notifications::Channels::Ntfy.new(message) if @config.get('beef.extension.notifications.ntfy.enable') == true4041end42end43end44end45end464748