// final String triggerTimesFile = path + "/2018-10/lifx-bulb/lifx-bulb-oct-18-2018.timestamps";
// final String deviceIp = "192.168.1.231"; // .246 == phone; .231 == Lifx
// November 1
- final String inputPcapFile = path + "/2018-10/lifx-bulb/lifx-bulb.wlan1.local.pcap";
- final String outputPcapFile = path + "/2018-10/lifx-bulb/lifx-bulb-processed.pcap";
- final String triggerTimesFile = path + "/2018-10/lifx-bulb/lifx-bulb-nov-1-2018.timestamps";
- final String deviceIp = "192.168.1.231"; // .246 == phone; .231 == Lifx
+// final String inputPcapFile = path + "/2018-10/lifx-bulb/lifx-bulb.wlan1.local.pcap";
+// final String outputPcapFile = path + "/2018-10/lifx-bulb/lifx-bulb-processed.pcap";
+// final String triggerTimesFile = path + "/2018-10/lifx-bulb/lifx-bulb-nov-1-2018.timestamps";
+// final String deviceIp = "192.168.1.231"; // .246 == phone; .231 == Lifx
// 10) Amcrest Camera August 9 experiment
// final String inputPcapFile = path + "/2018-08/amcrest-camera/amcrest-camera.wlan1.local.pcap";
// final String inputPcapFile = path + "/2018-08/blossom/blossom.wlan1.local.pcap";
// final String outputPcapFile = path + "/2018-08/blossom/blossom-processed.pcap";
// final String triggerTimesFile = path + "/2018-08/blossom/blossom-aug-13-2018.timestamps";
+// final String deviceIp = "192.168.1.229"; // .246 == phone; .229 == sprinkler
+ // 2 November
+// final String inputPcapFile = path + "/2018-10/blossom-sprinkler/blossom-sprinkler.wlan1.local.pcap";
+// final String outputPcapFile = path + "/2018-10/blossom-sprinkler/blossom-sprinkler-processed.pcap";
+// final String triggerTimesFile = path + "/2018-10/blossom-sprinkler/blossom-sprinkler-nov-2-2018.timestamps";
// final String deviceIp = "192.168.1.229"; // .246 == phone; .229 == sprinkler
// // 13) DLink siren August 14 experiment
// final String deviceIp = "192.168.1.246"; // .246 == phone; .183 == siren
// 14) Nest thermostat August 15 experiment
-// final String inputPcapFile = path + "/2018-08/nest/nest.wlan1.local.pcap";
-// final String outputPcapFile = path + "/2018-08/nest/nest-processed.pcap";
-// final String triggerTimesFile = path + "/2018-08/nest/nest-aug-15-2018.timestamps";
-// final String deviceIp = "192.168.1.246"; // .246 == phone; .127 == Nest thermostat
+ final String inputPcapFile = path + "/2018-08/nest/nest.wlan1.local.pcap";
+ final String outputPcapFile = path + "/2018-08/nest/nest-processed.pcap";
+ final String triggerTimesFile = path + "/2018-08/nest/nest-aug-15-2018.timestamps";
+ final String deviceIp = "192.168.1.246"; // .246 == phone; .127 == Nest thermostat
// 15) Alexa August 16 experiment
// final String inputPcapFile = path + "/2018-08/alexa/alexa.wlan1.local.pcap";
// TODO: Merging test
ppListOfListListOff = PcapPacketUtils.mergeSignatures(ppListOfListListOff, sortedAllConversation);
ppListOfListListOff = PcapPacketUtils.sortSignatures(ppListOfListListOff);
+ // TODO: Need to remove sequence number 1 for Nest Thermostat since it is not a good signature!
+ PcapPacketUtils.removeSequenceFromSignature(ppListOfListListOff, 1);
PcapPacketUtils.printSignatures(ppListOfListListOff);
//count = 0;
/*for (List<List<PcapPacket>> ll : ppListOfListListOff) {
File fileOnEvents = new File(onPairsPath);
PrintWriter pwOn = null;
try {
-
-
pwOn = new PrintWriter(fileOnEvents);
} catch(Exception ex) {
ex.printStackTrace();
// Skip empty conversations.
continue;
}
- // TODO: DEBUG!!!
- /*List<PcapPacket> listPP = c.getPackets();
- if(listPP.size() > 1000) {
- for (PcapPacket pp : listPP) {
- if (pp.length() == 639) {
- boolean test = c.isTls();
- System.out.println("Sequence has 639! " + test);
- }
- }
- }*/
for (List<PcapPacket> signatureSequence : mCluster) {
if (isTlsSequence(signatureSequence) != c.isTls()) {
// We consider it a mismatch if one is a TLS application data sequence and the other is not.
// final String onSignatureFile = path + "/2018-08/dlink-siren/onSignature-DLink-Siren-phone.sig";
// final String offSignatureFile = path + "/2018-08/dlink-siren/offSignature-DLink-Siren-phone.sig";
+ /*
// Kwikset Doorlock Sep 12 experiment
// final String inputPcapFile = path + "/evaluation/kwikset-doorlock/kwikset-doorlock.data.wlan1.pcap";
final String inputPcapFile = path + "/evaluation/kwikset-doorlock/kwikset-doorlock.data.eth0.pcap";
// // Kwikset Doorlock PHONE signatures
final String onSignatureFile = path + "/2018-08/kwikset-doorlock/onSignature-Kwikset-Doorlock-phone-new.sig";
final String offSignatureFile = path + "/2018-08/kwikset-doorlock/offSignature-Kwikset-Doorlock-phone-new.sig";
+ */
// D-Link Plug experiment
//final String inputPcapFile = path + "/evaluation/dlink/dlink-plug.data.wlan1.pcap";
// D-Link Plug experiment
final String inputPcapFile = path + "/training/dlink-plug/wlan1/dlink-plug.wlan1.local.pcap";
// D-Link Plug DEVICE signatures
- final String onSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-onSignature-device-side.sig";
- final String offSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-offSignature-device-side.sig";
+ //final String onSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-onSignature-device-side.sig";
+ //final String offSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-offSignature-device-side.sig";
// D-Link Plug PHONE signatures
- //final String onSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-onSignature-phone-side.sig";
- //final String offSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-offSignature-phone-side.sig";
+ final String onSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-onSignature-phone-side.sig";
+ final String offSignatureFile = path + "/training/dlink-plug/signatures/dlink-plug-offSignature-phone-side.sig";
*/
/*
/*
// Blossom Sprinkler experiment
- final String inputPcapFile = path + "/training/blossom-sprinkler/wlan1/blossom-sprinkler.wlan1.local.pcap";
+ //final String inputPcapFile = path + "/training/blossom-sprinkler/wlan1/blossom-sprinkler.wlan1.local.pcap";
+ final String inputPcapFile = path + "/training/blossom-sprinkler/eth0/blossom-sprinkler.eth0.local.pcap";
// Blossom Sprinkler DEVICE signatures
final String onSignatureFile = path + "/training/blossom-sprinkler/signatures/blossom-sprinkler-onSignature-device-side.sig";
final String offSignatureFile = path + "/training/blossom-sprinkler/signatures/blossom-sprinkler-offSignature-device-side.sig";
*/
-
- /*
// Nest Thermostat experiment
final String inputPcapFile = path + "/training/nest-thermostat/wlan1/nest-thermostat.wlan1.local.pcap";
// Nest Thermostat DEVICE signatures
// Nest Thermostat PHONE signatures
final String onSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-onSignature-phone-side.sig";
final String offSignatureFile = path + "/training/nest-thermostat/signatures/nest-thermostat-offSignature-phone-side.sig";
- */
/*
// Hue Bulb experiment
final String offSignatureFile = path + "/training/wemo-insight-plug/signatures/wemo-insight-plug-offSignature-device-side.sig";
*/
- /*
+
// Kwikset Doorlock Sep 12 experiment
- final String inputPcapFile = path + "/2018-08/kwikset-doorlock/kwikset3.wlan1.local.pcap";
- // Kwikset Doorlock PHONE signatures
- final String onSignatureFile = path + "/2018-08/kwikset-doorlock/onSignature-Kwikset-Doorlock-phone.sig";
- final String offSignatureFile = path + "/2018-08/kwikset-doorlock/offSignature-Kwikset-Doorlock-phone.sig";
- */
+// final String inputPcapFile = path + "/2018-08/kwikset-doorlock/kwikset3.wlan1.local.pcap";
+// // Kwikset Doorlock PHONE signatures
+// final String onSignatureFile = path + "/2018-08/kwikset-doorlock/onSignature-Kwikset-Doorlock-phone.sig";
+// final String offSignatureFile = path + "/2018-08/kwikset-doorlock/offSignature-Kwikset-Doorlock-phone.sig";
+
/*
// D-Link Siren experiment
List<List<List<PcapPacket>>> offSignature = PrintUtils.deserializeSignatureFromFile(offSignatureFile);
// LAN
-// SignatureDetector onDetector = new SignatureDetector(onSignature, null);
-// SignatureDetector offDetector = new SignatureDetector(offSignature, null);
+ SignatureDetector onDetector = new SignatureDetector(onSignature, null);
+ SignatureDetector offDetector = new SignatureDetector(offSignature, null);
// WAN
- SignatureDetector onDetector = new SignatureDetector(onSignature, "128.195.205.105");
- SignatureDetector offDetector = new SignatureDetector(offSignature, "128.195.205.105");
+// SignatureDetector onDetector = new SignatureDetector(onSignature, "128.195.205.105");
+// SignatureDetector offDetector = new SignatureDetector(offSignature, "128.195.205.105");
final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).
withLocale(Locale.US).withZone(ZoneId.of("America/Los_Angeles"));
public static void printSignatures(List<List<List<PcapPacket>>> signatures) {
// Iterate over the list of all clusters/sequences
- int sequenceCounter = 1;
+ int sequenceCounter = 0;
for(List<List<PcapPacket>> listListPcapPacket : signatures) {
// Iterate over every member of a cluster/sequence
System.out.print("====== SEQUENCE " + sequenceCounter++);
}
}
}
+
+ /**
+ * Remove a sequence in a signature object.
+ *
+ * @param signatures A {@link List} of {@link List} of {@link List} of
+ * {@link PcapPacket} objects.
+ * @param sequenceIndex An index for a sequence that consists of {{@link List} of {@link List} of
+ * {@link PcapPacket} objects.
+ */
+ public static void removeSequenceFromSignature(List<List<List<PcapPacket>>> signatures, int sequenceIndex) {
+
+ // Sequence index starts from 0
+ signatures.remove(sequenceIndex);
+ }
}
#fileExperiment = "blossom-sprinkler-aug-13-2018.timestamps"
#fileDetection = "detection-on-training-device-side"
# Nest thermostat
-#device = "nest-thermostat/self-test"
-#fileExperiment = "nest-aug-15-2018.timestamps"
-#fileDetection = "detection-on-training-phone-side"
+device = "nest-thermostat/self-test"
+fileExperiment = "nest-aug-15-2018.timestamps"
+fileDetection = "detection-on-training-phone-side"
# Hue bulb
#device = "hue-bulb/self-test"
#fileExperiment = "hue-bulb-aug-7-2018.timestamps"
#fileExperiment = "tplink-bulb-aug-3-2018.timestamps"
#fileDetection = "detection-on-training-phone-side"
# WeMo Insight Plug
-device = "wemo-insight-plug/self-test"
-fileExperiment = "wemo-insight-july-31-2018.timestamps"
-fileDetection = "detection-on-training-device-side"
+#device = "wemo-insight-plug/self-test"
+#fileExperiment = "wemo-insight-july-31-2018.timestamps"
+#fileDetection = "detection-on-training-device-side"
TIME_WINDOW = 15 # detection/signature window of 15 seconds
#NEG_TIME_WINDOW = -15 # detection/signature window of 15 seconds