Transferring Files with Code
Python
Python 2 - Download
eldeim@htb[/htb]$ python2.7 -c 'import urllib;urllib.urlretrieve ("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh", "LinEnum.sh")'Python 3 - Download
eldeim@htb[/htb]$ python3 -c 'import urllib.request;urllib.request.urlretrieve("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh", "LinEnum.sh")'PHP
PHP Download with File_get_contents()
eldeim@htb[/htb]$ php -r '$file = file_get_contents("https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh"); file_put_contents("LinEnum.sh",$file);'PHP Download with Fopen()
PHP Download a File and Pipe it to Bash
Other Languages
Ruby - Download a File
Perl - Download a File
JavaScript
Download a File Using JavaScript and cscript.exe
VBScript
Download a File Using VBScript and cscript.exe
Upload Operations using Python3
Starting the Python uploadserver Module
Uploading a File Using a Python One-liner
Last updated