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

Change auth info for the initial ucred to a proper one #377

Closed
ultimaweapon opened this issue Oct 1, 2023 · 70 comments · Fixed by #426
Closed

Change auth info for the initial ucred to a proper one #377

ultimaweapon opened this issue Oct 1, 2023 · 70 comments · Fixed by #426
Assignees
Labels
T-enhancement Type: Enhancement

Comments

@ultimaweapon
Copy link
Member

Need to find (or dump?) auth info from the PS4 process that run exec on the game binary after forked.

@ultimaweapon ultimaweapon added the T-enhancement Type: Enhancement label Oct 1, 2023
@ultimaweapon
Copy link
Member Author

@red-prig do you know the name of (S)ELF file of the process that exec the game binary?

@red-prig
Copy link

red-prig commented Oct 7, 2023

@ultimaweapon I suspect that it is somewhere in the depths of vsh, but I have not found the exact location.

@ultimaweapon
Copy link
Member Author

Thanks.

@red-prig
Copy link

red-prig commented Oct 8, 2023

@ultimaweapon Here is a log dump from the console, I think in combination with FW research, this can be used to judge the order of initialization
https://www.psdevwiki.com/ps4/Bootprocess

@ultimaweapon
Copy link
Member Author

Thanks.

@ultimaweapon
Copy link
Member Author

I think I found it. It is /system/sys/SceSysCore.elf.

@ultimaweapon
Copy link
Member Author

@VocalFan can you help on finding auth info for /system/sys/SceSysCore.elf? Some example of auth info: https://www.psdevwiki.com/ps4/Auth_Info

@VocalFan
Copy link
Member

Where is this specifically?

@ultimaweapon
Copy link
Member Author

It need to be dumped from the kernel somehow. The scene developers should be able to give you some clues.

@VocalFan
Copy link
Member

okay so, /system/vsh is the location. Will try to snag later :P

@ultimaweapon
Copy link
Member Author

okay so, /system/vsh is the location. Will try to snag later :P

No, it is /system/sys/SceSysCore.elf.

Found some evident that it is SceSysCore.elf: OpenOrbis/mira-project#154. It is quite small which mean it is likely to be an importance and highly privileged process.

@VocalFan
Copy link
Member

Eh, I found a SceSysCore.elf in /vsh/ ... Not sure how to snag the /sys/ elf if there is one.

@VocalFan
Copy link
Member

Uh, email.

@ultimaweapon
Copy link
Member Author

That one is SceShellCore.elf, not SceSysCore.elf.

@VocalFan
Copy link
Member

...I am the dumb.

@VocalFan
Copy link
Member

I found a payload that can get authinfo values, will do when home.

@VocalFan
Copy link
Member

Or uh...
3800000000000007

https://www.psdevwiki.com/ps4/Program_Authority_ID#User_Modules

@ultimaweapon
Copy link
Member Author

Strange. Why the value for exe and library does not match with #329 (comment). We still need the value for capabilities and attributes.

@red-prig
Copy link

It seems that using sys_get_self_auth_info you can dump all files in order, I’m also interested in this topic

@ultimaweapon
Copy link
Member Author

@red-prig looking good! The problem is it seems like this syscall need to be called from the process we want to dump the auth info.

@ultimaweapon
Copy link
Member Author

Wait, seems like the first parameter is the path for the SELF file to get the auth info!

@VocalFan
Copy link
Member

Soooo, good thing, Ultima?

@ultimaweapon
Copy link
Member Author

Yeah, I guess the payload you mentioned use this syscall to dump the auth info.

@VocalFan
Copy link
Member

https://github.com/stooged/Auth-Info-Dumper/blob/master/Auth_Info_Dumper/source/main.c

Can you build a 9.00 payload for me @ultimaweapon ? Latest official build is for 5.05

@ultimaweapon
Copy link
Member Author

Seems like it have more works than just compiling. Let me check to see if we can build a simple payload just for SceSysCore.

@VocalFan
Copy link
Member

Alright, because this payload just either kills the GUI, or kernel panics

@ultimaweapon
Copy link
Member Author

Required some works because we can't just call sys_get_self_auth_info due to the kernel will filter out most of the data we need.

@VocalFan
Copy link
Member

Alrighty, just keep me updated!

@red-prig
Copy link

I'm also confused by unsigned char buf[136]; here you probably need to pass a link to the buffer in the guest code, because it will not return the argument data back to you

@ultimaweapon
Copy link
Member Author

Although, probably if the application is launched in sandbox mode

We already escaped from the sandbox by calling jailbreak.

I'm also confused by unsigned char buf[136]; here you probably need to pass a link to the buffer in the guest code, because it will not return the argument data back to you

Sorry I don't understand what you mean. Could you elaborate this?

@ultimaweapon
Copy link
Member Author

I think I found the bug in my code now. The second parameter for kexec is not directly passed to the handler. It got wrapped in another struct.

@red-prig
Copy link

We already escaped from the sandbox by calling jailbreak.

Yes, you are jailbreaking, but in what context does the application launch? If it's an imitation of a game, then it's a sandbox.

@ultimaweapon
Copy link
Member Author

@VocalFan this should work.

dump-auth.zip

@red-prig
Copy link

I think I found the bug in my code now. The second parameter for kexec is not directly passed to the handler. It got wrapped in another struct.

Yes it is copied.

@ultimaweapon
Copy link
Member Author

Yes, you are jailbreaking, but in what context does the application launch? If it's an imitation of a game, then it's a sandbox.

Normally the payload will be executed by the web browser. Not sure what method of Guest Payload that @VocalFan use.

@red-prig
Copy link

Yes, you are jailbreaking, but in what context does the application launch? If it's an imitation of a game, then it's a sandbox.

Normally the payload will be executed by the web browser. Not sure what method of Guest Payload that @VocalFan use.

I think sys_is_in_sandbox will give an exact answer to the question

@red-prig
Copy link

Sorry I don't understand what you mean. Could you elaborate this?

i mean:

struct get_auth_args {
	const char *file;
	const char *buf;
};

@red-prig
Copy link

Although if args is copied simply as a link, then for args->file you must first do copyin(args->file, file, 8); and then error = kern_get_self_auth_info(td, file, 0, info);

@VocalFan
Copy link
Member

Normally the payload will be executed by the web browser. Not sure what method of Guest Payload that @VocalFan use.

I use AlAzif's Payload Guest, which puts the payload into GoldenHen's payload server... Basically, it has jailbreak/admin access.

@ultimaweapon
Copy link
Member Author

@VocalFan see my above comments for the newer version. That one should work.

@VocalFan
Copy link
Member

I am having the ultimate battle of moving myself from my bed.

@VocalFan
Copy link
Member

VocalFan commented Oct 25, 2023

07 00 00 00 00 00 00 38 00 00 00 00 00 1C 00 40
00 FF 00 00 00 00 00 80 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 80 00 40 00 40
00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 08
00 40 FF FF 00 00 00 F0 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00

Or just whole:

07 00 00 00 00 00 00 38 00 00 00 00 00 1C 00 40 00 FF 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 40 00 40 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 08 00 40 FF FF 00 00 00 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

@red-prig
Copy link

Seems true

@VocalFan
Copy link
Member

Seems true

Its similar to another SELF's Auth Info

@VocalFan
Copy link
Member

  0000  01 00 00 00 00 10 00 38 00 00 00 00 00 1c 00 40  .......8.......@
  0010  00 ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00  ................
  0020  00 00 00 00 00 00 00 00 00 00 00 c0 00 40 00 40  .............@.@
  0030  00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 f0  ................
  0040  00 40 ff ff 00 00 00 f0 00 00 00 00 00 00 00 00  .@..............
  0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  0080  00 00 00 00 00 00 00 00       
orbis_swu.self
  0000  07 00 00 00 00 00 00 38 00 00 00 00 00 1c 00 40  .......8.......@
  0010  00 ff 00 00 00 00 00 80 00 00 00 00 00 00 00 00  .ÿ.....€........
  0020  00 00 00 00 00 00 00 00 00 00 00 80 00 40 00 40  ...........€.@.@
  0030  00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 08  .......€........
  0040  00 40 ff ff 00 00 00 f0 00 00 00 00 00 00 00 00  .@ÿÿ...ð........
  0050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  0060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  0070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  0080  00 00 00 00 00 00 00 00       
SceSysCore.self

Note, I added SceSysCore to the Wiki's Auth Info page now, but it's pending approval... Either way, these two SELFs are similar in some ways, different in others.

@red-prig
Copy link

07 00 00 00 00 00 00 38 00 00 00 00 00 1C 00 40
00 FF 00 00 00 00 00 80 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 80 00 40 00 40
00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 08
00 40 FF FF 00 00 00 F0 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00

Or just whole:

07 00 00 00 00 00 00 38 00 00 00 00 00 1C 00 40 00 FF 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 40 00 40 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 08 00 40 FF FF 00 00 00 F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Judging by: https://www.psdevwiki.com/ps4/Program_Authority_ID#User_Modules 3800000000000007 this is SceSysCore.self so I think everything is correct

@ultimaweapon
Copy link
Member Author

@red-prig do you know what is Decid process?

@red-prig
Copy link

@red-prig do you know what is Decid process?

This probably has something to do with the debug, I didn't dig into it. Probably the hackers who broke the console can tell you more.

@ultimaweapon
Copy link
Member Author

Thanks.

@VocalFan
Copy link
Member

@ultimaweapon
image
For your working payload ^

@ultimaweapon
Copy link
Member Author

It is just a very basic payload with hard coded input. Also it is fixed to 9.0 kernel only. So I don't want to create a repository for a quick and dirty thing.

@VocalFan
Copy link
Member

It is just a very basic payload with hard coded input. Also it is fixed to 9.0 kernel only. So I don't want to create a repository for a quick and dirty thing.

But 9.00 is the latest jailbreakable, plus people can just modify the input before compiling.

@ultimaweapon
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: Enhancement
Development

Successfully merging a pull request may close this issue.

3 participants