fileserver

command
v0.0.0-...-e17f638 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 7 Imported by: 0

README

Go fileserver with uploads

Build CC COMMIT

This is a fileserver written in golang. As of now, this fileserver will not provide encryption or any other security measures besides logon authentication (if ran with -pass & -user flags configured) - this is just a simple fileserver. The script itself was (kinda but not really) inspired by UniIsland/SimpleHTTPServerWithUpload.py a well know python SimpleHTTPServer 'config' - however my fileserver actually works out of the box because its not from 2012 using deprecated modules.

As it stands, this fileserver doesn't support multiple file uploads - you can only upload one file at a time so trying to upload an array of files using curl -X POST http://IP:80 -F "upload[]=@/Users/test/a.exe" -F "upload[]=@/Users/boschko/b.dll" -H "Content-Type: multipart/form-data" ... Moreover, this is simply not the intent / use case of this script.

Getting Started

For those of you who are new to go and just want to run this ~ you only have to run go get github.com/gin-gonic/gin once.

Running: go get github.com/gin-gonic/gin && go run filserver.go
Building: go get github.com/gin-gonic/gin && go build -ldflags "-w -s" filserver.go

Or build
First run: go get github.com/gin-gonic/gin

  • env GOOS=windows GOARCH=386 go build -v filserver.go
  • env GOOS=linux GOARCH=amd64 go build -v filserver.go

Or Makefile

Run: Make will build for all OS compatibilities

Usage

Parameter Description
-h, --help show help message and exit
-dir (string) file dir (default "./")
-pass (string) password
-port (string) http port (default "80")
-user (string) username

Example

Start the go fileserver with authentication:

image

Login with credentials

image

Upload file from local machine

image

View the file on fileserver

image

Resources

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL