3 ms·
Why would you write a terrible editor in C and what would you use to type that in? Isn’t cat - > file.txt or echo enough? AFAIK bash is able to set up tcp con
by rmetzler 7y ago
Why would you write a terrible editor in C and what would you use to type that in?
Isn’t cat - > file.txt or echo enough?
AFAIK bash is able to set up tcp connections. Can’t you just download a static compiled editor through this?
Maybe you don’t have bash. So what exactly is the starting point?
- anthk 7y agoA basic shell with just forks and execs binaries from $PATH and nothing more. Maybe, just maybe, file redirection. You won't have neither echo(1) or cat(1), you must reimplement them. Echo(1) is damn easy.
- pishpash 7y agoBetter would be to have a scheduled execution of some bits on the disk, every 5 minutes or so, and you are only allowed to write to disk, not execute anything on your own.
- kchr 7y agoSounds like a neat scenario for a CTF :-)
- rmetzler 7y agoMaybe I’m dumb, but how would you write cat or echo if you don’t have a “terrible editor”?
- anthk 7y agogcc accepts compiling code from stdin. If not: >> echo.c << EOF #include <stdio.h> int main(){ while((c = getline()) != EOF){ putchar(c); } } EOF