소스 검색

Changed JSON format to contain attack type
Changed Src and Dst in JSON format

qam 10 년 전
부모
커밋
f73b062c52
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/de/tudarmstadt/informatik/hostage/logging/Record.java

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/logging/Record.java

@@ -237,7 +237,7 @@ public class Record implements Serializable {
 		switch (format){
 		switch (format){
 			// TraCINg Upload format, replaces internal ip's with external ip of network
 			// TraCINg Upload format, replaces internal ip's with external ip of network
 			case 1: 
 			case 1: 
-				return String.format("{ \"sensor\":{\"type\": \"Honeypot\", \"name\": \"HOsTaGe\"}, \"type\": 0, \"src\":{\"ip\": \"%s\", \"port\": %d}, \"dst\":{\"ip\": \"%s\", \"port\": %d} }", externalIP, localPort, externalIP, remotePort);
+				return String.format("{ \"sensor\":{\"type\": \"Honeypot\", \"name\": \"HOsTaGe\"}, \"type\": \"%s\", \"src\":{\"ip\": \"%s\", \"port\": %d}, \"dst\":{\"ip\": \"%s\", \"port\": %d} }", protocol + " server access", externalIP, remotePort, externalIP, localPort);
 			// ViewLogTable format: contains all important information about an attack.
 			// ViewLogTable format: contains all important information about an attack.
 			case 2: 
 			case 2: 
 				return String.format("%d: %s\nIn %s\n(%s)\nFrom [%s:%d]\nTo [%s:%d]\nMessage: %s\n", attack_id, protocol, SSID, BSSID, remoteIP.getHostAddress(), remotePort, localIP.getHostAddress(), localPort, packet);
 				return String.format("%d: %s\nIn %s\n(%s)\nFrom [%s:%d]\nTo [%s:%d]\nMessage: %s\n", attack_id, protocol, SSID, BSSID, remoteIP.getHostAddress(), remotePort, localIP.getHostAddress(), localPort, packet);