Code Monkey home page Code Monkey logo

evildav's Introduction

EvilDav

EvilDav is a powerful and flexible WebDAV server with advanced features including geofencing, bot detection, keyword blocking, read-only mode, reverse proxy functionality, customizable server header mimicking, and logging.

Features

  • Geofencing: Restricts access based on the client's geographical location.
  • Bot Detection: Detects and blocks bots based on user-agent strings.
  • Keyword Blocking: Blocks requests containing specific keywords in headers or URLs.
  • Read-Only Mode: Option to make the file serve folder read-only.
  • Reverse Proxy: Option to forward blocked requests to another URL.
  • Server Header Mimicking: Mimics headers from popular servers like NGINX, Netlify, Cloudflare, etc.
  • Logging: Logs server activities to a specified file.
  • Custom WebDAV URL: Set a custom URL path for WebDAV access.

Prerequisites

  • Python 3.11
  • Required Python packages:
    pip install -r requirements.txt

Installation

Clone the repository:

git clone https://github.com/ScRiPt1337/EvilDav.git
cd evildav

Configuration

Blocked Keywords File

Create a file named blocked_keywords.txt with the following content:

blockedword1
blockedword2
blockedword3

Server Headers Configuration

Create a file named server_headers.json with the following content:

{
  "nginx": {
    "Server": "nginx",
    "X-Content-Type-Options": "nosniff",
    "X-Frame-Options": "DENY",
    "X-XSS-Protection": "1; mode=block"
  },
  "netlify": {
    "Server": "Netlify",
    "X-Content-Type-Options": "nosniff",
    "X-Frame-Options": "DENY",
    "X-XSS-Protection": "1; mode=block"
  },
  "cloudflare": {
    "Server": "cloudflare",
    "CF-RAY": "<ray-id>"
  },
  "apache": {
    "Server": "Apache"
  },
  "iis": {
    "Server": "Microsoft-IIS/10.0"
  },
  "aws_cloudfront": {
    "Server": "CloudFront",
    "X-Cache": "Miss from cloudfront"
  },
  "aws_lambda": {
    "Server": "awselb/2.0"
  },
  "google_cloud_function": {
    "Server": "Google Frontend"
  }
}

Usage

Run the server with the following command:

python3 evildav.py /path/to/your/file.html --host 0.0.0.0 --port 8080 --root /path/to/serve --allowed_countries US RU --reverse_proxy_url http://example.com --server_type nginx --read_only --log_file server.log --dav_url /mydav

Arguments

  • html_path: Path to the HTML file to serve.
  • --host: Host to bind the server to (default: 0.0.0.0).
  • --port: Port to bind the server to (default: 8080).
  • --root: Root directory to serve files from (default: .).
  • --allowed_countries: List of allowed country ISO codes.
  • --blocked_countries: List of blocked country ISO codes.
  • --reverse_proxy_url: URL to reverse proxy to instead of serving HTML.
  • --server_type: Type of server to mimic (choices: nginx, netlify, cloudflare, apache, iis, aws_cloudfront, aws_lambda, google_cloud_function).
  • --read_only: Make the file serve folder read-only.
  • --log_file: Path to the log file (default: server.log).
  • --dav_url: URL path for WebDAV (default: /).

Project Structure

evildav/
├── worker.py
├── evildav.py
├── server_headers.json
├── blocked_keywords.txt
├── README.md

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

evildav's People

Contributors

script1337 avatar

Stargazers

 avatar  avatar swagkarna avatar

Watchers

 avatar

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.