Example Usage
#include <beacon.h>
#include <string>
#include <format>
#include <exception>
#include <chrono>
// The cpp-pe is in my option the best part to come out of the BOF PE design.
// The benefits of the C++ BOF PE is full use of the C++ runtime, including classes
// with virtual functions, templates, the C++ STL library and more importantly
// exceptions. This will enable BOF PE developers to create much cleaner code that
// is not if/else heavy which is typical of C based code which often checks for error
// codes during each function call.
//
// The drawback of this form of development is size. The example below with Clang
// will compile to an PE that is roughly 400KB in size. Keep in mind this sample is using std::format,
// std::string, std::chrono and exceptions. If we just make use of std::exception alone, it compiles to 80KB
void throw_message(const char* message) {
throw std::exception(message);
}
void print_message(const char* arg) {
auto message = std::format("Hello from Beacon C++ PE {}, the time is now {}\n",
arg == nullptr ? "unknown" : arg, std::chrono::system_clock::now());
BeaconOutput(CALLBACK_OUTPUT, message.data(), message.length());
th
See also
365
Free
BlueTeam, RedTeam, Bug bounty, CTI, OSINT, Threat Hunting, Network and Web Recon, Discovery, Enumera…
username-anarchy
Open Source
Kali
Username tools for penetration testing…
Viper
Free
Adversary simulation and Red teaming platform with AI…
Unicorn
Open Source
Simple tool for using a PowerShell downgrade attack and inject shellcode straight into memory. Works…
NoSQLMap
Open Source
Automated NoSQL injection and database exploitation tool. Targets MongoDB, CouchDB, Redis, and Cassa…
bettercap
Free
Kali
The Swiss Army knife for 802.11, BLE, HID, CAN-bus, IPv4 and IPv6 networks reconnaissance and MITM a…