goshs

goshs-labsMIT活跃维护

单二进制文件服务器,集成 HTTP/S、WebDAV、FTP/SFTP、SMB、LDAP 等多种协议,还能抓取 NTLM 哈希和接收 DNS/SMTP 回调,适合红队和开发者替代 python3 -m http.server。

Feature-rich single-binary file server for red teamers and developers. HTTP/S · WebDAV · FTP/SFTP · SMB · LDAP/S · NTLM hash capture · DNS/SMTP callbacks · TLS · Auth · Share links. A powerful python3 -m http.server replacement.

v2.1.7发布于 2026-09-28 07:17 UTC1,011star +3 / 7 天60fork同步于 2026-11-10 23:52 UTC

怎么上手

由 README 提炼,执行前请确认
curl -sSfL https://goshs.de/install.sh | sh
goshs
硬件要求按 README 说明

README 未说明硬件要求;作为 Go 单二进制程序,未提及 GPU 或显存需求。

有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

单二进制文件服务器,替代 python3 -m http.server,集成多种协议与凭据捕获

单二进制文件服务器,集成 HTTP/S、WebDAV、FTP/SFTP、SMB、LDAP 等多种协议,还能抓取 NTLM 哈希和接收 DNS/SMTP 回调,适合红队和开发者替代 python3 -m http.server。

核心能力

  • 单二进制提供 HTTP/S、WebDAV、FTP/SFTP、SMB、LDAP/S 多协议服务
  • 支持 NTLM 哈希捕获与 LDAP 凭据捕获,可接字典破解
  • 提供分享链接,可设下载次数与有效期限制
  • 支持载荷模板,下载时渲染 LHOST/LPORT 等变量
  • 内置 TUI 仪表盘,实时查看各协议与反弹 shell 事件

容易踩的坑

默认在当前目录的 8000 端口启动服务,注意端口占用;HTTPS 自签名模式需加 -s -ss 参数,浏览器会提示证书不受信任;LDAP 字典破解需自行提供 wordlist 路径,README 未内置字典。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.1.7
  1. v2.1.7最新正式版2026-09-28 · 2026-09-28 07:17 UTC

    What Changed in v2.1.7

    This is a security-focused release resolving six advisories. Most close the same class of gap: the per-folder .goshs ACL was enforced on HTTP/WebDAV but not on every other protocol serving the webroot. It also adds folder uploads to the web UI, fixes an FTP crash and an SFTP path bug on Windows, and brings the usual dependency and CI maintenance.

    🔒 Security

    Per-folder .goshs ACL now enforced on every protocol: SFTP, FTP, TFTP and SMB share a new fail-closed enforcer, httpserver.ProtocolACL. These protocols cannot present a folder's basic-auth credential, so a folder protected by a .goshs auth entry is denied outright. Block-listed names and the .goshs file itself (which holds the bcrypt hashes) are always denied, and directory listings hide .goshs, blocked entries and auth-protected subdirectories.

    • SFTP ignores the .goshs ACL (GHSA-2m7f-jq4x-rcj7, High): SFTP handlers only checked the webroot boundary, so the single SFTP credential could read, write, list, rename or delete files inside folders that .goshs protects or blocks over HTTP. ProtocolACL is now wired into every SFTP read, write, list and command path, including the rename destination.
    • TFTP, FTP and SMB ignore the .goshs ACL (GHSA-q8gg-q2wc-w52g, Medium): the same gap in the other transfer protocols. Protected subtrees could be downloaded anonymously over TFTP, including the .goshs file with its bcrypt hash. The fixes:
      • TFTP checks the ACL on read and write requests.
      • FTP wraps its filesystem in an ACL layer that also filters listings.
      • SMB checks at handle creation and on the rename destination, and filters directory queries.
    • A directory named .goshs wipes inherited auth (GHSA-mhxc-hfx2-7w79, Medium): a .goshs directory (creatable via ?mkdir) made the ACL resolver return an empty ACL, silently removing inherited per-directory auth and block lists for the whole subtree. The resolver now fails closed: an unreadable or unparsable .goshs (including a dangling symlink) denies everything, and non-regular .goshs entries are ignored. ?mkdir and uploads refuse any .goshs path component.
    • Block list bypass on case-insensitive filesystems (GHSA-3x28-6v7h-gg87, Medium): incomplete fix of CVE-2026-66064. Block-list and never-serve checks compared names case-sensitively, so SECRET.txt slipped past a block on secret.txt on Windows/macOS. All enforcement points across HTTP, WebDAV, SFTP and listing filters now compare case-insensitively.
    • Concurrent requests bypass the brute-force lockout (GHSA-8f9w-966j-qhq9, Medium): verifyCredentials checked and updated the per-IP failure counter in two separate locked sections around the bcrypt compare. A burst of concurrent wrong-password requests all passed the check, and the counter ended at 1, so the 5-failure lockout never triggered. Each attempt is now counted in the same locked section as the check, before the password is verified, so each IP gets at most 5 guesses per lockout window no matter how many requests it sends at once.

    ✨ New Features

    • Folder upload in the web UI (#227): whole folders, including subdirectories, can now be dropped or selected for upload, and their structure is preserved on the server. Relative paths are sanitized: .. cannot escape the target directory, and .goshs components are refused.

    🐛 Bug Fixes

    • FTP crashed on AUTH TLS without TLS (nil-pointer panic): when a client requested explicit TLS, the FTP driver handed back an empty TLS configuration and the server crashed. FTP now serves FTPS with the configured certificate (-s with -ss or -sk/-sc) and cleanly refuses AUTH TLS when TLS is not enabled.
    • SFTP paths doubled on Windows (#292): SFTP on Windows hosts prefixed the webroot twice, breaking directory navigation and transfers.

    🛠️ Build, CI & Packaging

    • Docker builder image moved to Go 1.27 (`golan
  2. v2.1.62026-08-24 · 2026-08-24 07:59 UTC
    查看更新说明

    What Changed in v2.1.6

    This release turns the old shared clipboard into a full team chat for the web UI and the TUI, and resolves nine coordinated security advisories across the HTTP, WebDAV, SMB, TFTP and collaborator surfaces, plus the usual dependency and CI maintenance.

    ✨ New Features

    • Team chat (replaces the shared clipboard) — The non-persistent clipboard has grown into a live, collaboration-focused chat, synchronized over the websocket hub across every browser and the --tui dashboard (which authors as tui@<host>). Highlights:

      • Markdown rendering with the full :shortcode: emoji catalog (~1800 emoji), composer autosuggest, and collapsible long code blocks.
      • Emoji reactions (with a who-reacted tooltip) and in-place editing of your own messages (↑ in the composer recalls and cycles them; edits are flagged (edited)).
      • Image paste (inlined as base64, or written to disk with --persist-chat-images) and file upload via 📎 (POST /?chatUpload → .goshs-chat/, respects --read-only, hidden from the listing).
      • Own-message highlight and opt-in desktop notifications (🔔 toggle) for others' messages when the tab is hidden.
      • Opt-in persistence — --persist-chat writes the full log (messages, edit flags, per-emoji reaction authors) to <webroot>/.goshs-chat/chat.json and restores it on restart; in memory only by default.
      # Chat is on by default; persist it across restarts and store pasted images on disk
      ./goshs --persist-chat --persist-chat-images
      
      # Disable the chat entirely
      ./goshs --no-chat
      

      Flags: -nc/--no-chat (replaces the old --no-clipboard), -pc/--persist-chat, -pci/--persist-chat-images.

    🔒 Security

    Nine coordinated advisories, all remotely and (by default) unauthenticated.

    Content-destruction / mode-flag bypasses under --no-delete / --upload-only / --read-only (#256) — Across every write protocol, --no-delete/--upload-only now treat overwrite, in-place write, truncate and rename/move of a pre-existing file as deletion-class operations and refuse them, while still allowing new-file creation and the operator's own create→write→rename upload flow.

    • SMB WRITE opcode overwrite (GHSA-275v-rxgc-4rcj, High) — the SMB2 WRITE opcode ignored the flags, allowing in-place overwrite of existing files.
    • SMB overwrite disposition & SET_INFO truncate (GHSA-jx6h-2x8x-hf5r, High) — FILE_OVERWRITE/OVERWRITE_IF/SUPERSEDE creates and SET_INFO allocation/EOF truncation destroyed existing file contents.
    • SMB rename/clobber (GHSA-ppvh-3pc7-mvxw, High) — FileRenameInformation moved and clobbered existing files.
    • TFTP --no-delete ignored (GHSA-2q29-798w-6qcp, High) — a TFTP WRQ ignored --no-delete, allowing overwrite and truncation of existing files.
    • TFTP WRQ destroys served files (GHSA-vw29-46p5-7h7x, High) — an unauthenticated WRQ could truncate any served file (os.Create implies O_TRUNC).
    • HTTP DELETE on block-listed files (GHSA-ppmc-5w4w-2669, High) — incomplete fix of CVE-2026-40189: .goshs block-listed files could still be removed via HTTP DELETE; the block list is now enforced before removal, mirroring the read/share/bulk/WebDAV paths.
    • WebDAV LOCK plants empty files (GHSA-whqg-vqcj-px54, Medium) — the library's LOCK handler plants lock-null empty files for absent paths, bypassing --read-only/--upload-only; webdavGuard now refuses LOCK/UNLOCK in those modes.

    The four SMB sinks now route through SMBServer.protectExisting(), which blocks only when a flag is set and the path is not one the current session just created.

    Credential & ACL exposure (#234)

    • Collaborator feed leaks the .goshs Authorization header (GHSA-wfg4-m42q-9pvq, High) — a legitimate write to a .goshs-protected directory carries Authorization: Basic …; the collaborator feed (anonymous when n
  3. v2.1.52026-08-02 · 2026-08-02 08:48 UTC
    查看更新说明

    What Changed in v2.1.5

    This is a security-focused release resolving seven coordinated advisories across the HTTP, WebDAV, FTP and SFTP surfaces, plus a TUI convenience feature and the usual dependency and CI maintenance.

    🔒 Security

    • HTTP/WebDAV --no-delete/--upload-only overwrite bypass (GHSA-966r-mw4j-rv64, Critical) — The v2.1.4 per-verb WebDAV guard blocked overwriting MOVE/COPY, but the PUT case and the HTTP put()/upload() handlers still gated only on --read-only, so a PUT/POST that overwrote an existing file destroyed its contents under --no-delete and --upload-only. Overwrites of existing files are now blocked whenever deletion is disabled, on both HTTP and WebDAV.
    • ConPtyShell.ps1 unauthenticated exemption bypass (GHSA-6m5c-fv2q-jrj2, Critical) — The exemption that lets a caught Windows host fetch ConPtyShell.ps1 was scoped only by the conpty query key and path, not by method or by requiring conpty to be the sole parameter. Appending ?conpty to a request reached most of the authenticated API surface anonymously (bulk download, info, WebSocket/RCE, unauthenticated PUT/DELETE). A shared conPtyExempt() helper now restricts the exemption to a GET/HEAD of exactly /ConPtyShell.ps1 whose only query parameter is conpty; every other method or extra feature key falls through to normal auth.
    • WebDAV POST returns file contents, bypassing --upload-only (GHSA-rc9g-fmpg-c6pp, High) — golang.org/x/net/webdav dispatches POST to the same read handler as GET, and the webdavGuard had no POST case, so an unauthenticated POST /file returned the full file body under --upload-only. The guard now treats POST like GET/HEAD and blocks it in upload-only mode.
    • FTP ignores --upload-only and only partially enforces --no-delete (GHSA-6wwv-mx7w-35jx, High) — The FTP server never wired the --upload-only flag at all (the whole webroot was readable in upload-only mode), and its --no-delete guard missed rename (RNFR/RNTO) and truncating overwrites. FTP now stacks independent filesystem wrappers: --no-delete blocks deletes, renames and truncating/overwriting writes (appends and new files still allowed), and --upload-only blocks reads while permitting uploads and directory listing.
    • Trailing-slash ACL and hidden-file bypass in sendFile (GHSA-964w-f6gj-5236, Medium) — sendFile derived the served filename from the raw request path while opening the file from the cleaned path; a trailing slash emptied the derived name and defeated both the never-serve rule for the .goshs file and the block list. The name is now derived consistently from the cleaned path.
    • Single-file ?share redemption served with an empty ACL (GHSA-mqvv-v9g7-4h3j, Medium) — Redeeming a share token for a single file passed an empty configFile{} to sendFile, so neither the block list nor the per-directory basic auth was evaluated. The share redemption path now resolves and enforces the effective ACL, and share minting validates the caller's ACL permissions.
    • SFTP server ignored --no-delete (GHSA-4wh5-87mw-whxf, Medium) — The SFTP server had no NoDelete field and never mapped the flag, so Remove/Rmdir/Rename/overwrite stayed available under --no-delete. The flag is now honored, including an overwrite guard on writes.

    ✨ New Features

    • Password reveal popup in the TUI — The --tui status bar shows the basic-auth user but never the password. Pressing p (in any pane except the generator, where p edits LPORT) now opens a modal overlay with the credentials — masked until u toggles plaintext, y/c copy, esc/q close. Handy when the password was generated inline at launch (e.g. -b "user:$(xkcdpass …)"). A bcrypt-hashed secret is shown but flagged as unrecoverable.

    🛠️ Build, CI & Packaging

    • Migrated the integration test harness to moby/moby (testcontainers 0.43).
    • Releases are now s
  4. v2.1.42026-07-03 · 2026-07-03 07:32 UTC
    查看更新说明

    What Changed in v2.1.4

    🔒 Security

    • WebDAV --no-delete bypass via MOVE/COPY (GHSA-hq33-8jgp-8qq3) — Under -w --no-delete (and --upload-only), the WebDAV MOVE verb still removed the source file — a rename deletes it from its original path — and, with Overwrite: T, destroyed an existing destination; COPY onto an existing file did the same via an implicit delete. The mode flags are now enforced on these verbs: MOVE is rejected whenever deletion is disabled, and a COPY that would overwrite an existing file is blocked, while a plain COPY to a new path stays allowed. --read-only continues to block all of them.
    • SFTP authentication bypass with a single credential (GHSA-rjrw-mjq6-hpmm) — SFTP only installed its password handler when both a username and a password were configured, so setting only one left the server accepting unauthenticated logins. Authentication is now enforced whenever either credential is set.

    ✨ New Features

    • Clipboard copy in the TUI generator — The --tui reverse-shell generator can now copy the selected payload straight to your - clipboard with y/c. It works both locally (xclip/xsel, wl-copy, pbcopy, clip) and over SSH via OSC 52, filling both the system clipboard and the X11 primary selection (Ctrl+V and middle-click / Shift+Insert). The generator tab was also restructured into a stacked layout so multi-line output can be cleanly mouse-selected without also grabbing the menu entries.

    🐛 Bug Fixes

    • Fatal port-bind errors under --tui — Every listening protocol is now bound before the TUI dashboard takes over the terminal, so a port conflict (or any bind error) is reported cleanly and is fatal up front — instead of being swallowed by a serving goroutine, which under --tui left the terminal in raw mode needing a reset (and was silently dropped entirely for FTP).

    ⬆️ Dependencies

    • Bumped golang.org/x/net 0.53.0 → 0.55.0.
    • Bumped GitHub Actions: github/codeql-action (init/autobuild/analyze) 4.36.2 → 4.36.3, and goreleaser/goreleaser-action 7.2.2 → 7.2.3.
  5. v2.1.32026-06-25 · 2026-06-25 13:50 UTC
    查看更新说明

    What Changed in v2.1.3

    ✨ New Features

    • TFTP server (-tftp / --tftp-server) — goshs can now serve files over TFTP, the one classic transfer protocol it was missing (next to HTTP/WebDAV/FTP/SFTP/SMB). Listens on UDP port 69 by default so built-in clients like Windows' tftp.exe work out of the box, and supports both downloads (RRQ) and uploads (WRQ) with blksize/tsize option negotiation. Honors the IP whitelist and --read-only/--upload-only, rejects path traversal, and is advertised via mDNS. Hand-rolled with zero new dependencies.
    # Serve the webroot over TFTP (port 69 needs privileges)
    sudo ./goshs -tftp
    
    # Custom, unprivileged port
    ./goshs -tftp -tftp-port 6900
    
    • Reverse-shell payload generator — A new generator tab in both the web UI and the --tui dashboard builds reverse-shell one-liners from a shared payload database (Bash, nc, Python, PHP, PowerShell, Perl, Ruby, and more), with LHOST/LPORT substitution and optional URL/Base64 encoding (PowerShell payloads as -EncodedCommand).

    🐛 Bug Fixes

    • TUI interface display (#187) — In --tui mode without an explicit -i, the status line now lists every bound interface IP instead of just showing 0.0.0.0.
    • TUI template variables — The status line now reflects every --tpl-var KEY=VALUE entry, not only LHOST/LPORT.
    • TUI status line — Enabled FTP/SFTP and TFTP servers are now surfaced in the status bar like the other protocols.
    • Config ldap_jndi — The example config shipped a non-binding ldap_jndi_enabled key; the correct, working key is ldap_jndi.
    • Config ldap_wordlist — A ldap_wordlist value set via the config file was silently ignored; it is now applied.

    🛠️ Build, CI & Packaging

    • COPR spec fixes — networking enabled and the debug build disabled so package builds succeed.
    • Shell completions (bash/zsh/fish) updated with the new -tftp / --tftp-server / -tftp-port flags.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Version GitHub License GitHub go.mod Go version GitHub issues Downloads Stars goreleaser codecov OpenSSF Scorecard OpenSSF Best Practices

    You're mid-engagement. You need to transfer a file, catch an SMB hash, or stand up a quick HTTPS server — and python3 -m http.server won't cut it.

    goshs is a single-binary file server built for the moments when you need more than Python's SimpleHTTPServer but don't want to configure Apache. HTTP/S, WebDAV, FTP/SFTP, SMB, LDAP/S, basic auth, share links, DNS/SMTP callbacks, NTLM hash capture + cracking — all from one command.

    intro

    Demo

    Try it out yourself: demo.goshs.de

    goshs-demo

    Quick Start

    # Serve the current directory on port 8000
    goshs
    
    # Serve with HTTPS (self-signed) and basic auth
    goshs -s -ss -b user:password
    
    # Capture SMB hashes
    goshs -smb -smb-domain CORP
    
    # Capture LDAP credentials and NTLM hashes (with optional wordlist cracking)
    goshs -ldap
    goshs -ldap -ldap-wordlist /usr/share/wordlists/rockyou.txt
    
    # Catch DNS callbacks and receive emails
    goshs -dns -dns-ip 1.2.3.4 -smtp -smtp-domain your-domain.com
    
    # Self-destruct after 2 hours
    goshs --ttl 2h
    
    # Run with the interactive terminal dashboard (great for headless SSH sessions)
    goshs --tui
    
    # Serve payloads that auto-fill your callback host/port at download time
    goshs -i 10.10.14.7 --template --tpl-var LPORT=4444
    # fetch rendered: curl 'http://10.10.14.7:8000/rev.ps1?tpl'
    

    Documentation

    For a detailed documentation go to docs.goshs.de

    Features

    📁 File OperationsDownload (resumable & seekable via HTTP Range), upload (drag & drop, POST/PUT), delete, bulk ZIP, QR codes
    🔌 ProtocolsHTTP/S, WebDAV, FTP/SFTP, SMB, LDAP/S
    🔒 Auth & SecurityBasic auth, certificate auth, TLS (self-signed, Let's Encrypt, custom cert), IP whitelist, file-based ACLs
    ⚙️ Server ModesRead-only, upload-only, no-delete, silent, invisible, CLI command execution, TTL self-destruct
    🔗 Share LinksToken-based sharing, download limit, time limit
    🎯 Collaboration / CTFLive team chat (markdown, emoji + :shortcodes: autosuggest, image paste, file upload, reactions, message edit, optional disk persistence — shared web ↔ TUI), DNS server, SMTP server, SMB NTLM hash capture + cracking, LDAP credential capture + NTLM hash cracking (JNDI mode for Log4Shell), redirect endpoint, Rev Shell Catcher + Payload generator
    🧩 Payload TemplatingRender {{.LHOST}}/{{.LPORT}} + custom --tpl-var values into served files on demand (?tpl)
    🔔 IntegrationWebhooks, tunnel via localhost.run, config file, JSON API, mDNS
    🖥️ TUI DashboardInteractive full-screen terminal dashboard; live panes for HTTP, DNS, SMB, LDAP, SMTP, reverse shells and team chat; attach and upgrade shells from the terminal
    🛠️ MiscDark/light themes, team chat, self-update, log output, embed files, drop privileges

    Installation

    Method
    🐧 curl | shcurl -sSfL https://goshs.de/install.sh | sh
    🦫 Gogo install goshs.de/goshs/v2@latest
    🐉 Kali & Parrot OSsudo apt install goshs
    🎗️ Arch Linux (AUR)yay -S goshs-bin
    🖤 BlackArchpacman -S goshs
    🏔️ Alpine Linux (edge)apk add goshs
    🫙 Snapsnap install goshs
    🎩 Fedora / RHEL (COPR)dnf copr enable goshs-labs/goshs && dnf install goshs
    🦎 openSUSEsudo zypper install goshs
    ❄️ Nix / NixOSnix-env -iA nixpkgs.goshs
    🍺 Homebrewbrew install goshs
    🪟 Scoopscoop bucket add extras && scoop install extras/goshs
    🪟 wingetwinget install GoshsLabs.Goshs
    🍫 Chocolateychoco install goshs
    🐳 Dockerdocker run --rm -it -p 8000:8000 -v "$PWD:/pwd" goshs-labs/goshs:latest -d /pwd
    📦 ReleaseDownload from GitHub Releases

    goshs can install tab completion for bash, fish, and zsh:

    goshs --completion bash
    goshs --completion fish
    goshs --completion zsh
    

    On macOS with Homebrew the correct Homebrew path is used automatically. After installation the command prints an exact activation instruction, e.g.:

    source ~/.local/share/bash-completion/completions/goshs
    

    The bundled web assets are committed, so a plain build just works:

    git clone https://github.com/goshs-labs/goshs.git
    cd goshs
    go build -o goshs .
    

    If you change the JavaScript or SCSS sources, rebuild the assets first with esbuild and sass installed:

    make generate
    go build -o goshs .
    

    Code Contributors

    Contributors

    Security Contributors

    These are the awesome contributors that made goshs even more secure :heart:

    Community

    Join the Discord Community and start connecting.

    Join Discord

    Star History

    Star History Chart

    Credits

    A special thank you goes to sc0tfree for inspiring this project with his project updog written in Python.