Whisper Library
|
A covert channel using packet lengths. More...
Public Member Functions | |
PacketLengthCovertChannel (function< void(std::string)> output, function< void(GenericPacket)> send) | |
Creates an PacketLengthCovertChannel. More... | |
~PacketLengthCovertChannel () | |
Deletes the PacketLengthCovertChannel. More... | |
CovertChannel * | instance () |
void | sendMessage (std::string message) |
sends a message More... | |
void | receivePacket (GenericPacket &udp_packet) |
interprets an udp packet More... | |
void | setArguments (std::string arguments) |
void | initialize () |
void | setOutput (function< void(std::string)> output) |
sets the function used to output received messages More... | |
void | setSend (function< void(GenericPacket)> send) |
sets the function used to send packets More... | |
std::string | name () const |
std::string | info () const |
std::string | protocol () const |
unsigned short | port () const |
std::string | id () const |
![]() | |
CovertChannel () | |
Creates a CovertChannel. | |
virtual | ~CovertChannel () |
Destructor. More... | |
virtual void | setArguments (string arguments)=0 |
configures the covert channel More... | |
virtual void | setOutput (function< void(string)> output)=0 |
sets the output method More... | |
Private Attributes | |
std::function< void(std::string)> | m_output |
function used to return received messages as a string | |
std::function< void(GenericPacket)> | m_send |
function used to send Udp Packets via the socket | |
std::vector< unsigned int > | m_packetlengths |
holds the packet lengths send or received | |
int | m_received |
counts the received packets | |
int | m_packetcount |
number of packets for the current transmission | |
int | m_baselength |
minimal length of data payload of the udp packets | |
LengthCoder * | m_coder |
used to encode and decode messages | |
A covert channel using packet lengths.
A PacketLengthCovertChannel can be used to send and receive messages coded in the length of udp packets. It uses a base length of ten and increases this length depending on the send message.
|
inline |
Creates an PacketLengthCovertChannel.
Creates a new PacketLengthCovertChannel. An PacketLengthCovertChannel needs three function pointers. It than can be use to send and receive messages.
output | a function the covert channel calls with the message he received as an argument |
send | a function the covert channel uses to send udp packets |
whisper_library::PacketLengthCovertChannel::~PacketLengthCovertChannel | ( | ) |
Deletes the PacketLengthCovertChannel.
Deletes this instance of PacketLengthCovertChannel and frees all memory.
|
virtual |
Implements whisper_library::CovertChannel.
|
virtual |
Implements whisper_library::CovertChannel.
|
inlinevirtual |
No initialisation needed, empty function
Implements whisper_library::CovertChannel.
|
virtual |
Implements whisper_library::CovertChannel.
|
virtual |
Implements whisper_library::CovertChannel.
|
virtual |
Implements whisper_library::CovertChannel.
|
virtual |
Implements whisper_library::CovertChannel.
|
virtual |
interprets an udp packet
The given packet is interpreted as an udp packet and the length of the packet is used to reassemble the message.
udp_packet | the packet that gets interpreted |
Implements whisper_library::CovertChannel.
|
virtual |
sends a message
The message gets encoded as packet lengths and then udp packets with this lengths get send using the function passed in the constructor.
message | the message that is send |
Implements whisper_library::CovertChannel.
|
inline |
No arguments, empty function
void whisper_library::PacketLengthCovertChannel::setOutput | ( | function< void(std::string)> | output | ) |
sets the function used to output received messages
output | a function-pointer used to output messages |
|
virtual |
sets the function used to send packets
send | a function-pointer used to send packets |
Implements whisper_library::CovertChannel.