gcc關(guān)閉地址隨機(jī)化,,attach 進(jìn)程時(shí)候發(fā)現(xiàn)函數(shù)地址變化,。
我在測(cè)試一個(gè)題目,出現(xiàn) Got EOF while reading in interactive 現(xiàn)象,。
我所編譯得文件已經(jīng)關(guān)閉了地址隨機(jī)化,,在exp 運(yùn)行過程中還是發(fā)現(xiàn)了地址變化。詳細(xì)如下:
1,;我編譯得命令:
gcc -m32 -fno-stack-protector -no-pie -o test test.c
2,;checksec 查尋如下:

3,;使用gdb調(diào)試,print 函數(shù)地址

4,;編寫exp ,,運(yùn)行發(fā)現(xiàn)錯(cuò)誤

5;調(diào)整exp ,,進(jìn)行調(diào)試,,代碼如下:

6;調(diào)試發(fā)現(xiàn),,在exp執(zhí)行過程中system 得地址已經(jīng)改變

7,;補(bǔ)充說明:python使用得是PyCharm 生成得虛擬運(yùn)行環(huán)境。
8,;源碼:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void vulnerable_function()
{
char buf[128];
read(STDIN_FILENO, buf, 256);
}
int main(int argc, char** argv)
{
vulnerable_function();
write(STDOUT_FILENO, "Hello, World\n", 13);
}
請(qǐng)問:為什么會(huì)產(chǎn)生如此現(xiàn)象,?