Git Product home page Git Product logo

incp's Introduction

incp

Insecure copy - copy files to a remote computer on a trusted network. Works on Windows, Linux, and macOS.

Files are transferred over a TCP connection as raw bytes. There is no encryption or compression being used. You probably want scp, rsync, Copy-Item, or maybe just piping a tar.gz through netcat.

Usage

incp -l [PORT]

Listens on the optional port for a one time transfer of files. After the files have been transferred, the server shuts down. If no port is given, it will listen on the default port of 4627.

incp SOURCE [SOURCE...] <IPv4 ADDRESS>[:PORT]:DESTINATION

Attempt to transfer the source file(s) to the destination directory or file at the given address on the given port. If no port is given, it will attempt to connect to the default port of 4627. For the most part, this should work exactly like cp except the destination includes an IPv4 address. Currently, incp is only able to transfer files and not directories.

Build

Unix

$ make

Windows

Open the Developer Powershell for Visual Studio and then change the directory to the project. incp uses the clang frontend for MSVC.

$ nmake /F Makefile-win

File Permissions

incp will attempt to copy the file permissions from the source file if its destination does not already exist. If the destination exists, then permissions will not be modified. When transferring to or from Windows, only the user's read, write, and execute permissions are transferred. Group and other permissions are cleared.

Protocol

incp-sequence

incp uses a simple protocol to exchange files. The above diagram shows a successful transfer of files between remote computers. The protocol consists of three "types." Strings, file info, and then raw data.

Strings are text that ends in a CRLF, e.g.

HELLO\r\n

File info contains three space-separated columns and ends with a CRLF. The columns are file type and file permission info, file size in bytes, and the file path. Everything after size is considered part of the path, so paths may contain spaces, e.g.

-rwxrw-rw- 1234 path/to/file\r\n

Raw data is only transferred after file info has been transferred. The raw data shall be exactly the same amount of bytes as was given in the file info size.

incp's People

Contributors

ccassise avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.