Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run-as binary without the suid bit set, is there solutions? #86

Open
Mera-balou opened this issue Aug 24, 2018 · 2 comments
Open

Run-as binary without the suid bit set, is there solutions? #86

Mera-balou opened this issue Aug 24, 2018 · 2 comments

Comments

@Mera-balou
Copy link

Mera-balou commented Aug 24, 2018

Hi everyone,

What i have:
Device : Samsung J3 2016 (SM-J320FN)
Kernel : 5.1.1 (vulnerable to dcow, make test => Ok)
ABI : v7a
API : 22
Phone unroot, OEM locked

Compilation is working without problem but exploit failed :

shell@j3xnlte:/system/bin $ ./run-as                                           
WARNING: linker: ./run-as: unused DT entry: type 0x6ffffffe arg 0x934
WARNING: linker: ./run-as: unused DT entry: type 0x6fffffff arg 0x2
uid ./run-as 2000
**setresgid/setresuid failed**
uid 2000
0 u:r:runas:s0
context 0 u:r:shell:s0
shell@j3xnlte:/system/bin $ id
uid=2000(shell) gid=2000(shell) groups=1003(graphics),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats) context=u:r:shell:s0

It seems that my /system/bin/run-as binary doesn't have the setuid set...

Well, i can flash a custom system partition (no integrity checked on this partition even if OEM is locked).

So my question is:

  • can i replace the stock rom run-as binary with custom run-as binary with setuid flag set? This flag will be preserved after the flash boot? I just read my init.rc and no chown command is executed to change /system/bin permissions (but maybe another file just execute chown command to change /system/bin permissions...)
  • if the answer is yes, where can i found a run-as binary with suid flag set?
  • Is there another sucessfull strategy?

I have read many threads but maybe you have already answer it... Do i miss something??

Thanks

@timwr @naikel @droidvoider

@Mera-balou Mera-balou changed the title Run-as binary without the setuid bit set, is there solutions? Run-as binary without the suid bit set, is there solutions? Aug 24, 2018
@predbannikov
Copy link

Did you manage to solve this problem or get root in another way?

@timwr
Copy link
Owner

timwr commented Dec 2, 2021

https://github.com/hyln9/VIKIROOT but it requires a vdso region.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants