All Projects → nmilcoff → Breachdetector

nmilcoff / Breachdetector

Licence: mit
Detect root, emulation, debug mode and other security concerns in your Xamarin apps

Projects that are alternatives of or similar to Breachdetector

Dayvsnight
DayVsNight - A Xamarin.Forms UI Challenge
Stars: ✭ 112 (+96.49%)
Mutual labels:  xamarin, mobile
Scanr
Detect x86 shellcode in files and traffic.
Stars: ✭ 16 (-71.93%)
Mutual labels:  detection, emulation
Gmimagepicker.xamarin
Port of the original GMImagePicker component to Xamarin.iOS
Stars: ✭ 65 (+14.04%)
Mutual labels:  xamarin, mobile
Fusillade
An opinionated HTTP library for Mobile Development
Stars: ✭ 269 (+371.93%)
Mutual labels:  xamarin, mobile
Brainpowerapp
A visual memory training game, a mobile game made with Xamarin for both Android and IOS .
Stars: ✭ 17 (-70.18%)
Mutual labels:  xamarin, mobile
Realm Dotnet
Realm is a mobile database: a replacement for SQLite & ORMs
Stars: ✭ 927 (+1526.32%)
Mutual labels:  xamarin, mobile
aev
Android library to verify the safety of user devices. Make sure that API calls from your app can be trusted. Instantly detect rooted devices, emulators, cloned apps, and other risk factors.
Stars: ✭ 64 (+12.28%)
Mutual labels:  detection, root
Open Source Xamarin Apps
📱 Collaborative List of Open Source Xamarin Apps
Stars: ✭ 318 (+457.89%)
Mutual labels:  xamarin, mobile
Embeddinator 4000
Tools to turn .NET libraries into native libraries that can be consumed on Android, iOS, Mac, Linux and other platforms.
Stars: ✭ 735 (+1189.47%)
Mutual labels:  xamarin, mobile
Xtoolkit.whitelabel
Modular MVVM framework for fast creating powerful cross-platform applications with Xamarin.
Stars: ✭ 22 (-61.4%)
Mutual labels:  xamarin, mobile
Metrica Plugin Xamarin
Xamarin plugin for Yandex AppMetrica SDK
Stars: ✭ 12 (-78.95%)
Mutual labels:  xamarin, mobile
Nat Explorer
An example project using Nat & Weex.
Stars: ✭ 55 (-3.51%)
Mutual labels:  mobile
Aprende Xamarin
Aprende C# y Xamarin desde cero! Auto-guiado y a tu ritmo. Dale ⭐si te gusta. Documentación disponible en el Wiki (website)
Stars: ✭ 53 (-7.02%)
Mutual labels:  xamarin
Threat Dragon Desktop
Desktop variant of OWASP Threat Dragon
Stars: ✭ 53 (-7.02%)
Mutual labels:  owasp
Airfrozengranter
AirFrozen
Stars: ✭ 52 (-8.77%)
Mutual labels:  root
Ios Sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 56 (-1.75%)
Mutual labels:  debug
Tiny
Tiny Face Detector, CVPR 2017
Stars: ✭ 1,079 (+1792.98%)
Mutual labels:  detection
Math object detection
An image recognition/object detection model that detects handwritten digits and simple math operators. The output of the predicted objects (numbers & math operators) is then evaluated and solved.
Stars: ✭ 52 (-8.77%)
Mutual labels:  detection
Rn Minimalist Weather App
Minimalist Weather App using React Native
Stars: ✭ 52 (-8.77%)
Mutual labels:  mobile
Audio player flutter
🎧 Apple Music / Tidal Audio Player for Flutter
Stars: ✭ 52 (-8.77%)
Mutual labels:  mobile

BreachDetector

Build status NuGet

🔧 Setup

Grab the latest NuGet package and install in your solution:

Install-Package Plugin.BreachDetector

In your iOS app, update the Info.plist and add the following URLs (those are queried as part of detecting jailbreak):

<key>LSApplicationQueriesSchemes</key>
<array>
	<string>cydia</string>
	<string>undecimus</string>
	<string>sileo</string>
	<string>zbra</string>
</array>

Additionally, if you want to use GetDeviceLocalSecurityType() method on iOS, you need to add an additional key to the Info.plist:

<key>NSFaceIDUsageDescription</key>
<string>Use a nice explanation here</string>

📱 Platforms supported

  • iOS +10
  • Android API +21
  • UWP Build +10240

🔑 Key features

  • Root/Jailbreak detection
  • Debug mode detection
  • Emulator/simulator detection
  • Store installation detection
  • Device local authentication method detection

💡 Examples

using Plugin.BreachDetector;

var isRootOrJailbreak = CrossBreachDetector.Current.IsRooted();
var isVirtualDevice = CrossBreachDetector.Current.IsRunningOnVirtualDevice();
var inDebug = CrossBreachDetector.Current.InDebugMode();
var fromStore = CrossBreachDetector.Current.InstalledFromStore(); 
var localAuthentication = CrossBreachDetector.Current.GetDeviceLocalSecurityType(); // values: Unknown, None, Pass, Biometric

Note: For a method that returns bool?, you can expect the result to be null if the platform that is running doesn't have an appropiate representation (example: IsRooted will return null for UWP).

🔒 Security considerations

  • The approach of this library is to rely on "traditional" iOS/Android libraries as much as possible. The reason is simply that the size of those communities is bigger compared to Xamarin.
  • Security is a cat and mouse game. Please be aware this library will try its best, but it might be defeated.
  • If possible, use AOT for your Xamarin.Android app (enabled by default in Xamarin.iOS, requires Enterprise license for Xamarin.Android). When using AOT, your IL code will be compiled into native instructions (x86, ARM instructions) and your code will be more difficult to reverse engineer.
  • Be aware ProGuard will only shrink the code of your Xamarin.Android app, obfuscation only works on the Java end.
  • Don't hardcode any of your keys in your mobile apps, those are really easy to spot using simple tools. In most cases you can serve them from your API.
  • To learn more about mobile security, I would highly recommend you start with the OWASP Mobile Application Security Verification Standard .

Good practices (OWASP)

The sample app in this repository also contains some good practices implementations that are not part of the BreachDetector library, but that you can copy into your own code:

MSTG-ARCH-9: A mechanism for enforcing updates of the mobile app exists.

Xamarin.Essentials VersionTracking to track the install versions of your app in the user device. If the current version is deprecated, you should take the user to a screen where it is asked to download the updated version. Here is an examlpe.

MSTG-STORAGE-9: The app removes sensitive data from views when moved to the background.

  • On Android you can set the Secure flags for the Window, here is an example. This will hide the content of the UI when the app is in background and also prevent the user from taking screenshots. Please be aware though the scope has some limitations related to child windows.
  • On iOS you can use the AppDelegate lifecycle methods to add / remove an image on top of your UI to hide the content (also note that on iOS you can't prevent the user from taking screenshots). Here is an example for this implementation.

Auto-logout due to user inactivity

The sample app in this repository has this mechanism implemented. You can see it here.

👷 Contributions

Yes, please! Issues are open for bugs/ideas and PRs are also welcome.

🙇 Acknowledgements

  • Many iOS features are implemented through a binding library for IOSSecuritySuite (MIT)
  • Root detection on Android is implemented through binding libraries for rootbeer (MIT) and Anti-Emulator (Apache-2.0)

📜 License

BreachDetector is licensed under MIT.

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].