3 ms·
More fun: libc is hosed on a remote box and you can't find any working statically linked binaries with network support, but still have a few live shells accessi
by blasdel 17y ago
More fun: libc is hosed on a remote box and you can't find any working statically linked binaries with network support, but still have a few live shells accessible.
I was starting to write a UUDECODE function in pure bash (I'd saved my ass before by pasting uuencoded binaries into terminal emulators) — but then I remembered that bash has built-in tcp support!
At least when called from the exec builtin to spawn a file descriptor, you can open /dev/tcp/$host/$port psuedo-devices. It's existence would have saved me countless more times, if the spoilsports at Debian/Ubuntu hadn't disabled it at compile-time.
- Kadin 17y ago> but then I remembered that bash has built-in tcp support! You have to be careful making that assumption anymore, though; the version of bash that's included with Debian (and downstream variants, e.g. Ubuntu) has /dev/tcp and /dev/udp support disabled. So it's not something you can count on having available in any random environment you log into. I disagree with Debian's decision to disable it, but they seem pretty firmly set on it -- people have been arguing with them to reverse it for the better part of a decade, to no avail, so I doubt it's going to change. It's a declining minority of users who probably care. But you could do some neat 'party tricks' with it.
- joeyh 17y agozsh's built in zftp support, which can be loaded and run without a working ld.so, has also saved me at least once.