• XSS.stack #1 – первый литературный журнал от юзеров форума

[Sharing] Quick Secure Upload Methods

el84

(L2) cache
Пользователь
Регистрация
10.01.2023
Сообщения
326
Реакции
143
Депозит
0.00
This is a simple way to upload a collection of files, for this example I will use https://transfer.sh, but its easy to change the script to use any other service.

The following snippet as /usr/bin/upload and give it permission to execute eg: "chmod +x /usr/bin/upload"


Bash:
#gen pass
PASS="$(dd if=/dev/random of=/dev/stdout bs=1 count=32 2>/dev/null| base64 -w0)"

#create tmp dir
TMP_DIR="$(mktemp -d)"

#compress with pass
7z a -mhe=on -p"${PASS}" -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on "${TMP_DIR}/files.7z" $@

#uploading
LINK=$(curl -s -T "${TMP_DIR}/files.7z" https://transfer.sh)

#output
printf "\n\nLink: %s\nPass: %s\nCmd : wget ${LINK}; 7z x -p\"${PASS}\" files.7z; rm files.7z\n\n" ${LINK} ${PASS}

#remove tmp dir
rm -rf ${TMP_DIR}

With this script you can upload single file or entire directories, it will compress all the file with a random generated password and then output the link and password and a one-line command to quick download and extract.
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх