Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
transfer.sh — コマンドラインからの簡単かつ高速なファイル共有。 | Kitploit
ツール/GitHubGitHub/dutchcoders/transfer.sh
汎用ユーティリティ暗号化/復号化ツールデータ流出
GitHubdutchcoders/transfer.sh

transfer.sh

コマンドラインからの簡単かつ高速なファイル共有。

リポジトリを見る
15.9k1.6k2ヶ月前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

SECURITY WARNING

IPフィルターとHTTP認証のバイパス(認証なしのX-Forwarded-Forヘッダースプーフィングによる)

transfer.sh Go Report Card Docker pulls Build Status

コマンドラインから簡単かつ高速にファイル共有ができます。このコードには、ご自身のインスタンスを作成するために必要なすべてが含まれています。

Transfer.shは現在、s3(Amazon S3)、gdrive(Google Drive)、storj(Storj)プロバイダー、およびローカルファイルシステム(local)をサポートしています。




免責事項

@stefanbentenは、このリポジトリのメンテナーであると同時に、このソフトウェアのよく知られた公開インスタンスをホストしている人物です。

両者は無関係であり、公開インスタンスに関するリクエストや問題をこのリポジトリに直接送る場所ではありません。

セキュリティ上の理由から、このソフトウェアのサードパーティの公開インスタンスは、リポジトリ内で宣伝されたり言及されたりすることはありません。

メンテナーである@aspaccaとしての私の公式な立場は、このソフトウェアを使用したい場合は、ご自身でインスタンスをホストするべきである、というものです。




使用方法

このセクションでは、transfer.shの使用方法を説明します。


アップロード```bash

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

root@kitploit:~
<br />

### 暗号化とアップロード```bash
$ gpg --armor --symmetric --output - /tmp/hello.txt | curl --upload-file - https://transfer.sh/test.txt

ダウンロードと復号```bash

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

root@kitploit:~
<br />

### Virustotal にアップロード```bash
$ curl -X PUT --upload-file nhgbhhj https://transfer.sh/test.txt/virustotal

削除```bash

$ curl -X DELETE

root@kitploit:~
<br />

---

<br />

## リクエストヘッダー

このセクションでは、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

#### 注意:この機能は自己ホストサーバーでのみ使用してください。サーバーサイドの暗号化をサードパーティのサービスに委ねることは自己責任となります。```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

注意: この機能は自己ホストサーバーでのみ使用してください。サーバーサイド暗号化をサードパーティサービスに委託するのは自己責任です。```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 />

## レスポンスヘッダー

このセクションでは、レスポンスヘッダーの扱い方について説明します:

<br />

### X-Url-Delete

ファイルの削除を要求するために使用され、レスポンスヘッダーとして返されるURL:```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



例

良い使用例は examples.md を参照してください。


リンクエイリアス

直接ダウンロードリンクを作成:

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

インラインファイル:

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




使用方法

Let's Encrypt証明書を使用してTLSを利用する場合は、lets-encrypt-hostsにドメインを設定し、tls-listenerを :443 に設定し、force-httpsを有効にしてください。

独自の証明書を使用してTLSを利用する場合は、tls-listenerを :443 に設定し、force-https、tls-cert-file、tls-private-keyを設定してください。




開発

GO111MODULEに切り替えました```bash go run main.go --provider=local --listener :8080 --temp-path=/tmp/ --basedir=/tmp/

root@kitploit:~
<br />

---

<br />

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



Docker

簡単なデプロイのために、公式Dockerコンテナを作成しました。プロセスを実行するユーザーのみが異なる2つのバリアントがあります。

デフォルトのものは root として実行されます:

[!WARNING] latest タグを WatchTower または類似のツールで使用することは推奨されません。latest タグは未リリースの開発版、テストビルド、古いバージョンのパッチリリースを参照する可能性があります。transfer.sh がメジャーバージョンまたはマイナーバージョンのタグをサポートするまでは、実際のバージョンタグを使用してください。```bash docker run --publish 8080:8080 dutchcoders/transfer.sh:latest --provider local --basedir /tmp/

root@kitploit:~
<br />

### 非ルート

`-noroot`タグは、アプリケーションが侵害された場合に備えて攻撃対象領域を減らすために、最小権限で実行されるイメージビルドを示します。

> [!NOTE]
> `-noroot` の使用は **推奨** されます。

<br />

接尾辞 `-noroot` が付いたものは、UID と GID の両方に `5000` を使用します。```bash
docker run --publish 8080:8080 dutchcoders/transfer.sh:latest-noroot --provider local --basedir /tmp/

[!NOTE] 開発履歴の詳細はこちら:

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

タグ


コンテナのビルド

コンテナを自分でビルドすることもできます。これにより、使用するUID/GIDを選択できます(例: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 />

## S3 の使い方

AWS S3 バケットを使用するには、以下のオプションを指定するだけです:
- provider `--provider s3`
- aws-access-key _(フラグまたは環境変数 `AWS_ACCESS_KEY` で指定)_
- aws-secret-key _(フラグまたは環境変数 `AWS_SECRET_KEY` で指定)_
- bucket _(フラグまたは環境変数 `BUCKET` で指定)_
- s3-region _(フラグまたは環境変数 `S3_REGION` で指定)_

s3-region を指定すれば、正しいエンドポイントが自動的に使用されるため、エンドポイント URL を設定する必要はありません。

<br />

### カスタム S3 プロバイダー

非 AWS のカスタム S3 プロバイダーを使用するには、クラウドプロバイダーによって定義されたエンドポイントを指定する必要があります。

<br />

---

<br />

## Storj ネットワークプロバイダー

Storj ネットワークをストレージプロバイダーとして使用するには、以下のフラグを指定する必要があります:
- provider `--provider storj`
- storj-access _(フラグまたは環境変数 STORJ_ACCESS で指定)_
- storj-bucket _(フラグまたは環境変数 STORJ_BUCKET で指定)_

<br />

### バケットとスコープの作成

準備として、アクセス権限(または uplink の設定からコピー)とバケットを作成する必要があります。

開始するには、アカウントにログインし、アクセス権限メニューに移動して、右上のウィザードを開始してください。

任意のアクセス権限名を入力し、*Next* をクリックして、必要に応じて制限を設定します。
その後、CLI またはブラウザ内で続行します。次に、暗号化キーとして使用するパスフレーズを求められます。
**安全な場所に保存してください。これがないと、ファイルを復号できなくなります!**

その後、アクセス権限をコピーし、transfer.sh エンドポイントの起動を開始できます。
セキュリティを強化するために、アクセス権限とバケット名の両方を環境変数として指定することをお勧めします。

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



Google Drive の使用方法

Google Drive を使用するには、次のオプションを指定する必要があります:

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

Gdrive Client Json の作成

console.cloud.google.com から OAuth クライアント ID を作成し、ファイルをダウンロードして、安全なディレクトリに配置する必要があります。


使用例go 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 "引数が指定されていません。\n使用法:\n transfer <file|directory>\n ... | transfer <file_name>\n">&2; return 1; fi; file_name=$(basename "$1"); if [ -t 0 ]; then file="$1"; if [ ! -e "$file" ]; then echo "$file: そのようなファイルまたはディレクトリはありません">&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
上記のファイル(2つ)を本当に"transfer.sh"にアップロードしますか?(Y/n):
######################################################################################################################################################################################################################################## 100.0%
削除コマンド:curl --request DELETE "https://transfer.sh/wJw9pz/image2.img/mSctGx7pYCId"
削除トークン:mSctGx7pYCId
ダウンロードリンク:https://transfer.sh/wJw9pz/image2.img

######################################################################################################################################################################################################################################## 100.0%
削除コマンド:curl --request DELETE "https://transfer.sh/ljJc5I/image.img/nw7qaoiKUwCU"
削除トークン:nw7qaoiKUwCU
ダウンロードリンク: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
上記のファイル(1つ)を本当に"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).
ツールをダウンロード
パラメータ説明値環境変数
listenerHTTPで使用するポート (:80)LISTENER
profile-listenerプロファイラで使用するポート (:6060)PROFILE_LISTENER
force-httpsHTTPSにリダイレクトfalseFORCE_HTTPS
tls-listenerHTTPSで使用するポート (:443)TLS_LISTENER
tls-listener-onlyTLSリスナーのみを有効にするフラグTLS_LISTENER_ONLY
tls-cert-fileTLS証明書へのパスTLS_CERT_FILE
tls-private-keyTLS秘密鍵へのパスTLS_PRIVATE_KEY
http-auth-userアップロード時の基本HTTP認証のユーザーHTTP_AUTH_USER
http-auth-passアップロード時の基本HTTP認証のパスワードHTTP_AUTH_PASS
http-auth-htpasswdアップロード時の基本HTTP認証用htpasswdファイルのパスHTTP_AUTH_HTPASSWD
http-auth-ip-whitelist認証チャレンジなしでアップロードを許可するIPのカンマ区切りリストHTTP_AUTH_IP_WHITELIST
virustotal-keyVirusTotal APIキーVIRUSTOTAL_KEY
ip-whitelistサービスへの接続を許可するIPのカンマ区切りリストIP_WHITELIST
ip-blacklistサービスへの接続を許可しないIPのカンマ区切りリストIP_BLACKLIST
temp-path一時フォルダへのパスシステムの一時領域TEMP_PATH
web-path静的Webファイルへのパス(開発用またはカスタムフロントエンド用)WEB_PATH
proxy-pathサービスがプロキシの背後で実行されるときのパスプレフィックス(先頭の/はトリムされます)PROXY_PATH
proxy-portサービスがプロキシの背後で実行されるときのプロキシポートPROXY_PORT
email-contactフロントエンドのメール連絡先EMAIL_CONTACT
ga-keyフロントエンドのGoogle AnalyticsキーGA_KEY
provider使用するストレージプロバイダ(s3, storj, gdrive または local)
uservoice-keyフロントエンドのUserVoiceキーUSERVOICE_KEY
aws-access-keyAWSアクセスキーAWS_ACCESS_KEY
aws-secret-keyAWSシークレットキーAWS_SECRET_KEY
bucketAWSバケットBUCKET
s3-endpointカスタムS3エンドポイントS3_ENDPOINT
s3-regionS3バケットのリージョンeu-west-1S3_REGION
s3-no-multipartS3マルチパートアップロードを無効化falseS3_NO_MULTIPART
s3-path-styleパススタイルURLを強制(Minioで必要)falseS3_PATH_STYLE
storj-accessプロジェクトのアクセス権STORJ_ACCESS
storj-bucketプロジェクト内で使用するバケットSTORJ_BUCKET
basedirローカル/gdriveプロバイダのストレージパスBASEDIR
gdrive-client-json-filepathgdriveプロバイダ用OAuthクライアントJSON設定ファイルへのパスGDRIVE_CLIENT_JSON_FILEPATH
gdrive-local-config-pathgdriveプロバイダ用ローカルtransfer.sh設定キャッシュを保存するパスGDRIVE_LOCAL_CONFIG_PATH
gdrive-chunk-sizegdriveアップロードのチャンクサイズ(MB単位)。利用可能メモリより小さくする必要があります(8 MB)GDRIVE_CHUNK_SIZE
lets-encrypt-hostsLet's Encrypt証明書に使用するホスト(カンマ区切り)HOSTS
logログファイルへのパスLOG
cors-domainsCORS用ドメインのカンマ区切りリスト(設定するとCORSが有効になります)CORS_DOMAINS
clamav-hostClamAV機能のホストCLAMAV_HOST
perform-clamav-prescanClamAVを使用してすべてのアップロードを事前スキャン(clamav-hostはローカルのclamd Unixソケットである必要があります)PERFORM_CLAMAV_PRESCAN
rate-limit1分間あたりのリクエスト数RATE_LIMIT
max-upload-size最大アップロードサイズ(キロバイト)MAX_UPLOAD_SIZE
purge-daysアップロードが自動的に削除される日数PURGE_DAYS
purge-interval自動削除を実行する間隔(時間)(S3とStorjは対象外)PURGE_INTERVAL
random-token-lengthアップロードパス用のランダムトークンの長さ(削除パスでは2倍になります)6RANDOM_TOKEN_LENGTH
名前使用方法
latest最新のCIビルド。ナイトリー、コミット時、タグ時などがあります。
latest-noroot最新のCIビルド。ナイトリー、コミット時、タグ時などがあります。[no root]を使用
nightly毎日UTC真夜中に予定されたCIビルド
nightly-noroot毎日UTC真夜中に予定されたCIビルド。[no root]を使用
edgemainへのコミットごとの最新のCIビルド
edge-norootmainへのコミットごとの最新のCIビルド。[no root]を使用
vx.y.zリリースのタグ付け後のCIビルド
vx.y.z-norootリリースのタグ付け後のCIビルド。[no root]を使用