chmod 4755 (rwsr-xr-x) gives (rwxrwxrwx)
7,118
You are running gcc
as root for some strange reason, but then you run the chmod
as your regular user. You don't have [permission to change the rights of call_shellcode
since you compiled it as root, and therefore the permissions remain unchanged.
Don't compile as root! Don't do anything as root unless you have to.
Author by
James
Updated on September 18, 2022Comments
-
James over 1 year
I want to get the permissions of a program, call_shellcode (which calls shellcode), to be set to -rwsr-xr-x. When I run:
sudo chmod 4755 call_shellcode
the permissions for some reason is still set at -rwxrwxrwx
I am trying to get the root shell, but when I execute the program I get a normal shell. I am using Ubuntu 16.04 (32-bit) in VirtualBox
-
Zanna about 6 yearsIs this file on an NTFS partition or something like that?
-
PerlDuck about 6 yearsPlease don't post pictures of your problem! Post it as text instead.
-
James about 6 yearsIt is in a shared folder between host and guest for the VM
-
Connor Payne about 6 yearsWho is the owner of the file? you can find this out by running ls -l on the directory.
-
terdon about 6 yearsIs that really the only error message you get? Nothing about
Operation not permitted
? -
James about 6 yearsYeah it only shows what is there
-
Yaron about 6 yearsplease edit your question, and add the result of
ls -l
in that directory
-
-
James about 6 yearsI just tried
gcc -o call_shellcode call_shellcode.c
without the sudo and it still doesnt work -
Yaron about 6 years@JamesTan - the file
call_shellcode
already exists and owned byroot
, you need tosudo rm call_shellcode
before running thegcc
as regular user