ProxyChannel.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 &originIP, const std::string &targetIP, const std::string &targetPort, const std::string &ownMAC,
  23. const std::string &originMAC, const std::string &channelGatewayMAC, const std::string &gatewayMAC, const bool relayOnly);
  24. /**
  25. * Destroys the CovertChannel.
  26. */
  27. virtual ~ProxyChannel();
  28. protected:
  29. /**
  30. * Handler for sniffed packets filterd to forward from the outer network.
  31. *
  32. * Handles incoming packets and forwards them.
  33. *
  34. * @param pdu sniffed packet
  35. *
  36. * @return false = stop loop | true = continue loop
  37. */
  38. virtual bool handleChannelFromOuter(Tins::PDU &pdu);
  39. /**
  40. * Handler for sniffed packets filterd to forward from the inner network.
  41. *
  42. * Handles incoming packets and forwards them.
  43. *
  44. * @param pdu sniffed packet
  45. *
  46. * @return false = stop loop | true = continue loop
  47. */
  48. virtual bool handleChannelFromInner(Tins::PDU &pdu);
  49. /**
  50. * Handler for sniffed packets filterd to use as channel from the outer network.
  51. *
  52. * Handles incoming packets and redirets them.
  53. *
  54. * @param pdu sniffed packet
  55. *
  56. * @return false = stop loop | true = continue loop
  57. */
  58. virtual bool handlePartnerFromOuter(Tins::PDU &pdu);
  59. /**
  60. * Relay option which activates relay only mode
  61. */
  62. const bool relayOnly;
  63. const Tins::IPv4Address ownAddress;
  64. const Tins::IPv4Address partnerAddress;
  65. const Tins::IPv4Address originAddress;
  66. const Tins::IPv4Address targetAddress;
  67. const Tins::HWAddress<6> ownMAC;
  68. const Tins::HWAddress<6> channelGatewayMAC;
  69. const Tins::HWAddress<6> gatewayMAC;
  70. const Tins::HWAddress<6> originMAC;
  71. };
  72. #endif