Yes, $() inside of double quotes is expanded. This is a documented and standardized feature of all shells derived from the bourne shell.
the thing is, it gets executed when enclosed in single quote too. that's what worried me. as i had been quoting urls within single quotes in shell commands and had been feeling relatively safe -- till now. i noticed the single quote. know how it gets escaped from the quote. the point is : we that work on command line use single quote to enclose urls as parameter to curl/wget. and that's not safe if you don't char-by-…
URL is also a shell script that executes some malicious(?) code
11–20 of 74 posts
Re: URL is also a shell script that executes some malicious(?) code
#12Yes, $() inside of double quotes is expanded. This is a documented and standardized feature of all shells derived from the bourne shell.
the thing is, it gets executed when enclosed in single quote too. that's what worried me. as i had been quoting urls within single quotes in shell commands and had been feeling relatively safe -- till now. i noticed the single quote. know how it gets escaped from the quote. the point is : we that work on command line use single quote to enclose urls as parameter to curl/wget. and that's not safe if you don't char-by-…
Re: URL is also a shell script that executes some malicious(?) code
#13Yes, $() inside of double quotes is expanded. This is a documented and standardized feature of all shells derived from the bourne shell.
the thing is, it gets executed when enclosed in single quote too. that's what worried me. as i had been quoting urls within single quotes in shell commands and had been feeling relatively safe -- till now. i noticed the single quote. know how it gets escaped from the quote. the point is : we that work on command line use single quote to enclose urls as parameter to curl/wget. and that's not safe if you don't char-by-…
Re: URL is also a shell script that executes some malicious(?) code
#14I could only get it work with bash, on zsh it does not work.
Re: URL is also a shell script that executes some malicious(?) code
#15Re: URL is also a shell script that executes some malicious(?) code
#16Re: URL is also a shell script that executes some malicious(?) code
#17Sounds like terminal software just needs a paste url option that sanitized before pasting.
Re: URL is also a shell script that executes some malicious(?) code
#18Earlier quoted context omitted.
the thing is, it gets executed when enclosed in single quote too. that's what worried me. as i had been quoting urls within single quotes in shell commands and had been feeling relatively safe -- till now. i noticed the single quote. know how it gets escaped from the quote. the point is : we that work on command line use single quote to enclose urls as parameter to curl/wget. and that's not safe if you don't char-by-…
No it is not. The single quote example is wrong because the evaluation part $(...) is unquoted. Take a closer look. The first single quote part ends after the first semicolon right before the $(
Re: URL is also a shell script that executes some malicious(?) code
#19Earlier quoted context omitted.
the thing is, it gets executed when enclosed in single quote too. that's what worried me. as i had been quoting urls within single quotes in shell commands and had been feeling relatively safe -- till now. i noticed the single quote. know how it gets escaped from the quote. the point is : we that work on command line use single quote to enclose urls as parameter to curl/wget. and that's not safe if you don't char-by-…
That's only because it's got single quotes contained within it.
Re: URL is also a shell script that executes some malicious(?) code
#20Yes, $() inside of double quotes is expanded. This is a documented and standardized feature of all shells derived from the bourne shell.
the thing is, it gets executed when enclosed in single quote too. that's what worried me. as i had been quoting urls within single quotes in shell commands and had been feeling relatively safe -- till now. i noticed the single quote. know how it gets escaped from the quote. the point is : we that work on command line use single quote to enclose urls as parameter to curl/wget. and that's not safe if you don't char-by-…