Следуя за вопросом Zanna, я переместил файлы из общей папки, и теперь разрешения установлены правильно.
Вы запускаете gcc как root по какой-то странной причине, но затем вы запускаете chmod в качестве обычного пользователя. У вас нет [прав на изменение прав call_shellcode, поскольку вы скомпилировали его как root, и поэтому разрешения остаются неизменными.
Не компилируйте как root! Не делайте ничего, как root, если вам не нужно.
Из man chmod:
SETUID AND SETGID BITS
chmod clears the set-group-ID bit of a regular file if the file's group
ID does not match the user's effective group ID or one of the user's
supplementary group IDs, unless the user has appropriate privileges.
Additional restrictions may cause the set-user-ID and set-group-ID bits
of MODE or RFILE to be ignored. This behavior depends on the policy
and functionality of the underlying chmod system call. When in doubt,
check the underlying system behavior.
Следуя за вопросом Zanna, я переместил файлы из общей папки, и теперь разрешения установлены правильно.
Вы запускаете gcc как root по какой-то странной причине, но затем вы запускаете chmod в качестве обычного пользователя. У вас нет [прав на изменение прав call_shellcode, поскольку вы скомпилировали его как root, и поэтому разрешения остаются неизменными.
Не компилируйте как root! Не делайте ничего, как root, если вам не нужно.
Из man chmod:
SETUID AND SETGID BITS
chmod clears the set-group-ID bit of a regular file if the file's group
ID does not match the user's effective group ID or one of the user's
supplementary group IDs, unless the user has appropriate privileges.
Additional restrictions may cause the set-user-ID and set-group-ID bits
of MODE or RFILE to be ignored. This behavior depends on the policy
and functionality of the underlying chmod system call. When in doubt,
check the underlying system behavior.