iQue Player hacking possibility with ique_diag.exe?

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
You wanted a crawler, you just got a (very slow) crawler. Type in the start and end IDs (don't try and break it, the only error handling it has is ignoring content IDs that don't exist) and it'll increment the counter by 1, try and download the file, and repeat. It requires Python 3, and I'll probably update it later to be able to ignore URLs from a file. https://pastebin.com/0jFNjSUt

The first results of crawling are in: between 1000 and 1100, you only missed one, http://cds.idc.ique.com:16963/cds/download?content_id=1082 - good job!
Edit: Oh derp derp derp derp, didn't read it properly... read that as 'you didn't miss any between 1000 and 1100'...

--------------------- MERGED ---------------------------

You were saying the latest update of iQue@Home can't be downloaded any more; with a custom server, could we do this?
 

Attachments

  • Crawler.zip
    359 bytes · Views: 222
Last edited by Jhynjhiruu,
  • Like
Reactions: Deleted User

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
Sorry for the triple post, but I've now updated the program to save which files exist and don't exist. It only checks for them after trying to download, so it isn't any faster, but this should make it easier to tell which files do exist. Pastebin link is the same, but here's the new executable, and my do.txt and dont.txt.
Here's a spreadsheet to keep track of them - PM me to get edit access.
 

Attachments

  • Crawler.zip
    713 bytes · Views: 214
Last edited by Jhynjhiruu,
  • Like
Reactions: Deleted User

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
Hopefully final post before someone else notices: using a proxy, I found that the iQue@home updater is trying to connect to http://rms.idc.ique.com/hr_update/e...rev=4096&Release_rev=104022005101909 HTTP/1.0 - changing the server in the SERVER file lets me point this to any URL on the internet, so spoofing an update should be super simple. I'm on proper Wi-Fi now, so I'll try and do a full crawl of the site.
 

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
OK, I fixed the error where it would write each number an increasing number of times - but I just noticed, after crawling all the way to 1576, that Python apparently has a limit on line numbers in files! Luckily, the program still works, it just won't output all the numbers. Ones that do exist are fine, as there are far fewer of those. I'll upload the improved program eventually.
 

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
Dusting off this old account to post here :)

I recently noticed some iQue references in certain things, and noticed how the iQue Player, security-wise, sounded very familiar.. it looked like a prototype WiI!

Some further investigation showed that the founder of iQue also founded BroadOn (the company that did a lot of security-related stuff for the Wii; designed the Starlet, coded IOS etc).

More investigation (getting exceptions out of the iQue Player webservices) showed BroadOn was definitely involved here as well.


Check an SASK you have to hand. Then look at the page on wiibrew about NAND (128KB of boot1, then 1MB-128KB of two copies of boot2, stored in a modified WAD format).
Then double check the SASK and see how close the two are. 64KB of presumably boot1 (this is the same across all known SASKs! by the way, the boot1 key is different from the Wii's), 16KB of presumably boot2 header (ticket, certs, CRL, much like a WAD -- WADs can contain a CRL but no WAD ever did; and the "TMD" isn't a thing with iQue), then boot2 content (size described by the boot2 ticket); then 16KB of presumably system menu header, then system menu content.

And notice that two SASKs stop after the boot2 header (and even have zero content length in the ticket!) ; and only the latest 5 SASKs (1091, 1095, 1099, 1101, 1106) have a second boot-title.

I quickly hacked together a ticket dumper based on emoose's research (a couple of the fields are probably wrong though, I took a guess at what they were based on a few tickets): https://pastebin.com/2NHCde84
It can handle SASKs, ticket.sys files, raw ticket.sys tickets, and raw tickets.

Using it, you can see that with the SASKs with two titles, the contentIDs are different.
1091: first ticket has contentID=1091, second ticket has contentID=1092
1095: first ticket has contentID=1095, second ticket has contentID=1096
1099: first ticket has contentID=1095, second ticket has contentID=1100 (and this SASK only differs from 1095 starting at the second ticket!)
1101: first ticket has contentID=1095, second ticket has contentID=1102 (and parts of the first ticket and the first contents (starting at offset 0x1000 of the content) differ from 1099/1095!)
1106: first ticket has contentID=1095, second ticket has contentID=1107 (and parts of the first ticket and the first contents (starting at offset 0x15300 of the content) differs from 1101!)

I'm working on reversing the PC-side applications; that's about the only thing I can do, as I don't actually have an iQue Player. (Anyone willing to sell me one at a reasonable price? I'm located in the UK.)
Looking on eBay (I might get one, actually) there's one person selling them - including shipping, it comes to about £120, and there are 2 left.
 

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
OK, I've crawled from x = 0 to x = 9999, and, as none of them were valid, I think I'm gonna make a new version that uses game IDs - can I get some more info on that?
Edit: Crawled all the way to 14999, none except the ones we already knew, keeping going though - and yes, my program tested 15000 IDs. What happened to my life??
Edit 2: Current count is (more than) 38843
 
Last edited by Jhynjhiruu,
  • Like
Reactions: asper

Krem Quay

Well-Known Member
Newcomer
Joined
Aug 24, 2014
Messages
89
Trophies
0
Age
26
XP
231
Country
United States
Damn dude you posted so many times. I'm glad it's in the name of progress though. :P

Also, I realize some Chinese resellers for iQue Players on eBay are away on vacation--I hear that it's because it's Chinese New Year or something over there.
 

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
Damn dude you posted so many times. I'm glad it's in the name of progress though. :P

Also, I realize some Chinese resellers for iQue Players on eBay are away on vacation--I hear that it's because it's Chinese New Year or something over there.
Yup, probably something like that. I'm considering making a Discord server for this, it might work a little better than Temp.
 

Zhongtiao1

Well-Known Member
Member
Joined
Feb 24, 2015
Messages
831
Trophies
0
Age
26
XP
2,767
Country
United States
Is there anything preventing us from hosting the ique files on notabug? If they host freeshop, they may be fine with us hosting the ique games there
 

emoose

Member
Newcomer
Joined
Nov 24, 2017
Messages
21
Trophies
0
Age
40
XP
142
Country
United Kingdom
Sorry for the extended absence, been meaning to post an update on things but some personal issues came up, haven't had all that much free time unfortunately.

Did try upgrading my unit in a VM but sadly the client didn't seem to detect it...
I'm hoping to try r/wing the nand with my rPi soon (as soon as I get around to soldering the wires on.. or paying someone to do it for me since I'm awful at soldering)
It's probably best that I get a dump before upgrading anyway seeing as this OS version seems to be rare.

@Wack0 Nice to see you here! Very interesting info about the SKSA, I noticed things were similar to Wii but didn't think the similarity went that deep. Gives me even more hope the signing bug might be in here.

To that end I tried looking into how the signatures work, managed to write some code (https://pastebin.com/qg4jDVyY) that works to verify the signatures inside SKSA (the signature only covers the ETICKET_SIG struct/TICKET struct, there's probably a hash of the actual data in there somewhere)
Basically 0x0 - 0xAC of that struct is hashed with SHA1, and checked against signature at 0xAC - 0x1AC with the public key specified by cert_name (which should be in the cert chain area of SKSA)

Oddly enough the same ETICKET_SIG struct inside ticket.sys tickets fails to verify. Comparing tickets between units it seems most of the struct matches (even including the signature) except for a 0x10 byte area (the unkHash289C in ETICKET_SIG / unk_94 in your TICKET struct) which differs between devices.
My guess is this is an encrypted title-key of sorts, except instead of being encrypted with a common key like Wii/WiiU it uses a per-device one instead, I'd guess it decrypts that 0x10 area using the device-key and then the signature is checked with that decrypted 0x10 area in-place.
Only explanation I can think of for that area being different between units while signature remains static.
(also no luck with the ETICKET_XS_SIG struct signature neither, I'm guessing it probably has something similar)

I think it's funny the SKSA signature verified fine though - I guess the 0x10 area in that is already decrypted?
Anyway seeing as we can calculate the signature hash for it we should be able to fake-sign SKSAs now... but that's kind of useless unless we figure out the SKSA crypto/hashing.
(I was really hoping to get ticket.sys fake-signing to work since that would have been a lot easier to test if fake-signing even works, but seems we can't go anywhere with that until we get that title-key business sorted :()

Also what console-unique parts have you seen in the NAND? From the single dump I've had to look at the SKSA area seemed to match up with the one from the cache (except for some spots where I think the NAND wasn't dumped properly)
AFAIK the only console-unique parts are the apps themselves, and a few config-related files (there's files like id.sys & depot.sys which contain the BBID of the device, I'd guess it refuses to boot if those don't match the BBID in the CPU)

I'd really like to look at other dumps to be sure though, I still have my ique_diag extension mod here that should be able to dump over USB, which sadly hasn't been actually tried out yet ;_;
(If anybody has iQue@Home setup and working with their device, and wouldn't mind trying it out, please PM me!)
 
Last edited by emoose,

Jhynjhiruu

Well-Known Member
Member
Joined
Dec 31, 2016
Messages
817
Trophies
0
Age
21
XP
1,708
Country
Sorry for the extended absence, been meaning to post an update on things but some personal issues came up, haven't had all that much free time unfortunately.

Did try upgrading my unit in a VM but sadly the client didn't seem to detect it...
I'm hoping to try r/wing the nand with my rPi soon (as soon as I get around to soldering the wires on.. or paying someone to do it for me since I'm awful at soldering)
It's probably best that I get a dump before upgrading anyway seeing as this OS version seems to be rare.

@Wack0 Nice to see you here! Very interesting info about the SKSA, I noticed things were similar to Wii but didn't think the similarity went that deep. Gives me even more hope the signing bug might be in here.

To that end I tried looking into how the signatures work, managed to write some code (https://pastebin.com/qg4jDVyY) that works to verify the signatures inside SKSA (the signature only covers the ETICKET_SIG struct/TICKET struct, there's probably a hash of the actual data in there somewhere)
Basically 0x0 - 0xAC of that struct is hashed with SHA1, and checked against signature at 0xAC - 0x1AC with the public key specified by cert_name (which should be in the cert chain area of SKSA)

Oddly enough the same ETICKET_SIG struct inside ticket.sys tickets fails to verify. Comparing tickets between units it seems most of the struct matches (even including the signature) except for a 0x10 byte area (the unkHash289C in ETICKET_SIG / unk_94 in your TICKET struct) which differs between devices.
My guess is this is an encrypted title-key of sorts, except instead of being encrypted with a common key like Wii/WiiU it uses a per-device one instead, I'd guess it decrypts that 0x10 area using the device-key and then the signature is checked with that decrypted 0x10 area in-place.
Only explanation I can think of for that area being different between units while signature remains static.
(also no luck with the ETICKET_XS_SIG struct signature neither, I'm guessing it probably has something similar)

I think it's funny the SKSA signature verified fine though - I guess the 0x10 area in that is already decrypted (or uses a common key to decrypt instead?)
Anyway seeing as we can calculate the signature hash for it we should be able to fake-sign SKSAs now... but that's kind of useless unless we figure out the SKSA crypto/hashing.
(I was really hoping to get ticket.sys fake-signing to work since that would have been pretty simple to test out, but seems we can't go anywhere with that until we get that title-key business sorted :()

Also what console-unique parts have you seen in the NAND? From the single dump I've had to look at the SKSA area seemed to match up with the one from the cache (except for some spots where I think the NAND wasn't dumped properly)
AFAIK the only console-unique parts are the apps themselves, and a few config-related files (there's files like id.sys & depot.sys which contain the BBID of the device, I'd guess it refuses to boot if those don't match the BBID in the CPU)

I'd really like to look at other dumps to be sure though, I still have my ique_diag extension mod here that should be able to dump over USB, which sadly hasn't been actually tried out yet ;_;
(If anybody has iQue@Home setup and working with their device, and wouldn't mind trying it out, please PM me!)
Come join the Discord server, we all wanna discuss stuff and GBATemp isn't the best nor fastest way to do it.
 

Krem Quay

Well-Known Member
Newcomer
Joined
Aug 24, 2014
Messages
89
Trophies
0
Age
26
XP
231
Country
United States
@emoose Hey, nice to hear from you again.

I ordered an iQUe Player yesterday (or day before), and it should arrive soon. I'm pretty sure it has iQue@Home support because a screenshot showed like 5 titles on it (i think 4 are demos, idk). So if that arrives, I can help do testing. Kevinpuerta has an iQUe@Home-compatibile iQue Player though
 

emoose

Member
Newcomer
Joined
Nov 24, 2017
Messages
21
Trophies
0
Age
40
XP
142
Country
United Kingdom
Status update for anyone lurking (and because Discord servers aren't exactly indexed in search engines :P)

We've made the ique_diag extension I mentioned before (adding support for ique nand dumping etc), big thanks to Normmatt for the main dumping code!
You can grab the compiled version + patched ique_diag.exe here: https://github.com/emoose/iQueDiagExtend/releases (code at https://github.com/Normmatt/iQueDiagExtend)
Confirmed working with USB-compatible units, I think you might need an XP system/VM to make use of it though. If you have both of those I really recommend you make a dump of your unit ASAP.

Thanks to the dumps from this I've also been able to fix up my iQueTool to parse NANDs properly, so I've released it here: https://github.com/emoose/iQueTool
It'll let you view & extract all kinds of info from your iQue NAND, eg. ticket information, SKSA (iQue firmware) info, NAND filesystem extracting...
For people who want to try tinkering with their unit iQueTool can also repair the spare data of the NAND (correcting ECCs, setting SA block info data..)

Note that all of the released tools are read-only, so there's no risk to bricking your device by using them.
DiagExtend does have code to write files back to NAND, but you'll have to compile it yourself to add it.
But really if you're interested in that you should just join us on Discord, so that we can help you out :)
 

MockyLock

Well-Known Member
Member
Joined
Apr 21, 2011
Messages
372
Trophies
1
XP
2,123
Country
France
'llo
i try to follow your very intereting work with my little knowledge.
i have an iQue that have an issue, it can't be turned off, and freezes each time i press "Power".
This issue came after i tried to connect my iQue to my computer, running the iQue soft. (die it maybe more 10 years ago, i can't remember the details).
See https://gbatemp.net/threads/ique-player-wont-switch-on.483197/#post-7571044
I was wondering if your tool could help me to fix my console, maybe by writing/fixing part of its own NAND.
Waiting for your help !
 
Last edited by MockyLock,

emoose

Member
Newcomer
Joined
Nov 24, 2017
Messages
21
Trophies
0
Age
40
XP
142
Country
United Kingdom
'llo
i try to follow your very intereting work with my little knowledge.
i have an iQue that have an issue, it can't be turned off, and freezes each time i press "Power".
This issue came after i tried to connect my iQue to my computer, running the iQue soft. (die it maybe more 10 years ago, i can't remember the details).
See https://gbatemp.net/threads/ique-player-wont-switch-on.483197/#post-7571044
I was wondering if your tool could help me to fix my console, maybe by writing/fixing part of its own NAND.
Waiting for your help !

Haven't heard of that issue before.. I'd guess maybe the kernel-area didn't write properly, or it could be the filesystem that got corrupt.
If your unit can still use USB we might be able to help you out though :)
Join the discord https://discord.gg/SeZ3RPb and we can walk you through getting a NAND dump, once you have a dump hopefully we can figure out whats wrong with it.
(I might not be online when you join, but if you ask about getting a dump someone should help you)
 
  • Like
Reactions: MockyLock
D

Deleted User

Guest
The most obvious next question would be: Is it vulnerable to the Trucha/fakesign bug? It seems to be an early version of ES from the Wii, so probably.
 

emoose

Member
Newcomer
Joined
Nov 24, 2017
Messages
21
Trophies
0
Age
40
XP
142
Country
United Kingdom
The most obvious next question would be: Is it vulnerable to the Trucha/fakesign bug? It seems to be an early version of ES from the Wii, so probably.

I'm hoping so, but for that we need to figure out how they actually check the signatures first... I found out how it works for the SKSA/kernel signature, but nothing I try seems to work for the 2 game ticket signatures :(

I'm thinking it might be changing some part of the ticket just before it validates it, like decrypting the title key first or something. There's work on getting a RAM sniffer setup, so hopefully that'll reveal more of it to us.
 
  • Like
Reactions: Deleted User

MockyLock

Well-Known Member
Member
Joined
Apr 21, 2011
Messages
372
Trophies
1
XP
2,123
Country
France
Haven't heard of that issue before.. I'd guess maybe the kernel-area didn't write properly, or it could be the filesystem that got corrupt.
If your unit can still use USB we might be able to help you out though :)
Join the discord https://discord.gg/SeZ3RPb and we can walk you through getting a NAND dump, once you have a dump hopefully we can figure out whats wrong with it.
(I might not be online when you join, but if you ask about getting a dump someone should help you)

Thank you for your offer.
i'll try to get there, hopefully this WE, as i have a lot of work.
See you soon !
 
  • Like
Reactions: emoose

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    DinohScene @ DinohScene: ahh nothing beats a coffee disaronno at work