GithubHelp home page GithubHelp logo

stefanesser / dumpdecrypted Goto Github PK

View Code? Open in Web Editor NEW
2.9K 112.0 661.0 248 KB

Dumps decrypted mach-o files from encrypted iPhone applications from memory to disk. This tool is necessary for security researchers to be able to look under the hood of encryption.

C 100.00%

dumpdecrypted's Introduction

Dumps decrypted iPhone Applications to a file - better solution than those GDB scripts for non working GDB versions
(C) Copyright 2011-2014 Stefan Esser


Compile:

First adjust the Makefile if you have a different iOS SDK installed.

And then just: make


Usage:

iPod:~ root# DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib /var/mobile/Applications/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Scan.app/Scan
mach-o decryption dumper

DISCLAIMER: This tool is only meant for security research purposes, not for application crackers.

[+] Found encrypted data at address 00002000 of length 1826816 bytes - type 1.
[+] Opening /private/var/mobile/Applications/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Scan.app/Scan for reading.
[+] Reading header
[+] Detecting header type
[+] Executable is a FAT image - searching for right architecture
[+] Correct arch is at offset 2408224 in the file
[+] Opening Scan.decrypted for writing.
[-] Failed opening. Most probably a sandbox issue. Trying something different.
[+] Opening /private/var/mobile/Applications/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/tmp/Scan.decrypted for writing.
[+] Copying the not encrypted start of the file
[+] Dumping the decrypted data into the file
[+] Copying the not encrypted remainder of the file
[+] Closing original file
[+] Closing dump file

dumpdecrypted's People

Contributors

stefanesser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dumpdecrypted's Issues

this is the command line log's error

dyld: Library not loaded: @rpath/QNBAutomatic.framework/QNBAutomatic
Referenced from: /var/mobile/Containers/Bundle/Application/518463AE-6083-4D1E-9F98-2E10C11CBE95/live4iphone.app/live4iphone
Reason: image not found
Trace/BPT trap: 5

dyld: warning: could not load inserted library 'dumpdecrypted.dylib' into hardened process because no suitable image found.

I do modify the Makefile based on my iPhone SDK. Compiling with make was perfect. But, while executing the dumpdecrypted.dylib I get the following error.

dyld: warning: could not load inserted library 'dumpdecrypted.dylib' into hardened process because no suitable image found.
Did find:
dumpdecrypted.dylib: code signature in (dumpdecrypted.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

"dyld: could not load inserted library" on iOS 9

Hi! Trying to use your great utility on iOS 9 and getting this message:

dyld: could not load inserted library '/var/mobile/Media/dumpdecrypted.dylib' because no suitable image found.  Did find:
/var/mobile/Media/dumpdecrypted.dylib: open() failed with errno=1

Trace/BPT trap: 5

Is there a way to fix it?

missing LC_DYLD_INFO load command

dyld: warning: could not load inserted library 'dumpdecrypted.dylib' into hardened process because no suitable image found. Did find:
dumpdecrypted.dylib: missing LC_DYLD_INFO load command
/private/var/mobile/Containers/Data/Application/A94731D0-A0A1-4006-9A2F-F7739BB1F417/Documents/dumpdecrypted.dylib: missing LC_DYLD_INFO load command
Abort trap: 6

unknown environment variable: DYLD_INSERT_LIBARIES

root# DYLD_INSERT_LIBARIES=dumpdecrypted.dylib /var/containers/Bundle/Application/4C7D2442-98A2-471F-AACE-964956B50EFE/XinRen.app/XinRen
dyld: warning, unknown environment variable: DYLD_INSERT_LIBARIES
Abort trap: 6

iPhone6, iOS12.4.4, macOS Catalina 10.15.4, xcode11.5

dumpdecrypted not working

i have generated dumpdecrypted.dylib file using make command on macOSX. I have copied the file to Library/ folder on jailbroken iphone running IOS 8.4. I am trying to install tools on iRET and this is the only one left. Need help

Symbol not found: ___chkstk_darwin

iPhone:~ root# DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib /var/mobile/Containers/Bundle/Application/BAEEB385-FB00-4C99-81CF-F64F7D4B124A/LTao4iPhone.app/LTao4iPhone

dyld: Symbol not found: ___chkstk_darwin
Referenced from: dumpdecrypted.dylib
Expected in: /usr/lib/libSystem.B.dylib
in dumpdecrypted.dylib
Trace/BPT trap: 5

iPhone5s, iOS8.4, macOS Catalina 10.15, xcode11.1

how to solve the problem

Failed opening. Most probably a sandbox issue. Trying something different.

[+] detected 32bit ARM binary in memory.
[+] offset to cryptid found: @0x53a78(from 0x53000) = a78
[+] Found encrypted data at address 00004000 of length 2490368 bytes - type 1.
[+] Opening /private/var/mobile/Containers/Bundle/Application/2B3C550D-FAA1-4C2B-A85B-FCA241FA16BA/my.app/my for reading.
[+] Reading header
[+] Detecting header type
[+] Executable is a FAT image - searching for right architecture
[+] Correct arch is at offset 16384 in the file
[+] Opening MobileTicket.decrypted for writing.
[-] Failed opening. Most probably a sandbox issue. Trying something different.
[+] Opening /private/var/mobile/Containers/tmp/my.decrypted for writing.
[-] Failed opening: Operation not permitted

failed to decrypt the app, the device is iPhone 4S, iOS 8.4.

Compatible With Ios 10?

Is this compatible with ios 10? Don't want to accidentally brick my device or anything... Thanks :)

Compatible With iOS 11?

Hello, I would like to know is this compatible with iOS 11.2.6?

I was working on a security research task with my colleague, it's about trying to decrypted a testing app without a given ipa file.

But when we trying to execute command "DYLD_INSERT_LIBRARIES=/path/to/dumpdecrypted.dylib /path/to/executable", we always get "Killed:9" error on terminal.

We tried many solutions like: sign the dylib file before copy it into sandbox by using codesign command on macOS X, change to mobile user before execute command by using su mobile, also we tried the solution in #19, but all we got is still "Killed:9" error.

We try to track the device log to see what actually happened, then we found the error message on device log is "kernel(Sandbox)[0] : Sandbox: hook..execve() killing [pid=5001, uid=0]: only launchd is allowed to spawn untrusted binaries" when we execute command "DYLD_INSERT_LIBRARIES=/path/to/dumpdecrypted.dylib /path/to/executable" everytime.

But both of us are really not good at using macOS X. We still have no idea after tring to find some information, we hope you guys can give us some direction or help.

Thanks for help.

btw, here's our running environment:

macOS X EL Capitan, 10.11.6
Xcode version 8.0(8A218a)
iPhone 7 Plus, iOS 11.2.6, jailbreaked by Electra1131 1.1.0

killed: 9 issue in ios 12.1.1 on iphone 6+

Killed: 9 issue on ios 12.1.1 on iphone 6+

Steps To Reproduce:

  1. copy to /usr/lib/.
    # cp dumpdecrypted.dylib into /usr/lib
    Make sure it has appropriate permissions so that user mobile can read and execute it
    -rwxr-xr-x 1 root wheel 214032 Oct 3 16:06 /usr/lib/dumpdecrypted.dylib
  2. change user to mobile:
    # su mobile
  3. change directory into somewhere that mobile can write to:
    # cd /var/mobile/Documents
  4. execute the command with absolute paths:
    # DYLD_INSERT_LIBRARIES=/usr/lib/dumpdecrypted.dylib /var/containers/Bundle/Application/...../MyApp.app/MyApp

killed: 9

Hi,

I successfully compiled it and tried it with an app that was having its cryptic to 0, as expected it has been detected as already decrypted, nothing to do, then i tried on a app with cryptic returning 1, and i got killed: 9.

anIpad:/Applications root# DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib /var/mobile/Applications/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX/anApp.app/anApp mach-o decryption dumper
Killed: 9

-9, the suicide signal :( Does this app have a mechanism to kill your process?

Thanks a lot for your time.

Error when use MakeFile

Why when I try to run "Makefile" in Terminal I have errors?

GCC_BIN: command not found
Downloads/dumpdecrypted-master/Makefile: line 6: CFLAGS: command not found
Downloads/dumpdecrypted-master/Makefile: line 6: SDK: command not found
Downloads/dumpdecrypted-master/Makefile: line 6: SDK: command not found
Downloads/dumpdecrypted-master/Makefile: line 6: SDK: command not found
Downloads/dumpdecrypted-master/Makefile: line 6: GCC_BASE: command not found

Error: `Symbol not found`

I'm getting the following error when I load the library

dyld: lazy symbol binding failed: Symbol not found: ___strlcpy_chk
  Referenced from: dumpdecrypted.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___strlcpy_chk
  Referenced from: dumpdecrypted.dylib
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap: 5

I'm running XCode 5.1, iOS 7.1 SDK, and using an iPod Touch running iOS 6.1.5

Any suggestions?

newly jailbroke 15.3.1, not working

...
[+] Dumping FeedbackLogger
[+] detected 64bit ARM binary in memory.
[-] This mach-o file is not encrypted. Nothing was decrypted.

[+] Dumping CoreServicesInternal
[+] detected 64bit ARM binary in memory.
[-] This mach-o file is not encrypted. Nothing was decrypted.
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.