Git Product home page Git Product logo

Suspicidy

Suspicidy aims to detect suspicious web requests. Currently, it only supports detection by request path, using a data-set of almost 800 paths collected from real web crawlers.

Installation

The package can be installed by adding suspicidy to your list of dependencies in mix.exs:

def deps do
  [
    {:suspicidy, "~> 0.1.0"}
  ]
end

Usage

If you want to use the built-in data-set, you can just use the Suspicidy module.

iex(1)> Suspicidy.suspicious_path?("/")
false

iex(2)> Suspicidy.suspicious_path?("/phpmyadmin")
true

Custom Data

You can use your own data-set if you wish. In order to do so, you have to create a loader module for the request paths. Here is a simply example:

defmodule MyApp.CustomLoader do
  def resource_files() do
    # Normally this would return a list of
    # file paths to the files containing the data-set.
    # You would put them in your priv directory.
    []
  end
  
  def paths() do
    # Here we return a list of paths.
    # You would normally load them from 
    # e.g. your priv directory.
    ["/evil", "/data.zip"]
  end
end

Then you can create a custom module and instruct Suspicidy to expose your data-set.

defmodule MyApp.CustomUsage do
  use Suspicidy.Builder, 
      path: [loader: MyApp.CustomLoader]
end

Finally, use your custom module:

iex(1)> MyApp.CustomUsage.suspicious_path?("/")
false

iex(2)> MyApp.CustomUsage.suspicious_path?("/evil")
true

Suspicidy's Projects

suspicidy icon suspicidy

Suspicidy aims to detect suspicious web requests

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.