BSD and GNU implementations of the date command are slightly incompatible.
The GNU implementation can take an arbitrary date with the -d option, and the format is automatically detected, but on BSD implementations it must be invoked like for setting the system date but using the -j option to avoid that step, and the input format must be provided with the -f option.
Since the -j option isn't supported by the GNU implementation, it can be exploited to detect which variant the system uses.
BSD and GNU implementations of the
date
command are slightly incompatible.The GNU implementation can take an arbitrary date with the
-d
option, and the format is automatically detected, but on BSD implementations it must be invoked like for setting the system date but using the-j
option to avoid that step, and the input format must be provided with the-f
option.Since the
-j
option isn't supported by the GNU implementation, it can be exploited to detect which variant the system uses.See: https://github.com/axel-download-accelerator/axel/commit/3f6ad06194782ded0eba621aa8ff8fe52d41280c#diff-67e997bcfdac55191033d57a16d1408a