This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

Related tags

URL Manipulation 0x0
Overview

The Null Pointer

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

Configuration

To change settings, modify instance/config.py. For more information on instance configuration, see the Flask documentation.

To customize the home and error pages, simply create a templates directory in your instance directory and copy any templates you want to modify there.

If you are running nginx, you should use the X-Accel-Redirect header. To make it work, include this in your nginx configโ€™s server block:

location /up {
    internal;
}

where /up is whatever youโ€™ve configured as FHOST_STORAGE_PATH.

For all other servers, set FHOST_USE_X_ACCEL_REDIRECT to False and USE_X_SENDFILE to True, assuming your server supports this. Otherwise, Flask will serve the file with chunked encoding, which sucks and should be avoided at all costs.

To make files expire, simply create a cronjob that runs cleanup.py every now and then.

Before running the service for the first time, run FLASK_APP=fhost flask db upgrade.

NSFW Detection

0x0 supports classification of NSFW content via Yahooโ€™s open_nsfw Caffe neural network model. This works for images and video files and requires the following:

  • Caffe Python module (built for Python 3)
  • ffmpegthumbnailer executable in $PATH
Comments
  • fhost: allow configuration at runtime

    fhost: allow configuration at runtime

    This reads configuration from a file called fhost.cfg if it exists, allowing users to configure the server without having to maintain a fork.

    I also used this opportunity to remove the gitignore entry for .py[cod]. It's only needed for python2, as python3 always places bytecode files inside __pycache__, which was already ignored.

    opened by ioistired 2
  • Show 404 message instead of crashing when requesting a file that isn't there

    Show 404 message instead of crashing when requesting a file that isn't there

    When you request a file that doesn't exist, 0x0 crashes:

    thestranjer@monolith:~$ curl http://0x0.st/non_existent_file.txt
    <pre>Process 16 stopped
    * thread #1: tid = 16, 0x00007f9e6f4d84e0, name = 'fhost'
        frame #0:
    Process 16 stopped
    * thread #8: tid = 16, 0x00007f9e51d0ad08 fhost`get(path='/non_existent_file.txt') + 27 at fhost.c:139, name = 'fhost/responder', stop reason = invalid address (fault address: 0x30)
        frame #0: 0x00007f9e51d0ad08 fhost`get(path='/non_existent_file.txt') + 27 at fhost.c:139
       136   get(SrvContext *ctx, const char *path)
       137   {
       138       StoredObj *obj = ctx->store->query(shurl_debase(path));
    -> 139       switch (obj->type) {
       140           case ObjTypeFile:
       141               ctx->serve_file_id(obj->id);
       142               break;
    (lldb) q</pre>
    

    I fix this error with this commit. It returns an answer that is human comprehensible:

    thestranjer@monolith:~$ curl http://localhost:5000/non_existent_file.txt
    404 File Not Found: /non_existent_file.txt
    

    It does not use the abort() call in the interest of returning human-comprehensible text.

    opened by TheStranjer 2
  • Actually send file contents when using FHOST_USE_X_ACCEL_REDIRECT

    Actually send file contents when using FHOST_USE_X_ACCEL_REDIRECT

    When I try to run 0x0 with the default settings, by going python3 fhost.py runserver, and using FHOST_USE_X_ACCEL_REDIRECT in the state of True, it allows me to upload files. However, when I try to curl, those files, it throws errors such as this:

    curl: (18) transfer closed with 34767 bytes remaining to read
    

    This is because it isn't actually sending the file contents! The edit to the code I make causes the server to function normally and actually send the file over without issue.

    opened by TheStranjer 2
  • remove short_url and add in-tree URLencoder

    remove short_url and add in-tree URLencoder

    This PR removes the short_url dependency as per issue #41. This implementation is pretty much the same as in short_url except I've rewritten the enbase() function to be iterative instead of recursive. The only functions of the class are enbase() and debase() since those were the only functions being used by fhost. My python is very rusty so if anything could be better I'll gladly modify this PR :)

    opened by 7415963987456321 1
  • Refactor is_fhost_url to use regex for url matching

    Refactor is_fhost_url to use regex for url matching

    I figured it was a bit unnecessary to have two functions for this so I refactored it into one function. I thought about introducing fhost_url as a global variable in order to avoid checking for every function call, but I'll await your input on that. This PR introduces re as a dependency, I don't know if you consider that to be excessive, but it certainly simplifies things.

    opened by 7415963987456321 0
Owner
mia
mia
ShortenURL-model - The model layer class for shorten url service

ShortenURL Model The model layer class for shorten URL service Usage Complete th

TwinIsland 1 Jan 7, 2022
Use this module to detect if a URL is on discord's phishing list.

PhishDetector This module was made so you can check a URL and see if it's in discord's official list of phishing and suspicious URLs. Installation pip

Elijah 4 Mar 25, 2022
๐ŸŒ URL parsing and manipulation made easy.

furl is a small Python library that makes parsing and manipulating URLs easy. Python's standard urllib and urlparse modules provide a number of URL re

Ansgar Grunseid 2.4k Jan 4, 2023
A simple, immutable URL class with a clean API for interrogation and manipulation.

purl - A simple Python URL class A simple, immutable URL class with a clean API for interrogation and manipulation. Supports Pythons 2.7, 3.3, 3.4, 3.

David Winterbottom 286 Jan 2, 2023
Customizable URL shortener written in Python3 for sniffing and spoofing

Customizable URL shortener written in Python3 for sniffing and spoofing

null 3 Nov 22, 2022
A simple URL shortener app using Python AWS Chalice, AWS Lambda and AWS Dynamodb.

url-shortener-chalice A simple URL shortener app using AWS Chalice. Please make sure you configure your AWS credentials using AWS CLI before starting

Ranadeep Ghosh 2 Dec 9, 2022
Ukiyo - A simple, minimalist and efficient discord vanity URL sniper

Ukiyo - a simple, minimalist and efficient discord vanity URL sniper. Ukiyo is easy to use, has a very visually pleasing interface, and has great spee

null 13 Apr 14, 2022
๐Ÿ”— FusiShort is a URL shortener built with Python, Redis, Docker and Kubernetes

This is a playground application created with goal of applying full cycle software development using popular technologies like Python, Redis, Docker and Kubernetes.

Lucas Fusinato Zanis 7 Nov 10, 2022
Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL. It allows you to see the complete path a redirected URL goes through. It will show you the full redirection path of URLs, shortened links, or tiny URLs.

JAYAKUMAR 28 Sep 11, 2022
A URL builder for genius :D

genius-url A URL builder for genius :D Usage from gurl import genius_url

๊Œ—แ–˜๊’’๊€ค๊“„๊’’๊€ค๊ˆค๊Ÿ 12 Aug 14, 2021
declutters url lists for crawling/pentesting

uro Using a URL list for security testing can be painful as there are a lot of URLs that have uninteresting/duplicate content; uro aims to solve that.

Somdev Sangwan 677 Jan 7, 2023
a url shortener project from semicolonworld

Url Shortener With Django Written by Semicolon World

null 3 Aug 24, 2021
find all the URL of a site with a specific Regex

href this program will find all the link with a spesfic Regex pattern from a site. what it will do in any site there are a lots of url that may you ne

Arya Shabane 12 Dec 5, 2022
python3 flask based python-url-shortener microservice.

python-url-shortener This repository is for managing all public/private entity specific api endpoints for an organisation. In this case we have entity

Asutosh Parida 1 Oct 18, 2021
A python code for url redirect check

A python code for url redirect check

Fayas Noushad 1 Oct 24, 2021
A url redirect status check module for python

A url redirect status check module for python

Fayas Noushad 2 Oct 24, 2021
A url shortner written in Flask.

url-shortener-elitmus This is a simple flask app which takes an URL and shortens it. This shortened verion of the URL redirects to the user to the lon

null 2 Nov 23, 2021
A simple URL shortener built with Flask

A simple URL shortener built with Flask and MongoDB.

Mike Lowe 2 Feb 5, 2022
Qysqa - URL shortener website with python

Qysqa - shorten your URL. ~ A simple URL-shortening website. how do you pronounc

Dastan Ozgeldi 0 Nov 18, 2022