#ifndef PROXYCHANNEL_H #define PROXYCHANNEL_H #include "CovertChannel.h" /** * @class ForwardChannel * * A CovertChannel which forwards the traffic it captures. */ class ProxyChannel : public CovertChannel { public: /** * Sets up a CovertChannel. * * Creates a CovertChannel, sets the network interfaces for sniffing and sending and sets the filter. * * @param innerInterface name of the interface of the inner network * @param outerInterface name of the interface of the outer network * @param filter pcap filter string which will be set for the channel sniffers and negated for the forward sniffers * @param relayOnly true - server only relays traffic | false - server redirects traffic over another relay */ ProxyChannel(const std::string &innerInterface, const std::string &outerInterface, const std::string &ownIP, const std::string &partnerIP, const std::string &originIP, const std::string &targetIP, const std::string &targetPort, const std::string &ownMAC, const std::string &originMAC, const std::string &channelGatewayMAC, const std::string &gatewayMAC, const bool relayOnly); /** * Destroys the CovertChannel. */ virtual ~ProxyChannel(); protected: /** * Handler for sniffed packets filterd to forward from the outer network. * * Handles incoming packets and forwards them. * * @param pdu sniffed packet * * @return false = stop loop | true = continue loop */ virtual bool handleChannelFromOuter(Tins::PDU &pdu); /** * Handler for sniffed packets filterd to forward from the inner network. * * Handles incoming packets and forwards them. * * @param pdu sniffed packet * * @return false = stop loop | true = continue loop */ virtual bool handleChannelFromInner(Tins::PDU &pdu); /** * Handler for sniffed packets filterd to use as channel from the outer network. * * Handles incoming packets and redirets them. * * @param pdu sniffed packet * * @return false = stop loop | true = continue loop */ virtual bool handlePartnerFromOuter(Tins::PDU &pdu); /** * Relay option which activates relay only mode */ const bool relayOnly; const Tins::IPv4Address ownAddress; const Tins::IPv4Address partnerAddress; const Tins::IPv4Address originAddress; const Tins::IPv4Address targetAddress; const Tins::HWAddress<6> ownMAC; const Tins::HWAddress<6> channelGatewayMAC; const Tins::HWAddress<6> gatewayMAC; const Tins::HWAddress<6> originMAC; }; #endif