Conversation
Notices
-
@mcscx@quitter.se (mcscx@quitter.se)'s status on Wednesday, 12-Jul-2017 18:40:11 CEST @mcscx@quitter.se @benediktg don't try this (unless you want to delete your home dir): "touch -- -rf \$HOME askme; rm *" @drak #DONTTRYTHISATHOME -
drak (drak@sn.1w6.org)'s status on Wednesday, 12-Jul-2017 17:05:42 CEST drak mkdir -p /tmp/ask; cd /tmp/ask && touch -- -i askme && rm * @mcscx@quitter.se likes this.@mcscx@quitter.se repeated this. -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Wednesday, 12-Jul-2017 17:30:22 CEST @mcscx@quitter.se @drak Nice one :-) A reminder to prefer ./* to *. -
Benedikt Geißler 🐃 (benediktg@gnusocial.de)'s status on Wednesday, 12-Jul-2017 17:55:47 CEST Benedikt Geißler 🐃 @mcscx @drak https://gnusocial.de/attachment/4090600 drak repeated this. -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Wednesday, 12-Jul-2017 18:50:29 CEST @mcscx@quitter.se @benediktg oh, interesting, why is your "-i" file still there? Doesnt zsh expand "*" to "-i askme"? -
drak (drak@sn.1w6.org)'s status on Thursday, 13-Jul-2017 08:41:01 CEST drak yes, it does. And then rm does `rm -i askme`, meaning: delete askme with required user interaction (-i) :) @mcscx@quitter.se likes this. -
drak (drak@sn.1w6.org)'s status on Friday, 14-Jul-2017 09:44:20 CEST drak did you try this? It does not work for me. -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Friday, 14-Jul-2017 12:06:56 CEST @mcscx@quitter.se @drak indeed it doesnt work. It seems bash doesn't do variable expansion after pathname expansion.I wonder if there are other malicious ways -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Friday, 14-Jul-2017 12:24:08 CEST @mcscx@quitter.se !bash tip: After setting "shopt -s extglob" you can exclude patterns from bash's #pathname #expansion:
ls /bin/!(*a*|*b*)drak repeated this. -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Friday, 14-Jul-2017 12:24:08 CEST @mcscx@quitter.se !bash tip: After setting "shopt -s extglob" you can exclude patterns from bash's #pathname #expansion:
ls /bin/!(*a*|*b*) -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Saturday, 15-Jul-2017 01:25:21 CEST @mcscx@quitter.se @perloid nice! I had to enable extglob here. Probably Debian used to leave it disabled some years ago when I originally installed the system -
It is we, Queen Maria de Medici of France! (clacke@social.heldscal.la)'s status on Monday, 17-Jul-2017 10:34:08 CEST It is we, Queen Maria de Medici of France! @mcscx Nope, the evaluation order of the various replacements in bash is pretty clearly documented, and I'm sure it's in one of @perloid's excellent episodes. :-) drak repeated this.
-