Git Product home page Git Product logo

sephiroth's Introduction

Sephiroth

A Python3 script to build cloud block lists for servers.

Requirements

  • Python 3.6+ (Sephiroth makes use of f-strings)

Setup

It is recommended to install the requirements into a virtual environment. From a brand new Ubuntu 18.04 machine, the setup flow should look something like this:

$ sudo apt install python3 python3-venv git
$ git clone https://github.com/0xdade/sephiroth.git
$ cd sephiroth/
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Usage

Sephiroth provides a built in help menu through the use of Python's argparse library. It tells you which commands are required, as well as other options.

sephiroth on  master [+] via sephiroth
➜ python sephiroth.py --help
usage: Sephiroth [-h] -s {nginx} -c {aws,azure,gcp} [-p] [--no-ipv6] [-V]

Sephiroth is made to help block clouds.

optional arguments:
  -h, --help            show this help message and exit
  -s {nginx}, --server {nginx}
                        Type of server to build blocklist for
  -c {aws,azure,gcp}, --cloud {aws,azure,gcp}
                        Cloud provider(s) to block
  -p, --proxy           Using PROXY Protocol?
  --no-ipv6             Exclude ipv6 addresses from the block list where
                        applicable
  -V, --version         show program's version number and exit

For more information, assistance, or to submit a pull request, please visit
https://github.com/0xdade/sephiroth.

Example

sephiroth on  master [!] via sephiroth took 6s
➜ python sephiroth.py -s nginx -c aws -c azure
Your nginx blocklist for aws, azure can be found at ./output/nginx_aws_azure_2020-02-16_040129.conf

Please add this line to /etc/nginx/nginx.conf before the Virtual Host Configs.

        include /mnt/c/Users/dade/Desktop/sephiroth/output/nginx_aws_azure_2020-02-16_040129.conf;

Then you can use the $block_ip variable in your site config like so:

        if ($block_ip) {
                return 302 https://example.com;
        }

Supported Servers

  • nginx - Makes use of nginx's "ngx_http_geo_module" which comes with the nginx package in Ubuntu 18.04. Optionally supports the use of proxy_protocol, in the event that you are using a PROXY-enabled redirector.

Supported Cloud Providers

  • aws - Amazon Web Services. Obtained via the documented download process.
  • azure - Azure Cloud. Fetched via a two part process. Fetch the html of the download page and then parse the html to get the failoverLink anchor tag. That JSON is then downloaded.
  • gcp - Google Cloud Platform. Fetched via the absolutely insane abuse of spf records as outlined in the docs.
  • oci - Oracle Cloud Infrastructure. Fetched via the documented download process

License

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
                    Version 2, December 2004 

 Copyright (C) 2004 Sam Hocevar <[email protected]> 

 Everyone is permitted to copy and distribute verbatim or modified 
 copies of this license document, and changing it is allowed as long 
 as the name is changed. 

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 

  0. You just DO WHAT THE FUCK YOU WANT TO.

sephiroth's People

Contributors

0xdade avatar sir-ragna avatar tophertimzen 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.