|
@@ -12,7 +12,7 @@
|
|
* forward the packets to an analyzer or modifyer so we can hide data in the
|
|
* forward the packets to an analyzer or modifyer so we can hide data in the
|
|
* traffic.
|
|
* traffic.
|
|
*/
|
|
*/
|
|
-class Sniffer {
|
|
|
|
|
|
+class CovertChannel {
|
|
public:
|
|
public:
|
|
/**
|
|
/**
|
|
* Creates a Sniffer.
|
|
* Creates a Sniffer.
|
|
@@ -21,14 +21,14 @@ public:
|
|
*
|
|
*
|
|
* @param interface name of the interface for sniffing
|
|
* @param interface name of the interface for sniffing
|
|
*/
|
|
*/
|
|
- Sniffer(const std::string &interfaceName);
|
|
|
|
|
|
+ CovertChannel(const std::string &innerInterface, const std::string &outerInterface);
|
|
|
|
|
|
/**
|
|
/**
|
|
* Destroys the Sniffer.
|
|
* Destroys the Sniffer.
|
|
*
|
|
*
|
|
* Destructor of the Sniffer.
|
|
* Destructor of the Sniffer.
|
|
*/
|
|
*/
|
|
- ~Sniffer();
|
|
|
|
|
|
+ virtual ~CovertChannel();
|
|
|
|
|
|
/**
|
|
/**
|
|
* Start sniffing on the interface.
|
|
* Start sniffing on the interface.
|
|
@@ -48,7 +48,7 @@ public:
|
|
*/
|
|
*/
|
|
void setFilter(const std::string &filterString);
|
|
void setFilter(const std::string &filterString);
|
|
|
|
|
|
-private:
|
|
|
|
|
|
+protected:
|
|
/**
|
|
/**
|
|
* Handler for sniffed packets.
|
|
* Handler for sniffed packets.
|
|
*
|
|
*
|
|
@@ -59,12 +59,23 @@ private:
|
|
*
|
|
*
|
|
* @return false = stop loop | true = continue loop
|
|
* @return false = stop loop | true = continue loop
|
|
*/
|
|
*/
|
|
- bool handle(Tins::PDU &pdu);
|
|
|
|
|
|
+ // bool handle(Tins::PDU &pdu);
|
|
|
|
+
|
|
|
|
+ bool handleForwardToInner(Tins::PDU &pdu);
|
|
|
|
+ bool handleForwardToOuter(Tins::PDU &pdu);
|
|
|
|
+ virtual bool handleRedirectToInner(Tins::PDU &pdu) = 0;
|
|
|
|
+ virtual bool handleRedirectToOuter(Tins::PDU &pdu) = 0;
|
|
|
|
+
|
|
|
|
+ void startInnerSniffing();
|
|
|
|
+ void startOuterSniffing();
|
|
|
|
|
|
/**
|
|
/**
|
|
* Tins sniffer object.
|
|
* Tins sniffer object.
|
|
*/
|
|
*/
|
|
- Tins::Sniffer *sniffer;
|
|
|
|
|
|
+ Tins::Sniffer *innerSniffer;
|
|
|
|
+ Tins::Sniffer *outerSniffer;
|
|
|
|
+ Tins::PacketSender innerSender;
|
|
|
|
+ Tins::PacketSender outerSender;
|
|
};
|
|
};
|
|
|
|
|
|
#endif
|
|
#endif
|