Open Donny1995 opened 5 years ago
Updated main.m to set euid and ruid in main, bit still same effect
int main(int argc, char * argv[]) {
@autoreleasepool {
patch_setuidandplatformize();
if (!(setuid(0) == 0 && setgid(0) == 0)) { //uids
printf("DID NOT SET UIDS");
}
if (!(seteuid(0) == 0 && setegid(0) == 0)) { //effective uids
printf("DID NOT SET Effective UIDS");
}
if (!(setruid(0) == 0 && setrgid(0) == 0)) { //real? uids. There is no getruid or getrgid functions to check but whatever set them too please
printf("DID NOT SET Real UIDS");
}
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
And also tried:
But still, same situation (
Hello. I found a problem where my binary runs in pseudo-root mode. All details below: Start with code to get superuser rights:
Where patch_setuidandplatformize is taken from cydo from youknowwhere
Then i entitle is with following file, using jtool or ldid2, does not matter:
Then i find my binary which is being installed by CydiaImpactor, and do:
chown root:wheel executable
chmod 6755 executable
.So, this is how binary looks like in filesystem. suid bits are set, aren't they?
-rwsr-sr-x 1 root admin 235872 Dec 3 02:38 ElectraTest
setuid(0) starts working. Or, does it? I do get getuid() == 0
But
I can't use posix_spawn - Operation not permitted
status = posix_spawn(&pid, "/usr/bin/stat", NULL, NULL, argv, environ);
orstatus = posix_spawn(&pid, "/bootstrap/usr/bin/stat", NULL, NULL, argv, environ);
I can't write anything to filesystem exact same way Electra does to test remount
I can't get kernel task port with hsp4
host_get_special_port(mach_host_self(), HOST_LOCAL_NODE, 4, &kern);
error is: "(os/kern) invalid argument"So i can do nothing extra. The only changes are:
At least, hsp4 is really working when called inside Electra code after remapping tfp0 in fun.c Also, jailbreakd on launch in main.m is getting hsp4 to start working. So, if i got uid==0 => jailbreakd patched me => it got kernel task port from hsp4?
What's wrong with theese steps? And if this question is to be classified as "This is not about actual Electra code, it's all your's broken arms", just tell me where to find the answers, please -_-.