+ Reply
Page 1 of 14 123 11 ... LastLast
Results 1 to 20 of 272

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Emergency SSH access using a pwn'd DFU mode RamDisk

is a discussion within the

General

forums, a part of the

Jailbreak / Downgrading / Upgrading

section;
Emergency SSH access using a pwn'd DFU mode RamDisk (Win7-32) Use at your own risk. Experienced users only !! If you don't know what you're doing, stay away!! Management summary:
...
  1. #1
    Mes
    Mes is offline
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,025
    Thanks
    102
    Thanked 788 Times in 731 Posts

    Default Emergency SSH access using a pwn'd DFU mode RamDisk
    Emergency SSH access using a pwn'd DFU mode RamDisk (Win7-32)

    Use at your own risk. Experienced users only !! If you don't know what you're doing, stay away!!


    Management summary:

    When an iDevice won't boot, several remedies are available. SSH, iPhoneExplorer/Browser, etc and iTunes restore are the normal methods to either restore or to gain access to a non-bootable device and implement a fix. This is an alternative approach when the normal methods don't work and all else fails. Warning: Significant iPhone/computer experience required!!

    Disclaimer:

    This is not new work. It uses this reference as THE source (Mostly iPhone hacking: Booting SSH ramdisk on new devices), adds changes for iOS 4.2.1 and lots of clarification. All thanks go to MsftGuy and so many others.

    Purpose:

    Acquire SSH access to the root and user filesystems, modify and/or delete the offending program, and reboot without any damage or noticeable change. This process should be considered a last resort. It builds a new ramdisk with SSH included, uses current jb'ing exploits to download the ramdisk and access the iDevice. It requires technical knowledge, significant computer and iPhone experience, and is NOT for the beginner or the faint of heart.

    Discussion:

    Since the release of 4.x, many have experienced booting issues after installing a non-compatible or faulty MobileSubstrate app. Most of the time, the 3GS will boot or respring into safe mode where it can be accessed and fixed. Unfortunately, once in awhile, it does not boot into safe mode. It hangs at the Apple logo. When this happens, I typically get the normal Apple logo for about 5 minutes, then it adds a spinning wheel for another 2-3 minutes, then everything freezes. It doesn't reboot, it does nothing! A force shutdown works, but it does the same thing over and over again.

    The problem: !!! No access !!!

    During this 'once in awhile' situation: SSH, AFC2, iPhoneBrowser/Explorer, iTunes, does not work and the computer does not recognize the device. Nothing I've tried will access or even recognize the device. Without access, it can not be fixed.

    Note: If your iDevice continually reboots (does not freeze), a simpler solution is likely. SSH/AFC2 access may be available for a short time during the reboot process.

    Applicability:

    Claimed support: iPhone4, iPad I, 3GS old & new bootrom
    iOS 4.0 and above
    Tested: 3GS, old bootrom, iOS 4.2.1 (Windows 7 PC, iTunes 10.1), jb'd w/PwnageTool
    Tested: 3GS, new bootrom, iOS 4.1 (Windows 7 PC, iTunes 10.4), jb'd w/redsn0w (using 4.1 files and keys, see end of post )
    Previously jailbroken (any method)
    Implements: limera1n for a pwn'd DFU mode exploit
    NOT FOR older 2G, 3G devices, or any iOS 3.x
    (A similar method using iRecovery is available, see links above)

    Note: Instructions are written for 3GS/4.2.1. Newer/older iOS/iDevices should work. My primary reference (msftguy link in 2nd paragraph above) provides a 4.1/3GS tutorial. Make appropriate changes (different custom ipsw with different file names) for your iOS / iDevice version.

    Requirements:

    1: RecoveryRamdiskBuilder_rev_2.zip: http://iphonetunnel-usbmuxconnectbyp...lder_rev_2.zip
    (Reference: Mostly iPhone hacking: Booting SSH ramdisk on new devices)
    2: Restore Ramdisk (038-0082-001.dmg) IV & KEY (3GS, iOS 4.2.1): from VFDecrypt Keys - The iPhone Wiki
    3: Custom 4.2.1 ipsw created by PwnageTool or Sn0wbreeze
    4: tetheredboot utility from https://github.com/downloads/msftguy...boot_win32.zip
    5: itunnel_mux (rev71): http://iphonetunnel-usbmuxconnectbyp..._mux_rev71.zip

    Process:

    1. Create a "New Folder"
    2: Extract everything (except the custom ipsw) to "New Folder"
    2: Extract the custom 4.2.1 ipsw (I use 7-zip) to a temporary folder
    From the temporary folder, find and copy to "New Folder"
    a. IBSS.n88ap.RELEASE.dfu,
    b. kernelcache.release.n88,
    c. DeviceTree.n88ap.img3, and
    d. 038-0082-001.dmg.
    (the restore ramdisk)
    3: execute: RecoveryRamdiskBuilder.exe (Build the new ramdisk with ssh included)
    Copy/Paste IV and KEY (from theiphonewiki....)
    Select ramdisk: 038-0082-001.dmg (the 4.2.1 custom ipsw ramdisk)
    A new ramdisk is created: 018-0082-001.dmg.ssh (automatically builds)
    If successful: Completes with: ALL OK; boot with '038-0082-001.dmg.ssh' ramdisk ......



    Finished building. Your directory should contain these files:




    4: Put the device in normal DFU mode (iClarified - iPhone - How to Put an iPhone Into DFU Mode)
    5: Open a cmd.exe window (run as admin) and navigate to "New Folder"
    6: Run tetheredboot and load 3 files on the iDevice:
    tetheredboot -i iBSS.n88ap.RELEASE.dfu -k kernelcache.release.n88 -r 038-0082-001.dmg.ssh

    Note: The 3GS screen should be totally white while tetheredboot is running.

    ------------ Displayed by tetheredboot ------------------
    ...initializing libpois0n
    ...ERROR: The process "iTunes.exe" not found.
    ...ERROR: The process "iTunesHelper.exe" not found.
    ...Waiting for the device to enter DFU mode
    ...Found device in DFU mode
    ...Checking if device is compatible with this jailbreak
    ...Checking the device type
    ...Identified device as iPhone2,1
    ...Preparing to upload limera1n exploit
    ...Resetting device counters
    ...Sending chunk headers
    ...Sending exploit payload
    ...Sending fake data
    ...Expoit send
    ...Reconnecting to device
    ...Waiting 2 seconds for the device to pop up...
    ...Uploading iBSS.n88ap.RELEASE.dfu to device
    ...[================================================] 100.0%
    ...Waiting 10 seconds for the device to pop up...
    ...Uploading 038-0082-001.dmg.ssh to device
    ...[================================================] 100.0%
    ...Uploading kernelcache.release.n88 to device
    ...[================================================] 100.0%
    ...Exiting libpois0n

    If the process stops at "Waiting 2 seconds....", start over at step 4.

    Note: After loading, the 3GS screen should have a white Apple logo with an empty progress bar




    ...If no errors (except iTunes), go to step 7...

    Note: If #6 tetheredboot fails to load the ramdisk (which tends to happen with large ramdisks),
    you can try using itunnel_mux to load kernel and ramdisk:
    6a: tetheredboot -i iBSS.n88ap.RELEASE.dfu
    6b: itunnel_mux --kernelcache kernelcache.release.n88 --devicetree DeviceTree.n88ap.img3 --ramdisk 038-0082-001.dmg.ssh

    7: execute itunnel_mux.exe to forward SSH connection to the USB (does not terminate):
    itunnel_mux --lport 22

    ------------Displayed by itunnel_mux----------------------------
    ...[INFO] Waiting for new TCP connection on port 22
    ...[INFO] Waiting for device ...
    ...[INFO] Device connected: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    .............. more messages after a connection is made ...........
    Note: Leave this window open ...............

    8: Open a new cmd.exe window (run as admin recommended)
    9. Create/start an SSH session (I use Cygwin for ssh)
    ssh root@localhost -p 22

    Note: If 1st log-in, a new RSA certificate will be generated. Enter 'yes' to accept

    11: Enter password: alpine
    12: This is your logged in prompt: -sh-4.0#

    Note1: itunnel_mux window: [INFO] Device connected .....
    Note2: After the connection, the 3GS screen will change to totally white
    Note3: If no ssh response/message from either window, check local firewall settings

    Mount / (root) filesystem (contains system settings & files, MobileSubstrate dylibs, etc)
    13: -sh-4.0# fsck_hfs /dev/disk0s1
    14: -sh-4.0# mount_hfs /dev/disk0s1 /mnt1/

    Mount /usr filesystem (everything else, IE: music, media, photos, apps, data, etc)
    15: -sh-4.0# fsck_hfs /dev/disk0s2s1
    16: -sh-4.0# mount_hfs /dev/disk0s2s1 /mnt2/

    To set the path correctly so you can easily navigate the filesystem:
    17: -sh-4.0# PATH=$PATH\:/mnt1/bin

    Congratulations, you now have full root access Up to this point, the iDevice has NOT been modified in any way --- so be careful! After you're done messing around, play it safe - execute: sync; sync; sync This will flush any pending filesystem writes.

    When finished, to terminate the session and restart the iPhone:
    18: -sh-4.0# kill 1

    Other common commands:
    ls (list directory), rm (delete), mv (rename or move), cp (copy)

    Note: If you save the directory "New Folder". Subsequent emergency SSH access is quick & easy. Start at step 4.

    All the information you need is available in this thread and on the internet. Experienced users only.

    For a 3GS on iOS 4.1 (note: cfw built by pwnage):
    iBSS.n88ap.RELEASE.dfu: 108.932 bytes
    kernelcache.release.n88: 4,761,412 bytes
    018-7080-079.dmg.ssh: 17.962,308 bytes
    Attached Thumbnails Attached Thumbnails Emergency SSH access using a pwn'd DFU mode RamDisk-tb1.png   Emergency SSH access using a pwn'd DFU mode RamDisk-tb1-1.png   Emergency SSH access using a pwn'd DFU mode RamDisk-tb2.png   Emergency SSH access using a pwn'd DFU mode RamDisk-tb3.png  
    Last edited by Mes; 09-09-2011 at 08:55 AM. Reason: Added 4.1 file notes

  2. The Following 9 Users Say Thank You to Mes For This Useful Post:

    animaltastic (12-28-2011), Darksecrets (05-14-2011), moon#pie (04-14-2011), mpwn (04-23-2011), Orby (04-08-2011), ramar (04-18-2011), Simon (04-18-2011), Sn1p3r (09-10-2011), Stray (04-08-2011)

  3. #2
    Livin the iPhone Life Stray's Avatar
    Join Date
    Oct 2010
    Location
    You Know...
    Posts
    14,067
    Thanks
    675
    Thanked 1,357 Times in 1,074 Posts

    Very nice
    Quote Originally Posted by ikesmasher View Post
    that was officially the scariest thing you have ever said str4y.
    Quote Originally Posted by Pancho paco View Post
    Dude T.M.I

  4. #3
    Super Galactic Moderator Orby's Avatar
    Join Date
    Aug 2010
    Location
    Omicron Persei Eight
    Posts
    5,667
    Thanks
    40
    Thanked 569 Times in 520 Posts

    You, sir, are a boss.

    Not like a boss.

    A full-on boss.

    Glad to see someone wrote up a (very good) tut for booting a "recovery" ramdisk. Now do one for OS X?

  5. #4
    Mes
    Mes is offline
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,025
    Thanks
    102
    Thanked 788 Times in 731 Posts

    Thank you STRAYunINFIDEL and orbyorb for your kind comments
    Last edited by Mes; 04-08-2011 at 11:57 PM.

  6. #5
    Livin the iPhone Life Stray's Avatar
    Join Date
    Oct 2010
    Location
    You Know...
    Posts
    14,067
    Thanks
    675
    Thanked 1,357 Times in 1,074 Posts

    No problem.
    Quote Originally Posted by ikesmasher View Post
    that was officially the scariest thing you have ever said str4y.
    Quote Originally Posted by Pancho paco View Post
    Dude T.M.I

  7. #6
    What's Jailbreak?
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    you are a god.
    my iP4 is stuck on a boot loop, ive tried every possible solution out there besides a restore, which i dont wanna do because ill lose all my photos etc..
    im gonna give this a shot tomorrow and see if i can get to the filesystem.

    one thing though, as far as the custom ispw goes, im running 4.0, so wouldnt i need a custom 4.0 ispw?

  8. #7
    Livin the iPhone Life Stray's Avatar
    Join Date
    Oct 2010
    Location
    You Know...
    Posts
    14,067
    Thanks
    675
    Thanked 1,357 Times in 1,074 Posts

    no you shouldn't need one just make sure you have your 4.0 shsh's
    Quote Originally Posted by ikesmasher View Post
    that was officially the scariest thing you have ever said str4y.
    Quote Originally Posted by Pancho paco View Post
    Dude T.M.I

  9. #8
    What's Jailbreak?
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How would I to mount the /private/var/mobile/ directory? I'm trying to backup my photos using this method because my iPhone would not boot up at all, but that directory is not there.

    Edit: Nevermind, I was searching the wrong folders, sorry for the bother. On the other hand. Amazing post, thank you so much, saved my precious photos ^.^
    Last edited by khoacalacan; 04-13-2011 at 11:15 AM.

  10. #9
    Developing Developer moon#pie's Avatar
    Join Date
    Jan 2010
    Posts
    5,215
    Thanks
    781
    Thanked 372 Times in 307 Posts

    Great write-up, Mes. The only issue I have (which I am surprised Orby didn't didn't point out), is that SSH is Secure Shell. As in over a network. I realize you probably know this and are just rolling with the common term used by the community, but if not, I just thought I would point it out.

    This is pretty much CLI over USB. Other than that, I'm sure this will help a lot of people.


    Twitter: @tshoults

  11. The Following User Says Thank You to moon#pie For This Useful Post:

    Mes (04-30-2011)

  12. #10
    Go Wings Zokunei's Avatar
    Join Date
    Jun 2010
    Location
    Michigan
    Posts
    6,387
    Thanks
    146
    Thanked 468 Times in 380 Posts

    This should help since I moved the mobilesubstrate file and now it won't boot :P

    Nice new sig, Stray. Now it's not so creepy that you said you love me.

  13. #11
    Livin the iPhone Life Stray's Avatar
    Join Date
    Oct 2010
    Location
    You Know...
    Posts
    14,067
    Thanks
    675
    Thanked 1,357 Times in 1,074 Posts

    Oh yeah. Hey Zokunei fix your ipod screen yet?
    Quote Originally Posted by ikesmasher View Post
    that was officially the scariest thing you have ever said str4y.
    Quote Originally Posted by Pancho paco View Post
    Dude T.M.I

  14. The Following User Says Thank You to Stray For This Useful Post:

    mpwn (04-23-2011)

  15. #12
    What's Jailbreak?
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Hi everyone, first of all, thanks for the instructions, I think I'm halfway through with recovering my files (iPhone 4 with iOS 4.2.1 stuck at recovery loop) ... but I think I'm stuck here:

    -sh-4.0# fsck_hfs /dev/disk0s2s1

    Apparently the volume is corrupted or something and it tries to fix it but fails after 3 attempts... it says "The volume data could not be repaired after 3 attempts"

    Should I proceed to mount it?
    And after I mount it, what should I do in order to backup my needed files just before I finally decide to restore it?

    Thanks in advance for the reply!

    EDIT: Couldn't mount it... it returned "mount_hfs invalid argument"
    Any clues on what I should I be doing next?
    Last edited by ramar; 04-18-2011 at 01:42 AM. Reason: update

  16. #13
    What's Jailbreak?
    Join Date
    Apr 2011
    Posts
    7
    Thanks
    3
    Thanked 0 Times in 0 Posts

    can someone help me i cant upload ramdisk in step 6 i try step 6a and 6b but dont get it need help asap pls help. ipod touch 3g 4.2.1

  17. #14
    Super Galactic Moderator Orby's Avatar
    Join Date
    Aug 2010
    Location
    Omicron Persei Eight
    Posts
    5,667
    Thanks
    40
    Thanked 569 Times in 520 Posts

    Quote Originally Posted by mpwn View Post
    can someone help me i cant upload ramdisk in step 6 i try step 6a and 6b but dont get it need help asap pls help. ipod touch 3g 4.2.1
    Can you clarify what "you don't get?" Perhaps by phrasing your issue as a question?

    If you are receiving an error message (or other unexpected behavior), it'd be helpful if you'd share what the message/weirdness is, what you're expecting instead of the message, and what you were doing immediately before you got your weird behavior.

    Thanks.

  18. #15
    What's Jailbreak?
    Join Date
    Apr 2011
    Posts
    7
    Thanks
    3
    Thanked 0 Times in 0 Posts

    dw problem fixed, something was wrong with my sn0wbreeze dmg so got my mac and made a custom firwmare with pwnagetool thx alot guys

  19. #16
    What's Jailbreak?
    Join Date
    May 2008
    Posts
    23
    Thanks
    3
    Thanked 0 Times in 0 Posts

    To ramar -

    Have you tried "fsck_hfs -r /dev/disk0s2s1"?

    May work for you, but it didn't work for me. I get the same. Can't mount mnt2.

    iPhone 4, 4.1

  20. #17
    What's Jailbreak?
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hi, 4.3.1 for 3gs doesnt have any IV and Keys, its not encrypted, how would we use ramdisk builder under windows? It seems to crash.
    I tried 4.2.1 and goes through successfully but I need 4.3.1. Thank you for your prompt reply.

  21. #18
    Super Galactic Moderator Orby's Avatar
    Join Date
    Aug 2010
    Location
    Omicron Persei Eight
    Posts
    5,667
    Thanks
    40
    Thanked 569 Times in 520 Posts

    Try using "0" (may get by with one zero each, you may need 256 bits worth of zeroes) as the KEY and IV. That's what I'd do at least...

  22. #19
    What's Jailbreak?
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hi, tried your zero approach and still no go, ramdiskbuilder crashes. It does work for the other IOS's that have keys form the wiki. Ones not encrypted dont seem to work. Im gonna try to get my hands on a mac and maybe try the mac method. Until then Im still searching.

  23. #20
    What's Jailbreak?
    Join Date
    May 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    So i ended up creating the ramdisk on a mac and it seemed to go through.

    Next issue is loading the ramdisk
    Im using this command:
    tetheredboot -i iBSS.n88ap.RELEASE.dfu -k kernelcache.release.n88 -r 038-0900-005.dmg.ssh

    It gets stuck loading the dms.ssh at 64%

    Perhaps its because of the size of the ramdisk... so

    Next commands I try are:
    tetheredboot -i iBSS.n88ap.RELEASE.dfu
    wait for this to exit then:
    itunnel_mux --kernelcache kernelcache.release.n88 --devicetree DeviceTree.n88ap.img3 --ramdisk 038-0900-005.dmg.ssh
    everything seems to load and stay loaded + iphone screen is white

    Lastly I use itunnel_mux --lport 22 on an xp machine.
    Firewall is off. But it keeps waiting for a device, doesnt connect. Am I on the right track here, what am I missing? Something wrong with the itunnel_mux command? Appreciate your responce.

LinkBacks (?)

  1. 07-26-2014, 10:06 PM
  2. 07-14-2014, 12:44 AM
  3. 06-24-2014, 12:13 AM
  4. 06-15-2014, 08:32 PM
  5. 06-04-2014, 11:14 AM
  6. 05-30-2014, 05:52 AM
  7. 05-27-2014, 05:18 AM
  8. 05-25-2014, 09:05 AM
  9. 05-03-2014, 04:47 AM
  10. 05-03-2014, 03:02 AM
  11. 04-23-2014, 11:42 AM
  12. 03-27-2014, 03:56 PM
  13. 03-08-2014, 08:41 PM
  14. 02-14-2014, 09:36 AM
  15. 02-05-2014, 02:56 PM
  16. 12-14-2013, 02:52 PM
  17. 12-06-2013, 10:41 PM
  18. 11-14-2013, 07:01 AM
  19. 10-24-2013, 09:05 AM
  20. 08-15-2013, 07:08 PM
  21. 07-18-2013, 01:28 PM
  22. 07-16-2013, 07:37 PM
  23. 07-14-2013, 08:08 AM
  24. 06-23-2013, 12:04 AM
  25. 05-21-2013, 04:10 AM
  26. 05-11-2013, 03:14 AM
  27. 05-05-2013, 07:07 AM
  28. 05-02-2013, 06:42 AM
  29. 02-24-2013, 06:29 PM
  30. 02-19-2013, 06:37 AM
  31. 02-13-2013, 01:34 PM
  32. 02-12-2013, 06:50 PM
  33. 02-02-2013, 08:02 AM
  34. 01-27-2013, 07:16 AM
  35. 01-09-2013, 02:44 PM
  36. 01-02-2013, 02:32 PM
  37. 12-28-2012, 08:42 AM
  38. 12-04-2012, 03:23 PM
  39. 12-03-2012, 03:12 PM
  40. 12-02-2012, 09:09 AM
  41. 11-20-2012, 08:00 AM
  42. 11-20-2012, 02:51 AM
  43. 10-23-2012, 02:02 AM
  44. 10-19-2012, 09:15 AM
  45. 09-27-2012, 08:26 PM
  46. 09-19-2012, 10:29 AM
  47. 09-19-2012, 05:19 AM
  48. 08-30-2012, 01:21 AM
  49. 08-29-2012, 08:25 AM
  50. 06-19-2012, 08:07 AM

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts