Selaa lähdekoodia

Server config settings

Jonas Pflanzer 4 vuotta sitten
vanhempi
commit
479e256ab7
2 muutettua tiedostoa jossa 24 lisäystä ja 14 poistoa
  1. 13 7
      daemon/Daemon-Config-Reference.md
  2. 11 7
      daemon/src/main.cpp

+ 13 - 7
daemon/Daemon-Config-Reference.md

@@ -1,17 +1,23 @@
 # Daemon configuration
 
 The daemon is configurable by config.txt.
-This file must be in the same directory as the binary.
+This file must be in the same directory from where you run the binary.
 
 ### Configuration Values
-`port` : The port where the server listens. Must be a valid port.
-`interface` : The sniffer interface you want to use.
-`userdatabase` : The file where userdata is stored in format: user;password
-
+`port`: The port where the server listens. Must be a valid port.<br/>
+`userdatabase`: The file where userdata is stored in format: user;password<br/>
+`filedirectory`: The file directory where the received files will be store. (Folder must exist!!!)<br/>
+`activateCovertChannel`: Set to true to activate covert channel. Won't initialize sniffers and senders if set to false<br/>
+`innerInterface`: The interface of your inner network<br/>
+`outerInterface`: The interface of your outer network<br/>
+`filter`: pcap filter string to set the filter for the covert channel<br/>
 ### Example for config.txt
 ```
 port=1234
-interface=lo
-userdatabase=user Storage.txt
+userdatabase=userStorage.txt
 filedirectory=./files/
+activateCovertChannel=true
+innerInterface=eth0
+outerInterface=eth1
+filter=host 8.8.8.8 and port 443
 ```

+ 11 - 7
daemon/src/main.cpp

@@ -15,17 +15,18 @@ int main(int argc, char *argv[]) {
 		exit(EXIT_FAILURE);
 	}
 
-	const string innerInterface = Config::getValue("innerInterface");
-	const string outerInterface = Config::getValue("outerInterface");
-	const string filter = Config::getValue("filter");
+	CovertChannel *covertchannel = nullptr;
+	if (Config::getValue("activateCovertChannel") == "true") {
+		const string innerInterface = Config::getValue("innerInterface");
+		const string outerInterface = Config::getValue("outerInterface");
+		const string filter = Config::getValue("filter");
+		covertchannel = new ForwardChannel(innerInterface, outerInterface, filter);
+	}
 
 	// check if userStorage is add specified location
 	// if not create one
 	UserManager::init(Config::getValue("userdatabase"));
 
-	CovertChannel *covertchannel = new ForwardChannel(innerInterface, outerInterface, filter);
-	covertchannel->startSniffing();
-
 	try {
 		io_service io_service;
 		Server server(io_service);
@@ -34,6 +35,9 @@ int main(int argc, char *argv[]) {
 		cerr << e.what() << endl;
 	}
 
-	delete (covertchannel);
+	if (covertchannel == nullptr) {
+		delete (covertchannel);
+	}
+
 	return 0;
 }