I was doing the "bof" problem on http://pwnable.kr/play.php I downloaded the "bof" file. But when I use gdb, it says as follows:
Starting program: /home/henry/Downloads/bof
/bin/bash: /home/henry/Downloads/bof: Permission denied
/bin/bash: line 0: exec: /home/henry/Downloads/bof: cannot execute: Permission denied
During startup program exited with code 126.
bof.c:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void func(int key){
char overflowme[32];
printf("overflow me : ");
gets(overflowme); // smash me!
if(key == 0xcafebabe){
system("/bin/sh");
}
else{
printf("Nah..\n");
}
}
int main(int argc, char* argv[]){
func(0xdeadbeef);
return 0;
}
It's the issue with your permissions. You currently don't have the permissions to execute the bof file.
To fix this, open the terminal and use the chmod
command.
chmod +x /home/henry/Downloads/bof
This will give you the permission to execute the file. You can also use something like chmod 744 /path/to/file
as an alternative. This will give you the permission to read, write, and execute on your account.
Check out linode documentation to know about file permissions.
User contributions licensed under CC BY-SA 3.0