首页 > 解决方案 > 如何用c编写shellcode?

问题描述

我尝试使用 c 在文件中编写 shell 代码,但在执行程序后我发现文件中的 ASCII 代码不是 shell 代码。这是代码:

FILE *shell;
    shell = fopen("shell.txt", "w");
    fprintf(shell,"shell = '\xbd\x7f\x94' \n");
    fclose(shell);

标签: cshellshellcode

解决方案


在 C 中要打印反斜杠,您需要对其进行转义,因为它转义字符。

所以要打印

shell = '\xbd\x7f\x94' <LF>

指定

"shell = '\\xbd\\x7f\\x94' \n"

反而。


推荐阅读