-2

i try to write shell code in file using c , but after execute the program i found the ASCII code not shell code in the file . this is the code :

FILE *shell;
    shell = fopen("shell.txt", "w");
    fprintf(shell,"shell = '\xbd\x7f\x94' \n");
    fclose(shell);
Yksisarvinen
  • 18,008
  • 2
  • 24
  • 52

1 Answers1

1

In C to print a backslash you need to escape it, as it is the escape character.

So to print

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

specify

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

instead.

alk
  • 69,737
  • 10
  • 105
  • 255