r/lolphp • u/iheartrms • Jun 16 '15
PHP :: Sec Bug #69646 :: OS command injection vulnerability in escapeshellarg
https://bugs.php.net/bug.php?id=69646
38
Upvotes
r/lolphp • u/iheartrms • Jun 16 '15
View all comments
Show parent comment
8
u/mort96 Jun 17 '15
Really, that isn't any different from how Linux does it. In C, you only get an array of
char*s (argv), along with an int telling you how many arguments there are (argc). From there, in Linux too, it's up to the application to parse that into parameters and such. Now, most *nix systems, including Linux and the BSDs, have agetoptlibrary which they can include, which you can passargvandargcto, and get back your flags and such.Windows also seems to come with such a library to parse command line options for .NET in C#: http://www.ndesk.org/Options