2
votes

Somesimes I must work with remote host which have telnet connection but no either ftp or ssh (to use scp) also there are no netcat. Also there are no gcc (to compile netcat for example).

Does anybody know how to transfer file(s) using telnet connection (using some kind of hack)?

(I know that it's not very appropriate protocol for souch a things.)

3
  • Something's got to handle the other end of the file transfer. What applications are on the remote host? Any compilers at all? Any scripting languages? May 7, 2009 at 11:45
  • It's unix (solaris and hp-ux hosts) asking person on the other side to setup ftp takes some time (hour or two). May 7, 2009 at 12:04
  • I've recently found there kermit. Thanks. I've never used it before. Just heard about it. May 7, 2009 at 12:06

6 Answers 6

4
votes

You should be able to use Kermit to transfer files over telnet, you can use C-Kermit as the telnet client to do so. Its only availible for Unix/Linux based systems though.

7
votes

Are you using Windows or Linux (*NIX)? The good old BBS type of file transfers work perfectly under telnet. You need to get the programs thought, and compile them. See zmodem and xmodem.

4
  • As far as protocols go, stick with zmodem. xmodem has minimal error correction capabilities and a lot of overhead. Ahh... the good old days.
    – spoulson
    May 7, 2009 at 11:57
  • no need to use zmodem for its error connection - the underlying TCP stream will provide a reliable transport layer.
    – Alnitak
    May 7, 2009 at 12:33
  • Ummmm, you might be surprised how many errors a 16bit checksum lets through, given a big enough sample of packets. May 7, 2009 at 12:38
  • sure, there's a 2^16 chance of a checksum collision. However most modern transport systems (dialup notwithstanding) have error rates far far better than that.
    – Alnitak
    May 7, 2009 at 14:06
2
votes

The kermit client application supports connections over telnet protocol, and AFAICR supports xmodem and zmodem, as well as its own file transfer protocol.

As far as I can recall, and it's many years since I've done this:

  1. connect to the remote host with kermit
  2. at the remote end, fire up kermit too
  3. at the remote end, type "server" at the kermit prompt
  4. your end will recognise that the link is now in file-transfer mode, and you can then issue "send" and "get" commands to transmit or receive files
2
votes

If you have nothing but a bare-bones Unix system at the remote end, you could encode with (gzip and) uuencode then copy/paste into uudecode (and gunzip).

If you don't have uudecode, but do have a shell, you could use shar to compose your first lump of transmitted data.

If policy allows you install executables, you can use these simple upload methods as bootstraps to install a kermit/zmodem remote, or wget, or curl, or nc.

1
vote

I know you said there's no netcat, but have you tried cross-compiling?

Busybox also includes a netcat client, which I've used on many ARM and MIPS embedded systems.

0
votes

you can use curl

"curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE and LDAP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks."

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .