Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bobolike123/NetworkTrafficAnalysis
/ functions
Functions
182 in github.com/bobolike123/NetworkTrafficAnalysis
⨍
Functions
182
◇
Types & classes
17
↓ 4 callers
Function
process_each_flow
:param pcapflow_path:文件流路径 :param method: str类,传入的pcap_flow文件属于'Normal', 'BFSSH', 'Infilt', 'HttpDoS','DDoS'中的哪种 :return:
preprocess/processPcap(abandon).py:28
↓ 3 callers
Method
createTrainLabels
(self, train_sample_distribution)
Classification.py:237
↓ 3 callers
Method
createValidationLabels
(self, validation_sample_distribution)
Classification.py:244
↓ 3 callers
Function
readFilenameList
(path)
tools/copyRandomSample.py:12
↓ 3 callers
Function
readFilenameList
(path)
tools/divideTrainAndValidationSet.py:5
↓ 3 callers
Method
save_bottleneck_features
(self, nb_train_samples, nb_validation_samples)
Classification.py:63
↓ 3 callers
Method
train_top_model
(self, trainlabels_nparray, validationlabels_nparray)
Classification.py:95
↓ 2 callers
Function
cal_perplexity
计算perplexity, D是距离向量, idx指dist中自己与自己距离的位置,beta是高斯分布参数 这里的perp仅计算了熵,方便计算
tools/TSNE_visual.py:17
↓ 2 callers
Method
dataset
写一个读取序列的生成器 batch_size:批量大小
tools/sequenceDatasetGenerator.py:71
↓ 2 callers
Function
dataset_generator2
不带OHE :param packets: :param labels: :param indices: :param batch_size: :return:
CICIDS2017_6class.py:96
↓ 2 callers
Function
dataset_generator2
不带OHE :param packets: :param labels: :param indices: :param batch_size: :return:
USTC-TFC2016_20class.py:96
↓ 2 callers
Function
dataset_generator2
不带OHE :param packets: :param labels: :param indices: :param batch_size: :return:
ISCX2012_LSTM_5class.py:95
↓ 2 callers
Function
dealwithresult
preprocess/ex_findPcap2category.py:13
↓ 2 callers
Function
draw_CM_2
第二种风格的CM图 :return:
ModelPredict.py:246
↓ 2 callers
Method
model_CICIDS
(self)
model/hybrid_model.py:58
↓ 2 callers
Method
model_LSTM
(self)
model/hybrid_model.py:78
↓ 2 callers
Method
model_USTC
(self)
model/hybrid_model.py:38
↓ 2 callers
Function
readCount
(filename='count.log')
log/logger.py:14
↓ 2 callers
Method
run
(self)
tools/divideTrainAndValidationSet.py:40
↓ 2 callers
Function
writeCount
:param tunple: tunple = (time_cost,losses,val_losses,acc,val_acc) :param filename: the file you want to save logger ,default:count.log
log/logger.py:62
↓ 1 callers
Function
FLNet
()
model/FLNet_model.py:7
↓ 1 callers
Function
HwangLSTM
()
model/LSTM_model.py:13
↓ 1 callers
Function
_check_data2save
这个程序有个bug是如果某个类别的流量包数刚好小于等于NUM_PER_CATEGORY 时,该类别的pkl结果不会被保存,因此在退出该类别的处理 之前要进行一个检查,保存剩余的数据 但是还有一个bug就是假设Train:Valid:Test=8:1:1 NUM_PER
preprocess/6_createInputData.py:167
↓ 1 callers
Method
binarize
(self, x, sz=256)
tools/sequenceDatasetGenerator.py:68
↓ 1 callers
Function
cal_pairwise_dist
计算pairwise 距离, x是matrix (a-b)^2 = a^w + b^2 - 2*a*b
tools/TSNE_visual.py:8
↓ 1 callers
Function
cal_ratio
()
testcode/useForTest.py:9
↓ 1 callers
Function
callbacks_method
:param K: K-fold number :return:
CICIDS2017_6class.py:161
↓ 1 callers
Function
callbacks_method
(K)
USTC-TFC2016_20class.py:162
↓ 1 callers
Function
callbacks_method
(K)
ISCX2012_LSTM_5class.py:159
↓ 1 callers
Method
checkDataNumber
(self, trainNum, validationNum)
Classification.py:251
↓ 1 callers
Method
checkFileisExist
(self)
tools/pickSmallDataset.py:60
↓ 1 callers
Method
checkFileisExist
(self)
tools/copyRandomSample.py:43
↓ 1 callers
Method
checkFileisExist
(self)
tools/divideTrainAndValidationSet.py:50
↓ 1 callers
Method
checkFileisExist
(self)
preprocess/5_clusteringPcap.py:70
↓ 1 callers
Function
check_dataset
(dataset_path)
preprocess/4_processPcap.py:117
↓ 1 callers
Function
check_dir
(path)
preprocess/4_processPcap.py:126
↓ 1 callers
Function
choose_label_name
(model_name)
ModelPredict.py:302
↓ 1 callers
Function
complement_minor
解析混淆矩阵,返回TN,TP,FP,FN四元列表 :param matrix: :return:
ModelPredict.py:154
↓ 1 callers
Method
copyFile
(self)
tools/pickSmallDataset.py:85
↓ 1 callers
Method
copyFile
(self)
tools/copyRandomSample.py:52
↓ 1 callers
Method
createNewFiles
(self)
tools/pickSmallDataset.py:41
↓ 1 callers
Method
createNewFiles
(self)
tools/copyRandomSample.py:25
↓ 1 callers
Method
createNewFiles
(self)
tools/divideTrainAndValidationSet.py:26
↓ 1 callers
Method
createNewFiles
(self)
preprocess/5_clusteringPcap.py:51
↓ 1 callers
Function
create_dataset
主函数 因为模型训练代码有把原始数据集分成train和validation了,因此这里我们只分成train_validation和test两个数据集 :param train_ratio: :param validation_ratio: :par
preprocess/6_createInputData.py:47
↓ 1 callers
Function
dealwithresult
Step 1 :导入outputResult中的文件名 Step 2 :用shutil.move将Step1 中对应的文件移至新的文件夹 :return:
preprocess/3_findPcap.py:36
↓ 1 callers
Function
del_all_pkl
()
preprocess/6_createInputData.py:41
↓ 1 callers
Function
del_end_file_by_time
(root_path)
tools/removeFile.py:3
↓ 1 callers
Method
drawPicture
(self, train_log)
Classification.py:155
↓ 1 callers
Function
findpcapname
查找configuration中的字典XML2PCAP,找到XML文件对应的PCAP名 :param logName: :return: 对应的PCAP名
preprocess/3_findPcap.py:84
↓ 1 callers
Function
getMatrixfrom_pcap
(filename,width)
tools/Session2png.py:18
↓ 1 callers
Function
get_current_index
()
preprocess/4_processPcap.py:30
↓ 1 callers
Method
get_data
(self)
tools/sequenceDatasetGenerator.py:17
↓ 1 callers
Method
get_floder_name
(self, index)
tools/pickSmallDataset.py:69
↓ 1 callers
Function
get_lable_pcappath
:param dir_path:分好类的文件夹所在的父目录 :return:
preprocess/4_processPcap.py:54
↓ 1 callers
Function
get_lable_pcappath
:param dir_path:分好类的文件夹所在的父目录 :return:
preprocess/readPcapFile.py:41
↓ 1 callers
Function
get_result_cm
:param confuse_matrix: :return:
ModelPredict.py:103
↓ 1 callers
Function
glob_and_move
(dir_path, fname_tuple,classname)
preprocess/ex_findPcap2category.py:69
↓ 1 callers
Function
glob_goal_pcap
(fpath,filename)
tools/findSpecificPcap.py:16
↓ 1 callers
Function
ip_defination
(class_name)
preprocess/ex_findPcap2category.py:42
↓ 1 callers
Function
is_dir_exist
(dir_path)
preprocess/processPcap(abandon).py:22
↓ 1 callers
Function
load_data
(root_path)
CICIDS2017_6class.py:30
↓ 1 callers
Function
load_data
(root_path)
USTC-TFC2016_20class.py:30
↓ 1 callers
Function
load_data
(root_path)
ISCX2012_LSTM_5class.py:29
↓ 1 callers
Function
load_data_p
仅供predict时load data用 :return:
ModelPredict.py:35
↓ 1 callers
Function
mkdir_p
(path)
tools/Session2png.py:29
↓ 1 callers
Function
mkdir_p
(path)
preprocess/ex_findPcap2category.py:89
↓ 1 callers
Function
mkdir_p
(path)
preprocess/3_findPcap.py:74
↓ 1 callers
Method
model
(self)
model/CNN_model.py:45
↓ 1 callers
Method
model
(self)
model/hybrid_model.py:17
↓ 1 callers
Function
model_predictor
主函数 :param weight_path: :param test_data_path: :param model_name: :param isChinese: 是否以中文语言输出图片,默认为否(英文输出) :return:
ModelPredict.py:338
↓ 1 callers
Function
model_structure
(name_of_model)
ModelPredict.py:69
↓ 1 callers
Function
model_structure
()
CICIDS2017_6class.py:142
↓ 1 callers
Function
model_structure
()
USTC-TFC2016_20class.py:143
↓ 1 callers
Function
model_structure
()
ISCX2012_LSTM_5class.py:140
↓ 1 callers
Method
model_structure
(self)
Classification.py:35
↓ 1 callers
Method
moveFile
(self)
tools/divideTrainAndValidationSet.py:59
↓ 1 callers
Method
moveFile
(self)
preprocess/5_clusteringPcap.py:95
↓ 1 callers
Function
move_goal_pcap
(flist,newDirName)
tools/findSpecificPcap.py:21
↓ 1 callers
Function
oneDNet
()
model/CNN_model.py:21
↓ 1 callers
Function
packetDataLen
(byte_stream)
preprocess/processPcap(abandon).py:110
↓ 1 callers
Function
parse_pcap
(pcap_file_path, label)
preprocess/4_processPcap.py:71
↓ 1 callers
Function
parse_pcap
解析pcap,如果解析的数量达到NUM_PER_CAEGORY,则中止解析,返回flag=False 注意,这里的raw(pcapfile[index])没有截断,保留了数据完整,后续处理起来更灵活 :param pcap_file_path: :para
preprocess/6_createInputData.py:96
↓ 1 callers
Function
parselog
(currentLogName)
preprocess/3_findPcap.py:20
↓ 1 callers
Function
pca
PCA算法 使用PCA先进行预降维
tools/TSNE_visual.py:79
↓ 1 callers
Function
process_ip
(ip_list)
preprocess/ex_findPcap2category.py:28
↓ 1 callers
Function
processdatadict
(dict, pcapname)
preprocess/3_findPcap.py:64
↓ 1 callers
Function
readFilenameList
(path)
tools/pickSmallDataset.py:16
↓ 1 callers
Function
readFilenameList
(path)
preprocess/5_clusteringPcap.py:24
↓ 1 callers
Method
readTotalFileNum
(self)
Classification.py:208
↓ 1 callers
Function
reset_current_index
()
preprocess/4_processPcap.py:46
↓ 1 callers
Function
run
(dataset_path)
CICIDS2017_6class.py:195
↓ 1 callers
Function
run
(dataset_path)
USTC-TFC2016_20class.py:192
↓ 1 callers
Function
run
(dataset_path,weight_path=None)
ISCX2012_LSTM_5class.py:191
↓ 1 callers
Function
run
()
tools/findSpecificPcap.py:29
↓ 1 callers
Function
run
(root_path)
preprocess/4_processPcap.py:102
↓ 1 callers
Function
run
遍历文件夹,得到文件夹下所有文件的路径,然后执行process_each_flow(),提取每个pcap下每个packet的特征并保存 用vthread.thread试一下多线程效果 :param source_pcapflow_path: :retur
preprocess/processPcap(abandon).py:72
↓ 1 callers
Function
run
如出现 SAXParseException: xxxxx not well-formed (invalid token) 字样说明SML内存在非法字符,使用XMLfilter.py将相应 XML文件过滤 :return:
preprocess/1_XMLParser.py:158
↓ 1 callers
Function
run
()
preprocess/ex_findPcap2category.py:122
↓ 1 callers
Function
run
()
preprocess/3_findPcap.py:96
next →
1–100 of 182, ranked by callers