-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path0_get_CIC_from_labels.py
40 lines (32 loc) · 1.84 KB
/
0_get_CIC_from_labels.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#----------------------------------------------------------------------------------------
#
# CIC_labels.py
#
#
#
# Discription:
# Format CIC label files for subsequent use
#-----------------------------------------------------------------------------------------
import os
import sys
import pandas as pd
import warnings
import shutil
warnings.filterwarnings('ignore')
def main():
filepath = "./labels/"
labels = pd.read_csv(filepath + "Friday-WorkingHours-Afternoon-DDos.pcap_ISCX.csv", sep=',')
labels = labels.append( pd.read_csv(filepath + "Friday-WorkingHours-Afternoon-PortScan.pcap_ISCX.csv", sep=','), ignore_index=True)
labels = labels.append( pd.read_csv(filepath + "Friday-WorkingHours-Morning.pcap_ISCX.csv", sep=','), ignore_index=True)
labels.to_csv('./dataset/Friday-WorkingHours_CIC.csv', index=None, header=True)
#labels = pd.read_csv(filepath + "Monday-WorkingHours.pcap_ISCX.csv", sep=',')
shutil.copy(filepath + "Monday-WorkingHours.pcap_ISCX.csv", "./dataset/Monday-WorkingHours_CIC.csv")
labels = pd.read_csv(filepath + "Thursday-WorkingHours-Afternoon-Infilteration.pcap_ISCX.csv", sep=',')
labels = labels.append( pd.read_csv(filepath + "Thursday-WorkingHours-Morning-WebAttacks.pcap_ISCX.csv", sep=','), ignore_index=True)
labels.to_csv('./dataset/Thursday-WorkingHours_CIC.csv', index=None, header=True)
#labels = pd.read_csv(filepath + "Tuesday-WorkingHours.pcap_ISCX.csv", sep=',')
shutil.copy(filepath + "Tuesday-WorkingHours.pcap_ISCX.csv","./dataset/Tuesday-WorkingHours_CIC.csv")
#labels = pd.read_csv(filepath + "Wednesday-workingHours.pcap_ISCX.csv", sep=',')
shutil.copy(filepath + "Wednesday-WorkingHours.pcap_ISCX.csv","./dataset/Wednesday-WorkingHours_CIC.csv")
if __name__ == "__main__":
main()