Skip to content

Commit b9a0f48

Browse files
authored
Merge pull request #2141 from patrickhener/add-goshs
Add goshs to several exflitration sections
2 parents 0f02b33 + 78a3433 commit b9a0f48

1 file changed

Lines changed: 67 additions & 1 deletion

File tree

src/generic-hacking/exfiltration.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,41 @@ if __name__ == "__main__":
119119
###
120120
```
121121

122+
### goshs
123+
124+
[goshs](https://github.com/patrickhener/goshs) is a single-binary replacement for `python3 -m http.server`
125+
with upload, download, WebDAV, SFTP, SMB, TLS, authentication, share links,
126+
and OOB collaboration features (DNS, SMTP, NTLM hash capture).
127+
128+
```bash
129+
# Serve current directory on port 8000
130+
goshs
131+
132+
# Serve with HTTPS (self-signed)
133+
goshs -s -ss
134+
135+
# Serve with basic auth
136+
goshs -b user:password
137+
138+
# Upload-only mode
139+
goshs -uo
140+
141+
# Read-only mode
142+
goshs -ro
143+
144+
# Capture SMB NTLM hashes
145+
goshs -smb -smb-domain CORP
146+
147+
# DNS callback server
148+
goshs -dns -dns-ip 10.10.10.10
149+
150+
# SMTP callback server
151+
goshs -smtp -smtp-domain [REDACTED]
152+
153+
# Tunnel via localhost.run (no port forwarding needed)
154+
goshs -tunnel
155+
```
156+
122157
## Webhooks (Discord/Slack/Teams) for C2 & Data Exfiltration
123158

124159
Webhooks are write-only HTTPS endpoints that accept JSON and optional file parts. They’re commonly allowed to trusted SaaS domains and require no OAuth/API keys, making them useful for low-friction beaconing and exfiltration.
@@ -293,6 +328,18 @@ WindPS-1> New-PSDrive -Name "new_disk" -PSProvider "FileSystem" -Root "\\10.10.1
293328
WindPS-2> cd new_disk:
294329
```
295330

331+
### goshs
332+
[goshs](https://github.com/patrickhener/goshs) is a single-binary alternative
333+
that serves files over SMB and captures NetNTLMv2 hashes from connecting clients:
334+
335+
```bash
336+
# Start SMB server with NTLM hash capture
337+
goshs -smb -smb-domain CORP
338+
339+
# Also works for plain HTTP file serving
340+
goshs
341+
```
342+
296343
## SCP
297344

298345
The attacker has to have SSHd running.
@@ -366,6 +413,24 @@ If you can send data to an SMTP server, you can create an SMTP to receive the da
366413
sudo python -m smtpd -n -c DebuggingServer :25
367414
```
368415

416+
### goshs
417+
418+
[goshs](https://github.com/patrickhener/goshs) can spin up a quick SMTP server
419+
to catch email callbacks during OOB exfiltration scenarios:
420+
421+
```bash
422+
# Start SMTP callback server
423+
goshs -smtp -smtp-domain [REDACTED]
424+
```
425+
426+
Received emails and callbacks are displayed directly in the terminal output.
427+
Can be combined with the DNS callback server for full OOB coverage:
428+
429+
```bash
430+
# DNS + SMTP combined
431+
goshs -dns -dns-ip 10.10.10.10 -smtp -smtp-domain [REDACTED]
432+
```
433+
369434
## TFTP
370435

371436
By default in XP and 2003 (in others it needs to be explicitly added during installation)
@@ -457,11 +522,12 @@ Then copy-paste the text into the windows-shell and a file called nc.exe will be
457522
## DNS
458523

459524
- [https://github.com/Stratiz/DNS-Exfil](https://github.com/Stratiz/DNS-Exfil)
525+
- [https://github.com/patrickhener/goshs](https://github.com/patrickhener/goshs)
460526

461527
## References
462528

463529
- [Discord as a C2 and the cached evidence left behind](https://www.pentestpartners.com/security-blog/discord-as-a-c2-and-the-cached-evidence-left-behind/)
464530
- [Discord Webhooks – Execute Webhook](https://discord.com/developers/docs/resources/webhook#execute-webhook)
465531
- [Discord Forensic Suite (cache parser)](https://github.com/jwdfir/discord_cache_parser)
466532

467-
{{#include ../banners/hacktricks-training.md}}
533+
{{#include ../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)