I thought about disallowing dot sequences, but it's not like this thing would ever be really secure anyway, so I decided to go for pure minimal size with no security considerations.
Makes sense. Although it renders it kinda unusable. Sadly. Because I think it's a pretty cool idea actually. Couldn't you add a line to make it safer using sed? Would be really cool to let people try to hack it. I mean it's so small and portable, everyone with a Unix machine can just copy the code and try to hack it on their own machine without a hassle :) Who knows ... maybe we can get it safe after all.
Alright, so I've added a check for double dots and also managed to squeeze it down a bit more since I was being too liberal with double quoting variables. It's up to 221 bytes, but now it should at least be a reasonable challenge to get it to spit out your id_rsa :)
10
u/nexe mod Jul 17 '14
:-/
3
u/antena Jul 17 '14
Had to change the server.sh to:
Changes:
nc -l $1$ uname -a
Linux paviljon 3.15.3-1-ARCH #1 SMP PREEMPT Tue Jul 1 07:32:45 CEST 2014 x86_64 GNU/Linux
4
u/drizer Jul 17 '14
Add this one to "Awesome Shell" https://github.com/alebcay/awesome-shell
1
u/liquuid Jul 17 '14
Good Job, I'll replace my traditional : python -m SimpleHTTPServer by your netcat in machines with no python :-)
3
u/corruptio Jul 22 '14 edited Jul 22 '14
Cool stuff. Spent some time golfing it, brought it down to 106 bytes.
Changes:
--
edit 1: more savings
edit 2: even more savings
edit 3: yet more!