ProxyChannel.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef PROXYCHANNEL_H
  2. #define PROXYCHANNEL_H
  3. #include "CovertChannel.h"
  4. /**
  5. * @class ForwardChannel
  6. *
  7. * A CovertChannel which forwards the traffic it captures.
  8. */
  9. class ProxyChannel : public CovertChannel {
  10. public:
  11. /**
  12. * Sets up a CovertChannel.
  13. *
  14. * Creates a CovertChannel, sets the network interfaces for sniffing and sending and sets the filter.
  15. *
  16. * @param innerInterface name of the interface of the inner network
  17. * @param outerInterface name of the interface of the outer network
  18. * @param filter pcap filter string which will be set for the channel sniffers and negated for the forward sniffers
  19. * @param relayOnly true - server only relays traffic | false - server redirects traffic over another relay
  20. */
  21. ProxyChannel(const std::string &innerInterface, const std::string &outerInterface, const std::string &ownIP, const std::string &partnerIP,
  22. const std::string &filterIP, const std::string &filterPort, const bool relayOnly);
  23. /**
  24. * Destroys the CovertChannel.
  25. */
  26. virtual ~ProxyChannel();
  27. protected:
  28. /**
  29. * Handler for sniffed packets filterd to forward from the outer network.
  30. *
  31. * Handles incoming packets and forwards them.
  32. *
  33. * @param pdu sniffed packet
  34. *
  35. * @return false = stop loop | true = continue loop
  36. */
  37. virtual bool handleChannelFromOuter(Tins::PDU &pdu);
  38. /**
  39. * Handler for sniffed packets filterd to forward from the inner network.
  40. *
  41. * Handles incoming packets and forwards them.
  42. *
  43. * @param pdu sniffed packet
  44. *
  45. * @return false = stop loop | true = continue loop
  46. */
  47. virtual bool handleChannelFromInner(Tins::PDU &pdu);
  48. /**
  49. * Handler for sniffed packets filterd to use as channel from the outer network.
  50. *
  51. * Handles incoming packets and redirets them.
  52. *
  53. * @param pdu sniffed packet
  54. *
  55. * @return false = stop loop | true = continue loop
  56. */
  57. virtual bool handlePartnerFromOuter(Tins::PDU &pdu);
  58. /**
  59. * Relay option which activates relay only mode
  60. */
  61. const bool relayOnly;
  62. const Tins::IPv4Address ownAddress;
  63. const Tins::IPv4Address partnerAddress;
  64. const Tins::IPv4Address filterAddress;
  65. };
  66. #endif