Giter Site home page Giter Site logo

flowgenerator's Introduction

Hello!

I'm Daud Ahmed.

LinkedIn Badge Dev.to Badge


๐Ÿ› ๏ธ Languages and Tools

Pythonย  Cย  C++ย  Dartย  JSย  HTMLย  CSSย  Gitย  GitLabย  VSย 

Pytorchย  tfย  Flaskย  Dockerย  Firebaseย  Flutterย  SQLiteย  Numpyย 


watching Visitor Count

daud99

GitHub Streak

flowgenerator's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mabidm-tsinghua

flowgenerator's Issues

Maybe unimplemented function url_model

Here is the help of cicflowmeter

cicflowmeter -h

usage: cicflowmeter [-h] (-i INPUT_INTERFACE | -f INPUT_FILE) [-c]
                    [-u URL_MODEL]
                    output

positional arguments:
  output                output file name (in flow mode) or directory (in
                        sequence mode)

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT_INTERFACE, --interface INPUT_INTERFACE
                        capture online data from INPUT_INTERFACE
  -f INPUT_FILE, --file INPUT_FILE
                        capture offline data from INPUT_FILE
  -c, --csv, --flow     output flows as csv
  -u URL_MODEL, --url URL_MODEL
                        URL endpoint for send to Machine Learning Model. e.g
                        http://0.0.0.0:80/prediction

I want to use cicflowmeter to capture realtime features that generated by net flow, and test my ML model trained by CICIDS2017 dataset,this URL_MODEL function can greatly simplify my implement of realtime detection,but I try a lot of times, it doesn't work.
Then, I read the code in flow_session.py to find how it writes generated feature into specified file, and found maybe the URL_MODEL
function were not implemeted, here is the code in line 107:

    def garbage_collect(self, latest_time) -> None:
        localtime = time.asctime( time.localtime(time.time()) )
        print(localtime, latest_time)
        # TODO: Garbage Collection / Feature Extraction should have a separate thread
        if not self.url_model:
            print("Garbage Collection Began. Flows = {}".format(len(self.flows)))
        keys = list(self.flows.keys())
        for k in keys:
            flow = self.flows.get(k)

            if (
                latest_time is None
                or latest_time - flow.latest_timestamp > EXPIRED_UPDATE
                or flow.duration > 90
            ):
                data = flow.get_data()

                if self.csv_line == 0:
                    self.csv_writer.writerow(data.keys())

                self.csv_writer.writerow(data.values())
                # print('-----------------------')
                # print(data.keys())
                # print('-----------------------')
                self.csv_line += 1

                del self.flows[k]

I did some print to see where the features are going,and I am now doing some change to the code to implement the function url_model,send the features with json format to specified url.

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.