i have this little program that executes a shellcode:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
char shellcode[]="here is the bytecode";
int main(int main, char *argv[]) {
void (*ret)();
ret = (void (*)())shellcode;
(void)(*ret)();
}
i compile it with: gcc -o file file.c -fno-stack-protector -z execstack.
Then i try to redirect the output to a file: ./file > tmp.txt
But it doesn't work. Neither this: ./file 2> tmp.txt or ./file &> tmp.txt
The output is always printed to the screen, never to the file. Can anyone help me? I really need the output of that shellcode.