Live data from Hacker News

Fun with Kermit and ZMODEM over SSH

cambus.net

31–40 of 110 posts

Re: Fun with Kermit and ZMODEM over SSH

#31

I still miss sz and rz when I ssh from a computer with no ssh server like nearly every windows box. If I remember right, sz = send a file from the server I'm in back to the client server. rz = receive a file from the client server. You can accomplish the with a new scp session on the client server, but it's an extra step. I use this as a helper when for building the scp command. function scppath() { echo $USER@$(host…

[deleted]

Re: Fun with Kermit and ZMODEM over SSH

#32
post #30

At my last job, I worked in the PCI cardholder data environment, and we were very careful to limit egress from our systems in order to make it hard to exfiltrate data in the unlikely event of a breach. I remember thinking, if I were a wily hacker and I managed to pop a shell on one of these hosts, I would not be deterred by network egress roadblocks. I'd figure out a way to get `sz` on to a host and exfiltrate data t…

> I'd figure out a way to get `sz` on to a host and exfiltrate data to my heart's content with ZMODEM like we did back in the day.

Probably as easy as `cat > sz` and then paste it over the wire? Maybe run through base64 first. Although actually depending on the situation you might be able to just do that directly and not bother with this? Like just as a super simple non-scientific test:

    $ ssh someserver cat /bin/ls > ./test-ls
    $ ssh someserver md5sum /bin/ls ; md5sum ./test-ls
    b3535289b2932e25650074aa6d89bf3c  /bin/ls
    b3535289b2932e25650074aa6d89bf3c  ./test-ls
That looks to work.

Re: Fun with Kermit and ZMODEM over SSH

#33

Earlier quoted context omitted.

Thanks for the laugh (but also kind of serious) - reminds me of https://xkcd.com/2221/ (what a fast floppy drive you have!)

Now I'm wondering if there's ever been emulated software that crashed because it tried to calculate a data transfer rate, but the emulator transferred the data faster than the delta in the time measuring in the emulated machine, so it divided by zero.

Well, certainly a lot of people running older software have had the joy of their disk size being larger than the software can handle. There's plenty of software that expects the disk size in bytes to fit into an signed or unsigned 32-bit int.

I also don't know about data transfer rates but if you want to emulate the really old stuff in DOSBox, you'll need to carefully examine pages like https://www.dosbox.com/wiki/Performance because there are plenty of games that do a divide-by-zero crash when they're trying to time the CPU for running at the desired speed.

Re: Fun with Kermit and ZMODEM over SSH

#34
post #30

At my last job, I worked in the PCI cardholder data environment, and we were very careful to limit egress from our systems in order to make it hard to exfiltrate data in the unlikely event of a breach. I remember thinking, if I were a wily hacker and I managed to pop a shell on one of these hosts, I would not be deterred by network egress roadblocks. I'd figure out a way to get `sz` on to a host and exfiltrate data t…

> I'd figure out a way to get `sz` on to a host and exfiltrate data to my heart's content with ZMODEM like we did back in the day. Probably as easy as `cat > sz` and then paste it over the wire? Maybe run through base64 first. Although actually depending on the situation you might be able to just do that directly and not bother with this? Like just as a super simple non-scientific test: $ ssh someserver cat /bin/ls >…

A related trick that can be actually useful is tar'ing on one side and untar'ing on the other: https://unix.stackexchange.com/questions/19804/compress-a-di...

scp is miserably slow on transferring lots of small files and this can be wildly faster, plus you get your choice of compression program based on what is on each side of the connection and what the bandwidth vs. CPU is.

Re: Fun with Kermit and ZMODEM over SSH

#35
i wrote implementations of the kermit protocol (and vt100 terminal emulators) for z80 cp/m machines and for the 6502-based BBC micro (both purely in assembler) way back in the mid 1980s. it was fun, and the protocol was really well documented, unlike some others i've had to deal with (i'm looking at you DDE & CORBA). oh, happy times! a bit later i wrote an implementation in C (and a bit of assembler for the interrupt-driven i/o) for the ibm pc.

Re: Fun with Kermit and ZMODEM over SSH

#36

Earlier quoted context omitted.

Thanks for the laugh (but also kind of serious) - reminds me of https://xkcd.com/2221/ (what a fast floppy drive you have!)

Now I'm wondering if there's ever been emulated software that crashed because it tried to calculate a data transfer rate, but the emulator transferred the data faster than the delta in the time measuring in the emulated machine, so it divided by zero.

The original Macintosh ROM does some floppy drive calibration routines on startup to measure jitter in the spin rate. A common source of errors when writing a Macintosh emulator is emulating a "perfect" floppy drive. If the spin rate jitter is zero, the ROM attempts to a divide by zero and crashes.

Re: Fun with Kermit and ZMODEM over SSH

#37
post #10

Last year we implemented "ymodem over BLE" for reasons that are complicated and possibly stupid. It felt familiar but strange and wrong to do such a thing. Worked great though.

I still use these protocols for embedded systems. There is almost always a CLI on a UART, so one should be able to transfer files.

Ymodem is simpler and smaller than Zmodem, but we've used both. I've used Zmodem at 921600 baud, but it needs fairly large buffers (for a UART) to work.

One of the big advantages is that TeraTerm for Windows exists, and supports xyzmodem. It means that I often don't have to write any host-side software for things like firmware update, and more important, don't have to touch Windows.

Re: Fun with Kermit and ZMODEM over SSH

#38
post #12

Thankfully, ZModem existed. I’d never been able to use Kermit successfully back in the days, always had trouble with it. I even had more success with XModem.

Jumping from Kermit to ZModem was quite a revelation for this Muppets fan. I was so sad to find I'd been needlessly reducing my download speed just by going with the fuzzy green frog, when presented with all of the different download options.

You probably didn't have Kermit configured correctly; most of us didn't.

When someone finally showed me how to set the options (which default to reliable-but-godawfully-slow) for much higher speed transmission (bigger segments, sliding windows for ACK, maybe a few other things?), it was entirely comparable to Zmodem.

Re: Fun with Kermit and ZMODEM over SSH

#39

Earlier quoted context omitted.

Jumping from Kermit to ZModem was quite a revelation for this Muppets fan. I was so sad to find I'd been needlessly reducing my download speed just by going with the fuzzy green frog, when presented with all of the different download options.

What gets me is that ZModem-Resume had effective continuation of failed transfers _decades_ before HTTP got it right. The early days of the web drove me bonkers, having to start over with a long file that failed in the middle.

I remember using a program...I forget what it was called, but it was popular in the 56K days for resuming HTTP downloads. It would even allow you to provide mirror URLs so you could download from multiple sources at once.

I want to say it was called WinGet, but now there's something else called that, so I can't confirm it.

EDIT: It was called GetRight.

Re: Fun with Kermit and ZMODEM over SSH

#40

Earlier quoted context omitted.

Thanks for the laugh (but also kind of serious) - reminds me of https://xkcd.com/2221/ (what a fast floppy drive you have!)

Now I'm wondering if there's ever been emulated software that crashed because it tried to calculate a data transfer rate, but the emulator transferred the data faster than the delta in the time measuring in the emulated machine, so it divided by zero.

Emulated or not, old Turbo Pascal programs would crash on any computer faster than about 200MHz. The initialization code for the CRT module would try to calibrate timing for the Delay function and the division would overflow if the processor was too fast. See https://retrocomputing.stackexchange.com/questions/12111/
Post reply on HN