Git Product home page Git Product logo

tcpdump_and_cicflowmeter's Introduction

Introduction

This project is about capturing packets flow through a network interface, save each specific-size chunk into a PCAP file, and then automatically convert it to the feature-extracted CSV file by CICFlowMeter-3.0.

The CSV is meant to be analysed for intrusion detection. You can find further detail at the website of CIC.

Usage

Quick Start

For trying, just run:

try_me.sh

To Run Literally

Calling capture_interface_pcap.sh will capture the packets since the beginning until specific time in the script, periodically. Each time that PCAP file is saved, the script convert_pcap_csv.sh will be called the converter, CICFlowMeter.

capture_interface_pcap.sh <interface> <pcap_output_dir> [priviledged_user_name]

For example:

capture_interface_pcap.sh wlan0 pcap

or

capture_interface_pcap.sh eth0 output_dir bobuser

To Run on Startup

Edit the working directory in file pcap2ciclog.service, and also the executed script shoud be refered with absolute path:

...
[Service]
WorkingDirectory=/home/../../TCPDUMP_and_CICFlowMeter
ExecStart=/home/../../TCPDUMP_and_CICFlowMeter/pcap2ciclog.sh
...

Then, link it into the directory /lib/systemd/system:

cd /lib/systemd/system
sudo ln -sf <the-dir>/pcap2ciclog.service

Enable the service:

sudo systemctl enable pcap2ciclog.service

Finally, let's get started!

sudo systemctl start pcap2ciclog.service

Note on Issues

To Fix the Permission Denied Problem

In some case of using on Ubuntu with Apparmor, you may has a 'permission denied' issue when tcpdump tries to execute a script. It is a security measure. To relax, please add the following line into file /etc/apparmor.d/usr.sbin.tcpdump:

/usr/sbin/tcpdump {
  ...
  # for -z
  /**/* ixr,      # <-- add me!
  ...
}

Then, restart the service:

sudo service apparmor restart

To Fix java.lang.UnsatisfiedLinkError Problem

Due to the libpcap-dev package was not installed. The error will be shown:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.slytechs.library.NativeLibrary.dlopen(Ljava/lang/String;)J
        at com.slytechs.library.NativeLibrary.dlopen(Native Method)
        at com.slytechs.library.NativeLibrary.<init>(Unknown Source)
        at com.slytechs.library.JNILibrary.<init>(Unknown Source)
        at com.slytechs.library.JNILibrary.loadLibrary(Unknown Source)
        at com.slytechs.library.JNILibrary.register(Unknown Source)
        at com.slytechs.library.JNILibrary.register(Unknown Source)
        at com.slytechs.library.JNILibrary.register(Unknown Source)
        at org.jnetpcap.Pcap.<clinit>(Unknown Source)
        at cic.cs.unb.ca.jnetpcap.PacketReader.config(PacketReader.java:58)
        at cic.cs.unb.ca.jnetpcap.PacketReader.<init>(PacketReader.java:52)
        at cic.cs.unb.ca.ifm.CICFlowMeter.main(CICFlowMeter.java:93)

Please install via:

sudo apt install libpcap-dev

For furture OSs, please follow the guildline on https://javatutorial.net/capture-network-packages-java.

To Build CICFlowMeter Command-line Version

The forked and revised version of ISCX/CICFlowMeter can be found at https://github.com/iPAS/CICFlowMeter. Nevertheless, in case you need to know how to make it by yourself, or if the next version need the maintenance again, the guidance is directed by the following clues.

Get CICFlowMeter

git clone https://github.com/ISCX/CICFlowMeter.git

Then, go inside.

Get Gradle (option)

chmod +x gradlew
./gradlew

However, this is not neccessary in case you already have it.

Update CICFlowMeter

In CICFlowMeter directory, please:

git fetch --all
git reset original/master --hard

All code will be renew as the original repository. All revised files will be gone, even yours.

Build CICFlowMeter

  • Edit the build.gradle file, enable to find JNetPCAP package:

    1. Add a new repository:

      repositories {
          ...
      
          maven {
              url "http://clojars.org/repo/"
          }
      
      }
      
    2. Reversion the dependency:

      dependencies {
          ...
      
          // compile group: 'org.jnetpcap', name: 'jnetpcap', version:'1.4.1'
          compile group: 'jnetpcap', name: 'jnetpcap', version: '1.4.r1425-1g'
      
      
  • To make the command-line enable:

    1. Change all occurences of the following:

       cic.cs.unb.ca.ifm.App
      

      to

       cic.cs.unb.ca.ifm.CICFlowMeter
      
    2. Exclude the GUI besides include the command-line source file:

      sourceSets {
          main {
              java {
                  srcDir 'src'
                  // exclude '**/CICFlowMeter.java'
                  exclude '**/App.java'
              }
          }
      }
      
    3. Edit the code src/main/java/cic/cs/unb/ca/ifm/CICFlowMeter.java by looking at my CICFlowMeter.java.

  • Then, build the project:

    gradle build

Test Running CICFlowMeter

  • To run via Gradle:

    gradle run

    The result might be shown like the following:

      type Jar
      type JavaExec
      :compileJava UP-TO-DATE
      :processResources UP-TO-DATE
      :classes UP-TO-DATE
      :run
      cic.cs.unb.ca.ifm.CICFlowMeter Sorry,no pcap files can be found under: <...some path...>
    
      BUILD SUCCESSFUL
    
      Total time: 0.936 secs
    

Install

The built package is in directory CICFlowMeter_repo/build/distributions/. Get and place in a directory that fit.

Update the Runner Script

After the distribution package was gotten, unpack and revise the code in script CICFlowMeter-3.0/bin/CICFlowMeter:

  1. Change the reference to libraries with real path:

     DEFAULT_JVM_OPTS='"-Djava.library.path=../lib/native"'
    

    to

     DEFAULT_JVM_OPTS='"-Djava.library.path='$APP_HOME/lib/native'"'
    
  2. Call to command-line instead of GUI application:

     eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $CIC_FLOW_METER_OPTS -classpath "\"$CLASSPATH\"" cic.cs.unb.ca.ifm.App "$APP_ARGS"
    

    to

     eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $CIC_FLOW_METER_OPTS -classpath "\"$CLASSPATH\"" cic.cs.unb.ca.ifm.CICFlowMeter "$APP_ARGS"
    

To Build CICFlowMeter-4

  • gradle and maven are required

tcpdump_and_cicflowmeter's People

Contributors

ipas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tcpdump_and_cicflowmeter's Issues

tcpdump still get permission denied

I've encounter the permission issue. I'm using VM, OS is ubuntu 20.04. I've already change the apparmor files

this is my output below

sugiuraayano@ubuntu:~/TCPDUMP_and_CICFlowMeter $ sh capture_interface_pcap.sh ens33 pcap root
capture_interface_pcap.sh: 8: [[: not found
capture_interface_pcap.sh: 9: [[: not found
capture_interface_pcap.sh: 39: [[: not found
capture_interface_pcap.sh: 48: Bad substitution
tcpdump: listening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
tcpdump: pcap/2021-05-25-14:17:53.pcap: Permission denied
=== Capturer is being cancled ===
=== Wait the converter finished for 3 seconds...
>>> Script dir: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter
+++ CICFlowMeter PCAP-to-CSV Converter +++
    Input file: pcap/2021-05-25-14:16:53.pcap
    Output dir: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/csv
run at:   /home/sugiuraayano/TCPDUMP_and_CICFlowMeter
app at:   /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0
SAVED:    /home/sugiuraayano/TCPDUMP_and_CICFlowMeter
APP_HOME: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0
CLASSPATH: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/animal-sniffer-annotations-1.14.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/checker-compat-qual-2.0.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/CICFlowMeter-4.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/commons-io-2.5.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/commons-lang3-3.6.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/commons-math3-3.5.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/error_prone_annotations-2.1.3.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/guava-23.6-jre.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/hamcrest-core-1.3.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/j2objc-annotations-1.1.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/java-cup-0.11a.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/jfreechart-1.5.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/jnetpcap-1.4.r1425-1g.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/jsr305-1.3.9.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/junit-4.12.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/log4j-1.2.17.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/log4j-api-2.11.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/log4j-core-2.11.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/slf4j-api-1.7.25.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/slf4j-log4j12-1.7.25.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/tika-core-1.17.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/weka-stable-3.6.14.jar
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs/debug (Permission denied)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
	at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
	at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
	at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
	at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at cic.cs.unb.ca.ifm.CICFlowMeter.<clinit>(CICFlowMeter.java:18)
log4j:ERROR Either File or DatePattern options are not set for appender [DEBUGFILE].
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs/info.log (Permission denied)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
	at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
	at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
	at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at cic.cs.unb.ca.ifm.CICFlowMeter.<clinit>(CICFlowMeter.java:18)
cic.cs.unb.ca.ifm.CICFlowMeter 
cic.cs.unb.ca.ifm.CICFlowMeter CICFlowMeter-V3 found: 1 Files.
cic.cs.unb.ca.ifm.CICFlowMeter 
cic.cs.unb.ca.ifm.CICFlowMeter Working on... pcap/2021-05-25-14:16:53.pcap 
cic.cs.unb.ca.ifm.CICFlowMeter Done! in 0 seconds
cic.cs.unb.ca.ifm.CICFlowMeter 	 Total packets: 1442
cic.cs.unb.ca.ifm.CICFlowMeter 	 Valid packets: 1442
cic.cs.unb.ca.ifm.CICFlowMeter 	 Ignored packets:0 0 
cic.cs.unb.ca.ifm.CICFlowMeter PCAP duration 58 seconds
cic.cs.unb.ca.ifm.CICFlowMeter ----------------------------------------------------------------------------
cic.cs.unb.ca.ifm.CICFlowMeter 

----------------------------------------------------------------------------
 TOTAL FLOWS GENERATED: 0
cic.cs.unb.ca.ifm.CICFlowMeter ----------------------------------------------------------------------------

+++ Remove pcap/2021-05-25-14:16:53.pcap
rm: cannot remove 'pcap/2021-05-25-14:16:53.pcap': Permission denied
+++ Finish the conversion


=== Convert left PCAP files if any
=== pcap/2021-05-25-14:16:53.pcap is left
>>> Script dir: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter
+++ CICFlowMeter PCAP-to-CSV Converter +++
    Input file: pcap/2021-05-25-14:16:53.pcap
    Output dir: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/csv
run at:   /home/sugiuraayano/TCPDUMP_and_CICFlowMeter
app at:   /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0
SAVED:    /home/sugiuraayano/TCPDUMP_and_CICFlowMeter
APP_HOME: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0
CLASSPATH: /home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/animal-sniffer-annotations-1.14.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/checker-compat-qual-2.0.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/CICFlowMeter-4.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/commons-io-2.5.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/commons-lang3-3.6.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/commons-math3-3.5.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/error_prone_annotations-2.1.3.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/guava-23.6-jre.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/hamcrest-core-1.3.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/j2objc-annotations-1.1.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/java-cup-0.11a.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/jfreechart-1.5.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/jnetpcap-1.4.r1425-1g.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/jsr305-1.3.9.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/junit-4.12.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/log4j-1.2.17.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/log4j-api-2.11.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/log4j-core-2.11.0.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/slf4j-api-1.7.25.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/slf4j-log4j12-1.7.25.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/tika-core-1.17.jar:/home/sugiuraayano/TCPDUMP_and_CICFlowMeter/CICFlowMeters/CICFlowMeter-4.0/lib/weka-stable-3.6.14.jar
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs/debug (Permission denied)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
	at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
	at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
	at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
	at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at cic.cs.unb.ca.ifm.CICFlowMeter.<clinit>(CICFlowMeter.java:18)
log4j:ERROR Either File or DatePattern options are not set for appender [DEBUGFILE].
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs/info.log (Permission denied)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:158)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
	at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
	at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
	at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
	at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at cic.cs.unb.ca.ifm.CICFlowMeter.<clinit>(CICFlowMeter.java:18)
cic.cs.unb.ca.ifm.CICFlowMeter 
cic.cs.unb.ca.ifm.CICFlowMeter CICFlowMeter-V3 found: 1 Files.
cic.cs.unb.ca.ifm.CICFlowMeter 
cic.cs.unb.ca.ifm.CICFlowMeter Working on... pcap/2021-05-25-14:16:53.pcap 
cic.cs.unb.ca.ifm.CICFlowMeter Done! in 0 seconds
cic.cs.unb.ca.ifm.CICFlowMeter 	 Total packets: 1442
cic.cs.unb.ca.ifm.CICFlowMeter 	 Valid packets: 1442
cic.cs.unb.ca.ifm.CICFlowMeter 	 Ignored packets:0 0 
cic.cs.unb.ca.ifm.CICFlowMeter PCAP duration 58 seconds
cic.cs.unb.ca.ifm.CICFlowMeter ----------------------------------------------------------------------------
cic.cs.unb.ca.ifm.CICFlowMeter 

----------------------------------------------------------------------------
 TOTAL FLOWS GENERATED: 180
cic.cs.unb.ca.ifm.CICFlowMeter ----------------------------------------------------------------------------

+++ Remove pcap/2021-05-25-14:16:53.pcap
+++ Finish the conversion

=== Clean stuff up

My /ect/apparmor.d/usr.sbin.tcpdump files:

# vim:syntax=apparmor
#include <tunables/global>

/usr/sbin/tcpdump flags=(complain) {
  #include <abstractions/base>
  #include <abstractions/nameservice>
  #include <abstractions/user-tmp>

  capability net_raw,
  capability setuid,
  capability setgid,
  capability dac_override,
  capability chown,
  network raw,
  network packet,
  
  # for -D
  @{PROC}/bus/usb/ r,
  @{PROC}/bus/usb/** r,

  # for finding an interface
  /dev/ r,
  @{PROC}/[0-9]*/net/dev r,
  /sys/bus/usb/devices/ r,
  /sys/class/net/ r,
  /sys/devices/**/net/** r,

  # for -j
  capability net_admin,

  # for tracing USB bus, which libpcap supports
  /dev/usbmon* r,
  /dev/bus/usb/ r,
  /dev/bus/usb/** r,
  
  # for -z
  /**/* ixr,  // add line here
  /{usr/,}bin/gzip ixr,
  /{usr/,}bin/bzip2 ixr,


  # for init_etherarray(), with -e
  /etc/ethers r,

  # for USB probing (see libpcap-1.1.x/pcap-usb-linux.c:probe_devices())
  /dev/bus/usb/**/[0-9]* w,

  # for -F and -w
  audit deny @{HOME}/.* mrwkl,
  audit deny @{HOME}/.*/ rw,
  audit deny @{HOME}/.*/** mrwkl,
  audit deny @{HOME}/bin/ rw,
  audit deny @{HOME}/bin/** mrwkl,
  owner @{HOME}/ r,
  owner @{HOME}/** rw,

  # for -r, -F and -w
  /**.[pP][cC][aA][pP] rw,

  # for convenience with -r (ie, read pcap files from other sources)
  /var/log/snort/*log* r,

  /usr/sbin/tcpdump mr,

  # Site-specific additions and overrides. See local/README for details.
  #include <local/usr.sbin.tcpdump>
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.