2023-10-23 2023-10-23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/mman.h> char shellcode[800]; void vulnerable() { mprotect(0x404000,0x1000,PROT_READ | PROT_WRITE|PROT_EXEC); //第一个参数需要是内存段的起始地址,第二个参数需要对其,64位是0x1000 gets(shellcode); puts(shellcode); ((void(*)(void))&shellcode)(); return; } int main(int argc, char **argv) { vulnerable(); return 0; } 前一篇 使用正则表达式批量修改函数 后一篇 关于AES加密输出密文不为128位的倍数的原因
说些什么吧!