• Stars
    star
    201
  • Rank 194,491 (Top 4 %)
  • Language
    Python
  • License
    Mozilla Public Li...
  • Created over 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Toolkit for processing PCAP file and transform into image of MNIST dataset

USTC-TK2016

This repository is a toolkit called "USTC-TK2016", which is used to parse network traffic (.pcap file). Besides, the dataset is "USTC-TFC2016".

  • The master branch can only run on Windows environment.
  • The ubuntu branch can run on Ubuntu Linux 16.04 LTS environment.

NOTICE: This repository credits to echowei/DeepTraffic


Installation

  1. Clone this repository on your machine
    # Clone the repository on "master" branch
    $ git clone -b master https://github.com/yungshenglu/USTC-TK2016
  2. Install the required packages via the following command
    # Run the command at the root of the repository
    $ pip3 install -r requirements.txt

Execution

NOTICE: You are on the master branch now!

  1. Download the traffic dataset USTC-TFC2016 and put it into the directory 1_Pcap\
    • You can download the traffic dataset USTC-TFC2016 from my another repository.
  2. Open the PowerShell and run 1_Pcap2Session.ps1 (take a few minutes)
    • To split the PCAP file by each session, please make sure the line 10 and 14 in 1_Pcap2Session.ps1 is uncommented and make line 11 and 15 is in comment.
    • To split the PCAp file by each flow, please make sure the line 11 and 15 in 1_Pcap2Session.ps1 is uncommented and make line 10 and 14 is in comment.
    • Run 1_Pcap2Session.ps1
      # Make sure your current directory is correct
      PS> .\1_Pcap2Session.ps1
    • If succeed, you will see the following files (folders) in folder 2_Session\
      • AllLayers\
      • L7\
  3. Run 2_ProcessSession.ps1 (take a few minutes)
    # Make sure your current directory is correct
    PS> .\2_ProcessSession.ps1
    • If succeed, you will see the following files (folders) in folder 3_ProcessedSession\
      • FilteredSession\ - Get the top 60000 large PCAP files
      • TrimedSession\ - Trim the filtered PCAP files into size 784 bytes (28 x 28) and append 0x00 if the PCAP file is shorter than 784 bytes
      • The files in subdirectory Test\ and Train\ is random picked from dataset.
  4. Run 3_Session2Png.py (take a few minutes)
    # Make sure your current directory is correct
    PS> python3 3_Session2png.py
    • If succeed, you will see the following files (folders) in folder 4_Png\
      • Test\ - For testing
      • Train\ - For training
  5. Run 4_Png2Mnist.py (take a few minutes)
    # Make sure your current directory is correct
    PS> python3 4_Png2Mnist.py
    • If succeed, you will see the the training datasets in folder 5_Mnist\
      • train-images-idx1-ubyte
      • train-images-idx3-ubyte
      • train-images-idx1-ubyte.gz
      • train-images-idx3-ubyte.gz

Contributor

NOTICE: You can follow the contributing process CONTRIBUTING.md to join me. I am very welcome any issue!


License

Mozilla Public License Version 2.0

More Repositories

1

USTC-TFC2016

Traffic dataset USTC-TFC2016
102
star
2

Simple_SISO_OFDM_USRP

Implement SISO OFDM with BPSK demodulation on USRP
MATLAB
16
star
3

CrossyRoadEX

Implement "Croosy Road" in C# and Unity
ASP
11
star
4

NCTU-Thesis-Template

LaTeX Template of Thesis for National Chiao Tung University (NCTU)
TeX
11
star
5

Simple_SISO_OFDM

Simulate SISO OFDM with BPSK demodulation
MATLAB
6
star
6

NBA-Boxscore

An extension of NBA boxscore on VS Code ๐ŸŽ‰
TypeScript
5
star
7

InterferenceNulling

Simulate interference nulling in simple MIMO OFDM with BPSK demodulation
MATLAB
5
star
8

Packet_Manipulation

Lab in NCTU course "Introduction to Computer Networks 2018"
Shell
4
star
9

OnlineJudgeUVa

Personal submissions on Online Judge UVa
C++
4
star
10

NumberPlateRecognition

Recognize the number plate using TensorFlow in Python
Python
3
star
11

InterferenceNulling_USRP

Implement interference nulling in simple MIMO OFDM with BPSK demodulation
MATLAB
3
star
12

StudyJams

Personal notes on Google Cloud Study Jams
Jupyter Notebook
3
star
13

LeetCode

Personal submissions on LeetCode
C++
3
star
14

ONOS-Practice

This repository is used to practice some basic operations in ONOS controller.
Java
3
star
15

TODO-Desktop

Desktop version of TODO! ๐ŸŽ‰
JavaScript
3
star
16

OnlineJudgeNCTU

Personal submissions on Online Judge NCTU (ๅœ‹็ซ‹ไบค้€šๅคงๅญธ็จ‹ๅผ่งฃ้กŒ็ณป็ตฑ)
C++
2
star
17

MWIS

Assignment in NCTU course "Distributed Algorithms 2017"
C++
2
star
18

Hacktoberfest2018

Hacktoberfest 2018 Event, host by @toolbuddy in Tainan, Taiwan.
Makefile
2
star
19

TrafficStat

Implement a simple packet processing tool for multiple PCAP files
Python
2
star
20

TaiwanEX

Implement a classic game "JapanEX" in Taiwan's version
JavaScript
1
star
21

Route_Configuration

Lab in NCTU course "Introduction to Computer Networks 2018"
Python
1
star
22

tensroflow-mnist

This repository is going to use TensorFlow to train the MNIST network.
Python
1
star
23

Dcard-Reader

Simple post reader for Dcard ๐Ÿš€
TypeScript
1
star
24

BufferOverflowAttack

Simulate a simple buffer overflow attack
Assembly
1
star
25

ClassicSudoku

Implement the classic game "Sudoku" in C++
C++
1
star
26

academic-kickstart

Shell
1
star
27

CipherHacking

Simulate a simple cipher hacking in Python
Python
1
star
28

papoGen-demo

This repository is demo environment for papoGen
JavaScript
1
star
29

CandyCrush

Implement the classic game "Candy Crush" in Qt
C++
1
star
30

Simple_POX

Simple SDN on POX controller
Python
1
star
31

Network_Topology

Lab in NCTU course "Introduction to Computer Networks 2018"
Python
1
star
32

OnlineJudgeZero

Personal Submission of Online Judge Zero (่‡บ็ฃ้ซ˜ไธญ็”Ÿ็จ‹ๅผ่งฃ้กŒ็ณป็ตฑ)
C++
1
star
33

tensorflow-practice

Practicing and learning TensorFlow
Jupyter Notebook
1
star