Closed Izib closed 8 years ago
Hi lzib!
I see you have passed untether stage - "alive?!". So, could you please write here your iPhone/iPad model?
About your question 2: You can't compile untether without sources of patchfinder_64.c (it's my name of this file, I reverse-engineered it), but it's private (owner is the Pangu team). Another problem is defines for IOKit - xnuexp.h. It's easy to restore. Just locate structures and prototypes of unknown functions in the Apple Opensource or from old headers of IOKit.
Thank you for your comment. Model is iphone 6(A1586)
What does the "alive?!" mean? do you have the "yalu" work on you device?
No, I rewrote the dyldmagic app (cause it's hardcoded for the iPhone 6 (I beleive) kernel offsets to by-pass codesign). So, it generates a stable version of magic.dylib w/o a GasGauge exploit (user level codesign by-pass with csbypass method). But I can't get untether working on my iOS 8.4.1 runned on iPhone 5s 64Gb. The untether crashes at stage of kernel dumping. The "Doing a full kernel dump now.." message is last in my log and I get blue screen every tap of the jailbreak app. I am fighting with that problem yet.
The "alive?!" means, that kernel is probably dumped, gadgets were found and kernel was patched. The main goal of jailbreak process is to patch the kernel (turn off sandbox, codesign, memory protection and other features to allow any app w/o valid code signature (read the Apple native signature, not developer certificate signature) to be runned outside of sandbox with root rights).
So, my next question is it is stable for you? Are you get log message with "alive?!" every time or with some random taps?
The ROP-ified version of the exploit is unstable, with a pretty low success rate. On the other hand, the untether itself was in my experience pretty reliable.
@kpwn you mean stable on iPhone 6, or you tested 5/5s also?
I only tested on an iPhone 6. I've never really had a 5s 8.4.1 until very recently, and since dyldmagic won't work on it I have no way to test. (except fixing it but I have no time for it right now)
@progopis I know "Alive?!" means patch working on the code-side. if it really works, why it doesn't extracting my file. As my post mentioned, I add var/mobile/Media/izib_jb.log to test if it untar the file. I was thinking there's some thing wrong on my device and the code doesn't print any exception log. That's why I wanna recompile the untether.
You question: I changed the "run.sh", the new "run.sh" is about 70% chance to get 6+ ret and "alive?!" on my device.
@progopis BTW: I tried decompiling the patchfinder_64 from untether(I estimate that needs too much time). I chose to patch the untether bin to add logs. That makes it very unstable, I haven't got one success "alive?!" in my tests. I was stucked... I might have to RE the patchfinder_64 file.
If I remember correctly, untether has full symbols. You may link against those, but it requires patching the untether mach-o.
@Izib could you check please last version on iPhone 6?
@progopis 8.4.1(12H321)
@Izib, thanks but I mean last version of yalu after last commit.
I am working on commit 9a682f393f41b912333add22f5af9d5d7464ca17
commit 9a682f393f41b912333add22f5af9d5d7464ca17
Merge: 604a5ea 7d3115d
Author: kpwn <i_are@qwertyoruiop.com>
Date: Tue Dec 1 09:45:38 2015 +0100
Merge pull request #37 from qfdk/master
fix the zcat in run.sh
I also tried the commit 5668b58d061ee2e3261aa57139090dc68c0fdafd (That's merged from you)
commit 5668b58d061ee2e3261aa57139090dc68c0fdafd
Merge: 9562a33 1624860
Author: kpwn <i_are@qwertyoruiop.com>
Date: Sun Jun 26 23:26:15 2016 +0200
Merge pull request #45 from FriedAppleTeam/master
It’s a merged commit of FriedApple Team.
and then I cannot reach "Alive?!". Always crashed after "Kernel dumped".
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: Smoke Britta Erry Day
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: yalu for ios841 arm64 untether by ~qwertyoruiop[kjc]
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: +420 swags @ windknown, comex, ih8sn0w, posixninja, _morpheus_, haifisch, jk9357, ttwj, kim jong un
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: -420 swags @ south (fake) korea, saurik, britta
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: Found overlapping object
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: Found overlapped object
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: Found overlapped object again
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: Partially dumping the kernel...
Jun 28 00:19:26 zhangqing drugs[195] <Warning>: Kernel dumped.
[disconnected]
Nice, it looks like the loader works and the untether too, to a certain extent.
So, I can probably find the time to write up a new, better untether. I guess.
@Izib For me, too. I also have a crash after "Kernel dumped.". We have a new kernel dumper, more stable, and it can reach even "Doing a full kernel dump now..", "Done!". I beleive the problem with untether that we were forced to make it 32 bit and/or killed fork()
. We can not load 64 bit binaries with current loader (due to AMFI was not patched in the kernel and loader is 32 bit itself). So, I suppose the final stable solution is almost ready.
Btw, I tried to reproduce Pangu exploits on 64 bit device, and here is POC for panic2, it works on both 32 bit and 64 bit versions:
void panic2(io_connect_t connection)
{
vm_address_t address = 0;
vm_size_t vmsize = 4096;
kern_return_t kr = IOConnectMapMemory(connection, 0, mach_task_self(), &address, &vmsize, kIOMapAnywhere);
if (kr != KERN_SUCCESS || vmsize != 4096) {
return;
}
size_t size;
cpu_type_t type;
size = sizeof(type);
sysctlbyname("hw.cputype", &type, &size, NULL, 0);
if (type == CPU_TYPE_ARM64) {
// ARM 64-bit CPU
NSLog(@"it's a 64 bit");
*(uint32_t *)(address + 24) = 0xAAAAAAA;
*(uint32_t *)(address + 28) = 0; // change 169 to 0
} else if (type == CPU_TYPE_ARM) {
// ARM 32-bit CPU
NSLog(@"it's a 32 bit");
*(uint32_t *)(address + 16) = 0xAAAAAAA;
*(uint32_t *)(address + 20) = 0; // change 339 to 0
} else {
NSLog(@"it's unknown");
return;
}
IOConnectCallMethod(connection, 14, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL);
}
I don't know is it usable for untether.
The heap overflow used by Yalu is pretty easy as heap overflow. I can recompile the untether for armv7.
I patched untether and make it work now. (After reboot hundred times, my device is unstable and only 1/5 chance to patch successfully) Meanwhile something is broken, I cannnot use "idevicediagnostics restart" on my device :(
Jun 28 13:00:19 iPhone com.apple.MobileSoftwareUpdate.UpdateBrainService[199] <Notice>: 0050c000 : Verifying the package contents
Jun 28 13:00:24 iPhone com.apple.xpc.launchd[1] (lockdown.17261501381.com.apple.mobile.diagnostics_relay[207]) <Warning>: Service exited with abnormal code: 1
This error is not the problem of yalu code any more, I will close this issue. thanx @progopis @kpwn
First of all, I read all issues in yalu thead. i'm 90% sure I did exactly what it needs to do.
log in Mac shell:
log in kjc_jb.log:
But I scan the port 22, it's closed. openssh dones't work, back to check syslog by idevicesyslog, no info prints about sshd.
I am not sure which folder is the readable folder for ifunbox, also tried writing test info to izib_jb.log in /private/var/mobile/Media and /Media folder. After all of those tests, didn't see izib_jb.log in ifunbox.
@kpwn sorry, it's a long story, I just want to know is some way to continue debugging the issue. I was thinking there must be some way to check it while you are doing the jb work.