BOF and Extensions
Beacon Object Files
Description of BOF for agents
Beacon BOFsGopher BOFsExtensions
How to execute AxScript
AxScript and BOFs
Last updated
var metadata = {
name: "Elevation-BOF",
description: "BOFs for context elevation",
store: true
};
// AxScript code
// ...let cmd_shell = ax.create_command("shell", "Execute command via cmd.exe", "shell whoami /all");
cmd_shell.addArgString("cmd_params", true);
cmd_shell.setPreHook(function (id, cmdline, parsed_json, ...parsed_lines) {
let new_cmd = "ps run -o C:\\Windows\\System32\\cmd.exe /c " + parsed_json["cmd_params"];
ax.execute_alias(id, cmdline, new_cmd);
});
var cmd_screenshot = ax.create_command("screenshot_bof", "Alternative screenshot capability that does not do fork n run by @codex_tf2", "screenshot -n screen1 -p 812");
cmd_screenshot.addArgFlagString("-n", "note", "Screenshot caption", "ScreenshotBOF");
cmd_screenshot.addArgFlagInt("-p", "pid", "PID of the application whose window screenshot will be taken. If 0, then a full-screen screenshot", 0);
cmd_screenshot.setPreHook(function (id, cmdline, parsed_json, ...parsed_lines) {
let note = parsed_json["note"];
let pid = parsed_json["pid"];
let bof_params = ax.bof_pack("cstr,int", [note, pid]);
let bof_path = ax.script_dir() + "_bin/Screenshot." + ax.arch(id) + ".o";
ax.execute_alias(id, cmdline, `execute bof ${bof_path} ${bof_params}`, "Task: Screenshot BOF");
});