The book said that ASLR is activated by default on Linux, but when I try to confirm it, I find a strange problem: when I click the run button in VSCode, it always outputs a fixed stack address and ASLR doesn't work, but when I run the executable file generated by VSCode in bash, ASLR works
The code to check the address of the stack:
Код: Выделить всё
#include
int main() {
long local;
printf("local at %p\n", &local);
return 0;
}
Вывод нажатия кнопки «Запустить файл c/cpp»:
Код: Выделить всё
local at 0x7fffffffd250
< /code>
Вывод запуска исполняемого файла в Bash (несколько примеров случайных адресов): < /p>
local at 0x7ffed0965fb0
local at 0x7fff3eff7630
local at 0x7ffc0e083a00
Я проверил, что ASLR открыт на моей машине, я хочу знать, в чем разница между нажатием кнопки и ее запуском с Bash?
Подробнее здесь:
https://stackoverflow.com/questions/797 ... mmand-line