Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
transfer.sh — Condivisione di file facile e veloce dalla riga di comando. | Kitploit
Strumenti/GitHubGitHub/dutchcoders/transfer.sh
Utilità GenericheStrumenti di Crittografia/DecrittografiaEsfiltrazione Dati
GitHubdutchcoders/transfer.sh

transfer.sh

Condivisione di file facile e veloce dalla riga di comando.

Vedi Repository
15.9k1.6k2 mesi faRevisionato da Kitploit

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

AVVISO DI SICUREZZA

Bypass del filtro IP e dell'autenticazione HTTP tramite spoofing non autenticato dell'header X-Forwarded-For

transfer.sh Go Report Card Docker pulls Build Status

Condivisione di file facile e veloce dalla riga di comando. Questo codice contiene il server con tutto il necessario per creare la propria istanza.

Transfer.sh attualmente supporta i provider s3 (Amazon S3), gdrive (Google Drive), storj (Storj) e il file system locale (local).




Dichiarazione di non responsabilità

@stefanbenten è un manutentore di questo repository e la persona che ospita una nota installazione pubblica del software nel repository.

Le due cose sono comunque indipendenti, e il repository non è il luogo a cui indirizzare richieste e segnalazioni per nessuna delle installazioni pubbliche.

Nessuna installazione pubblica di terze parti del software nel repository sarà pubblicizzata o menzionata nel repository stesso, per ragioni di sicurezza.

La posizione ufficiale mia, @aspacca, come manutentore del repository, è che se desideri utilizzare il software dovresti ospitare la tua installazione.




Utilizzo

Questa sezione descrive come utilizzare transfer.sh


Caricamento```bash

$ curl -v --upload-file ./hello.txt https://transfer.sh/hello.txt

root@kitploit:~
<br />

### Cripta e Carica```bash
$ gpg --armor --symmetric --output - /tmp/hello.txt | curl --upload-file - https://transfer.sh/test.txt

Scarica & Decifra```bash

$ curl https://transfer.sh/1lDau/test.txt | gpg --decrypt --output /tmp/hello.txt

root@kitploit:~
<br />

### Carica su Virustotal```bash
$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal

Eliminazione```bash

$ curl -X DELETE

root@kitploit:~
<br />

---

<br />

## Intestazioni delle Richieste

Questa sezione spiega come gestire le intestazioni delle richieste con curl:

<br />

### Max-Downloads```bash
$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt -H "Max-Downloads: 1" # Limit the number of downloads

Max-Days```bash

$ curl --upload-file ./hello.txt https://transfer.sh/hello.txt -H "Max-Days: 1" # Set the number of days before deletion

root@kitploit:~
<br />

### X-Encrypt-Password

#### Attenzione, utilizza questa funzione solo sul tuo server self-hosted: affidarsi a un servizio di terze parti per la crittografia lato server è a tuo rischio.```bash
$ curl --upload-file ./hello.txt https://your-transfersh-instance.tld/hello.txt -H "X-Encrypt-Password: test" # Encrypt the content server side with AES256 using "test" as password

X-Decrypt-Password

Attenzione, utilizza questa funzione solo sul tuo server self-hosted: affidarsi a un servizio di terze parti per la crittografia lato server è a tuo rischio```bash

$ curl https://your-transfersh-instance.tld/BAYh0/hello.txt -H "X-Decrypt-Password: test" # Decrypt the content server side with AES256 using "test" as password

root@kitploit:~
<br />

---

<br />

## Intestazioni di Risposta

Questa sezione spiega come gestire le intestazioni di risposta:

<br />

### X-Url-Delete

L'URL utilizzato per richiedere l'eliminazione di un file e restituito come intestazione di risposta:```bash
curl -sD - --upload-file ./hello.txt https://transfer.sh/hello.txt | grep -i -E 'transfer\.sh|x-url-delete'
x-url-delete: https://transfer.sh/hello.txt/BAYh0/hello.txt/PDw0NHPcqU
https://transfer.sh/hello.txt/BAYh0/hello.txt



Esempi

Vedi buoni esempi di utilizzo su examples.md


Alias di link

Crea link di download diretto:

https://transfer.sh/1lDau/test.txt --> https://transfer.sh/get/1lDau/test.txt

File inline:

https://transfer.sh/1lDau/test.txt --> https://transfer.sh/inline/1lDau/test.txt




Utilizzo

Se desideri utilizzare TLS con i certificati Let's Encrypt, imposta lets-encrypt-hosts sul tuo dominio, imposta tls-listener su :443 e abilita force-https.

Se desideri utilizzare TLS con i tuoi certificati, imposta tls-listener su :443, force-https, tls-cert-file e tls-private-key.




Sviluppo

Passato a GO111MODULE```bash go run main.go --provider=local --listener :8080 --temp-path=/tmp/ --basedir=/tmp/

root@kitploit:~
<br />

---

<br />

## Compilazione```bash
$ git clone [email protected]:dutchcoders/transfer.sh.git
$ cd transfer.sh
$ go build -o transfersh main.go



Docker

Per una facile distribuzione, abbiamo creato un contenitore Docker ufficiale. Ci sono due varianti, che differiscono solo per l'utente che esegue il processo.

Quella predefinita verrà eseguita come root:

[!WARNING] È scoraggiato utilizzare il tag latest per WatchTower o strumenti simili. Il tag latest può fare riferimento a build di sviluppo non rilasciate, build di test e patch release per versioni precedenti. Utilizza un tag di versione effettivo fino a quando transfer.sh non supporterà tag di versione major o minor.```bash docker run --publish 8080:8080 dutchcoders/transfer.sh:latest --provider local --basedir /tmp/

root@kitploit:~
<br />

### No root

I tag `-noroot` indicano build di immagini che vengono eseguite con il minimo privilegio per ridurre la superficie d'attacco qualora un'applicazione venga compromessa.

> [!NOTE]
> L'uso di `-noroot` è **raccomandato**

<br />

Quella con il suffisso `-noroot` utilizzerà `5000` sia come UID che come GID:```bash
docker run --publish 8080:8080 dutchcoders/transfer.sh:latest-noroot --provider local --basedir /tmp/

[!NOTE] Dettagli della cronologia di sviluppo presso:

  • https://github.com/dutchcoders/transfer.sh/pull/418

Tag


Costruzione del Contenitore

Puoi anche costruire il contenitore da solo. Questo ti permette di scegliere quale UID/GID verrà utilizzato, ad esempio quando si usano mount NFS:```bash

Build arguments:

* RUNAS: If empty, the container will run as root.

Set this to anything to enable UID/GID selection.

* PUID: UID of the process. Needs RUNAS != "". Defaults to 5000.

* PGID: GID of the process. Needs RUNAS != "". Defaults to 5000.

docker build -t transfer.sh-noroot --build-arg RUNAS=doesntmatter --build-arg PUID=1337 --build-arg PGID=1338 .

root@kitploit:~
<br />

---

<br />

## Utilizzo S3

Per l'utilizzo con un bucket AWS S3, è sufficiente specificare le seguenti opzioni:
- provider `--provider s3`
- aws-access-key _(tramite flag o variabile d'ambiente `AWS_ACCESS_KEY`)_
- aws-secret-key _(tramite flag o variabile d'ambiente `AWS_SECRET_KEY`)_
- bucket _(tramite flag o variabile d'ambiente `BUCKET`)_
- s3-region _(tramite flag o variabile d'ambiente `S3_REGION`)_

Se specifichi la s3-region, non è necessario impostare l'URL dell'endpoint poiché verrà utilizzato automaticamente l'endpoint corretto.

<br />

### Provider S3 personalizzati

Per utilizzare un provider S3 personalizzato non AWS, è necessario specificare l'endpoint come definito dal tuo cloud provider.

<br />

---

<br />

## Provider Storj Network

Per utilizzare la rete Storj come provider di archiviazione, è necessario specificare i seguenti flag:
- provider `--provider storj`
- storj-access _(tramite flag o variabile d'ambiente STORJ_ACCESS)_
- storj-bucket _(tramite flag o variabile d'ambiente STORJ_BUCKET)_

<br />

### Creazione del Bucket e dell'Scope

È necessario creare un access grant (o copiarlo dalla configurazione uplink) e un bucket in preparazione.

Per iniziare, accedi al tuo account e vai al menu Access Grant e avvia la procedura guidata in alto a destra.

Inserisci il nome dell'access grant desiderato, premi *Next* e limitalo come necessario/preferito.
Successivamente continua tramite CLI o all'interno del browser. Successivamente, ti verrà chiesta una passphrase utilizzata come chiave di crittografia.
**Assicurati di salvarla in un luogo sicuro. Senza di essa, perderai la possibilità di decrittare i tuoi file!**

Successivamente, puoi copiare l'access grant e quindi avviare l'endpoint di transfer.sh. 
Si consiglia di fornire sia l'access grant che il nome del bucket come variabili d'ambiente per una maggiore sicurezza.

Esempio:```
export STORJ_BUCKET=<BUCKET NAME>
export STORJ_ACCESS=<ACCESS GRANT>
transfer.sh --provider storj



Utilizzo di Google Drive

Per l'utilizzo con Google drive, è necessario specificare le seguenti opzioni:

  • provider
  • gdrive-client-json-filepath
  • gdrive-local-config-path
  • basedir

Creazione del Gdrive Client Json

Devi creare un ID client OAuth da console.cloud.google.com, scaricare il file e posizionarlo in una directory sicura.


Esempio di utilizzogo run main.go --provider gdrive --basedir /tmp/ --gdrive-client-json-filepath /[credential_dir] --gdrive-local-config-path [directory_to_save_config]




Shell functions

Bash, ash and zsh (multiple files uploaded as zip archive)

Add this to .bashrc or .zshrc or its equivalent
root@kitploit:~
transfer() ( if [ $# -eq 0 ]; then printf "Nessun argomento specificato.\nUtilizzo:\n transfer <file|directory>\n ... | transfer <nome_file>\n">&2; return 1; fi; file_name=$(basename "$1"); if [ -t 0 ]; then file="$1"; if [ ! -e "$file" ]; then echo "$file: File o directory inesistente">&2; return 1; fi; if [ -d "$file" ]; then cd "$file" || return 1; file_name="$file_name.zip"; set -- zip -r -q - .; else set -- cat "$file"; fi; else set -- cat; fi; url=$("$@" | curl --silent --show-error --progress-bar --upload-file "-" "https://transfer.sh/$file_name"); echo "$url"; )```

<br />

#### Now you can use transfer function

$ transfer hello.txt```


Bash and zsh (with delete url, delete token output and prompt before uploading)

Add this to .bashrc or .zshrc or its equivalent
Expand

root@kitploit:~
transfer()
{
    local file
    declare -a file_array
    file_array=("${@}")

    if [[ "${file_array[@]}" == "" || "${1}" == "--help" || "${1}" == "-h" ]]
    then
        echo "${0} - Upload arbitrary files to \"transfer.sh\"."
        echo ""
        echo "Usage: ${0} [options] [<file>]..."
        echo ""
        echo "OPTIONS:"
        echo "  -h, --help"
        echo "      show this message"
        echo ""
        echo "EXAMPLES:"
        echo "  Upload a single file from the current working directory:"
        echo "      ${0} \"image.img\""
        echo ""
        echo "  Upload multiple files from the current working directory:"
        echo "      ${0} \"image.img\" \"image2.img\""
        echo ""
        echo "  Upload a file from a different directory:"
        echo "      ${0} \"/tmp/some_file\""
        echo ""
        echo "  Upload all files from the current working directory. Be aware of the webserver's rate limiting!:"
        echo "      ${0} *"
        echo ""
        echo "  Upload a single file from the current working directory and filter out the delete token and download link:"
        echo "      ${0} \"image.img\" | awk --field-separator=\": \" '/Delete token:/ { print \$2 } /Download link:/ { print \$2 }'"
        echo ""
        echo "  Show help text from \"transfer.sh\":"
        echo "      curl --request GET \"https://transfer.sh\""
        return 0
    else
        for file in "${file_array[@]}"
        do
            if [[ ! -f "${file}" ]]
            then
                echo -e "\e[01;31m'${file}' could not be found or is not a file.\e[0m" >&2
                return 1
            fi
        done
        unset file
    fi

    local upload_files
    local curl_output
    local awk_output

    du -c -k -L "${file_array[@]}" >&2
    # be compatible with "bash"
    if [[ "${ZSH_NAME}" == "zsh" ]]
    then
        read $'upload_files?\e[01;31mDo you really want to upload the above files ('"${#file_array[@]}"$') to "transfer.sh"? (Y/n): \e[0m'
    elif [[ "${BASH}" == *"bash"* ]]
    then
        read -p $'\e[01;31mDo you really want to upload the above files ('"${#file_array[@]}"$') to "transfer.sh"? (Y/n): \e[0m' upload_files
    fi

    case "${upload_files:-y}" in
        "y"|"Y")
            # for the sake of the progress bar, execute "curl" for each file.
            # the parameters "--include" and "--form" will suppress the progress bar.
            for file in "${file_array[@]}"
            do
                # show delete link and filter out the delete token from the response header after upload.
                # it is important to save "curl's" "stdout" via a subshell to a variable or redirect it to another command,
                # which just redirects to "stdout" in order to have a sane output afterwards.
                # the progress bar is redirected to "stderr" and is only displayed,
                # if "stdout" is redirected to something; e.g. ">/dev/null", "tee /dev/null" or "| <some_command>".
                # the response header is redirected to "stdout", so redirecting "stdout" to "/dev/null" does not make any sense.
                # redirecting "curl's" "stderr" to "stdout" ("2>&1") will suppress the progress bar.
                curl_output=$(curl --request PUT --progress-bar --dump-header - --upload-file "${file}" "https://transfer.sh/")
                awk_output=$(awk \
                    'gsub("\r", "", $0) && tolower($1) ~ /x-url-delete/ \
                    {
                        delete_link=$2;
                        print "Delete command: curl --request DELETE " "\""delete_link"\"";

                        gsub(".*/", "", delete_link);
                        delete_token=delete_link;
                        print "Delete token: " delete_token;
                    }

                    END{
                        print "Download link: " $0;
                    }' <<< "${curl_output}")

                # return the results via "stdout", "awk" does not do this for some reason.
                echo -e "${awk_output}\n"

                # avoid rate limiting as much as possible; nginx: too many requests.
                if (( ${#file_array[@]} > 4 ))
                then
                    sleep 5
                fi
            done
            ;;

        "n"|"N")
            return 1
            ;;

        *)
            echo -e "\e[01;31mWrong input: '${upload_files}'.\e[0m" >&2
            return 1
    esac
}```

</p></details>

#### Sample output
```bash
$ ls -lh
total 20M
-rw-r--r-- 1 <some_username> <some_username> 10M Apr  4 21:08 image.img
-rw-r--r-- 1 <some_username> <some_username> 10M Apr  4 21:08 image2.img
$ transfer image*
10240K  image2.img
10240K  image.img
20480K  total
Vuoi davvero caricare i file sopra (2) su "transfer.sh"? (Y/n):
######################################################################################################################################################################################################################################## 100.0%
Comando di eliminazione: curl --request DELETE "https://transfer.sh/wJw9pz/image2.img/mSctGx7pYCId"
Token di eliminazione: mSctGx7pYCId
Link di download: https://transfer.sh/wJw9pz/image2.img

######################################################################################################################################################################################################################################## 100.0%
Comando di eliminazione: curl --request DELETE "https://transfer.sh/ljJc5I/image.img/nw7qaoiKUwCU"
Token di eliminazione: nw7qaoiKUwCU
Link di download: https://transfer.sh/ljJc5I/image.img

$ transfer "image.img" | awk --field-separator=": " '/Delete token:/ { print $2 } /Download link:/ { print $2 }'
10240K  image.img
10240K  total
Vuoi davvero caricare i file sopra (1) su "transfer.sh"? (Y/n):
######################################################################################################################################################################################################################################## 100.0%
tauN5dE3fWJe
https://transfer.sh/MYkuqn/image.img```

<br />

---

<br />

## Contributions

Contributions are welcome.

<br />

---

<br />

## Creators

**Remco Verhoef**
- <https://twitter.com/remco_verhoef>
- <https://twitter.com/dutchcoders>

**Uvis Grinfelds**

<br />

---

<br />

## Maintainers

- **Andrea Spacca**
- **Stefan Benten**

<br />

---

<br />

## Copyright and License

Code and documentation copyright 2011-2018 Remco Verhoef.
Code and documentation copyright 2018-2020 Andrea Spacca.
Code and documentation copyright 2020- Andrea Spacca and Stefan Benten.

Code released under [the MIT license](https://github.com/dutchcoders/transfer.sh/blob/HEAD/LICENSE).
Scarica lo strumento
ParametroDescrizioneValoreEnv
listenerporta da usare per http (:80)LISTENER
profile-listenerporta da usare per il profiler (:6060)PROFILE_LISTENER
force-httpsreindirizza a httpsfalseFORCE_HTTPS
tls-listenerporta da usare per https (:443)TLS_LISTENER
tls-listener-onlyflag per abilitare solo l'ascoltatore tlsTLS_LISTENER_ONLY
tls-cert-filepercorso del certificato tlsTLS_CERT_FILE
tls-private-keypercorso della chiave privata tlsTLS_PRIVATE_KEY
http-auth-userutente per autenticazione http di base sul caricamentoHTTP_AUTH_USER
http-auth-passpassword per autenticazione http di base sul caricamentoHTTP_AUTH_PASS
http-auth-htpasswdpercorso del file htpasswd per autenticazione http di base sul caricamentoHTTP_AUTH_HTPASSWD
http-auth-ip-whitelistlista separata da virgole di IP consentiti per caricare senza richiesta di autenticazioneHTTP_AUTH_IP_WHITELIST
virustotal-keychiave API VirusTotalVIRUSTOTAL_KEY
ip-whitelistlista separata da virgole di IP consentiti a connettersi al servizioIP_WHITELIST
ip-blacklistlista separata da virgole di IP non consentiti a connettersi al servizioIP_BLACKLIST
temp-pathpercorso della cartella temporaneatemp di sistemaTEMP_PATH
web-pathpercorso dei file web statici (per sviluppo o front-end personalizzato)WEB_PATH
proxy-pathprefisso del percorso quando il servizio è eseguito dietro un proxy (un prefisso / verrà rimosso)PROXY_PATH
proxy-portporta del proxy quando il servizio è eseguito dietro un proxyPROXY_PORT
email-contactcontatto email per il front-endEMAIL_CONTACT
ga-keychiave di Google Analytics per il front-endGA_KEY
providerquale provider di archiviazione utilizzare(s3, storj, gdrive o local)
uservoice-keychiave UserVoice per il front-endUSERVOICE_KEY
aws-access-keychiave di accesso AWSAWS_ACCESS_KEY
aws-secret-keychiave di accesso AWSAWS_SECRET_KEY
bucketbucket AWSBUCKET
s3-endpointEndpoint S3 personalizzato.S3_ENDPOINT
s3-regionregione del bucket S3eu-west-1S3_REGION
s3-no-multipartdisabilita il caricamento multipart S3falseS3_NO_MULTIPART
s3-path-styleForza URL in stile percorso, richiesto per Minio.falseS3_PATH_STYLE
storj-accessAccesso per il progettoSTORJ_ACCESS
storj-bucketBucket da utilizzare all'interno del progettoSTORJ_BUCKET
basedirpercorso di archiviazione per provider locale/gdriveBASEDIR
gdrive-client-json-filepathpercorso del file JSON di configurazione client OAuth per provider gdriveGDRIVE_CLIENT_JSON_FILEPATH
gdrive-local-config-pathpercorso per memorizzare la cache di configurazione locale di transfer.sh per provider gdriveGDRIVE_LOCAL_CONFIG_PATH
gdrive-chunk-sizedimensione del chunk per il caricamento gdrive in megabyte, deve essere inferiore alla memoria disponibile (8 MB)GDRIVE_CHUNK_SIZE
lets-encrypt-hostshost da utilizzare per i certificati Let's Encrypt (separati da virgole)HOSTS
logpercorso del file di logLOG
cors-domainslista separata da virgole di domini per CORS, impostandolo abilita CORSCORS_DOMAINS
clamav-hosthost per la funzionalità clamavCLAMAV_HOST
perform-clamav-prescanpre-scansiona ogni caricamento usando clamav (clamav-host deve essere un socket unix locale di clamd)PERFORM_CLAMAV_PRESCAN
rate-limitrichieste al minutoRATE_LIMIT
max-upload-sizedimensione massima di upload in kilobyteMAX_UPLOAD_SIZE
purge-daysnumero di giorni dopo i quali i caricamenti vengono eliminati automaticamentePURGE_DAYS
purge-intervalintervallo (ore) per eseguire la pulizia automatica (esclusi S3 e Storj)PURGE_INTERVAL
random-token-lengthlunghezza del token casuale per il percorso di upload (doppia per il percorso di eliminazione)6RANDOM_TOKEN_LENGTH
NomeUtilizzo
latestUltima build CI, può essere nightly, su commit, su tag, ecc.
latest-norootUltima build CI, può essere nightly, su commit, su tag, ecc. utilizzando [no root]
nightlyBuild CI pianificata ogni mezzanotte UTC
nightly-norootBuild CI pianificata ogni mezzanotte UTC utilizzando [no root]
edgeUltima build CI dopo ogni commit su main
edge-norootUltima build CI dopo ogni commit su main utilizzando [no root]
vx.y.zBuild CI dopo il tagging di una release
vx.y.z-norootBuild CI dopo il tagging di una release utilizzando [no root]