Tag: shellcode

C execve()参数

我必须填写以下参数: int execve(const char *filename, char *const argv[], char *const envp[]); 如果我执行这个程序: #include int main() { char *args[2]; args[0] = “/bin/sh”; args[1] = NULL; execve(args[0], args, NULL); } shell按预期正确生成。 我的问题是,如果我将NULL作为第二个参数传递,那么shell也会正确生成: #include int main() { char *args[2]; args[0] = “/bin/sh”; args[1] = NULL; execve(args[0], NULL, NULL); } 那么使用args向量(使用“/ bin / sh”+ NULL)作为第二个参数而不是NULL的目的是什么?

无法执行Shellcode – >(Speicherzugriffsfehler(Speicherabzug geschrieben))

我有这个function: char code[] = “\xeb\x19\x31\xc0\x31\xdb\x31\xd2\x31\xc9\xb0\x04\xb3\x01\x59\xb2\x05\xcd\x80\x31\xc0\xb0\x01\x31\xdb\xcd\x80\xe8\xe2\xff\xff\xff\x68\x65\x6c\x6c\x6f”; int main(int argc, char **argv) { int (*func)(); func = (int (*)()) code; (int)(*func)(); } (此代码来自: shellcode教程 ) 所以我编译并执行它,但我只得到这个消息:Speicherzugriffsfehler(Speicherabzug geschrieben)。 为什么我没有得到回报,只有这个错误信息? ps:我的系统是ubuntu x86 pc。 shellcode应该可以使用它。 我使用gcc和gcc-4.5编译它,两个相同的错误…

测试shellcode

我有这段代码来测试shellcode但我不明白所以任何人都可以解释一下吗? 忘记汇编shellcode,我想要了解的是C代码, char shellcode[] = “…”; int main(int argc, char **argv) { int (*func)(); func = (int (*)()) shellcode; (int)(*func)(); } 我的意思是一切,什么是空的() ,请解释它,好像你正在向初学者解释它。

从C – Bus错误10测试Shellcode

下面,我写了一个打印’Hello,World!’的x64程序集。 来自Mac OS X 10.8上的系统调用。 它独立执行时汇编并运行完美。 ; Assemble and link with: ; nasm -f macho64 -o HelloWorld.o HelloWorld.s ; ld -arch x86_64 -o HelloWorld HelloWorld.o global start section .text start: push rbp mov rbp, rsp jmp short String xor rdi, rdi mov di, 0x01 StringRet: pop rsi xor rdx, rdx mov dl, 0xE mov r8b, […]

C代码说明

有人可以帮我解释一下这些代码吗? char code[] = “paste your shellcode here”; int main(int argc, char **argv) { int (*func)(); func = (int (*)()) code; (int)(*func)(); }

作为函数转换的char数组的这个调用是做什么的?

我遇到了这段代码: char code[] = “\xb0\x01\x31\xdb\xcd\x80”; int main(int argc, char **argv) { int (*func)(); func = (int (*)()) code; (int)(*func)(); } 它是从用于Linux和Windows Tutorial的Writing Shellcode复制而来的。 有人可以解释一下这个函数调用(int)(*func)(); 是在做?

C程序中的Shellcode

链接http://hackoftheday.securitytube.net/2013/04/demystifying-execve-shellcode-stack.html突出显示了编写execve shellcode的方法。 #include #include unsigned char code[] = “\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80”; main() { printf(“Shellcode Length: %d\n”, strlen(code)); int (*ret)() = (int(*)())code; ret(); } 行int (*ret)() = (int(*)())code; 做?