Easily and securely send things from one computer to another :crocodile: :package:

croc
Version Coverage Build
Status

This project is supported by:

croc is a tool that allows any two computers to simply and securely transfer files and folders. AFAIK, croc is the only CLI file-transfer tool that does all of the following:

  • allows any two computers to transfer data (using a relay)
  • provides end-to-end encryption (using PAKE)
  • enables easy cross-platform transfers (Windows, Linux, Mac)
  • allows multiple file transfers
  • allows resuming transfers that are interrupted
  • local server or port-forwarding not needed
  • ipv6-first with ipv4 fallback
  • can use proxy, like tor

For more information about croc, see my blog post.

Example

Install

Download the latest release for your system, or install a release from the command-line:

$ curl https://getcroc.schollz.com | bash

On macOS you can install the latest release with Homebrew:

$ brew install croc

On macOS you can also install the latest release with MacPorts:

$ sudo port selfupdate
$ sudo port install croc

On Windows you can install the latest release with Scoop or Chocolatey:

$ scoop install croc
$ choco install croc

On Unix you can install the latest release with Nix:

$ nix-env -i croc

On Alpine Linux you have to install dependencies first:

$ apk add bash coreutils
$ wget -qO- https://getcroc.schollz.com | bash

On Arch Linux you can install the latest release with pacman:

$ pacman -S croc

On Gentoo you can install with portage:

$ emerge net-misc/croc

On Termux you can install with pkg:

$ pkg install croc

On FreeBSD you can install with pkg:

$ pkg install croc

Or, you can install Go and build from source (requires Go 1.12+):

$ GO111MODULE=on go get -v github.com/schollz/croc/v8

Usage

To send a file, simply do:

$ croc send [file(s)-or-folder]
Sending 'file-or-folder' (X MB)
Code is: code-phrase

Then to receive the file (or folder) on another computer, you can just do

$ croc code-phrase

The code phrase is used to establish password-authenticated key agreement (PAKE) which generates a secret key for the sender and recipient to use for end-to-end encryption.

There are a number of configurable options (see --help). A set of options (like custom relay, ports, and code phrase) can be set using --remember.

Custom code phrase

You can send with your own code phrase (must be more than 4 characters).

$ croc send --code [code-phrase] [file(s)-or-folder]

Use pipes - stdin and stdout

You can pipe to croc:

$ cat [filename] | croc send

In this case croc will automatically use the stdin data and send and assign a filename like "croc-stdin-123456789". To receive to stdout at you can always just use the --yes will automatically approve the transfer and pipe it out to stdout.

$ croc --yes [code-phrase] > out

All of the other text printed to the console is going to stderr so it will not interfere with the message going to stdout.

Send text

Sometimes you want to send URLs or short text. In addition to piping, you can easily send text with croc:

$ croc send --text "hello world"

This will automatically tell the receiver to use stdout when they receive the text so it will be displayed.

Use a proxy

You can use a proxy as your connection to the relay by adding a proxy address with --socks5. For example, you can send via a tor relay:

$ croc --socks5 "127.0.0.1:9050" send SOMEFILE

Self-host relay

The relay is needed to staple the parallel incoming and outgoing connections. By default, croc uses a public relay but you can also run your own relay:

$ croc relay

By default it uses TCP ports 9009-9013. Make sure to open those up. You can customized the ports (e.g. croc relay --ports 1111,1112), but you must have a minimum of 2 ports for the relay. The first port is for communication and the subsequent ports are used for the multiplexed data transfer.

You can send files using your relay by entering --relay to change the relay that you are using if you want to custom host your own.

$ croc --relay "myrelay.example.com:9009" send [filename]

Note, when sending, you only need to include the first port (the communication port). The subsequent ports for data transfer will be transmitted back to the user from the relay.

Self-host relay (docker)

If it's easier you can also run a relay with Docker:

$ docker run -d -p 9009-9013:9009-9013 -e CROC_PASS='YOURPASSWORD' schollz/croc

Be sure to include the password for the relay otherwise any requests will be rejected.

$ croc --pass YOURPASSWORD --relay "myreal.example.com:9009" send [filename]

Note: when including --pass YOURPASSWORD you can instead pass a file with the password, e.g. --pass FILEWITHPASSWORD.

License

MIT

Acknowledgements

croc has gone through many iterations, and I am awed by all the great contributions! If you feel like contributing, in any way, by all means you can send an Issue, a PR, ask a question, or tweet me (@yakczar).

Thanks @warner for the idea, @tscholl2 for the encryption gists, @skorokithakis for code on proxying two connections. Finally thanks for making pull requests @maximbaz, @meyermarcel, @Girbons, @techtide, @heymatthew, @Lunsford94, @lummie, @jesuiscamille, @threefjord, @marcossegovia, @csleong98, @afotescu, @callmefever, @El-JojA, @anatolyyyyyy, @goggle, @smileboywtu, @nicolashardy, @fbartels, @rkuprov, @hreese, @xenrox and Ipar!

Comments
  • Croc fails if either machine lacks an IPv4 address

    Croc fails if either machine lacks an IPv4 address

    Please try to download the latest version of croc before reporting a bug!

    Describe the bug I just tried croc between two machines on the same local network, both of which have routable public IPv6 addresses, but one of which has no IPv4 connection.

    Initiating a transfer from the IPv6-only machine, the receiver fails with "unexpected end of JSON input":

    [debug] 13:25:44 cli.go:123: debug mode on
    [debug] 13:25:44 croc.go:149: options: {IsSender:false SharedSecret:winter-eternal-lagoon Debug:true RelayAddress:142.93.177.120:9009 RelayPorts:[] RelayPassword:pass123 Stdout:false NoPrompt:false NoMultiplexing:false DisableLocal:false Ask:false}
    connecting...[debug]    13:25:44 croc.go:418: attempt to discover peers
    [debug] 13:25:44 croc.go:442: discoveries: []
    [debug] 13:25:44 croc.go:443: establishing connection
    [debug] 13:25:44 croc.go:449: establishing receiver connection to 142.93.177.120:9009
    [debug] 13:25:44 tcp.go:313: sending password
    [debug] 13:25:44 tcp.go:318: waiting for first ok
    [debug] 13:25:44 tcp.go:329: sending room
    [debug] 13:25:44 tcp.go:334: waiting for room confirmation
    [debug] 13:25:44 tcp.go:343: all set
    [debug] 13:25:44 croc.go:452: banner: 9010,9011,9012,9013
    [debug] 13:25:44 croc.go:457: receiver connection established: &{connection:0xc000010010}
    [debug] 13:25:44 croc.go:462: sending ips?
    [debug] 13:25:44 croc.go:469: ips data: 
    [debug] 13:25:44 croc.go:518: exchanged header message
    securing channel...[debug]      13:25:44 croc.go:530: ready
    [debug] 13:25:44 message.go:31: writing pake message (727 bytes)
    [debug] 13:25:45 croc.go:552: got error processing: unexpected end of JSON input
    unexpected end of JSON input
    

    Initiating from the dual-stack system, croc tries to connect to IPv4, and fails:

    [debug] 13:27:09 cli.go:123: debug mode on
    [debug] 13:27:09 croc.go:149: options: {IsSender:false SharedSecret:jessica-pump-total Debug:true RelayAddress:142.93.177.120:9009 RelayPorts:[] RelayPassword:pass123 Stdout:false NoPrompt:false NoMultiplexing:false DisableLocal:false Ask:false}
    connecting...[debug]    13:27:09 croc.go:418: attempt to discover peers
    [debug] 13:27:10 croc.go:442: discoveries: []
    [debug] 13:27:10 croc.go:443: establishing connection
    [debug] 13:27:10 croc.go:449: establishing receiver connection to 142.93.177.120:9009
    [debug] 13:27:10 croc.go:452: banner: 
    could not connect to 142.93.177.120:9009: dial tcp 142.93.177.120:9009: connect: network is unreachable
    

    I also tried running my own explicit relay, but got connecting...could not connect to 2605:a601:ab68:2f00:8af:f435:49ee:8012: dial tcp: address 2605:a601:ab68:2f00:8af:f435:49ee:8012: too many colons in address.

  • croc starts eating a lot of CPU if noone retrieves file.

    croc starts eating a lot of CPU if noone retrieves file.

    > croc --version
    croc version v6.2.0-ffddd3e
    

    So today I set up a file to send, but my friend said he was going to do the download later (several hours). So I left croc on with send and left it at that.

    Many hours later, I was checking htop on the same computer and saw that said croc session had started to chew a lot of CPU on two threads.

    2019-11-11-184128_655x38_scrot


    When trying to reproduce the issue, I see that initially croc takes a thread for a little while (probably doing some pre-work?) before going dormant. (reason for different PID's is probably that I took screenshot of different times, due to behaviour) Doing some work: 2019-11-11-184427_649x46_scrot Going dormant: 2019-11-11-184733_657x23_scrot


    So thus far have not reproduced the bug again - but I assume and suspect it is something to do with if the process is running for a long while it will chew more and more CPU.


    I don't know if it is croc, some library or go. But will report back if I can see the issue again. Either it is a 'one off thing' or just simply a bug once the process has been running for a while.


    And while typing, didn't take too long (a few minutes?) and it started to take 100% CPU.

    2019-11-11-190101_658x25_scrot

    Hope this bug report helps you find out the issue!

  • Resuming file transfer?

    Resuming file transfer?

    Does croc support resuming transfers? Magic-wormhole seems to be lacking this. I'd use rsync but setting up ssh is proving to be too much of a challenge for my recipient and I'm not sure how to get through NAT even if they succeed.

  • Add flag to trigger hashing full file when synchronizing

    Add flag to trigger hashing full file when synchronizing

    On croc (version v8.6.12-c373b38), detection of whether a file is already present on the receiving side is not trustworthy. As I understand it, a constant-time hash is used, meaning that not the entire file content is inspected, but only a fixed number of samples. This, in turn, means that any differences in any other places are not detected. This is entirely unexpected behavior.

    Example:

    Create a file of 10 MB of \0s, followed by an A, followed by 10 MB of \0s again, transfer it, then create the same file, but with a B instead of the A, transfer it again. The second time, the file is not transferred because croc thinks the two files are identical (the debug output states that the hashes are identical). Expected behavior would be to transmit the new file.

    On the sender side:

    ~/croctest/send $ dd if=/dev/zero bs=10M count=1 > A; echo A >> A; dd if=/dev/zero bs=10M count=1 >> A
    1+0 records in
    1+0 records out
    10485760 bytes (10 MB, 10 MiB) copied, 0,0329896 s, 318 MB/s
    1+0 records in
    1+0 records out
    10485760 bytes (10 MB, 10 MiB) copied, 0,0147199 s, 712 MB/s
    ~/croctest/send $ croc send A
    Sending 'A' (20.0 MB)
    Code is: herbert-mars-jump
    On the other computer run
    
    croc herbert-mars-jump
    
    Sending (->192.168.101.108:53286)
     100% |████████████████████| (20/20 MB, 45.569 MB/s)
    ~/croctest/send $ dd if=/dev/zero bs=10M count=1 > A; echo B >> A; dd if=/dev/zero bs=10M count=1 >> A
    1+0 records in
    1+0 records out
    10485760 bytes (10 MB, 10 MiB) copied, 0,0273334 s, 384 MB/s
    1+0 records in
    1+0 records out
    10485760 bytes (10 MB, 10 MiB) copied, 0,011334 s, 925 MB/s
    ~/croctest/send $ croc send A
    Sending 'A' (20.0 MB)
    Code is: formula-nothing-virus
    On the other computer run
    
    croc formula-nothing-virus
    ~/croctest/receive $ sum A
    00043 20481
    ~/croctest/send $
    

    And on the receiver side:

    ~/croctest/receive $ croc herbert-mars-jump 
    Accept 'A' (20.0 MB)? (y/n) y
    
    Receiving (<-[::1]:51542)
     100% |████████████████████| (20/20 MB, 45.438 MB/s)
    ~/croctest/receive $ croc formula-nothing-virus
    Accept 'A' (20.0 MB)? (y/n) y
    
    Receiving (<-[::1]:51596)
    ~/croctest/receive $
    32810 20481
    ~/croctest/receive $
    
  • Receiving does not work on macOS with M1

    Receiving does not work on macOS with M1

    On my MacBook Air with M1 CPU, croc (which I installed via Brew) just hangs at connecting... when I try receiving a file.

    To Reproduce Steps to reproduce the behavior:

    1. Get some macOS Big Sur device, or install macOS as a Hackintosh using something like OpenCore. I only tried on one with an M1 SoC, but the issue might also exist on any macOS system. Perhaps it's not even macOS-specific, but rather ARM-specific.
    2. brew install croc
    3. Allow croc to open ports in your firewall settings.
    4. Send a file to yourself, or ask someone to send it to you from any machine.

    Expected behavior The program should stop connecting... after a few seconds or so and start receiving the file.

    Version croc version v8.6.7-05640cd

  • problem with decoding: unexpected end of JSON input

    problem with decoding: unexpected end of JSON input

    Describe the bug I get problem with decoding: unexpected end of JSON input when trying to send files.

    To Reproduce Steps to reproduce the behavior:

    1. Get a shell with croc in PATH (see below)
    2. Send and receive a file or folder, preferably on the machine itself

    Expected behavior It just works

    Version croc version v8.1.1-e250eee

    Get a shell with that version installed using: NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/c4364cdddc421dfdb4a60fda38ed955abce1603a.tar.gz nix-shell -p 'with (import<nixpkgs>{});buildGoModule rec {pname = "croc";version = "8.1.2";src = fetchFromGitHub {owner = "schollz";repo = pname;rev = "v${version}";sha256 = "0m7kgfmdbmz0r0dydz7j9cllp77076qgdcmkw3jnrsj169f5acfa";};vendorSha256 = "1fjv4y7pkwd4wsq3y66r75gr0makhjcdf0i3cpxgv03x5ahkf16b";doCheck = false;subPackages = [ "." ];}'

    Additional context

    [debug]	21:18:34 tcp.go:421: sending password
    [debug]	21:18:34 tcp.go:430: waiting for first ok
    [debug]	21:18:34 tcp.go:445: sending room
    [debug]	21:18:34 tcp.go:454: waiting for room confirmation
    [debug]	21:18:35 tcp.go:467: all set
    [debug]	21:18:35 croc.go:540: banner: 9010,9011,9012,9013
    [debug]	21:18:35 croc.go:546: receiver connection established: &{connection:0xc0003b4010}
    [debug]	21:18:35 croc.go:551: sending ips?
    [debug]	21:18:35 croc.go:560: ips data: 
    [error]	2020/08/31 21:18:35 croc.go:563: ips unmarshal error: invalid character '\x01' looking for beginning of value
    [debug]	21:18:35 croc.go:613: exchanged header message
    securing channel...[debug]	21:18:35 croc.go:625: ready
    [debug]	21:18:35 message.go:46: writing pake message
    [error]	2020/08/31 21:18:36 compress.go:46: error copying data: unexpected EOF
    [debug]	21:18:36 croc.go:848: problem with decoding: unexpected end of JSON input
    [debug]	21:18:36 croc.go:650: got error processing: problem with decoding: unexpected end of JSON input
    problem with decoding: unexpected end of JSON input
    
  • wormhole protocol and PAKE compatibility

    wormhole protocol and PAKE compatibility

    Hi!

    I have found with great interest this golang implementation of some of the concepts behind Magic Wormhole. As a user of the latter (and maintainer of the Debian package), I am happy to see other implementations pop up, especially if it means it's easier for others to share files and use those concepts.

    Unfortunately, I am concerned with the current implementation of croc, as I explained in https://github.com/schollz/croc/issues/15#issuecomment-399301454

    I see two main issues:

    • compatibility concerns
    • security concerns

    Compatibility

    While it's great croc reuses some concepts behind magic-wormhole, it doesn't exactly implement the same protocol. This means the problem space is fragmented: a user of croc can't talk with a user of wormhole and vice-versa, which makes it needlessly hard for users to talk to each other.

    I understand the idea behind it: a different implementation means more decentralization, for example. But that doesn't mean it has to be a different implementation to be decentralized. Wormhole, out of the box, supports using different relay (e.g. "discovery") and transfer (e.g. "nat trasversal") servers and croc could still implement the wormhole protocol while not being dependent on @warner's infrastructure as a single point of failure (SPOF). In fact, he explicitly said it would be good if other projects would make use of different DNS aliases for those services so they can easily be switched to different backends if traffic would become unmanageable for his services. This is how the debian packages work: the transit server is patched to be tcp:magic-wormhole-transit.debian.net:4001:priority=2.0 instead of the upstream tcp:transit.magic-wormhole.io:4001. Then on Debian's infrastructure, that DNS entry is just a pointer to the normal transit server. The relay server server is the same, however (ws://relay.magic-wormhole.io:4000/v1).

    Implementing this would mean adding Wormhole support in croc, specifically the capability of talking with transit and, more importantly, relay servers so that croc would share the same key namespace as Wormhole.

    Security

    But this would also require reimplementing the key exchange using PAKE instead of the home-grown, SHA256-based key exchanged. As I explained in my previous comments, I am unsure of the security properties of croc as it is done right now. A lot of care was given to the way Wormhole implements the key exchange: it uses a low-entropy ephemeral and weak key to establish a strong session key: that is the PAKE protocol which was published in multiple papers and seems to be solid at the cryptographic layer. I am not sure the SHA256-checksum croc implements has similar properties. For example, does it allow multiple attempts or does it bail on first try? Wouldn't it be possible for an attacker to build a rainbow table of all possible keys and just use that to access the files?

    I haven't reviewed croc's security properties in details, so maybe my concerns are misplaced. But as a general principle, rolling out a different cryptosystem for another project seems an idea fraught with dangers that should generally be avoided. In that regard, I also think that PAKE exchange support should be implemented as well as the above network compatibility.

    I hope this is useful for you and thanks for working on all of this!

  • Memory leak in relay

    Memory leak in relay

    I'm running a relay and I noticed that it consumes huge amount of RAM:

    image

    In fact I haven't even used croc in a few days.

    It runs in docker-compose as so:

    version: "3.7"
    
    services:
      croc:
        image: schollz/croc
        restart: always
        ports:
          - "9009:9009"
          - "9010:9010"
          - "9011:9011"
          - "9012:9012"
          - "9013:9013"
        command: "--pass XXXX relay"
    

    in docker-compose logs I see a ton of either port scans or failed attempts to use my relay (I assume failed, because they don't know the password... hopefully):

    croc_1  | [warn]	2020/03/22 08:35:11 relay-45.136.108.67:1464: read tcp 172.21.0.2:9010->45.136.108.67:1464: read: connection reset by peer
    croc_1  | [warn]	2020/03/22 19:53:34 relay-92.63.194.15:670: read tcp 172.21.0.2:9010->92.63.194.15:670: read: connection reset by peer
    croc_1  | [warn]	2020/03/23 00:30:46 relay-198.108.67.48:48788: read tcp 172.21.0.2:9011->198.108.67.48:48788: read: connection reset by peer
    croc_1  | [warn]	2020/03/23 00:30:47 relay-198.108.67.48:57744: read tcp 172.21.0.2:9011->198.108.67.48:57744: read: connection reset by peer
    croc_1  | [warn]	2020/03/23 00:30:48 relay-198.108.67.48:3586: read tcp 172.21.0.2:9011->198.108.67.48:3586: read: connection reset by peer
    croc_1  | [warn]	2020/03/23 13:34:51 relay-85.93.20.170:65357: read tcp 172.21.0.2:9009->85.93.20.170:65357: read: connection reset by peer
    croc_1  | [warn]	2020/03/23 14:32:41 relay-223.71.167.163:8870: EOF
    croc_1  | [warn]	2020/03/23 16:36:22 relay-185.209.0.76:1104: read tcp 172.21.0.2:9010->185.209.0.76:1104: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 09:38:40 relay-182.92.107.76:43560: EOF
    croc_1  | [warn]	2020/03/24 09:38:45 relay-182.92.107.76:43608: EOF
    croc_1  | [warn]	2020/03/24 09:38:50 relay-182.92.107.76:43622: EOF
    croc_1  | [warn]	2020/03/24 09:38:55 relay-182.92.107.76:43642: EOF
    croc_1  | [warn]	2020/03/24 09:39:00 relay-182.92.107.76:43660: EOF
    croc_1  | [warn]	2020/03/24 09:39:06 relay-182.92.107.76:43678: EOF
    croc_1  | [warn]	2020/03/24 09:39:12 relay-182.92.107.76:43694: EOF
    croc_1  | [warn]	2020/03/24 09:39:20 relay-182.92.107.76:43742: EOF
    croc_1  | [warn]	2020/03/24 09:39:25 relay-182.92.107.76:43774: EOF
    croc_1  | [warn]	2020/03/24 09:39:30 relay-182.92.107.76:43792: EOF
    croc_1  | [warn]	2020/03/24 09:39:35 relay-182.92.107.76:43806: EOF
    croc_1  | [warn]	2020/03/24 09:39:45 relay-182.92.107.76:43828: EOF
    croc_1  | [warn]	2020/03/24 09:39:46 relay-182.92.107.76:43848: EOF
    croc_1  | [warn]	2020/03/24 09:39:51 relay-182.92.107.76:43866: EOF
    croc_1  | [warn]	2020/03/24 09:39:56 relay-182.92.107.76:43886: EOF
    croc_1  | [warn]	2020/03/24 09:40:02 relay-182.92.107.76:43918: EOF
    croc_1  | [warn]	2020/03/24 09:40:07 relay-182.92.107.76:43948: EOF
    croc_1  | [warn]	2020/03/24 09:40:15 relay-182.92.107.76:43988: EOF
    croc_1  | [warn]	2020/03/24 09:40:20 relay-182.92.107.76:44022: EOF
    croc_1  | [warn]	2020/03/24 09:40:25 relay-182.92.107.76:44056: EOF
    croc_1  | [warn]	2020/03/24 09:40:31 relay-182.92.107.76:44094: EOF
    croc_1  | [warn]	2020/03/24 09:40:36 relay-182.92.107.76:44132: EOF
    croc_1  | [warn]	2020/03/24 09:40:41 relay-182.92.107.76:44152: EOF
    croc_1  | [warn]	2020/03/24 09:41:20 relay-182.92.107.76:44200: EOF
    croc_1  | [warn]	2020/03/24 09:41:20 relay-182.92.107.76:44230: EOF
    croc_1  | [warn]	2020/03/24 09:41:20 relay-182.92.107.76:44178: EOF
    croc_1  | [warn]	2020/03/24 09:41:21 relay-182.92.107.76:44250: EOF
    croc_1  | [warn]	2020/03/24 09:41:21 relay-182.92.107.76:44280: EOF
    croc_1  | [warn]	2020/03/24 09:41:26 relay-182.92.107.76:44342: EOF
    croc_1  | [warn]	2020/03/24 09:41:31 relay-182.92.107.76:44376: EOF
    croc_1  | [warn]	2020/03/24 09:41:32 relay-182.92.107.76:1011: EOF
    croc_1  | [warn]	2020/03/24 12:10:19 relay-45.136.108.68:314: read tcp 172.21.0.2:9012->45.136.108.68:314: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:12 relay-198.108.67.48:42524: read tcp 172.21.0.2:9009->198.108.67.48:42524: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:12 relay-198.108.67.48:49112: read tcp 172.21.0.2:9010->198.108.67.48:49112: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:12 relay-198.108.67.48:13786: read tcp 172.21.0.2:9011->198.108.67.48:13786: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:12 relay-198.108.67.48:42462: read tcp 172.21.0.2:9012->198.108.67.48:42462: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:12 relay-198.108.67.48:38194: read tcp 172.21.0.2:9013->198.108.67.48:38194: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:13 relay-198.108.67.48:48878: read tcp 172.21.0.2:9009->198.108.67.48:48878: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:13 relay-198.108.67.48:56930: read tcp 172.21.0.2:9010->198.108.67.48:56930: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:13 relay-198.108.67.48:57708: read tcp 172.21.0.2:9012->198.108.67.48:57708: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:13 relay-198.108.67.48:28824: read tcp 172.21.0.2:9011->198.108.67.48:28824: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:13 relay-198.108.67.48:54196: read tcp 172.21.0.2:9013->198.108.67.48:54196: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:15 relay-198.108.67.48:34946: read tcp 172.21.0.2:9009->198.108.67.48:34946: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:15 relay-198.108.67.48:49106: read tcp 172.21.0.2:9010->198.108.67.48:49106: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:15 relay-198.108.67.48:43464: read tcp 172.21.0.2:9011->198.108.67.48:43464: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:15 relay-198.108.67.48:7878: read tcp 172.21.0.2:9012->198.108.67.48:7878: read: connection reset by peer
    croc_1  | [warn]	2020/03/24 18:59:15 relay-198.108.67.48:13390: read tcp 172.21.0.2:9013->198.108.67.48:13390: read: connection reset by peer
    

    I am speculating that maybe such connections confuse relay and make it leak memory.

    Restarting the relay brings memory usage down to 12MB.

    Let me know if I can help you with anything.

  • snap installed croc can't access file in home directory - permission denied

    snap installed croc can't access file in home directory - permission denied

    Describe the bug Croc installed on Ubuntu 19.10 via sudo snap install croc or via software centre cannot access files in home directory

    To Reproduce Steps to reproduce the behavior:

    jake@jts-800:~$ croc send Camera1_2020_01_04.avi 
    open /home/jake/Camera1_2020_01_04.avi: permission denied
    

    Neither cli nor store provide option to change permissions: http://www.linuxandubuntu.com/home/snap-application-permissions

    jake@jts-800:~$ snap interfaces croc
    error: no interfaces found
    jake@jts-800:~$ snap connect croc:home
    error: snap "croc" has no plug named "home"
    

    20200112_SelectionNN

    Version croc version v6.4.8-fd20b25 Ubuntu 19.10

  • install fails on macOS fresh install

    install fails on macOS fresh install

    Automated install fails on fresh macOS install (10.14.6) because the directory /usr/local/bin is not created by default during macOS installation.

    Mac:~ root# curl https://getcroc.schollz.com | bash
    […]
    install: /usr/local/bin/: No such file or directory
    \e[0;31m== Install attempt returned an unexpected value of 71\e[0m
    
  • Provide a source tarball with vendored dependencies

    Provide a source tarball with vendored dependencies

    Hey, would you be able to provide one more archive as part of your release, a source tarball just like Github is building for you (source.tar.gz) but with vendored dependencies? These can be generated using go mod tidy; go mod vendor commands.

    I want this to allow building croc in a clean environment without internet access (assuming source tarball is already present), which might for example help with reproducible builds effort.

    To generate a tarball you can use git directly, for example Github itself is running this command (where the last argument is the tag name):

    git archive -o v6.2.3.tar.gz --format tar.gz --prefix=croc-6.2.3/ v6.2.3
    

    Let me know if this makes sense and if I can help with something!

  • Send-to-relay security

    Send-to-relay security

    Is your feature request related to a problem? Please describe. The problem is described in the last section of https://schollz.com/blog/croc9/ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like The solution was also hinted at in the same section, but I couldn't find whether it was implemented. The version number is still 9.

    Describe alternatives you've considered I've looked through past issues and their closure from after 2021-04-23, but could find no clear indication that this got fixed.

    Additional context Just curious if it was found to not be serious enough, or that it actually got fixed.

  • Tab completion for words

    Tab completion for words

    Typing multiple long words could be fastidious, having them autocomplete after hitting Tab once the first letters are typed would be great.

    I heavily used this feature from magic-wormhole, which isn't shell completion: the completion is only possible when the program is already running with wormhole receive (which is the equivalent of running croc). Currently when running croc, after correctly typing the numbers then the first few letters of a word and hitting Tab, there is no completion, just spaces.

  • Trying to setup personal relay through cloudflare:

    Trying to setup personal relay through cloudflare: "initial bytes are not magic"

    Describe the bug

    I set up a personal relay using the docker container, using the below compose file. When someone tries to receive the file, they get the following error: initial bytes are not magic: 48545450. Not sure what's going on. Is croc not waiting long enough to get redirected through cloudflare's proxying? Is cloudflare just not proxying the traffic properly? If I'm reading the documentation correctly, those ports should work.

    Ports are properly forwarded and the relay works if cloudflare proxying is disabled for the subdomain I'm using.

    To Reproduce

    Steps to reproduce the behavior:

    1. Create relay on computer with ports compatible with cloudflare proxy (docker-compose)
    2. Initiate send using that relay, using the cloudflare subdomain croc --pass CROC_PASS --relay "croc.CLOUDFLAREDOMAIN.com:2052" send --hash imohash SOMEFILE
    3. Initiate receive using that relay, using the cloudflare subdomain croc --relay croc.CLOUDFLAREDOMAIN.com:2052 --pass CROC_PASS CODE_PHRASE
    4. magic bytes error

    Expected behaviour

    Croc receive should hopefully work through Cloudflare proxy.

    Version

    croc version v9.6.2-3b81934

    Additional context

    docker-compose
      # croc - Easily and securely send things from one computer to another 🐊 📦
      croc:
        image: schollz/croc
        container_name: croc
        restart: unless-stopped
        entrypoint: ["sh", "-c", "/croc --pass \\$CROC_PASS relay --ports 2052,2082,2086,2095"]
        env_file: 
          - "$SECRETSDIR/croc.env"
        hostname: croc
        networks:
          lan_macvlan:
            ipv4_address: $CROC_IP
        mac_address: $CROC_MAC
        ports:
          - 2052:2052/tcp # communication
          - 2082:2082/tcp # data transfer
          - 2086:2086/tcp # data transfer
          - 2095:2095/tcp # data transfer
          # - 9009-9013:9009-9013 # default
        volumes:
          - $CONTDIR/croc:/.config/croc
    
  • Debian/Ubuntu package

    Debian/Ubuntu package

    Is your feature request related to a problem? Please describe.

    There appear to be direct installation options for Arch, Fedora, Gentoo, FreeBSD and others, but not Debian and Ubuntu.

    Describe the solution you'd like

    An official package so that users can do apt install croc.

    I hope that this would be posible given that packages for other distros/package managers exist already.

    Describe alternatives you've considered

    Direct installation via Bash, but this of course requires users to perform updates manually.

    ~~There used to be a snap, as far as I can tell, but snaps are problematic in their own way.~~ (Apparently snap packages were never considered for good reasons: https://github.com/schollz/croc/pull/479)

  • Allow sending files on Windows by dragging and dropping files or folders onto croc.exe

    Allow sending files on Windows by dragging and dropping files or folders onto croc.exe

    Is your feature request related to a problem? Please describe. It would be a nice feature for people who use Windows and don't want to learn how to cd into the Downloads directory using CMD and run croc.exe with parameters.

    Describe the solution you'd like I would like to be able to tell someone they can drag and drop files and hopefully also folders onto croc.exe to send them. I imagine this would bring up a CMD window that would show the code to type to receive the files.

    I don't use Windows myself, so for all I know, it already works like this.

    Describe alternatives you've considered Perhaps, if one were to double-click on croc.exe, it would y/n prompt you if you wanted to send or receive?

    It just occurred to me that it might be possible to create a .bat file (croc-send.bat?) that will allow drag-and-dropping files as arguments to croc.exe send?

    Additional context This feature request was inspired by a hackernews thread where it was mentioned that in Windows someone who wasn't familiar with command line apps could still easily double click croc.exe and type in a receive code.

  • feat: first attempt at open source and go. Trying to implement an aut…

    feat: first attempt at open source and go. Trying to implement an aut…

    first attempt at open source and go. Trying to implement an auto-retry for issue #151. I'm not sure where to call the retry function. Looking for some constructive criticism here, thank you.

Paw: a cross platform application to manage your passwords and identities securely
Paw: a cross platform application to manage your passwords and identities securely

Paw Paw is a cross platform application to manage your passwords and identities securely. It is written in Go and uses Fyne as UI toolkit and age as e

Oct 13, 2022
Package for downloading things from a string URL using a variety of protocols.

go-getter is a library for Go (golang) for downloading files or directories from various sources using a URL as the primary form of input.

Jan 6, 2023
A pair of local reverse proxies (one in Windows, one in Linux) for Tailscale on WSL2

tailscale-wsl2 TL;DR Running two reverse proxies (one in Windows, one in the WSL2 Linux VM), the Windows Tailscale daemon can be accessed via WSL2: $

Dec 9, 2022
Deskreen turns any device with a web browser into a secondary screen for your computer
Deskreen turns any device with a web browser into a secondary screen for your computer

Deskreen Website: https://deskreen.com ▶️ Deskreen Youtube channel (video tutorials, demos, use cases for Deskreen day to day usage) Deskreen turns an

Jan 7, 2023
Running Golang on the Internet Computer?...
Running Golang on the Internet Computer?...

Golang on the Internet Computer Running Golang on the Internat Computer?! Yes, it is possible! This repository contains a simple example that shows ho

Jun 13, 2022
DeepCopy a portable app that allows you to copy all forms of specified file types from your entire file system of the computer

DeepCopy a portable app that allows you to copy all forms of specified file types from your entire file system of the computer

Dec 20, 2021
Go setup - Setting up Golang on my computer

This is my Journey Of Learning Go in 2022 I am going to first get some backgroun

Feb 4, 2022
Get ip address with Golang on your computer/system

Get IP Address with Golang Get IP address(es) with go-lang is a simple command line tool to get your IP address vpn, internal, external, etc. Usage ge

Sep 5, 2022
A Go package for creating contributor list by release, Help full for those organization that use one repository for platform release

This is a Go package which create contributors list by release by scanning across all repository that exist in organisation, Only helpful for those or

Dec 26, 2021
Use pingser to create client and server based on ICMP Protocol to send and receive custom message content.
Use pingser to create client and server based on ICMP Protocol to send and receive custom message content.

pingser Use pingser to create client and server based on ICMP Protocol to send and receive custom message content. examples source code: ./examples Us

Nov 9, 2022
GoHooks make it easy to send and consume secured web-hooks from a Go application

GoHooks GoHooks make it easy to send and consume secured web-hooks from a Go application. A SHA-256 signature is created with the sent data plus an en

Nov 16, 2022
UDP Transport: compress, encrypt and send any data reliably over unreliable UDP connections

udpt UDP Transport Compresses, encrypts and transfers data between a sender and receiver using UDP protocol. Features and Design Aims: Avoid the overh

Nov 5, 2022
Send email and SMS broadcasts to your contacts. SMS are sent via your Android phone connected to your PC.

Polysender Send email and SMS broadcasts to your contacts. Polysender is a desktop application, so it does not require a complicated server setup. Ema

Aug 11, 2022
Watch for interesting patterns in Caddy logs and send a Telegram notification.

Watch for interesting patterns in Caddy logs and send a Telegram notification.

Jul 21, 2022
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.

gev 中文 | English gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily bui

Jan 6, 2023
Just another "what is my IP address" service, including geolocation and headers information

What is my IP address What is my IP address Features Endpoints Build Usage Examples Run a default TCP server Run a TLS (HTTP/2) server only Run a defa

Nov 21, 2022
Send network packets over a TCP or UDP connection.

Packet is the main class representing a single network message. It has a byte code indicating the type of the message and a []byte type payload.

Nov 28, 2022
Helps you to send ssh commands to target machine in your local network from outside via gRPC
Helps you to send ssh commands to target machine in your local network from outside via gRPC

rpc-ssh In case, you don't want to make your ssh port accessible from outside local network. This repository helps you to send ssh commands to target

Nov 16, 2022