All Projects → DimaKoz → Stunning Signature

DimaKoz / Stunning Signature

Licence: mit
Native Signature Verification For Android (with example)

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Stunning Signature

Androidsecurity
Android安全实践
Stars: ✭ 150 (+7.91%)
Mutual labels:  ndk, signature, native
libandroidjni
Android JNI bindings library
Stars: ✭ 66 (-52.52%)
Mutual labels:  ndk, native
Camerakit Android
Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
Stars: ✭ 5,131 (+3591.37%)
Mutual labels:  ndk, native
Jpegkit Android
Efficient JPEG operations for Android without the risk of an OutOfMemoryException.
Stars: ✭ 154 (+10.79%)
Mutual labels:  ndk, native
Android Luajit Launcher
Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
Stars: ✭ 87 (-37.41%)
Mutual labels:  ndk, native
Bacardi
Bacardi project is an effort to provide multi-language binding for Node.js native layer.
Stars: ✭ 115 (-17.27%)
Mutual labels:  native
React Native Css Gradient
React Native css gradients - react-native-linear-gradient with css gradient support
Stars: ✭ 129 (-7.19%)
Mutual labels:  native
Home Assistant Android
UNOFFICIAL Android app/frontend for Home Assistant (https://home-assistant.io)
Stars: ✭ 108 (-22.3%)
Mutual labels:  native
Androiddevwithcpp
Android Develop With C++
Stars: ✭ 106 (-23.74%)
Mutual labels:  ndk
Awesome Android Ndk
🔥 全面深入地掌握NDK技术,成为下一波5G时代的浪潮儿~
Stars: ✭ 138 (-0.72%)
Mutual labels:  ndk
React Nodegui Starter
Starter repository for react based native desktop apps using react-nodegui
Stars: ✭ 132 (-5.04%)
Mutual labels:  native
Callapp Lib
🔥call app from h5(H5唤起客户端 )
Stars: ✭ 1,857 (+1235.97%)
Mutual labels:  native
Spring Native
Spring Native provides beta support for compiling Spring applications to native executables using GraalVM native-image compiler.
Stars: ✭ 2,282 (+1541.73%)
Mutual labels:  native
Googleserialport
Android串口通信:抱歉,学会它真的可以为所欲为 ! ! !
Stars: ✭ 130 (-6.47%)
Mutual labels:  ndk
Ramda Debug
🐏 Debugging for Ramda.
Stars: ✭ 113 (-18.71%)
Mutual labels:  signature
Byopen
🎉A dlopen library that bypasses mobile system limitation
Stars: ✭ 133 (-4.32%)
Mutual labels:  ndk
Crashsdk
catch crash on Android(arm/x86)
Stars: ✭ 107 (-23.02%)
Mutual labels:  ndk
Openrtb
Go (Golang) OpenRTB 2.5, 3.0 / AdCOM 1.0 / Native 1.2 types/enums
Stars: ✭ 123 (-11.51%)
Mutual labels:  native
Ofxremoteui
OpenFrameworks addon serves any number of variables (bool, float, int, enum, string, ofColor) on the network, so that you can modify from outside the OF app. Includes a native OSX Client. OSC based.
Stars: ✭ 132 (-5.04%)
Mutual labels:  native
Lambda Lantern
🧙 ‎‎ A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.
Stars: ✭ 122 (-12.23%)
Mutual labels:  native

How to prevent tampering signatures of APK-files using C (Native check of a signature of APKs)

It may be helpful only for non-rooted devices (and of course reverse-engineer always wins).

The example of obtaining apk's signature on the native layer (without jni).

This example was created to help developers stand against one type of an attack. The attack inserts code into Application class (or creates it), hooks the getPackageInfo method of the PackageManager then returns an original signature on demand. This attack is implemented in 'nkstool' tool. After user has applied 'nkstool' tool on your APK, the application always gets its own signature in Java layer or through JNI when it's requested in APK even though it is not true.

The source code of this attacking tool can be found here: https://github.com/L-JINBIN/ApkSignatureKiller

Working example of this tool is in the '/nkstool' directory only for testing and educational purposes!

To test this example (nkstool) just dot he following:

  • edit config.txt

  • copy your APK (the one to be hacked) to the same directory '/nkstool'

  • run script either 'run.bat' or 'run.sh'

Finally you can see results of the checks:

Before the attack - all signatures are equal

image

After the attack - signatures are not equal. Native layer (C-code) gives you the real signature of the APK.

image

How do we get a real signature:

  • Get a path of our APK

  • Extract 'META-INF/CERT.RSA' from the APK

  • Parse 'META-INF/CERT.RSA'

  • We pass a signature through JNI from native layer to Java (just for convenience)

Here is an example how we can get MD5 from a signature(using mbed TLS)

Also I suggest you do not forget about '-fvisibility=hidden' flag.

Used libraries and projects:

Thanks

  • Guys who constantly crack my applications (and not only mine) and post their tools. I was inspired by this one.
  • floyd and others from StackOverflow post

Licence

MIT License

Copyright (c) 2018 Dmitrii Kozhevin [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].