Giter Site home page Giter Site logo

frida-ios-cipher's Introduction

Frida-iOS-Cipher

GitHub Workflow Status (with event)

Introduction

Intercept all cryptography-related functions on iOS with Frida Api.

Support Algorithm

  • AES
  • DES,3DES
  • CAST(What it's?)
  • RC2,RC4
  • Blowfish
  • SHA1,SHA224,SHA256,SHA384,SHA512
  • MD2,MD4,MD5
  • HMAC
  • PBKDF

Preview

image

Instructions for use

  • You can customize the functions you want to intercept printing by turning them on (they are all turned on by default).
  • Print data limit (default maximum 240 bytes for a single piece of data, where there is no limit for key, hash and digest results)
  • and stack information (off by default)
  • Doesn't differentiate between OC or Swift, the api calls for encryption are the same for both languages

Simple to use

  • Spawn mode
frida -U --codeshare Humenger/frida-ios-cipher -f "xxx.xxx.xxx" --no-pause
  • Attach mode
frida -U --codeshare Humenger/frida-ios-cipher -n "app name"

Config

Configuration at the beginning of the script.

//config
const CIPHER_CONFIG={
    "enable":true,//global enable
    "highlighting": true,//syntax highlighting
    "crypto":{
        "enable":true,//crypto enable
        "maxDataLength":240,//Maximum length of single data printout
        "printStack":false,
        "aes":true,
        "des":true,
        "3des":true,
        "cast":true,
        "rc4":true,
        "rc2":true,
        "blowfish":true,
        "filter": []
    },
    "hash":{
        "enable":true,//hash enable
        "maxInputDataLength":240,
        "printStack":false,
        "md2":true,
        "md4":true,
        "md5":true,
        "sha1":true,
        "sha224":true,
        "sha256":true,
        "sha384":true,
        "sha512": true,
        "filter": []
    },
    "hmac":{
        "enable":true,//hmac enable
        "maxInputDataLength":240,
        "printStack":false,
        "sha1":true,
        "md5":true,
        "sha224":true,
        "sha256":true,
        "sha384":true,
        "sha512":true,
        "filter": []
    },
    "pbkdf":{
        "enable":true,
        "printStack":false,
        "filter": []
    }
}

Because printing the stack may lead to program execution exceptions, printStack is off by default, and you can turn it on by yourself if you need to.

Build

npm install 
npm run build

Replenishment

Of course there are a couple of functions that don't do interceptions, as shown below:

CCCryptorStatus
     CCCryptorCreateFromData(CCOperation op, CCAlgorithm alg,
         CCOptions options, const void *key, size_t keyLength, const void *iv,
         const void *data, size_t dataLength, CCCryptorRef *cryptorRef,
         size_t *dataUsed);
  • This function also calls CCCryptorCreate internally, so it doesn't do interceptions
  • Similarly CCCryptorCreateFromDataWithMode
  • There are also a couple of CCDigest functions that are too cold to be added later if encountered
  • There are also a couple of random functions as well as UUIDs, which seem to be strictly within the scope of cryptography, to which I'll add later on
  • As for asymmetric encryption, I can't seem to find an official implementation at the moment

Consultation

Technical Support

Knowledge Planet

frida-ios-cipher's People

Contributors

jitcor 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

frida-ios-cipher's Issues

swift App error

Terminal operation :frida -U --codeshare Humenger/frida-ios-cipher -n ""
Tips
CCCrypt func is null
CC_SHA1 func is null
CC_SHA224 func is null
CC_SHA256 func is null
CC_SHA384 func is null
CC_SHA512 func is null
CC_MD2 func is null
CC_MD4 func is null
CC_MD5 func is null
CCHmac func is null
CCKeyDerivationPBKDF func is null

The APP calls CCCrypt and CCHmac

Apps freezes with crypto enabled

I start any application

frida -l iosciper.js -f com.apple.Maps -U

with a script and if the “crypto” section of the config is enabled, the application hangs (apparently one of the encryption functions is triggered at that moment). There are no errors, the application closes after some time.

frida 16.3.3, iOS 15.3.1, iPhone SE2

print_arg error: TypeError: cannot read property 'toString' of undefined

Hello sir,

First I want to say thank you for frida-ios-cipher.

error

error message:
print_arg error: TypeError: cannot read property 'toString' of undefined
at t (frida/runtime/hexdump.js:20)
at M (agent/index.ts:240)
at onEnter (agent/index.ts:381)

Do you have discord or line? your gmail does not work.

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.