Giter Club home page Giter Club logo

http-server's Introduction

This simple HTTPS server provides download (with directory listing feature) and upload functionalities to ease the process of sharing files between computers/phones/tablets that are in the same network. It also comes handy for pentesting purposes under certain circumtances :-).

Features

  • Supports TLS
  • Directory listing for the files to download
  • Upload files to the shared directory
  • Provide some security checks (whitelist to prevent path traversal, token to prevent unauthorized uploads)

Install

go get https://github.com/GiulioComi/http-server

Usage

Usage of serve:
  -f string
    	The folder to serve (default /tmp/http-server)
  -p string
    	The port to run on (default "8086")
  -u string
    	The webpath where the upload form is hosted (default "upload/")
  -w string
    	The root webpath (default "/")
  -h prints this help

Example of console output

./http-server 
Certs already created.
Local ip address: 10.0.2.15
Serving local folder /tmp/http-server/ on "https://10.0.2.15:8086/"
File Upload form available at "https://10.0.2.15:8086/upload"
Token to use for upload:	"81ffc3175283db2c4cf0"
Press Control+C to stop

Example to upload files without GUI access to the machine

curl -i -s -k  -X $'POST' \
    -H $'Host: 10.0.2.15:8086' -H $'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H $'Accept-Language: en-US,en;q=0.5' -H $'Accept-Encoding: gzip, deflate' -H $'Referer: https://[URL]/upload' -H $'DNT: 1' -H $'Connection: close' -H $'Upgrade-Insecure-Requests: 1' -H $'Content-Type: multipart/form-data; boundary=---------------------------606768120669673484490201340' -H $'Content-Length: 140654' \
    --data-binary $'-----------------------------\x0d\x0aContent-Disposition: form-data; name=\"uploadfile\"; filename=\"[FILENAME]\"\x0d\x0aContent-Type: [CONTENT-TYPE]\x0d\x0a\x0d\x0a[CONTENT]\x0d\x0a-----------------------------\x0d\x0aContent-Disposition: form-data; name=\"token\"\x0d\x0a\x0d\x0ad0cd53e404919e8509f9\x0d\x0a-------------------------------\x0d\x0a' \
    $'https://[URL]/upload'

Credits

Thanks to empijei for initial inspiration (https://github.com/empijei/serve).

http-server's People

Contributors

empijei avatar giuliocomi avatar silverweed 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.