Whisper Library
|
A covert channel using inter packet delays. More...
Public Member Functions | |
TimingCovertChannel (function< void(string)> output, function< void(GenericPacket)> send) | |
Constructor. More... | |
~TimingCovertChannel () | |
CovertChannel * | instance () |
void | sendMessage (string message) |
void | receivePacket (GenericPacket &packet) |
void | setArguments (string arguments) |
Gives arguments to the channel to configure the delays. More... | |
void | initialize () |
void | setOutput (function< void(string)> output) |
sets the output method More... | |
void | setSend (function< void(GenericPacket)> send) |
sets the methode used to send packets | |
string | name () const |
Returns a string with the name of the covert channel "Timing Covert Channel". | |
string | info () const |
Returns a string with basic information about the timing covert channel. | |
string | protocol () const |
Returns the protocol used by this covert channel (udp) | |
unsigned short | port () const |
Returns the used port (23) | |
string | id () const |
![]() | |
CovertChannel () | |
Creates a CovertChannel. | |
virtual | ~CovertChannel () |
Destructor. More... | |
virtual void | sendMessage (std::string message)=0 |
sends a message More... | |
Private Member Functions | |
void | calculateTresholds () |
void | startTimeoutTimer () |
void | sendDelays (vector< unsigned int > delays) |
Private Attributes | |
MorseCoder * | m_coder |
MorseCoder is used to encode messages as morse. | |
function< void(string)> | m_output |
callback function pointer that is used to return received messages as a string | |
function< void(GenericPacket)> | m_send |
function pointer that is used to send Udp Packets via the socket | |
chrono::time_point < chrono::system_clock > | m_receive_start |
Marks the time the last packet was received to measure inter-packet delays. | |
chrono::time_point < chrono::system_clock > | m_timeout_end |
Marks the time point at which the timeout ends. It is increased each time a packet is received. | |
atomic< bool > | m_timeout_changed |
signals 'startTimeoutTimer' that the timeout end point has changed. | |
vector< unsigned int > | m_received_delays |
stores the measured delays | |
atomic< bool > | m_receiving |
indicates, if the channel is currently receiving a message | |
unsigned int | m_timeout |
timeout in milliseconds after the last received message until the delays are interpreted | |
unsigned int | m_delay_short |
delay_short is used to encode a short signal (in milliseconds) | |
unsigned int | m_threshold_delay_short |
threshold between short and long delays | |
unsigned int | m_delay_long |
delay_long is used to encode a long signal (in milliseconds) | |
unsigned int | m_threshold_delay_long |
threshold between long and letter delays | |
unsigned int | m_delay_letter |
delay_letter is used to encode the end of a letter (in milliseconds) | |
unsigned int | m_threshold_delay_letter |
threshold between letter and space delays | |
unsigned int | m_delay_space |
delay_space is used to encode space between words (in milliseconds) | |
mutex | m_mutex_sending |
mutex to prevent different threads from sending simultaneously | |
A covert channel using inter packet delays.
The TimingCovertChannel implements a covert channel, that uses inter-packet delays to transmit morse. The receiver measures the delays between incoming packets to decode the message. To use the channel, call 'sendMessage' with your message as a string. Received packets are given to 'receiveMessage' which returns the decoded message after a timeout to the callback function m_output.
|
inline |
Constructor.
output | function pointer that is called, when a complete message arrived. Its parameter is this message. |
send | function pointer that is called to send a UdpPacket via the socket. |
whisper_library::TimingCovertChannel::~TimingCovertChannel | ( | ) |
Destructor
|
private |
Calcules thresholds between the different intervals to compensate for transmitting delays.
|
virtual |
Implements whisper_library::CovertChannel.
|
inlinevirtual |
No initialisation needed, empty function
Implements whisper_library::CovertChannel.
|
virtual |
Implements whisper_library::CovertChannel.
|
virtual |
Has to be called when a packet is received, with the packet as the argument. After a timeout the callback m_output is called with the received message.
packet | packet that was received on network |
Implements whisper_library::CovertChannel.
|
private |
Sends Udp packets using m_send with inter-packet delays given as the argument.
void whisper_library::TimingCovertChannel::sendMessage | ( | string | message | ) |
Sends a message using the timing channel.
message | Message that is send |
|
virtual |
Gives arguments to the channel to configure the delays.
Available arguments: -set_timings [short] [long] [letter] [space] [short] [long] [letter] [space] are the delays used for morse encoding in milliseconds
arguments | string that is parsed for channel arguments |
Implements whisper_library::CovertChannel.
|
virtual |
sets the output method
output | the method the covert channel uses to output the received messages |
Implements whisper_library::CovertChannel.
|
private |
Starts the timeout. If m_timeout_changed is false and m_timeout_end is in the past, it calls the callback function m_output.