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
100-redteam-projects
Free
Projects for security students…
Netexec (nxc)
Open Source
Kali
The maintained fork and successor to CrackMapExec. Network service exploitation Swiss army knife for…
365
Free
BlueTeam, RedTeam, Bug bounty, CTI, OSINT, Threat Hunting, Network and Web Recon, Discovery, Enumera…
ExploitDB / SearchSploit
Open Source
Kali
Archive of public exploits and vulnerable software maintained by Offensive Security. SearchSploit pr…
Evil-WinRM
Open Source
Kali
Full-featured WinRM shell for hacking and penetration testing. Supports pass-the-hash, file upload/d…
Responder (NBT-NS Poisoner)
Open Source
Kali
Rogue authentication server and LLMNR/NBT-NS/mDNS poisoner for Windows networks. Captures NTLM chall…