<?xml version="1.0"?>
<rss version="2.0"><channel><title>Mobile security Latest Topics</title><link>https://rstforums.com/forum/forum/24-mobile-security/</link><description>Mobile security Latest Topics</description><language>en</language><item><title>securitate android</title><link>https://rstforums.com/forum/topic/124223-securitate-android/</link><description><![CDATA[<p>
	Ce parere aveti despre Graphene, imi ofera o securitate mai buna a telefonului, astfel ca mesajele si aplicatile sa fie in controlul meu, iar mesajele si apelurile sa nu mai poata fi ascultate? 
</p>
]]></description><guid isPermaLink="false">124223</guid><pubDate>Mon, 20 Jul 2026 14:50:57 +0000</pubDate></item><item><title>Decodare Huawei, Digi.Mobil respeciv branduite Vodafone</title><link>https://rstforums.com/forum/topic/23582-decodare-huawei-digimobil-respeciv-branduite-vodafone/</link><description><![CDATA[<p>Multi dintre noi avem acasa un telefon de la DIGI, ei bine unii poate il dau de colo colo l-ar folosi daca ar fi decodat sau il folosesc dar nu ca telefon primar iar in cazul in care telefonul folosit in mod curent s-ar defecta le-ar prinde bine un backup.</p><p>Sau poate unul din modelele huawei branduite de vodafone.</p><p>Softul care urmeaza sa il prezint va va ajuta in decodarea acestuia moca.</p><p>Telefoane suportate: u120 ;u120*;u121 ;v715 ;v716 ;v810 ;v725 ; v720.603i ;v830.</p><p>Pentru inceput avem nevoie de drivere, mergem pe siteul producatorului la</p><p><a href="http://www.huaweidevice.com/worldwide/productFamily.do?method=index&amp;directoryId=2037&amp;treeId=37" rel="external nofollow">UMTS - Huawei Device Co., Ltd..</a> si alegem modelul nostru, sa zicem u120: <a href="http://www.huaweidevice.com/worldwide/productFeatures.do?pinfoId=380&amp;directoryId=2037&amp;treeId=37" rel="external nofollow">U120 - Huawei Device Co., Ltd..</a></p><p>-&gt;Download apoi descarcam Customer Application Software si il instalam.</p><p>Bun avem driverele, conectam prin mini-usb telefonul si totul e oki.</p><p>Acum il putem decoda:</p><p>Descarcam: <a href="http://www.mediafire.com/?2lhugtylzyd" rel="external nofollow">v4mpire_unlocker.rar</a></p><p>Cautam modelul nostru in lista, ex: u120 e la Old , bifam Optiunile Read Codes si Read Code Unlock apoi Read Info, daca intampinam vreo eroare inseamna ca nu sunt bune porturile com default, in device manager cautam ce porturi com sunt folosite si incercam toate combinatiile, sau mai simplu instalam dc-unlocker <a href="http://www.dc-unlocker.com/downloads/get/akj4enY" rel="external nofollow">Dc-unlocker | download - ZTE, Sonyericsson ,Sierra Wireless Aircard, Sierra, Option, Novatel, Maxon, Huawei</a> (soft de decodate pe bani) dam sa detecteze modelul si ne va spune si porturile folosite.</p><p>Programelul se va conecta si ne va da codul de deblocare, introducem alt sim si folosim codul afisat. Repornim telefonul si done!</p><p>PS:testat cu Digi, Huawei u120.</p><p>//update: site-ul huawei s-a modificat, noul link la care se gasesc driverele este: <a href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&amp;directoryId=3372&amp;treeId=0" rel="external nofollow">http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&amp;directoryId=3372&amp;treeId=0</a></p>
]]></description><guid isPermaLink="false">23582</guid><pubDate>Sun, 15 Aug 2010 13:14:25 +0000</pubDate></item><item><title>Allview P4 Duo backup stock firmware</title><link>https://rstforums.com/forum/topic/119399-allview-p4-duo-backup-stock-firmware/</link><description><![CDATA[<p>
	Salutare oameni buni! Aș avea și eu nevoie de un backup al firmwareul-ui stock de la Allview P4 Duo cu Android 4.0 ICS.
</p>

<p>
	 
</p>

<p>
	Mulțumesc,
</p>

<p>
	Mihai
</p>
]]></description><guid isPermaLink="false">119399</guid><pubDate>Mon, 06 May 2024 16:01:45 +0000</pubDate></item><item><title>Android infectat</title><link>https://rstforums.com/forum/topic/119083-android-infectat/</link><description><![CDATA[<p>
	Salutare, exista vreun soft/apk care sa verifice daca un telefon este infectat cu spyware/malware gen mSpy ?
</p>
]]></description><guid isPermaLink="false">119083</guid><pubDate>Wed, 31 Jan 2024 10:41:18 +0000</pubDate></item><item><title>change voice call Android real time</title><link>https://rstforums.com/forum/topic/118968-change-voice-call-android-real-time/</link><description><![CDATA[<p>
	Salut, caut de ceva timp o aplicatoie call changing voice in timp real de la Madonna pana la Optimus Prime, in timp real, free, ce am gasit in G store sunt doar recordere si fake call...
</p>

<p>
	 
</p>

<p>
	Stiu sigur ca sunt, m-a sunat un tovaras sa me intalnim la suc...
</p>

<p>
	 
</p>

<p>
	Multumesc
</p>
]]></description><guid isPermaLink="false">118968</guid><pubDate>Tue, 07 Nov 2023 11:25:40 +0000</pubDate></item><item><title>Samsung Grand Prime Remove Google Account</title><link>https://rstforums.com/forum/topic/115959-samsung-grand-prime-remove-google-account/</link><description><![CDATA[<p>
	Salut 
</p>

<p>
	 
</p>

<p>
	Am primit cadou un telefon de la o bătrânică, Samsung Grand Prime (nu stiu modelul) nu pot accesa meniul, am incercat cu Hard Reset, nimic, am incercat cu software-uri insa toate au PUA/Generic etc...
</p>

<p>
	 
</p>

<p>
	Cum il poate aduce in starea din fabribricatie?
</p>

<p>
	 
</p>

<p>
	Doarme cand o sun sa-mi trimita G-xxx, am incercat ore
</p>

<p>
	 
</p>

<p>
	Edit/ Model: Samsung sm-g531f
</p>

<p>
	Edit// Am incercat si cu Odin, nu gasesc Firmware, baba nu stie password-ul de la e-mail, incerc sa-i dau un Flash
</p>

<p>
	 
</p>

<p>
	Multumesc
</p>
]]></description><guid isPermaLink="false">115959</guid><pubDate>Fri, 04 Nov 2022 08:31:59 +0000</pubDate></item><item><title>send multi sms - import contacts</title><link>https://rstforums.com/forum/topic/115669-send-multi-sms-import-contacts/</link><description><![CDATA[<p>
	Va salut baieti,
</p>

<p>
	 
</p>

<p>
	Stie cineva o aplicatie pt android testata cu care as putea sa import contacte de tip xls, txt, csv. Totodata doresc sa trimit si un singur mesaj la multiple contacte...
</p>

<p>
	 
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">115669</guid><pubDate>Mon, 22 Aug 2022 10:30:45 +0000</pubDate></item><item><title>Vodafone VFD 620</title><link>https://rstforums.com/forum/topic/118887-vodafone-vfd-620/</link><description><![CDATA[<p>
	Salutare am un astfel de model se poade decoda in alta retea multumesc!
</p>
]]></description><guid isPermaLink="false">118887</guid><pubDate>Fri, 15 Sep 2023 08:20:11 +0000</pubDate></item><item><title><![CDATA[Reverse engineering & modifying Android apps with JADX & Frida]]></title><link>https://rstforums.com/forum/topic/115188-reverse-engineering-modifying-android-apps-with-jadx-frida/</link><description><![CDATA[<h1>
	Reverse engineering &amp; modifying Android apps with JADX &amp; Frida
</h1>

<div>
	<p>
		I get a lot of emails from users who want to know exactly what their favourite Android app is doing, and want to tweak and change how that works for themselves.
	</p>

	<p>
		There are some great tools to do this, including <a href="https://github.com/skylot/jadx/" rel="external nofollow">JADX</a> &amp; <a href="https://frida.re/" rel="external nofollow">Frida</a>, but using these is complicated, and every reverse engineering problem has its own unique challenges &amp; solutions. There's few good guides to getting started, and even fewer guides on the advanced tricks available.
	</p>

	<p>
		In this article, I want to talk you through the core initial steps to look inside any Android app, give you the tools to find &amp; understand the specific code that matters to you, and then show you how you can use that information to modify the app for yourself.
	</p>

	<p>
		Let's set the scene first.
	</p>

	<h2>
		Context
	</h2>

	<p>
		I'm assuming here that somebody else has written an Android app that you're interested in. You want to know exactly how a specific bit of behaviour works, and you want to change what it's doing.
	</p>

	<p>
		I'm going to focus on the classic HTTP Toolkit user example here of <a href="https://security.stackexchange.com/questions/29988/what-is-certificate-pinning" rel="external nofollow">certificate pinning</a>: where security-conscious apps that send HTTPS traffic go beyond the normal HTTPS validation requirements, and actively check that the HTTPS certificates used are from a small set of specific trusted certificates, not just the standard set trusted by all Android devices.
	</p>

	<p>
		(I'm focusing on certificate pinning because it's a common use case and it's convenient, but the techniques here work for all other kinds of reverse engineering &amp; patching too, don't worry!)
	</p>

	<p>
		Certificate pinning is a problem for <a href="https://httptoolkit.tech/android/" rel="external nofollow">HTTP Toolkit</a> users, who are trying to intercept HTTPS traffic to see what messages their Android apps are sending &amp; receiving. It's not possible to intercept these app's traffic because they won't trust HTTP Toolkit's certificate, even after it's been injected into the device's system certificate store.
	</p>

	<p>
		Using the tools we're going to talk about in a moment we can take an unknown 3rd party app, find the certificate pinning code within it, and disable that remotely while the app runs on our device. This makes it possible to intercept, inspect &amp; mock all of its traffic in any way we like!
	</p>

	<p>
		This isn't not easy, but it's usually not necessary. For starters, 99% of apps don't use certificate pinning beyond Android's <a href="https://httptoolkit.tech/blog/intercepting-android-https/" rel="external nofollow">standard restrictions</a>, and for that case if you use HTTP Toolkit on a rooted device you're done in one click. For most apps that do explicitly pin their certificates, you can disable that using <a href="https://httptoolkit.tech/blog/frida-certificate-pinning/" rel="external nofollow">this general-purpose Frida script</a> which already knows how to disable all the most popular cert pinning libraries available.
	</p>

	<p>
		In some cases though apps implement their own custom certificate pinning logic, or do something else unusual, which means the general-purpose script can't recognize and disable the right APIs. In these kinds of cases, or if you're trying to modify any other kinds of app behaviour, you need to roll up your sleeves and get your hands dirty.
	</p>

	<p>
		For this article, I've prepped an <a href="https://github.com/httptoolkit/android-ssl-pinning-demo/" rel="external nofollow">certificate pinning demo app</a>:
	</p>

	<p>
		<a href="https://httptoolkit.tech/static/e0fde9f73d1fb0b4c9ee19043a68890b/d362c/ssl-pinning-demo.png" rel="external nofollow"><img alt="A screenshot of the certificate pinning demo app" srcset="https://d33wubrfki0l68.cloudfront.net/e689aea8029091f82e619d91d83f7e7c73e58996/c0a83/static/e0fde9f73d1fb0b4c9ee19043a68890b/ddeaf/ssl-pinning-demo.png 84w, https://d33wubrfki0l68.cloudfront.net/0109e0927c0564e8c06854e6653fd2844f68bafa/da25e/static/e0fde9f73d1fb0b4c9ee19043a68890b/f4dcd/ssl-pinning-demo.png 169w, https://d33wubrfki0l68.cloudfront.net/6d564b340f90cf085301409456dd5beb3cc7378d/8899c/static/e0fde9f73d1fb0b4c9ee19043a68890b/2a8de/ssl-pinning-demo.png 338w, https://d33wubrfki0l68.cloudfront.net/d422add6b61ca3217353e4018245e86ba4fbfc6d/d897e/static/e0fde9f73d1fb0b4c9ee19043a68890b/d362c/ssl-pinning-demo.png 356w" title="A screenshot of the certificate pinning demo app" src="https://d33wubrfki0l68.cloudfront.net/d422add6b61ca3217353e4018245e86ba4fbfc6d/d897e/static/e0fde9f73d1fb0b4c9ee19043a68890b/d362c/ssl-pinning-demo.png" /></a>
	</p>

	<p>
		Each button sends an HTTPS request, and validates the connection in a slightly different way. The 'unpinned' option does nothing, the next 4 use various standard pinning techniques, and the last button uses totally custom code to manually check the certificate.
	</p>

	<p>
		If you use this with HTTP Toolkit normally, you can only intercept the first request. If you use the general-purpose Frida script, you can intercept the next 4 too, but not the last one.
	</p>

	<p>
		In this article we're going to focus on that last button, reverse engineer this app to see how it works, and write a custom Frida script to disable the certificate checking functionality.
	</p>

	<h2>
		The Plan
	</h2>

	<p>
		To reverse engineer an app and hook some behaviour, there's a few core steps you need to work through:
	</p>

	<ol>
		<li>
			Download a copy of the app on your computer
		</li>
		<li>
			Extract the source code
		</li>
		<li>
			Find the code we're interested in
		</li>
		<li>
			Understand how that code works
		</li>
		<li>
			Write a Frida hook to change how that code works
		</li>
	</ol>

	<h2>
		Download the app
	</h2>

	<p>
		Android apps are generally published to the Google Play store, but you can't easily download the app from there directly to mess around with on your computer.
	</p>

	<p>
		Fortunately, many sites that mirror the Google Play store, and do provide direct downloads of almost all available apps. <a href="https://apkmirror.com/" rel="external nofollow">ApkMirror.com</a> and <a href="https://apkpure.com/" rel="external nofollow">ApkPure.com</a> are two good examples.
	</p>

	<p>
		In the general case, you should go to your favourite APK mirror site, and download the latest APK for the app you're interested in.
	</p>

	<p>
		In this specific case, I wrote the app, so I've conveniently published it directly on GitHub. You can download its APK <a href="https://github.com/httptoolkit/android-ssl-pinning-demo/releases/latest" rel="external nofollow">here</a>.
	</p>

	<h3>
		Android app formats
	</h3>

	<p>
		What is this APK file? Let's start with some quick but necessary background on Android app formats. There's two distribution formats you'll run into: APKs (older) and XAPKs (newer, also known Android App Bundles).
	</p>

	<p>
		In this example, the app is provided as a single APK, so that's easy enough, but many other apps you'll run into may be XAPKs, so it's worth understanding the difference.
	</p>

	<p>
		APKs are fairly simple: they're a ZIP file with a bunch of metadata, all the application's assets &amp; config files, and one or more binary .dex files, which contain the compiled application.
	</p>

	<p>
		XAPKs are more complicated: they're a zip file that contains multiple APKs. In practice, they'll contain one large primary APK, with the main application code &amp; resources, and then various small APKs which include the config or resources only relevant to certain types of devices. There might be separate config APKs for devices with larger screens, or different CPU architectures. For reverse engineering you usually just need the main APK, and you can ignore the rest.
	</p>

	<h2>
		Extract the code
	</h2>

	<p>
		Inside the APK, if you open it as a zip, you'll find a large classes.dex file (for <a href="https://developer.android.com/studio/build/multidex" rel="external nofollow">multidex</a> apps, there might even be a classes2.dex or more). These DEX files contain all the JVM classes of the application, in the compiled bytecode format used by Android's Runtime engine (ART, which replaced Dalvik a few years back).
	</p>

	<p>
		These DEX files contain the compiled application, but do not contain all the original source. Many things, most notably including local variable names &amp; comments, are lost when compiling an Android application, and it's always impossible to extract those from the app.
	</p>

	<p>
		The external interfaces of each class are generally present here though (assuming that <a href="https://developer.android.com/studio/build/shrink-code#obfuscate" rel="external nofollow">obfuscation</a> wasn't used). That will usually be enough to find the method that you're interested in. Using those external interfaces you can usually then deduce what each line is trying to do, and progressively rename variables and add your own comments until you have some code that makes sense.
	</p>

	<p>
		To start that process, we need to convert the DEX file into a format we can mess around with ourselves. The best tool to do this is <a href="https://github.com/skylot/jadx" rel="external nofollow">JADX</a> (you can download it from their <a href="https://github.com/skylot/jadx/releases/latest" rel="external nofollow">GitHub release page</a>).
	</p>

	<p>
		Once JADX is installed, you run it like so:
	</p>

	<div>
		<pre>jadx ./pinning-demo.apk</pre>
	</div>

	<p>
		This will create a folder with the same name as the APK, containing 'resources' and 'sources' folders. The sources folder is what we're interested in: this is JADX's best guess at the Java source code that would've generated this DEX file. It's not perfect, but it should be pretty close.
	</p>

	<p>
		If you use JADX on <a href="https://github.com/httptoolkit/android-ssl-pinning-demo/releases/latest" rel="external nofollow">the latest pinning demo APK</a>, you'll find a structure like this:
	</p>

	<ul>
		<li>
			<p>
				sources/
			</p>

			<ul>
				<li>
					android/ - the core Android classes
				</li>
				<li>
					androidx/ - Android Jetpack classes
				</li>
				<li>
					<p>
						com/
					</p>

					<ul>
						<li>
							android/volley/ - The Volley HTTP client
						</li>
						<li>
							datatheorem/android/trustkit - One of the popular pinning libraries used
						</li>
						<li>
							google/ - Firefox, GSON &amp; various other Google packages
						</li>
					</ul>
				</li>
				<li>
					kotlin/ - runtime components of Kotlin
				</li>
				<li>
					okhttp3/ - OkHttp3, a popular HTTP library
				</li>
				<li>
					[...various other namespaces &amp; packages]
				</li>
				<li>
					tech/httptoolkit/pinning_demo/ - the main application code
				</li>
			</ul>
		</li>
	</ul>

	<p>
		Once you've extracted the code from an app like this, you can explore it any way you like - using Android Studio, using any other text editor, or just grepping for interesting text, it's up to you. By default, I'd recommend using some editor that can highlight and do basic automated refactoring (variable renaming) on Java code, since that'll make the next steps much easier.
	</p>

	<h2>
		Find the code you care about
	</h2>

	<p>
		Which code you want to reverse engineer &amp; hook depends on the problem you're trying to solve. In my case, the problem is that when I intercept the app's HTTP using <a href="https://httptoolkit.tech/android/" rel="external nofollow">HTTP Toolkit</a> and press the "Manually pinned request" button, I get a "Certificate rejected" message in HTTP Toolkit, and I want to stop that happening.
	</p>

	<p>
		That message typically means that the app is pinning a certificate - i.e. even though the HTTP Toolkit certificate is trusted on the device, the app is including its own custom checks, which are rejecting the HTTPS certificates and blocking HTTP Toolkit's automatic HTTP interception.
	</p>

	<p>
		So, the goal here is to find out which bit of code is making the custom-checked HTTPS request behind that last button, find out where that checks the certificate, and then later disable that check.
	</p>

	<p>
		<a href="https://httptoolkit.tech/static/0e70e67c22389eb2c16a99333df8b209/7b401/ssl-pinning-manual-button.png" rel="external nofollow"><img alt="A screenshot of the manually pinned request button" srcset="https://d33wubrfki0l68.cloudfront.net/30bdd7ab226bcfe1e38940fa1c2436c21db6457c/b9152/static/0e70e67c22389eb2c16a99333df8b209/d4183/ssl-pinning-manual-button.png 256w, https://d33wubrfki0l68.cloudfront.net/b46347702a5d6d90449bd8fd01f7595f16964c35/86604/static/0e70e67c22389eb2c16a99333df8b209/add15/ssl-pinning-manual-button.png 512w, https://d33wubrfki0l68.cloudfront.net/6bb4d9ef2cf90f9c686097b2637a90acb32a2814/c3be0/static/0e70e67c22389eb2c16a99333df8b209/7b401/ssl-pinning-manual-button.png 780w" title="A screenshot of the manually pinned request button" src="https://d33wubrfki0l68.cloudfront.net/6bb4d9ef2cf90f9c686097b2637a90acb32a2814/c3be0/static/0e70e67c22389eb2c16a99333df8b209/7b401/ssl-pinning-manual-button.png" /></a>
	</p>

	<p>
		Whatever code you want to change in your case, there are a lot of tricks available to help you hunt it down. Let's try out a few different approaches on this demo app.
	</p>

	<h3>
		Search for relevant strings
	</h3>

	<p>
		In my case, I know the failing request is going to sha512.badssl.com (a known-good HTTPS test site) so searching for that is a good start. That works, and gives me a few different places in the code that are sending requests, but there's options here for all the different possible pinning mechanisms, and related config files too. It's not immediately clear which code is relevant, so it'd be better to find something more precise.
	</p>

	<p>
		Some other strings that might be interesting, for the certificate pinning case:
	</p>

	<ul>
		<li>
			checkCert
		</li>
		<li>
			validateCert
		</li>
		<li>
			pinning
		</li>
		<li>
			pinner
		</li>
		<li>
			certificate
		</li>
		<li>
			SSL
		</li>
		<li>
			TLS
		</li>
	</ul>

	<p>
		Here you're looking for anything might be included in the name of a class, field or method, or which might be included in strings (e.g. error messages), since all of that will be preserved and searchable in the decompiled code.
	</p>

	<p>
		For example, if you're trying to understand where some HTTP API data comes from, you could try searching for the API endpoint path, or the name of query parameters. If you're looking for the implementation of a specific algorithm, it's worth searching for the common domain terms in that algorithm, or if you're trying to extract secrets or keys from the app then 'secret', 'key', and 'auth' are all worth investigating.
	</p>

	<h3>
		Search for usage of relevant Java APIs
	</h3>

	<p>
		Although local variable names aren't available, and in obfuscated apps even the class &amp; package names may be obscured, the built-in JVM classes &amp; package names are always available and unchanged.
	</p>

	<p>
		That means they're a great way to find related functionality. If you know the code you're interested in is likely to be using a certain data type, calling a specific API, or throwing a certain type of exception, you can use that to immediately narrow down your search.
	</p>

	<p>
		In this example, I think it's likely that all manual certificate checks are going to be using java.security.cert.X509Certificate, so I can search for usages of that type. This does give some good answers!
	</p>

	<p>
		Unfortunately though the entire app is filled with lots of different ways to do certificate pinning, by design, so this still comes back with a long list of matches, and it's not easy to tell which is relevant immediately. In most other apps that won't be a problem (most apps implement certificate pinning just the once!) and we could trawl through the results, but for now it's better to test out some other options first.
	</p>

	<h3>
		Check for HTTP error reports
	</h3>

	<p>
		Many apps nowadays include automatic error reporting using tools like <a href="https://sentry.io/" rel="external nofollow">Sentry</a>.
	</p>

	<p>
		This is useful to app developers, but also to reverse engineers! Even when the app's own requests may use certificate pinning, requests sent by external libraries like these generally will not, so they're inspectable using HTTP Toolkit (or any other HTTP MitM proxy). That's useful because those requests themselves will usually include the stacktrace for any given error.
	</p>

	<p>
		This provides an excellent way for finding the source of any errors that you want to work around:
	</p>

	<ul>
		<li>
			Intercept traffic from your device using <a href="https://httptoolkit.tech/android/" rel="external nofollow">HTTP Toolkit</a> or another proxy
		</li>
		<li>
			Trigger the error
		</li>
		<li>
			Look through the captured HTTP traffic for error reports
		</li>
		<li>
			Find the stacktrace in the relevant error report
		</li>
		<li>
			Follow the stacktrace into the codebase extracted earlier to immediately find the relevant code
		</li>
	</ul>

	<p>
		Bingo! In this case though, we're out of luck, as it's a tiny demo app with no error reporting. More searching required.
	</p>

	<h3>
		Check ADB for errors
	</h3>

	<p>
		Very commonly, apps will log errors and extra info to the console for easy debugging. Android captures this output from all running JVM processes in a single output buffer, along with stack traces from all uncaught errors, and makes that accessible via <a href="https://developer.android.com/studio/command-line/adb" rel="external nofollow">ADB</a> using the logcat command.
	</p>

	<p>
		Outputting errors and debug info here is especially common in smaller apps which don't use an automated error reporting tool, so if you're looking to find &amp; change some code that throws errors it's a great alternative to the previous approach. Even in non-error cases, the output here can provide excellent clues about application behaviour at the moments you're interested in.
	</p>

	<p>
		To capture the logs from a device, run:
	</p>

	<div>
		<pre>adb logcat -T1</pre>
	</div>

	<p>
		This will stream the live logs from your device, without the history, until you stop it. It's often useful to pipe this to a file instead (i.e. ... &gt; logs.txt) to save it for more detailed later analysis, since there can be a lot of noise here from other activity on the device.
	</p>

	<p>
		While this command is running, if you reproduce your error, you'll frequently find useful error stacktraces or error messages, which can then guide you to the right place in the code.
	</p>

	<p>
		For our demo app, this works great. By enabling logging when pressing the button, if you look carefully between the other noisy log output, we can now get the specific error message unique to that button:
	</p>

	<div>
		<pre>&gt; adb logcat -T1
--------- beginning of main
...
11-22 10:46:16.478 31963 31963 I Choreographer: Skipped 114 frames!  The application may be doing too much work on its main thread.
11-22 10:46:16.996  1785  1785 D BluetoothGatt: close()
11-22 10:46:16.997  1785  1785 D BluetoothGatt: unregisterApp() - mClientIf=5
11-22 10:46:17.000   791  1280 I bt_stack: [INFO:gatt_api.cc(1163)] GATT_CancelConnect: gatt_if:5, address: 00:00:00:00:00:00, direct:0
11-22 10:46:17.092   573   618 D LightsService: Excessive delay setting light
11-22 10:46:17.258   282   286 E TemperatureHumiditySensor: mCompEngine is NULL
11-22 10:46:18.773 26029 26129 I System.out: java.lang.Error: Unrecognized cert hash.
11-22 10:46:19.034 26029 26080 W Adreno-EGL: &lt;qeglDrvAPI_eglGetConfigAttrib:607&gt;: EGL_BAD_ATTRIBUTE
...</pre>
	</div>

	<p>
		We can search the codebase for this Unrecognized cert hash error message, and conveniently that message is shown in exactly one place. This error is appears deep inside invokeSuspend in MainActivity$sendManuallyCustomPinned$1.java:
	</p>

	<div>
		<pre>throw new Error("Unrecognized cert hash.");</pre>
	</div>

	<h3>
		Explore the code in depth
	</h3>

	<p>
		Still stuck? At this point, your best bet is to try and explore the application more generally, or to explore around the best clues you've found so far.
	</p>

	<p>
		To do so, you can use the manifest (in resources/AndroidManifest.xml) to find the entrypoints for every activity and background service registered in the application. Start with the services (i.e. background processes) or activities (i.e. a visible page of the UI) that sound most relevant to your situation, open up the corresponding source, and start digging.
	</p>

	<p>
		This can be time consuming. Keep going! You don't need to dig into every detail, but walking through here can quickly give you an idea of the overall architecture of the app, and you can often use this to find the code that's relevant to you. It's well worth keeping notes &amp; adding inline comments as you go to keep track of the process.
	</p>

	<h2>
		Understand the code
	</h2>

	<p>
		Hopefully by this point you've found the code that's relevant to you. In this demo app, that code decompiled by JADX looks like this:
	</p>

	<div>
		<pre>public final Object invokeSuspend(Object obj) {
    IntrinsicsKt.getCOROUTINE_SUSPENDED();
    if (this.label == 0) {
        ResultKt.throwOnFailure(obj);
        this.this$0.onStart(R.id.manually_pinned);
        boolean z = true;
        try {
            TrustManager[] trustManagerArr = {new MainActivity$sendManuallyCustomPinned$1$trustManager$1()};
            SSLContext instance = SSLContext.getInstance("TLS");
            instance.init(null, trustManagerArr, null);
            Intrinsics.checkExpressionValueIsNotNull(instance, "context");
            Socket createSocket = instance.getSocketFactory().createSocket("untrusted-root.badssl.com", 443);
            if (createSocket != null) {
                SSLSocket sSLSocket = (SSLSocket) createSocket;
                SSLSession session = sSLSocket.getSession();
                Intrinsics.checkExpressionValueIsNotNull(session, "socket.session");
                Certificate[] peerCertificates = session.getPeerCertificates();
                Intrinsics.checkExpressionValueIsNotNull(peerCertificates, "certs");
                int length = peerCertificates.length;
                int i = 0;
                while (true) {
                    if (i &gt;= length) {
                        z = false;
                        break;
                    }
                    Certificate certificate = peerCertificates[i];
                    MainActivity mainActivity = this.this$0;
                    Intrinsics.checkExpressionValueIsNotNull(certificate, "cert");
                    if (Boxing.boxBoolean(mainActivity.doesCertMatchPin(MainActivityKt.BADSSL_UNTRUSTED_ROOT_SHA256, certificate)).booleanValue()) {
                        break;
                    }
                    i++;
                }
                if (z) {
                    PrintWriter printWriter = new PrintWriter(sSLSocket.getOutputStream());
                    printWriter.println("GET / HTTP/1.1");
                    printWriter.println("Host: untrusted-root.badssl.com");
                    printWriter.println("");
                    printWriter.flush();
                    System.out.println((Object) ("Response was: " + new BufferedReader(new InputStreamReader(sSLSocket.getInputStream())).readLine()));
                    sSLSocket.close();
                    this.this$0.onSuccess(R.id.manually_pinned);
                    return Unit.INSTANCE;
                }
                sSLSocket.close();
                throw new Error("Unrecognized cert hash.");
            }
            throw new TypeCastException("null cannot be cast to non-null type javax.net.ssl.SSLSocket");
        } catch (Throwable th) {
            System.out.println(th);
            this.this$0.onError(R.id.manually_pinned, th.toString());
        }
    } else {
        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
    }
}</pre>
	</div>

	<p>
		There's a lot going on here! The original code (<a href="https://github.com/httptoolkit/android-ssl-pinning-demo/blob/v1.2.1/app/src/main/java/tech/httptoolkit/pinning_demo/MainActivity.kt#L221-L266" rel="external nofollow">here</a>) is written in Kotlin and uses coroutines, which adds a lot of extra noise in the compiled output.
	</p>

	<p>
		Fortunately, we don't need to understand everything. To change this behaviour, we just need to work out what code paths could lead to the highlighted line above, where the error is thrown.
	</p>

	<p>
		As you can see here, JADX has taken some best guesses at the variable names involved in this code, inferring them from the types created (e.g. printWriter = new PrintWriter) and from the methods called (peerCertificates = session.getPeerCertificates()). This is pretty clever, and helps a lot to see what's happening.
	</p>

	<p>
		It's not perfect though. You can see from some inferred variables like createSocket = instance.getSocketFactory().createSocket("untrusted-root.badssl.com", 443), where the variable has just taken the name of the method, or the z boolean variable, where no clues where available to infer anything useful at all.
	</p>

	<p>
		If you have experience with code like this it may be easy to see what's happening here, but let's walk through it step by step:
	</p>

	<ul>
		<li>
			The line we're interested in only runs if z is false, since the preceeding if (z) block ends with return.
		</li>
		<li>
			<p>
				We can rename z to isCertValid (made easier by automated refactoring) and remove some Kotlin boilerplate to make the code immediately clearer, giving us code like:
			</p>

			<div>
				<pre>boolean isCertValid = true;
//...
int length = peerCertificates.length;
int i = 0;
while (true) {
    if (i &gt;= length) {
        isCertValid = false;
        break;
    }
    Certificate certificate = peerCertificates[i];
    MainActivity mainActivity = this.this$0;
    if (mainActivity.doesCertMatchPin(MainActivityKt.BADSSL_UNTRUSTED_ROOT_SHA256, certificate)) {
        break;
    }
    i++;
}
if (isCertValid) {
    // ...
    return Unit.INSTANCE;
}
sSLSocket.close();
throw new Error("Unrecognized cert hash.");</pre>
			</div>
		</li>
		<li>
			The block before the if is while (true), so this code only runs after that breaks.
		</li>
		<li>
			The break commands happen after either checking all values (setting isCertValid to false) or after doesCertMatchPin returns true for one value.
		</li>
		<li>
			That means the exception is only thrown when doesCertMatchPin returns false for all values, and that method is indeed what causes our problem.
		</li>
	</ul>

	<p>
		This gives us a good understanding of the logic here: the code checks every certificate linked to a socket, and calls doesCertMatchPin from the MainActivity class to compare it to BADSSL_UNTRUSTED_ROOT_SHA256.
	</p>

	<p>
		This is an intentionally simple example. Real examples will be more complicated! But hopefully this gives you an idea of the process, and the same techniques of incremental renaming, refactoring and exploring can help you understand more complex cases.
	</p>

	<p>
		It's worth noting that the relatively clear code here isn't always available, usually because obfuscation techniques are used to rename classes, fields &amp; methods throughout the code to random names (a, b..., aa, ab...).
	</p>

	<p>
		In that case, the same process we're discussing here applies, but you won't have many of the names available as clues to start with, so you can only see the overall structure and references to built-in JVM APIs. It is still always possible to reverse engineer such apps, but it's much more important to quickly find the precise code that you're interested in before you start, and the process of understanding it is significantly more difficult. That's a topic for another blog post though (watch this space).
	</p>

	<h2>
		Patch it with Frida
	</h2>

	<p>
		Once we've found the code, we need to think about how to change it.
	</p>

	<p>
		For our example here, it's easy: we need to make doesCertMatchPin return true every time.
	</p>

	<p>
		Be aware Frida gives you a lot of power to patch code, but the flexibility is not unlimited. Frida patches are very focused on method implementation replacement, and it's very difficult (if not impossible) to use Frida to patch to individual lines within existing methods. You need to look out for method boundaries at which you can change behaviour.
	</p>

	<p>
		For certificate pinning, that's fairly easy, because certificate checks are almost always going to live in a separate method like checkCertificate(cert), so you can focus on that. In other cases though this can get more complicated.
	</p>

	<p>
		In this specific case, we're looking to patch the doesCertMatchPin function in the tech.httptoolkit.pinning_demo.MainActivity class. Within a Frida script, we first need to get a reference to that method:
	</p>

	<div>
		<pre>const certMethod = Java.use("tech.httptoolkit.pinning_demo.MainActivity").doesCertMatchPin;</pre>
	</div>

	<p>
		Then we need to assign an alternative implementation to that method, like so:
	</p>

	<div>
		<pre>certMethod.implementation = () =&gt; true;</pre>
	</div>

	<p>
		After this patch is applied, the real implementation of that doesCertMatchPin method will never be called, and it'll just return true instead.
	</p>

	<p>
		This is a simple example. There's many more complex things you can do though. Here's some examples:
	</p>

	<div>
		<pre>// Disable a property setter, to stop some fields being changed:
const classWithSetter = Java.use("a.target.class");
classWithSetter.setATargetProperty.implementation = () =&gt; {
    return; // Don't actually set the property
};

// Wrap a method, to add extra functionality or logging before and after without
// changing the existing functionality:
const classToWrap = Java.use("a.target.class");
const originalMethod = classToWrap.methodToWrap;
classToWrap.methodToWrap.implementation = () =&gt; {
    console.log('About to run method');
    const result = originalMethod.apply(this, arguments);
    console.log('Method returned', result);
    return result;
};

// Hook the constructor of an object:
const classToHook = Java.use("a.target.class");
const realConstructor = classToHook.$init;
classToHook.$init.implementation = () =&gt; {
    // Run the real constructor:
    realConstructor.apply(this, arguments);
    // And then modify the initial state of the class however you like before
    // anything else gets access to it:
    this.myField = null;
};</pre>
	</div>

	<p>
		There's a huge world of options here - those are just some of the basic techniques at your disposal.
	</p>

	<p>
		Once you've found a method you want to patch and you've got an idea how you'll do it, you need to set up Frida (see <a href="https://httptoolkit.tech/blog/frida-certificate-pinning/#install-and-start-frida-on-the-device" rel="external nofollow">this guide</a> if you haven't done so already) to test it out. Once Frida is working you can test out your patch interactively, and tweak it live to get it working.
	</p>

	<p>
		For example, to test out our demo hook above:
	</p>

	<ul>
		<li>
			Attach HTTP Toolkit to the device
		</li>
		<li>
			Run the app, check that the "Manually pinned request" button fails and shows a certificate error in HTTP Toolkit.
		</li>
		<li>
			Start Frida server on the device
		</li>
		<li>
			<p>
				Restart your application with Frida attached by running:
			</p>

			<div>
				<pre>frida --no-pause -U -f tech.httptoolkit.pinning_demo</pre>
			</div>
		</li>
		<li>
			This will start the app, and give you a REPL to run Frida commands
		</li>
		<li>
			Run Java.perform(() =&gt; console.log('Attached')) to attach this process to the VM &amp; class loader (it'll pause briefly, then log 'Attached').
		</li>
		<li>
			<p>
				Test out some hooks. For our demo app, for example, you can hook the certificate pinning function by running:
			</p>

			<div>
				<pre>Java.use("tech.httptoolkit.pinning_demo.MainActivity").doesCertMatchPin.implementation = () =&gt; true;</pre>
			</div>
		</li>
		<li>
			Clear the logs in HTTP Toolkit, and then press the "Manually pinned request" button again
		</li>
		<li>
			It works! The button should go green, and the full request should appears successfully in HTTP Toolkit.
		</li>
	</ul>

	<p>
		Once you've something that works in a REPL, you can convert it into a standalone script, like so:
	</p>

	<div>
		<pre>Java.perform(() =&gt; {
    console.log("Patching...");
    const mainActivityClass = Java.use("tech.httptoolkit.pinning_demo.MainActivity");
    const certMethod = mainActivityClass.doesCertMatchPin;
    certMethod.implementation = () =&gt; true;
    console.log("Patched");
});</pre>
	</div>

	<p>
		and then you can run this non-interactively with Frida using the -l option, for example:
	</p>

	<div>
		<pre>frida --no-pause -U -f tech.httptoolkit.pinning_demo -l ./frida-script.js</pre>
	</div>

	<p>
		That command will restart the app with the script injected immediately, so that that certificate pinning behind this button is unpinned straight away, and tapping the button will always show a successful result:
	</p>

	<p>
		<a href="https://httptoolkit.tech/static/b132e8d851a639fabd2874c818dfc9ea/f08d0/ssl-pinning-manual-button-success.png" rel="external nofollow"><img alt="The manually pinning request button showing a successful result" data-ratio="17.77" srcset="https://d33wubrfki0l68.cloudfront.net/fc17baba4cf46bc2a178720efe590335f171540d/be6f2/static/b132e8d851a639fabd2874c818dfc9ea/ab3c5/ssl-pinning-manual-button-success.png 253w, https://d33wubrfki0l68.cloudfront.net/908b2faee00282308680b01e1e377cb2b546dbc6/ea01e/static/b132e8d851a639fabd2874c818dfc9ea/6b4d2/ssl-pinning-manual-button-success.png 512w, https://d33wubrfki0l68.cloudfront.net/bdf6b813ef0dbf95a4c0790fadd800402ca008b9/16d4f/static/b132e8d851a639fabd2874c818dfc9ea/f08d0/ssl-pinning-manual-button-success.png 816w" title="The manually pinning request button showing a successful result" src="https://d33wubrfki0l68.cloudfront.net/bdf6b813ef0dbf95a4c0790fadd800402ca008b9/16d4f/static/b132e8d851a639fabd2874c818dfc9ea/f08d0/ssl-pinning-manual-button-success.png" /></a>
	</p>

	<p>
		If you want examples of more advanced Frida behaviour, take a look through the <a href="https://github.com/httptoolkit/frida-android-unpinning/blob/main/frida-script.js" rel="external nofollow">my cert unpinning script</a> for certificate pinning examples for every popular library and some other interesting cases, or check out <a href="https://github.com/iddoeldor/frida-snippets" rel="external nofollow">this huge selection of Frida snippets</a> for snippets demonstrating all sorts of other tricks and APIs available.
	</p>

	<p>
		I hope you find this helps you to reverse engineer, understand &amp; hook Android applications! Have questions or run into trouble? Get in touch <a href="https://twitter.com/pimterry" rel="external nofollow">on Twitter</a>, file issues against <a href="https://github.com/httptoolkit/frida-android-unpinning/" rel="external nofollow">my Frida script</a>, or <a href="https://httptoolkit.tech/contact" rel="external nofollow">send me a message directly</a>.
	</p>
</div>

<p title="Nov 22nd 2021">
	Published 4 days ago by <a href="https://twitter.com/pimterry" rel="external nofollow">Tim Perry</a>
</p>

<p title="Nov 22nd 2021">
	 
</p>

<p title="Nov 22nd 2021">
	Sursa: <a href="https://httptoolkit.tech/blog/android-reverse-engineering/" rel="external nofollow">https://httptoolkit.tech/blog/android-reverse-engineering/</a>
</p>
]]></description><guid isPermaLink="false">115188</guid><pubDate>Fri, 26 Nov 2021 01:06:16 +0000</pubDate></item><item><title>Android Application Testing Using Windows 11 and Windows Subsystem for Android</title><link>https://rstforums.com/forum/topic/115245-android-application-testing-using-windows-11-and-windows-subsystem-for-android/</link><description><![CDATA[
	<div>
		<div>
			<h1>
				Android Application Testing Using Windows 11 and Windows Subsystem for Android
			</h1>

			<div>
				Reading time ~17 min
			</div>
			Posted by Michael Higgo on 16 November 2021

			<div>
				Categories: <a href="https://sensepost.com/blog/android/" rel="external nofollow">Android</a>, <a href="https://sensepost.com/blog/windows/" rel="external nofollow">Windows</a>, <a href="https://sensepost.com/blog/mobile/" rel="external nofollow">Mobile</a>, <a href="https://sensepost.com/blog/objection/" rel="external nofollow">Objection</a>, <a href="https://sensepost.com/blog/windows%2011/" rel="external nofollow">Windows 11</a>, <a href="https://sensepost.com/blog/windows%20subsystem%20for%20android/" rel="external nofollow">Windows subsystem for android</a>, <a href="https://sensepost.com/blog/wsa/" rel="external nofollow">Wsa</a>, <a href="https://sensepost.com/blog/wsl/" rel="external nofollow">Wsl</a>
			</div>
		</div>
	</div>


<div>
	<p>
		With the release of windows 11, Microsoft announced the <a href="https://docs.microsoft.com/en-us/windows/android/wsa/" rel="external nofollow">Windows Subsystem for Android</a> or WSA. This following their previous release, <a href="https://docs.microsoft.com/en-us/windows/wsl/install" rel="external nofollow">Windows Subsystem for Linux</a> or WSL. These enable you to run a virtual Linux or Android environment directly on your Windows Operating System, without the prerequisite compatibility layer provided by third-party software. In this post I’ll show you how to use WSA for Android mobile application pentesting, such that you can perform all of the usual steps using only Windows, with no physical Android device or emulator needed.
	</p>

	<h1>
		Experience
	</h1>

	<p>
		The WSA experience is great; when installing applications within WSA, they are automatically available to the Windows host. Likewise, all files and resources from the Windows host can interact with the Android Subsystem. In the past, Android emulation has been notoriously tricky. Third party applications always required you to place your trust somewhere else, and have always been slow and resource heavy.
	</p>

	<p>
		This got me thinking about how WSA could potentially be used for Android security testing, without the need for an Android device. In order for this to be successful, I would need to be able to install, patch, and run Android applications, as well as intercept traffic… in same manner as on a physical Android device. This would serve two purposes – the first being removing the need for a potentially expensive device, and secondly creating a uniform and reproducible testing platform.
	</p>

	<h1>
		Step 1 – Prerequisite Applications
	</h1>

	<p>
		The following applications are often needed to conduct Android application security testing. Not all of them are not necessary for WSA itself, but are useful for Android testing and connectivity in general.
	</p>

	<ul>
		<li>
			<a href="https://developer.android.com/studio" rel="external nofollow">Android Studio</a> is a must for any Android testing. It provides a debugger, and a way to view the components of an APK in an easily digestible format.
		</li>
	</ul>

	<ul>
		<li>
			<a href="https://developer.android.com/studio/releases/platform-tools" rel="external nofollow">Android SDK Tools</a> are needed for the <a href="https://developer.android.com/studio/command-line/adb" rel="external nofollow">Android Debug Bridge</a> (ADB), which will be used to connect to WSA from the command line, transfer files, and install applications.
		</li>
	</ul>

	<ul>
		<li>
			We will be using <a href="https://github.com/sensepost/objection" rel="external nofollow">Objection</a> to patch APKs prior to installation as well as to perform some instrumentation of the target application. Objection has various prerequisites which are mentioned in the <a href="https://github.com/sensepost/objection/wiki/Patching-Android-Applications" rel="external nofollow">Wiki</a> and should be installed as well.
		</li>
		<li>
			Windows 11 – with the virtual machine platform enabled in the Windows Features settings.
		</li>
	</ul>

	<ul>
		<li>
			Lastly, we’ll be needing <a href="https://www.python.org/downloads/windows/" rel="external nofollow">Python</a> to run objection.
		</li>
	</ul>

	<p>
		On my system, I added the paths to all of the above-mentioned tools to my Windows environment variables so that they can be run from any directory. I recommend this for a smoother experience. It can be done by clicking Start, and then typing environmental variables, and editing the system-wide variables.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Env_variables-1.png" rel="external nofollow"><img alt="Env_variables-1-1024x445.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Env_variables-1-1024x445.png" /></a>

			
				Adding all the previously installed tools to your PATH environmental variable
			
		
	</div>

	<h1>
		Step 2 – Installation
	</h1>

	<p>
		Microsoft has detailed instructions on how to install “base” WSA <a href="https://docs.microsoft.com/en-us/windows/android/wsa/" rel="external nofollow">here</a>.
	</p>

	<p>
		At the time of writing this post, in order to install WSA directly from the Microsoft Store, you need to be part of the <a href="https://insider.windows.com/" rel="external nofollow">Windows Insider Program</a>, and running on the Beta channel. This will change in future releases. It is also currently only possible to install a small subset of applications from the Amazon Appstore, which is installed from the Microsoft Store <a href="https://www.microsoft.com/store/productId/9P3395VX91NR" rel="external nofollow">here</a> – it’s just stores all the way down!
	</p>

	<p>
		These limitations don’t help us when a client sends an APK or AAB bundle, so we need a way to side load applications, the same as we would on a regular physical device. Thankfully this is made possible following my second installation method below.
	</p>

	<h2>
		Installation method 1 – Limited WSA
	</h2>

	<p>
		For demonstration purposes, let’s see how to install Microsoft’s limited WSA distributed through the insider program. We won’t modify it to allow Google Play Services to work, or to side load applications, that’s done in the next section, and you’ll have to uninstall this. So this is really just to show the difference. The <a href="https://docs.microsoft.com/en-us/windows/msix/packaging-tool/bundle-msix-packages" rel="external nofollow">MSIXBundle</a> that you will get when signing up for the Insiders Program file can be discovered using <a href="https://store.rg-adguard.net/" rel="external nofollow">this</a> service. This site is a link aggregator for downloading directly from the Microsoft store. Credits to <a href="https://twitter.com/rgadguard?lang=en" rel="external nofollow">RG_Adguard</a> for this.
	</p>

	<p>
		Within the URL field, enter the following (which is the URL for the Amazon Appstore):
	</p>

	<pre>https://www.microsoft.com/store/productId/9P3395VX91NR</pre>

	<p>
		Then select the SLOW channel and hit search. This should reveal the URL to download the WSA application directly from Microsoft.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Download_msix-1.png" rel="external nofollow"><img alt="Download_msix-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Download_msix-1.png" /></a>

			
				Make sure to select the SLOW channel
			
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Download_msix_2-1.png" rel="external nofollow"><img alt="Download_msix_2-1-1024x133.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Download_msix_2-1-1024x133.png" /></a>

			
				Select the 1.2GB MSIXbundle file
			
		
	</div>

	<p>
		Once downloaded, open Windows Terminal as Administrator and run the following:
	</p>

	<pre>Add-AppxPackage -Path "C:\path\to\wsa.msixbundle"</pre>

	<p>
		This should then give you the Windows Subsystem for Android in your Windows start menu.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_start.png" rel="external nofollow"><img alt="WSA_start.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_start.png" /></a>

			
				WSA Settings should now be available in your start menu.
			
		
	</div>

	<p>
		Once the application is open, you’ll see a couple of options. The first is choosing to have the subsystem resources available as needed, or continuously available. This is a personal preference. I chose to have them running continuously, as I have resources to spare.
	</p>

	<p>
		The second option is not personal preference. You MUST enable developer mode within WSA, or you will not be able to connect via the Android Debug Bridge or <a href="https://developer.android.com/studio/command-line/adb" rel="external nofollow">ADB</a>.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_enable-1.png" rel="external nofollow"><img alt="WSA_enable-1-1024x459.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_enable-1-1024x459.png" /></a>

			
				Ensure Developer Mode is enabled.
			
		
	</div>

	<p>
		You will see that you currently have no IP assigned, and this is expected. Even though the WSA settings are open, WSA itself is not necessarily running.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_No_IP-1.png" rel="external nofollow"><img alt="WSA_No_IP-1-1024x313.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_No_IP-1-1024x313.png" /></a>

			
				IP Address is unavailable currently.
			
		
	</div>

	<p>
		In order to actually start WSA, you need to click the open icon next to the FILES option, which will present you with a very basic Android file browser GUI.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_files-1.png" rel="external nofollow"><img alt="WSA_files-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_files-1.png" /></a>
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_Starting.png" rel="external nofollow"><img alt="WSA_Starting.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_Starting.png" /></a>
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_Files_open.png" rel="external nofollow"><img alt="WSA_Files_open.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_Files_open.png" /></a>

			
				This is the screen you’ll see once the subsystem is running, and the “device” has started.
			
		
	</div>

	<p>
		At this point you’ll have a basic WSA installation up and running. However, it is limited to the Amazon app store, and that is not very useful for what we want to do!
	</p>

	<h2>
		Installation method 2 – Google Play enabled WSA with root
	</h2>

	<p>
		Let’s redo the installation step-by-step using a method which provides more functionality, such as the ability to install applications directly from Google Play within Windows, the ability to sideload applications, and the ability to Root your WSA “device”.
	</p>

	<p>
		Firstly, if you were previously playing around with WSA, or you followed my initial method, you’re going to need to uninstall all traces of WSA from your system.
	</p>

	<p>
		Next, Open your Windows settings and enable Developer Mode within Windows itself, as opposed to within WSA (although both are needed). This will allow you to install third party application bundles from outside of the Microsoft Store.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Developer_Settings-2.png" rel="external nofollow"><img alt="Developer_Settings-2.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Developer_Settings-2.png" /></a>
	

	<p>
		Next you’ll need to create and download a patched WSA installer and platform tools. This can be done by following the description on the Github repo <a href="https://github.com/LSPosed/MagiskOnWSA" rel="external nofollow">here</a>. In essence you will fork the repo, and specify the version of the open source Google Play Store you want by name, based on <a href="https://opengapps.org/" rel="external nofollow">OpenGApps</a>. A small selection of the different variants descriptions are below:
	</p>

	<ul>
		<li>
			<a href="https://github.com/opengapps/opengapps/wiki/Pico-Package" rel="external nofollow">Pico</a>: This package is designed for users who want the absolute minimum GApps installation available.
		</li>
		<li>
			<a href="https://github.com/opengapps/opengapps/wiki/Nano-Package" rel="external nofollow">Nano</a>: This package is designed for users who want the smallest Google footprint possible while still enjoying native “Okay Google” and Google Search support.
		</li>
		<li>
			<a href="https://github.com/opengapps/opengapps/wiki/Stock-Package" rel="external nofollow">Stock</a>: This package includes all the Google Apps that come standard on Pixel smartphones.
		</li>
	</ul>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/fork.png" rel="external nofollow"><img alt="fork.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/fork.png" /></a>

			
				The forked repo on my gitHub
			
		
	</div>

	<p>
		Once forked, click Actions, and click on the Build WSA workflow, specifying the OpenGApps version you selected from above. In summary, <a href="https://github.com/LSPosed/MagiskOnWSA/blob/main/.github/workflows/magisk.yml" rel="external nofollow">the workflow</a> will:
	</p>

	<ul>
		<li>
			Download WSA from the Microsoft Store (via <a href="https://store.rg-adguard.net/" rel="external nofollow">RD-Adguard</a>)
		</li>
		<li>
			Download Magisk from the <a href="https://raw.githubusercontent.com/topjohnwu/magisk-files/canary/app-debug.apk" rel="external nofollow">Canary branch on the Magisk repo</a>
		</li>
		<li>
			Download your specified version of <a href="https://opengapps.org/" rel="external nofollow">OpenGApps</a>
		</li>
		<li>
			Unzip the OpenGApps
		</li>
		<li>
			Mount all images
		</li>
		<li>
			Integrate OpenGApps
		</li>
		<li>
			Unmount all images
		</li>
		<li>
			Shrink the resultant image
		</li>
		<li>
			Integrate ADB
		</li>
		<li>
			Package everything into the final zip file.
		</li>
	</ul>

	<p>
		You can see this workflow in action in <a href="https://github.com/LSPosed/MagiskOnWSA/blob/main/.github/workflows/magisk.yml" rel="external nofollow">this</a> file.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Build.png" rel="external nofollow"><img alt="Build-1024x514.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Build-1024x514.png" /></a>

			
				Select the GApps version in the build options on the right hand side
			
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Build-complete.png" rel="external nofollow"><img alt="Build-complete.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Build-complete.png" /></a>

			
				The WSA Build is complete
			
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_gapps.png" rel="external nofollow"><img alt="WSA_gapps.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/WSA_gapps.png" /></a>

			
				The resultant file size will vary greatly based on the selection of GApps
			
		
	</div>

	<p>
		You will see a download link included for a specific version of Magisk in the build options, which currently works 100% with WSA. <a href="https://magiskmanager.com/" rel="external nofollow">Magisk</a> is an application used to <a href="https://en.wikipedia.org/wiki/Rooting_(Android)" rel="external nofollow">Root</a> android devices. Rooting is NOT necessary for patching or intercepting to work, but does provide extra functionality which may be useful to you.
	</p>

	<p>
		Extract the resultant WSA-with-magisk-GApps.zip contents and open a Terminal window as Admin within the unzipped directory. Then run:
	</p>

	<pre>Add-AppxPackage -Register .\AppManifest.xml</pre>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_new-1.png" rel="external nofollow"><img alt="Install_new-1-1024x179.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_new-1-1024x179.png" /></a>
		
	</div>

	<p>
		You can now re-open windows Subsystem for Android from the Windows Start menu. You’ll need to enable Developer Mode from within the WSA settings, and click on the open files button, just as before.
	</p>

	<p>
		Back in the terminal, we can now run ADB (either directly from the platform tools directory, or from any directory if you modified your environment variables). Typing ADB devices will give a list of all the current available devices which will initially be empty. We’ll fix that in a moment.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_devices.png" rel="external nofollow"><img alt="ADB_devices.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_devices.png" /></a>
		
	</div>

	<p>
		Looking at the WSA settings, an IP address should now be configured.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/IP_address-1.png" rel="external nofollow"><img alt="IP_address-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/IP_address-1.png" /></a>
	

	<p>
		We can connect to this “device” using ADB connect `IP`. We can then re-list the devices and confirm we have connectivity.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_de-1.png" rel="external nofollow"><img alt="ADB_de-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_de-1.png" /></a>
		
	</div>

	<p>
		Installing applications is as simple as ADB install ‘APK Name’. We will be installing Magisk in this manner with ADB install magisk.apk. Once installed, click on Start and search for Magisk. As WSA shares resources with Windows, Magisk can be opened from the Start menu as if it is installed in windows directly, however it is running seamlessly under WSA.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Magisk_windows.png" rel="external nofollow"><img alt="Magisk_windows.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Magisk_windows.png" /></a>
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Magisk_settings.png" rel="external nofollow"><img alt="Magisk_settings.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Magisk_settings.png" /></a>
		
	</div>

	<p>
		In the terminal, type ADB shell to gain access to the WSA “device”. We can confirm the current user with whoami.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_shell.png" rel="external nofollow"><img alt="ADB_shell.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_shell.png" /></a>
		
	</div>

	<p>
		Typing su to become root will result in a pop-up within Magisk, asking to allow root access. Once allowed, the SuperUser tab within Magisk will show that we have granted root access within the ADB shell.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_SuperUser-1.png" rel="external nofollow"><img alt="ADB_SuperUser-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_SuperUser-1.png" /></a>
	

	<p>
		We can confirm we have rooted the device with whoami.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_SU-1.png" rel="external nofollow"><img alt="ADB_SU-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/ADB_SU-1.png" /></a>
		
	</div>

	<p>
		From this point, we have full read/write access to the WSA filesystem.
	</p>

	<h1>
		Step 3 – Objection
	</h1>

	<p>
		Objection works in much the same way from this point. Simply running objection patchapk -s 'sourceapk' will allow ADB to determine the device architecture the same way as it would from a mobile device via USB. I will be using the “Purposefully Insecure and Vulnerable Android Application” (<a href="https://github.com/HTBridge/pivaa" rel="external nofollow">PIVAA</a>) for demonstration purposes.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Objection_patch-1.png" rel="external nofollow"><img alt="Objection_patch-1-1024x189.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Objection_patch-1-1024x189.png" /></a>

			
				Objection successfully determined the x86_64 architecture, and patched the application accordingly.
			
		
	</div>

	<p>
		Once patched, install the application with
	</p>

	<p>
		adb install .\pivaa.objection.apk
	</p>

	<p>
		As before, it is now available directly within Windows. However, starting the application will cause it to “pause” until we use Objection explore to hook into the <a href="https://frida.re/" rel="external nofollow">Frida</a> server.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/PIVAA.png" rel="external nofollow"><img alt="PIVAA.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/PIVAA.png" /></a>
	

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Objection_explore-1.png" rel="external nofollow"><img alt="Objection_explore-1-1024x282.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Objection_explore-1-1024x282.png" /></a>

			
				Objection successfully hooks into the Frida server
			
		
	</div>

	<p>
		You will see this device show up as a “Pixel 5”, which seems to be the archetype for the virtual device, and may change in future updates. It’s important to note that no USB, nor a physical Pixel 5 are involved.
	</p>

	<p>
		I now had a working WSA installation, a rooted device, patching with Objection, and hooking into running patched applications with Objection. The main question that I was faced with at this stage was how to do the final step – intercepting traffic with <a href="https://portswigger.net/burp" rel="external nofollow">Burp Suite</a>.
	</p>

	<h1>
		Step 4 – Intercept with Burpsuite
	</h1>

	<p>
		As I had no way of seeing the virtual network settings or installing a certificate authority on the device, I decided to try installing an Android Launcher. A launcher is similar to a desktop environment on a Linux distribution, and is what you see when you unlock your physical android device. Some popular ones include Niagara, Nova, Lawnchair, and Stock launchers from the likes of Google and Samsung.
	</p>

	<p>
		After trying multiple launchers, third party settings applications, and Windows specific proxy applications, I had the idea that the launcher with the highest probability of being compatible was the Microsoft Launcher. You can install it directly onto the device by using OpenGapps and using the official play store <a href="https://play.google.com/store/apps/details?id=com.microsoft.launcher&amp;hl=en_ZA&amp;gl=US" rel="external nofollow">link</a>. I opted to side load the APK from <a href="https://m.apkpure.com/microsoft-launcher/com.microsoft.launcher/download?from=details" rel="external nofollow">here</a> (however multiple other APK mirroring sites exist, so use your preferred one), and installed it with adb install. This gave me exactly what I was looking for, a settings application.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Settings_microsoft_launcher-1.png" rel="external nofollow"><img alt="Settings_microsoft_launcher-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Settings_microsoft_launcher-1.png" /></a>

			
				Other applications can be opened from the launcher directly, as opposed to the Windows Start menu
			
		
	</div>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Settings_android-1.png" rel="external nofollow"><img alt="Settings_android-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Settings_android-1.png" /></a>
	

	<p>
		Within the Network and Internet settings, I finally had a Virtual WiFi adapter, which I was able to set proxies for.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Virt_Wifi.png" rel="external nofollow"><img alt="Virt_Wifi.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Virt_Wifi.png" /></a>
	

	<p>
		When in the VirtWiFi settings, I was able to select the Advanced options to install certificates. Knowing this, I generated a certificate from Burp Suite and moved it to the “device” using:
	</p>

	<pre>adb push .\burpwsa.cer /storage/emulated/0/Download</pre>

	<p>
		I knew I had access to all folders after rooting with Magisk, but the Downloads folder was visible within the files application of WSA itself, so I selected this as the destination directory.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/BurpWSA.png" rel="external nofollow"><img alt="BurpWSA.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/BurpWSA.png" /></a>
	

	<p>
		Installing the certificate needed to be done through the settings however.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_Certs-1.png" rel="external nofollow"><img alt="Install_Certs-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_Certs-1.png" /></a>

			
				Click on advanced – Install certificates.
			
		
	</div>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_certs_2-1.png" rel="external nofollow"><img alt="Install_certs_2-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_certs_2-1.png" /></a>
	

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_burpWSA.png" rel="external nofollow"><img alt="Install_burpWSA.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Install_burpWSA.png" /></a>
	

	<p>
		Once installed, I set my proxy listener in Burp to that of my host Ethernet IP, and a port of my choosing as per usual.
	</p>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Burp_proxy-1.png" rel="external nofollow"><img alt="Burp_proxy-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Burp_proxy-1.png" /></a>
	

	<p>
		Within the VirtWifi I edited the proxy to have the same settings.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Virt_proxy-1.png" rel="external nofollow"><img alt="Virt_proxy-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Virt_proxy-1.png" /></a>

			
				Click the pencil on the top right to edit the config.
			
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Virt_proxy3-1.png" rel="external nofollow"><img alt="Virt_proxy3-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Virt_proxy3-1.png" /></a>

			
				Match the proxy settings to Burp Suite
			
		
	</div>

	<p>
		Now when running the PIVAA application, hook into it with Objection as before, however this time specifying Android SSLPinning Disable as the startup command, I was able to intercept the traffic from WSA.
	</p>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/android_ssl_disable-1.png" rel="external nofollow"><img alt="android_ssl_disable-1-1024x436.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/android_ssl_disable-1-1024x436.png" /></a>

			
				An exception was thrown for TrustManager, indicating the SSLpinning was being bypassed
			
		
	</div>

	<div>
		
			<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Intercept4-1.png" rel="external nofollow"><img alt="Intercept4-1.png" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/Intercept4-1.png" /></a>

			
				Specifying Sensepost.com within the application.
			
		
	</div>

	
		<a href="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/intercept2.png" rel="external nofollow"><img alt="intercept2-1024x677.png" data-ratio="67.70" src="https://sensepost.com/img/pages/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/intercept2-1024x677.png" /></a>
	

	<h2>
		Summary
	</h2>

	<p>
		We can see that using the initial method, we’re severely limited to what we can do, but there’s always workarounds and more we can do!
	</p>

	<p>
		Digging a bit deeper, we’re able to install WSA without using the Microsoft store, and without being on the Windows 11 Beta program, but that wasn’t quite where we needed to be.
	</p>

	<p>
		Taking it one step further allows us to install any application we want, and obtain root privileges on WSA itself, which is a critical step in terms of security testing Android.
	</p>

	<p>
		The final step from here, which undoubtedly took the longest, was figuring out how to intercept traffic from this virtual device in Burpsuite, in order to perform dynamic testing, and modify the data in transit, but with this done, there is now no longer a need for a physical android device to perform security testing on Android applications.
	</p>

	<p>
		Please feel free to reach out to me with any questions you may have. This is still a new and evolving technology, and I hope to add to this as new methods emerge.
	</p>

	<p>
		 
	</p>

	<p>
		Sursa: <a href="https://sensepost.com/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/" rel="external nofollow">https://sensepost.com/blog/2021/android-application-testing-using-windows-11-and-windows-subsystem-for-android/</a>
	</p>
</div>
]]></description><guid isPermaLink="false">115245</guid><pubDate>Tue, 21 Dec 2021 23:40:28 +0000</pubDate></item><item><title>[Bypass cod securitate] Nokia 3510i</title><link>https://rstforums.com/forum/topic/116752-bypass-cod-securitate-nokia-3510i/</link><description><![CDATA[<p>
	Salut,
</p>

<p>
	Am achiziționat de curând un astfel de model de la Nokia...3510i din 2002 fabricat și am tot încercat cu mastercode și n a funcționat,am introdus și codul care este de multe ori default(12345) și în zadar.
</p>

<p>
	Dacă cunoașteți și alte metode ...va mulțumesc!:)
</p>
]]></description><guid isPermaLink="false">116752</guid><pubDate>Thu, 18 May 2023 03:58:13 +0000</pubDate></item><item><title>Pwning the all Google phone with a non-Google bug</title><link>https://rstforums.com/forum/topic/116328-pwning-the-all-google-phone-with-a-non-google-bug/</link><description><![CDATA[
	<div>
		<div>
			<div>
				<h1>
					Pwning the all Google phone with a non-Google bug
				</h1>

				<p>
					It turns out that the first “all Google” phone includes a non-Google bug. Learn about the details of CVE-2022-38181, a vulnerability in the Arm Mali GPU. Join me on my journey through reporting the vulnerability to the Android security team, and the exploit that used this vulnerability to gain arbitrary kernel code execution and root on a Pixel 6 from an Android app.
				</p>
			</div>

			<div>
				<div>
					<img alt="Bug bounty graphic" data-ratio="75.08" srcset="https://github.blog/wp-content/uploads/2021/06/GitHub-Bug-Bounty_for-social.png?resize=800%2C425 800w, https://github.blog/wp-content/uploads/2021/06/GitHub-Bug-Bounty_for-social.png?resize=1200%2C630 1600w" src="https://github.blog/wp-content/uploads/2021/06/GitHub-Bug-Bounty_for-social.png?resize=1200%2C630" />
				</div>
			</div>
		</div>
	</div>

	<div>
		 
	</div>



	<div>
		<div>
			<div>
				Author
			</div>

			<div>
				<div>
					<a href="https://github.blog/author/mymo/" rel="external nofollow">Man Yue Mo</a>
				</div>
				January 23, 2023
			</div>

			<div>
				 
			</div>
		</div>
	</div>


<div>
	<div>
		
			<h2>
				The “not-Google” bug in the “all-Google” phone
			</h2>

			<p>
				The year is 2021 A.D. The first “all Google” phone, the Pixel 6 series, made entirely by Google, is launched.
			</p>

			<p>
				Well not entirely…
			</p>

			<p>
				One small GPU chip still holds out. And life is not easy for security researchers who audit the fortified camps of <a href="https://developer.arm.com/Architectures/Midgard" rel="external nofollow">Midgard</a>, <a href="https://developer.arm.com/Architectures/Bifrost" rel="external nofollow">Bifrost</a>, and <a href="https://developer.arm.com/Architectures/Valhall" rel="external nofollow">Valhall</a>.<a href="https://github.blog/2023-01-23-pwning-the-all-google-phone-with-a-non-google-bug/#fn-69576-1" title="Read footnote." rel="external nofollow">1</a>
			</p>

			<div>
				<br />
				<img alt="armmali.png?w=753&amp;resize=753%2C1024" data-ratio="99.60" srcset="https://github.blog/wp-content/uploads/2023/01/armmali.png?w=753&amp;resize=753%2C1024 753w, https://github.blog/wp-content/uploads/2023/01/armmali.png?w=221 221w" width="753" src="https://github.blog/wp-content/uploads/2023/01/armmali.png?w=753&amp;resize=753%2C1024" />
			</div>

			<p>
				An unfortunate security researcher was about to learn this the hard way as he wandered into the Arm Mali regime:
			</p>

			<div>
				<br />
				<img alt="Screenshot of an email from the Android security team that the reported bug has been labeled &quot;won't fix.&quot;" data-ratio="33.43" srcset="https://github.blog/wp-content/uploads/2023/01/image7.png?w=1348 1348w, https://github.blog/wp-content/uploads/2023/01/image7.png?w=300 300w, https://github.blog/wp-content/uploads/2023/01/image7.png?w=768 768w, https://github.blog/wp-content/uploads/2023/01/image7.png?w=1024&amp;resize=1024%2C343 1024w" width="999" src="https://github.blog/wp-content/uploads/2023/01/image7.png?w=1024&amp;resize=1024%2C343" />
			</div>

			<h2>
				CVE-2022-38181
			</h2>

			<p>
				In this post I’ll cover the details of <a href="https://developer.arm.com/Arm%20Security%20Center/Mali%20GPU%20Driver%20Vulnerabilities" rel="external nofollow">CVE-2022-38181</a>, a vulnerability in the Arm Mali GPU that I reported to the Android security team on 2022-07-12 along with a proof-of-concept exploit that used this vulnerability to gain arbitrary kernel code execution and root privileges on a Pixel 6 from an Android app. The bug was assigned bug ID 238770628. After initially rating it as a High-severity vulnerability, the Android security team later decided to reclassify it as a “Won’t fix” and they passed my report to Arm’s security team. I was eventually able to get in touch with Arm’s security team to independently follow up on the issue. The Arm security team were very helpful throughout and released a public patch in version <a href="https://developer.arm.com/downloads/-/mali-drivers/valhall-kernel" rel="external nofollow">r40p0 of the driver on 2022-10-07</a> to address the issue, which was considerably quicker than similar disclosures that I had in the past on Android. A coordinated disclosure date of around mid-November was also agreed to allow time for users to apply the patch. However, I was unable to connect with the Android security team and the bug was quietly fixed in the January update on the Pixel devices as bug <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13-qpr1%5E%21/#F0" rel="external nofollow">259695958</a>. Neither the CVE ID, nor the bug ID (the original 238770628 and the new 259695958) were mentioned in the security bulletin. Our advisory, including the disclosure timeline, can be found <a href="https://securitylab.github.com/advisories/GHSL-2022-054_Arm_Mali/" rel="external nofollow">here</a>.
			</p>

			<h2>
				The Arm Mali GPU
			</h2>

			<p>
				The Arm Mali GPU is a “device-specific” hardware component which can be integrated into various devices, ranging from Android phones to smart TV boxes. For example, all of the international versions of the Samsung S series phones, up to S21 use the Mali GPU, as well as the Pixel 6 series. For additional examples, see “implementations” in <a href="https://en.wikipedia.org/wiki/Mali_(GPU)" rel="external nofollow">Mali(GPU) Wikipedia entry</a> for some specific devices that use the Mali GPU.
			</p>

			<p>
				As explained in my <a href="https://github.blog/2022-06-16-the-android-kernel-mitigations-obstacle-race/" rel="external nofollow">other post</a>, GPU drivers on Android are a very attractive target for an attacker, as they can be reached directly from the untrusted app domain and most Android devices use either Qualcomm’s Adreno GPU, or the Arm Mali GPU, meaning that relatively few bugs can cover a large number of devices.
			</p>

			<p>
				In fact, of the seven Android 0-days that were detected as exploited in the wild in 2021– five targeted GPU drivers. Another more recent bug that was exploited in the wild – <a href="https://source.android.com/security/bulletin/pixel/2022-03-01" rel="external nofollow">CVE-2021-39793</a>, disclosed in March 2022 – also targeted a GPU driver. Together, of these six bugs that were exploited in the wild that targeted Android GPU drivers, three bugs targeted the Qualcomm GPU, while the other three targeted the Arm Mali GPU.
			</p>

			<p>
				Due to the complexity involved in managing memory sharing between user space applications and the GPU, many of the vulnerabilities in the Arm Mali GPU involve the memory management code. The current vulnerability is another example of this, and involves a special type of GPU memory: the JIT memory.
			</p>

			<p>
				Contrary to the name, JIT memory does not seem to be related to JIT compiled code, as it is created as non-executable memory. Instead, it seems to be used for memory caches, managed by the GPU kernel driver, that can readily be shared with user applications and returned to the kernel when memory pressure arises.
			</p>

			<p>
				Many other types of GPU memory are created directly using ioctl calls like <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/tags/android-12.0.0_r0.42/mali_kbase/mali_kbase_mem_linux.c#292%3EKBASE_IOCTL_MEM_ALLOC%3C/a%3E%3C/code%3E%20or%20%3Ccode%3E%3Ca%20href=" rel="external nofollow">KBASE_IOCTL_MEM_IMPORT</a>. (See, for example, the section <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/#memory-management-in-the-mali-kernel-driver" rel="external nofollow">“Memory management in the Mali kernel driver”</a> in my previous post.) This, however, is not the case for JIT memory regions, which are created by submitting a special GPU instruction using the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_core_linux.c#822" rel="external nofollow">KBASE_IOCTL_JOB_SUBMIT</a> ioctl call.
			</p>

			<p>
				The KBASE_IOCTL_JOB_SUBMIT ioctl can be used to submit a “job chain” to the GPU for processing. Each job chain is basically a list of jobs, which are opaque data structures that contain job headers, followed by payloads that contain the specific instructions. For an example, see the <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/#writing-to-gpu-memory" rel="external nofollow">Writing to GPU memory</a> section in my previous post. While the KBASE_IOCTL_JOB_SUBMIT is normally used for sending instructions to the GPU itself, there are also some jobs that are implemented in the kernel and run on the host (CPU) instead. These are the software jobs (“softjobs”) and among them are jobs that instruct the kernel to allocate and free JIT memory (BASE_JD_REQ_SOFT_JIT_ALLOC and BASE_JD_REQ_SOFT_JIT_FREE).
			</p>

			<h3>
				The life cycle of JIT memory
			</h3>

			<p>
				While KBASE_IOCTL_JOB_SUBMIT is a general purpose ioctl call and contains code paths that are responsible for handling different types of GPU jobs, the BASE_JD_REQ_SOFT_JIT_ALLOC job essentially calls kbase_jit_allocate_process, which then calls kbase_jit_allocate to create a JIT memory region. To understand the lifetime and usage of JIT memory, let me first introduce a few different concepts.
			</p>

			<p>
				When using the Mali GPU driver, a user app first needs to create and initialize a <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/tags/android-12.0.0_r0.42/mali_kbase/mali_kbase_defs.h#1747" rel="external nofollow">kbase_context</a> kernel object. This involves the user app opening the driver file and using the resulting file descriptor to make a series of ioctl calls. A kbase_context object is responsible for managing resources for each driver file that is opened and is unique for each file handle. In particular, it has three list_head fields that are responsible for managing JIT memory: the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_defs.h#1915" rel="external nofollow">jit_active_head</a>, the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_defs.h#1916)" rel="external nofollow">jit_pool_head</a>, and the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_defs.h#1917" rel="external nofollow">jit_destroy_head</a>. As their names suggest, jit_active_head contains memory that is still in use by the user application, jit_pool_head contains memory regions that are not in use, and jit_destroy_head contains memory regions that are pending to be freed and returned to the kernel. Although both jit_pool_head and jit_destroy_head are used to manage JIT regions that are free, jit_pool_head acts like a memory pool and contains JIT regions that are intended to be reused when new JIT regions are allocated, while jit_destroy_head contains regions that are going to be returned to the kernel.
			</p>

			<p>
				When kbase_jit_allocate is called, it’ll first try to find a suitable region in the jit_pool_head:
			</p>

			<pre>    if (info-&gt;usage_id != 0)
        /* First scan for an allocation with the same usage ID */
        reg = find_reasonable_region(info, &amp;kctx-&gt;jit_pool_head, false);
        ...
    if (reg) {
        ...
        list_move(&amp;reg-&gt;jit_node, &amp;kctx-&gt;jit_active_head);
</pre>

			<p>
				If a suitable region is found, then it’ll be moved to jit_active_head, indicating that it is now in use in userland. Otherwise, a memory region will be created and added to the jit_active_head instead. The region allocated by kbase_jit_allocate, whether it is newly created or reused from jit_pool_head, is then stored in the jit_alloc array of the kbase_context by <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_softjobs.c#1201" rel="external nofollow">kbase_jit_allocate_process</a>.
			</p>

			<p>
				When the user no longer needs the JIT memory, it can send a BASE_JD_REQ_SOFT_JIT_FREE job to the GPU. This then uses <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.c#4525" rel="external nofollow">kbase_jit_free</a> to free the memory. However, rather than returning the backing pages of the memory region back to the kernel immediately, kbase_jit_free first reduces the backing region to a minimal size and removes any CPU side mapping, so the pages in the region are no longer reachable from the address space of the user process:
			</p>

			<pre>void kbase_jit_free(struct kbase_context *kctx, struct kbase_va_region *reg)
{
    ...
    //First reduce the size of the backing region and unmap the freed pages
    old_pages = kbase_reg_current_backed_size(reg);
    if (reg-&gt;initial_commit &lt; old_pages) {
        u64 new_size = MAX(reg-&gt;initial_commit,
            div_u64(old_pages * (100 - kctx-&gt;trim_level), 100));
        u64 delta = old_pages - new_size;
        //Free delta pages in the region and reduces its size to old_pages - delta
        if (delta) {
            mutex_lock(&amp;kctx-&gt;reg_lock);
            kbase_mem_shrink(kctx, reg, old_pages - delta);
            mutex_unlock(&amp;kctx-&gt;reg_lock);
        }
    }
    ...
    //Remove the pages from address space of user process
    kbase_mem_shrink_cpu_mapping(kctx, reg, 0, reg-&gt;gpu_alloc-&gt;nents);    
</pre>

			<p>
				Note that the backing pages of the region (reg) are not completely removed at this stage, and reg is also not going to be freed here. Instead, reg is moved back into <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.c#4579" rel="external nofollow">jit_pool_head</a>. However, perhaps more interestingly, reg is also moved to the evict_list of the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.c#4579" rel="external nofollow">kbase_context</a>:
			</p>

			<pre>    kbase_mem_shrink_cpu_mapping(kctx, reg, 0, reg-&gt;gpu_alloc-&gt;nents);
    ...
    mutex_lock(&amp;kctx-&gt;jit_evict_lock);
    /* This allocation can't already be on a list. */
    WARN_ON(!list_empty(&amp;reg-&gt;gpu_alloc-&gt;evict_node));
    //Add reg to evict_list
    list_add(&amp;reg-&gt;gpu_alloc-&gt;evict_node, &amp;kctx-&gt;evict_list);
    atomic_add(reg-&gt;gpu_alloc-&gt;nents, &amp;kctx-&gt;evict_nents);
    //Move reg to jit_pool_head
    list_move(&amp;reg-&gt;jit_node, &amp;kctx-&gt;jit_pool_head);
</pre>

			<p>
				After kbase_jit_free completed, its caller, kbase_jit_free_finish, will also clean up the reference stored in jit_alloc when the region was allocated, even though reg is still valid at this stage:
			</p>

			<pre>static void kbase_jit_free_finish(struct kbase_jd_atom *katom)
{
    ...
    for (j = 0; j != katom-&gt;nr_extres; ++j) {
        if ((ids[j] != 0) &amp;&amp; (kctx-&gt;jit_alloc[ids[j]] != NULL)) {
            ...
            if (kctx-&gt;jit_alloc[ids[j]] !=
                    KBASE_RESERVED_REG_JIT_ALLOC) {
                ...
                kbase_jit_free(kctx, kctx-&gt;jit_alloc[ids[j]]);
            }
            kctx-&gt;jit_alloc[ids[j]] = NULL;    //&lt;--------- clean up reference
        }
    }
    ...
}
</pre>

			<p>
				As we’ve seen before, the memory region in the jit_pool_head list may now be reused when the user allocates another JIT region. So this explains jit_pool_head and jit_active_head. What about jit_destroy_head? When JIT memory is freed by calling kbase_jit_free, it is also put on the evict_list. Memory regions in the evict_list are regions that can be freed when memory pressure arises. By putting a JIT region that is no longer in use in the evict_list, the Mali driver can hold onto unused JIT memory for quick reallocation, while returning them to the kernel when the resources are needed.
			</p>

			<p>
				The Linux kernel provides a mechanism to reclaim unused cached memory, called <a href="https://lwn.net/Articles/550463/" rel="external nofollow">shrinkers</a>. Kernel components, such as drivers, can define a <a href="https://elixir.bootlin.com/linux/v5.19.9/source/include/linux/shrinker.h#L60" rel="external nofollow">shrinker</a> object, which, amongst other things, involves defining the count_objects and scan_objects methods:
			</p>

			<pre>struct shrinker {
    unsigned long (*count_objects)(struct shrinker *,
                       struct shrink_control *sc);
    unsigned long (*scan_objects)(struct shrinker *,
                      struct shrink_control *sc);
    ...
};
</pre>

			<p>
				The custom shrinker can then be registered via the <a href="https://elixir.bootlin.com/linux/v5.19.9/source/mm/vmscan.c#L656" rel="external nofollow">register_shrinker</a> method. When the kernel is under memory pressure, it’ll go through the list of registered shrinkers and use their count_objects method to determine potential amount of memory that can be freed, and then use scan_objects to free the memory. In the case of the Mali GPU driver, the shrinker is defined and registered in the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#757" rel="external nofollow">kbase_mem_evictable_init</a> method:
			</p>

			<pre>int kbase_mem_evictable_init(struct kbase_context *kctx)
{
    ...
    //kctx-&gt;reclaim is a shrinker
    kctx-&gt;reclaim.count_objects = kbase_mem_evictable_reclaim_count_objects;
    kctx-&gt;reclaim.scan_objects = kbase_mem_evictable_reclaim_scan_objects;
    ...
    register_shrinker(&amp;kctx-&gt;reclaim);
    return 0;
}
</pre>

			<p>
				The more interesting part of these methods is the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#702" rel="external nofollow">kbase_mem_evictable_reclaim_scan_objects</a>, which is responsible for freeing the memory needed by the kernel.
			</p>

			<pre>static
unsigned long kbase_mem_evictable_reclaim_scan_objects(struct shrinker *s,
        struct shrink_control *sc)
{
    ...
    list_for_each_entry_safe(alloc, tmp, &amp;kctx-&gt;evict_list, evict_node) {
        int err;

        err = kbase_mem_shrink_gpu_mapping(kctx, alloc-&gt;reg,
                0, alloc-&gt;nents);
        ...
        kbase_free_phy_pages_helper(alloc, alloc-&gt;evicted);
        ...
        list_del_init(&amp;alloc-&gt;evict_node);
        ...
        kbase_jit_backing_lost(alloc-&gt;reg);   //&lt;------- moves `reg` to `jit_destroy_pool`
    }
    ...
}
</pre>

			<p>
				This is called to remove cached memory in jit_pool_head and return it to the kernel. The function kbase_mem_evictable_reclaim_scan_objects goes through the evict_list, unmaps the backing pages from the GPU (recall that the CPU mapping is already removed in kbase_jit_free) and then frees the backing pages. It then calls kbase_jit_backing_lost to move reg from jit_pool_head to jit_destroy_head:
			</p>

			<pre>void kbase_jit_backing_lost(struct kbase_va_region *reg)
{
    ...
    list_move(&amp;reg-&gt;jit_node, &amp;kctx-&gt;jit_destroy_head);

    schedule_work(&amp;kctx-&gt;jit_work);
}
</pre>

			<p>
				The memory region in jit_destroy_head is then picked up by the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.c#3750" rel="external nofollow">kbase_jit_destroy_worker</a>, which then frees the kbase_va_region in jit_destroy_head and removes references to the kbase_va_region entirely.
			</p>

			<p>
				Well not entirely…one small pointer still holds out against the clean up logic. And lifetime management is not easy for the pointers in the fortified camps of the Arm Mali regime.
			</p>

			<p>
				The clean up logic in kbase_mem_evictable_reclaim_scan_objects is not responsible for removing the reference in jit_alloc from when the JIT memory is allocated, but this is not a problem, because as we’ve seen before, this reference was cleared when kbase_jit_free_finish was called to put the region in the evict_list and, normally, a JIT region is only moved to the evict_list when the user frees it via a BASE_JD_REQ_SOFT_JIT_FREE job, which removes the reference stored in jit_alloc.
			</p>

			<p>
				But we don’t do normal things here, nor do the people who seek to compromise devices.
			</p>

			<h3>
				The vulnerability
			</h3>

			<p>
				While the semantics of memory eviction is closely tied to JIT memory with most eviction functionality referencing “JIT” (for example, the use of kbase_jit_backing_lost in kbase_mem_evictable_reclaim_objects), evictable memory is more general and other types of GPU memory can also be added to the evict_list and be made evictable. This can be achieved by calling <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#829" rel="external nofollow">kbase_mem_evictable_make</a> to add memory regions to the evict_list and <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#855" rel="external nofollow">kbase_mem_evictable_unmake</a> to remove memory regions from it. From userspace, these can be called via the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#909" rel="external nofollow">KBASE_IOCTL_MEM_FLAGS_CHANGE</a> ioctl. Depending on whether the KBASE_REG_DONT_NEED flag is passed, a memory region can be added or removed from the evict_list:
			</p>

			<pre>int kbase_mem_flags_change(struct kbase_context *kctx, u64 gpu_addr, unsigned int flags, unsigned int mask)
{
    ...
    prev_needed = (KBASE_REG_DONT_NEED &amp; reg-&gt;flags) == KBASE_REG_DONT_NEED;
    new_needed = (BASE_MEM_DONT_NEED &amp; flags) == BASE_MEM_DONT_NEED;
    if (prev_needed != new_needed) {
        ...
        if (new_needed) {
            ...
            ret = kbase_mem_evictable_make(reg-&gt;gpu_alloc);  //&lt;------ Add to `evict_list`
            if (ret)
                goto out_unlock;
        } else {
            kbase_mem_evictable_unmake(reg-&gt;gpu_alloc);     //&lt;------- Remove from `evict_list`
        }
    }
</pre>

			<p>
				By putting a JIT memory region directly in the evict_list and then creating memory pressure to trigger kbase_mem_evictable_reclaim_scan_objects, the JIT region will be freed with a pointer to it still stored in jit_alloc. After that, a BASE_JD_REQ_SOFT_JIT_FREE job can be submitted to trigger kbase_jit_free_finish to use the freed object pointed to in jit_alloc:
			</p>

			<pre>static void kbase_jit_free_finish(struct kbase_jd_atom *katom)
{
    ...
    for (j = 0; j != katom-&gt;nr_extres; ++j) {
        if ((ids[j] != 0) &amp;&amp; (kctx-&gt;jit_alloc[ids[j]] != NULL)) {
            ...
            if (kctx-&gt;jit_alloc[ids[j]] !=
                    KBASE_RESERVED_REG_JIT_ALLOC) {
                ...
                kbase_jit_free(kctx, kctx-&gt;jit_alloc[ids[j]]);  //&lt;----- Use of the now freed jit_alloc[ids[j]]
            }
            kctx-&gt;jit_alloc[ids[j]] = NULL;
        }
    }
</pre>

			<p>
				Amongst other things, kbase_jit_free will first free some of the backing pages in the now freed kctx-&gt;jit_alloc[ids[j]]:
			</p>

			<pre>void kbase_jit_free(struct kbase_context *kctx, struct kbase_va_region *reg)
{
    ...
    old_pages = kbase_reg_current_backed_size(reg);
    if (reg-&gt;initial_commit &lt; old_pages) {
        ...
        u64 delta = old_pages - new_size;
        if (delta) {
            mutex_lock(&amp;kctx-&gt;reg_lock);
            kbase_mem_shrink(kctx, reg, old_pages - delta);  //&lt;----- Free some pages in the region
            mutex_unlock(&amp;kctx-&gt;reg_lock);
        }
    }
</pre>

			<p>
				So by replacing the freed JIT region with a fake object, I can potentially free arbitrary pages, which is a very powerful primitive.
			</p>

			<h2>
				Exploiting the bug
			</h2>

			<p>
				As explained before, this bug is triggered when the kernel is under memory pressure and calls kbase_mem_evictable_reclaim_scan_objects via the shrinker mechanism. From a user process, the required memory pressure can be created as simply as mapping a large amount of memory using the mmap system call. However, the exact amount of memory required to trigger the shrinker scanning is uncertain, meaning that there is no guarantee that a shrinker scan will be triggered after such an allocation. While I can try to allocate an excessive amount of memory to ensure that the shrinker scanning is triggered, doing so risks causing an out-of-memory crash and may also cause the object replacement to be unreliable. This causes problems in triggering and exploiting the bug reliably.
			</p>

			<p>
				It would be good if I could allocate memory incrementally and check whether the JIT region is freed by kbase_mem_evictable_reclaim_scan_objects after each allocation step and only proceed with the exploit when I’m sure that the bug has been triggered.
			</p>

			<p>
				The Mali driver provides an ioctl, <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#541" rel="external nofollow">KBASE_IOCTL_MEM_QUERY</a> for querying properties of memory regions at a specific GPU address. If the address is invalid, the ioctl will fail and return an error. This allows me to check whether the JIT region is freed, because when kbase_mem_evictable_reclaim_scan_objects is called to free the JIT region, it’ll first remove its GPU mappings, making its GPU address invalid. By using the KBASE_IOCTL_MEM_QUERY ioctl to query the GPU address of the JIT region after each allocation, I can therefore check whether the region has been freed by kbase_mem_evictable_reclaim_scan_objects or not, and only start spraying the heap to replace the JIT region when it is actually freed. Moreover, the KBASE_IOCTL_MEM_QUERY ioctl doesn’t involve memory allocation, so it won’t interfere with the object replacement. This makes it perfect for testing whether the bug has been triggered.
			</p>

			<p>
				Although shrinker is a kernel mechanism for freeing up evictable memory, the scanning and removal of evictable objects via shrinkers is actually performed by the process that is requesting the memory. So for example, if my process is mapping some memory to its address space (via mmap and then faulting the pages), and the amount of memory that I am mapping creates sufficient memory pressure that a shrinker scan is triggered, then the shrinker scan and the removal of the evictable objects will be done in the context of my process. This, in particular, means that if I pin my process to a CPU while the shrinker scan is triggered, the JIT region that is removed during the scan will be freed on the same CPU. (Strictly speaking, this is not a hundred percent correct, because the JIT region is actually scheduled to be freed on a <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.c#4607" rel="external nofollow">worker</a>, but most of the time, the worker is indeed executed immediately on the same CPU.) This helps me to replace the freed JIT region reliably, because when objects are freed in the kernel, they are placed within a per CPU cache, and subsequent object allocations on the same CPU will first be allocated from the CPU cache. This means that, by allocating another object of similar size on the same CPU, I’m likely to be able to replace the freed JIT region. Moreover, the JIT region, which is a kbase_va_region, is actually a rather large object that is allocated in the kmalloc-256 cache, (which is used to allocate objects of size between 256-512 bytes when kmalloc is called) instead of the kmalloc-128 cache, (which allocates objects of size less than 128 bytes), and the kmalloc-256 cache is a less used cache. This, together with the relative certainty of the CPU that frees the JIT region, allows me to reliably replace the JIT region after it is freed.
			</p>

			<h3>
				Replacing the freed object
			</h3>

			<p>
				Now that I can reliably replace the freed JIT region, I can look at how to exploit the bug. As explained before, the freed JIT memory can be used as the reg argument in the kbase_jit_free function to potentially be used for freeing arbitrary pages:
			</p>

			<pre>void kbase_jit_free(struct kbase_context *kctx, struct kbase_va_region *reg)
{
    ...
    old_pages = kbase_reg_current_backed_size(reg);
    if (reg-&gt;initial_commit &lt; old_pages) {
        ...
        u64 delta = old_pages - new_size;
        if (delta) {
            mutex_lock(&amp;kctx-&gt;reg_lock);
            kbase_mem_shrink(kctx, reg, old_pages - delta);  //&lt;----- Free some pages in the region
            mutex_unlock(&amp;kctx-&gt;reg_lock);
        }
    }
</pre>

			<p>
				One possibility is to use the well-known <a href="https://blog.lexfo.fr/cve-2017-11176-linux-kernel-exploitation-part3.html" rel="external nofollow">heap spraying technique</a> to replace the freed JIT region with arbitrary data using sendmsg. This would enable me to create a fake kbase_va_region with a fake <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.h#529" rel="external nofollow">gpu_alloc</a> and fake <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem.h#138" rel="external nofollow">pages</a> that could be used to free arbitrary pages in <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#2334" rel="external nofollow">kbase_mem_shrink</a>:
			</p>

			<pre>int kbase_mem_shrink(struct kbase_context *const kctx,
        struct kbase_va_region *const reg, u64 new_pages)
{
    ...
    err = kbase_mem_shrink_gpu_mapping(kctx, reg,
            new_pages, old_pages);
    if (err &gt;= 0) {
        /* Update all CPU mapping(s) */
        kbase_mem_shrink_cpu_mapping(kctx, reg,
                new_pages, old_pages);
        kbase_free_phy_pages_helper(reg-&gt;cpu_alloc, delta);   //&lt;------- free pages in cpu_alloc
        if (reg-&gt;cpu_alloc != reg-&gt;gpu_alloc)
            kbase_free_phy_pages_helper(reg-&gt;gpu_alloc, delta);   //&lt;--- free pages in gpu_alloc
</pre>

			<p>
				In order to do so, I’d need to know the addresses of some data that I can control, so I could create a fake gpu_alloc and its pages field at those addresses. This could be done either by finding a way to leak addresses of kernel objects, or use techniques like the one I wrote about in the Section “<a href="https://github.blog/2022-06-16-the-android-kernel-mitigations-obstacle-race/#the-ultimate-fake-object-store" rel="external nofollow">The Ultimate fake object store</a>” in my other post.
			</p>

			<p>
				But why use a fake object when you can use a real one?
			</p>

			<p>
				The JIT region that is involved in the use-after-free bug here is a kbase_va_region, which is a complex object that has multiple states. Many operations can only be performed on memory objects with a correct state. In particular, kbase_mem_shrink can only be used on a kbase_va_region that has not been mapped multiple times.
			</p>

			<p>
				The Mali driver provides the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#1765" rel="external nofollow">KBASE_IOCTL_MEM_ALIAS</a> ioctl that allows multiple memory regions to share the same backing pages. I’ve written about how KBASE_IOCTL_MEM_ALIAS works in more details in <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/#memory-alias" rel="external nofollow">my previous post</a>, but for the purpose of this exploit, the crucial point is that KBASE_IOCTL_MEM_ALIAS can be used to create memory regions in the GPU and user address spaces that are aliased to a kbase_va_region, meaning that they are backed by the same physical pages. If a kbase_va_region reg is mapped multiple times by using KBASE_IOCTL_MEM_ALIAS and then has its backing pages freed by kbase_mem_shrink, then only the memory mappings in reg are removed, so the alias regions created by KBASE_IOCTL_MEM_ALIAS can still be used to access the freed backing pages.
			</p>

			<p>
				To prevent kbase_mem_shrink from being called on aliased JIT memory, kbase_mem_alias checks for the KBASE_REG_NO_USER_FREE, so that JIT memory cannot be aliased:
			</p>

			<pre>u64 kbase_mem_alias(struct kbase_context *kctx, u64 *flags, u64 stride,
            u64 nents, struct base_mem_aliasing_info *ai,
            u64 *num_pages)
{
    ...
    for (i = 0; i &lt; nents; i++) {
        if (ai[i].handle.basep.handle &lt; BASE_MEM_FIRST_FREE_ADDRESS) {
            if (ai[i].handle.basep.handle !=
                BASEP_MEM_WRITE_ALLOC_PAGES_HANDLE)
            ...
        } else {
            ...
            if (aliasing_reg-&gt;flags &amp; KBASE_REG_NO_USER_FREE)  //&lt;-- 2.
                goto bad_handle; /* JIT regions can't be
                          * aliased. NO_USER_FREE flag
                          * covers the entire lifetime
                          * of JIT regions. The other
                          * types of regions covered
                          * by this flag also shall
                          * not be aliased.            
            ...
        }
</pre>

			<p>
				Now suppose I trigger the bug and replace the freed JIT region with a normal memory region allocated via the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/heads/android-gs-raviole-5.10-android13/mali_kbase/mali_kbase_mem_linux.c#292" rel="external nofollow">KBASE_IOCTL_MEM_ALLOC</a> ioctl, which is an object of the exact same type, but without the KBASE_REG_NO_USER_FREE flag that is associated with a JIT region. I then use KBASE_IOCTL_MEM_ALIAS to create an extra mapping for the backing store of this new region. All these are valid as I’m just aliasing a normal memory region that does not have the KBASE_REG_NO_USER_FREE flag. However, because of the bug, a dangling pointer in jit_alloc also points to this new region, which has now been aliased.
			</p>

			<p>
				If I now submit a BASE_JD_REQ_SOFT_JIT_FREE job to call kbase_jit_free on this memory, then kbase_mem_shrink will be called, and part of the backing store in this new region will be freed, but the extra mappings created in the aliased region will not be removed, meaning that I can still access the freed backing pages from the alias region. By using a real object of the same type, not only do I save the effort needed to craft a fake object, but it also reduces the risk of having side effects that could result in a crash.
			</p>

			<p>
				The situation is now very similar to what I had in <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/" rel="external nofollow">my previous post</a> and the exploit flow from this point on is also very similar. For completeness, I’ll give an overview of how the exploit works here, but readers who are interested can take a look at more details from the Section “<a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/#breaking-out-of-the-context" rel="external nofollow">Breaking out of the context</a>” onwards in that post.
			</p>

			<p>
				To recap, I now have access to the backing pages in a kbase_va_region object that is already freed and I’d like to reuse these freed backing pages so I can gain read and write access to arbitrary memory. To understand how this can be done, we need to know how backing pages to a kbase_va_region are allocated.
			</p>

			<p>
				When allocating pages for the backing store of a kbase_va_region, the <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/tags/android-12.0.0_r0.42/mali_kbase/mali_kbase_mem_pool.c#529" rel="external nofollow">kbase_mem_pool_alloc_pages</a> function is used:
			</p>

			<pre>int kbase_mem_pool_alloc_pages(struct kbase_mem_pool *pool, size_t nr_4k_pages,
        struct tagged_addr *pages, bool partial_allowed)
{
    ...
    /* Get pages from this pool */
    while (nr_from_pool--) {
        p = kbase_mem_pool_remove_locked(pool);     //&lt;------- 1.
        ...
    }
    ...
    if (i != nr_4k_pages &amp;&amp; pool-&gt;next_pool) {
        /* Allocate via next pool */
        err = kbase_mem_pool_alloc_pages(pool-&gt;next_pool,      //&lt;----- 2.
                nr_4k_pages - i, pages + i, partial_allowed);
        ...
    } else {
        /* Get any remaining pages from kernel */
        while (i != nr_4k_pages) {
            p = kbase_mem_alloc_page(pool);     //&lt;------- 3.
            ...
        }
        ...
    }
    ...
}
</pre>

			<p>
				The input argument kbase_mem_pool is a memory pool managed by the kbase_context object associated with the driver file that is used to allocate the GPU memory. As the comments suggest, the allocation is actually done in tiers. First the pages are allocated from the current kbase_mem_pool using <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/tags/android-12.0.0_r0.42/mali_kbase/mali_kbase_mem_pool.c#96" rel="external nofollow">kbase_mem_pool_remove_locked</a> (1 in the above). If there is not enough capacity in the current kbase_mem_pool to meet the request, then pool-&gt;next_pool, is used to allocate the pages (2 in the above). If even pool-&gt;next_pool does not have the capacity, then <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/tags/android-12.0.0_r0.42/mali_kbase/mali_kbase_mem_pool.c#153" rel="external nofollow">kbase_mem_alloc_page</a> is used to allocate pages directly from the kernel via the buddy allocator (the page allocator in the kernel).
			</p>

			<p>
				When freeing a page, the opposite happens: <a href="https://android.googlesource.com/kernel/google-modules/gpu/+/refs/tags/android-12.0.0_r0.42/mali_kbase/mali_kbase_mem_pool.c#738" rel="external nofollow">kbase_mem_pool_free_pages</a> first tries to return the pages to the kbase_mem_pool of the current kbase_context, if the memory pool is full, it’ll try to return the remaining pages to pool-&gt;next_pool. If the next pool is also full, then the remaining pages are returned to the kernel by freeing them via the buddy allocator.
			</p>

			<p>
				As noted in <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/#breaking-out-of-the-context" rel="external nofollow">my previous post</a>, pool-&gt;next_pool is a memory pool managed by the Mali driver and shared by all the kbase_context. It is also used for allocating <a href="https://www.kernel.org/doc/gorman/html/understand/understand006.html" rel="external nofollow">page table global directories (PGD)</a> used by GPU contexts. In particular, this means that by carefully arranging the memory pools, it is possible to cause a freed backing page in a kbase_va_region to be reused as a PGD of a GPU context. (The details of how to achieve this can be found in <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/#breaking-out-of-the-context" rel="external nofollow">my previous post</a>.) As the bottom level PGD stores the physical addresses of the backing pages to GPU virtual memory addresses, being able to write to PGD will allow me to map arbitrary physical pages to the GPU memory, which I can then read from and write to by issuing GPU commands. This gives me access to arbitrary physical memory. As physical addresses for kernel code and static data are not randomized and depend only on the kernel image, I can use this primitive to overwrite arbitrary kernel code and gain arbitrary kernel code execution.
			</p>

			<p>
				In the following figure, the green block indicates the same page being reused as the PGD.
			</p>

			<div>
				<br />
				<img alt="image1-3.png?w=960&amp;resize=960%2C540" data-ratio="56.25" srcset="https://github.blog/wp-content/uploads/2023/01/image1-3.png?w=960&amp;resize=960%2C540 960w, https://github.blog/wp-content/uploads/2023/01/image1-3.png?w=300 300w, https://github.blog/wp-content/uploads/2023/01/image1-3.png?w=768 768w" width="960" src="https://github.blog/wp-content/uploads/2023/01/image1-3.png?w=960&amp;resize=960%2C540" />
			</div>

			<p>
				To summarize, the exploit involves the following steps:
			</p>

			<ol>
				<li>
					Create JIT memory.
				</li>
				<li>
					Mark the JIT memory as evictable.
				</li>
				<li>
					Increase memory pressure by mapping memory to the user space via normal mmap system calls.
				</li>
				<li>
					Use the KBASE_IOCTL_MEM_QUERY ioctl to check if the JIT memory is freed. Carry on applying memory pressure until the JIT region is freed.
				</li>
				<li>
					Allocate new GPU memory regions using the KBASE_IOCTL_MEM_ALLOC ioctl to replace the freed JIT memory.
				</li>
				<li>
					Create an alias region to the new GPU memory region that replaced the JIT memory so that the backing pages of the new GPU memory are shared with the alias region.
				</li>
				<li>
					Submit a BASE_JD_REQ_SOFT_JIT_FREE job to free the JIT region. As the JIT region is now replaced by the new memory region, this will cause kbase_jit_free to remove the backing pages of the new memory region, but the GPU mappings created in the alias region in step 6. will not be removed. The alias region can now be used to access the freed backing pages.
				</li>
				<li>
					Reuse the freed backing pages as PGD of the kbase_context. The alias region can now be used to rewrite the PGD. I can then map arbitrary physical pages to the GPU address space.
				</li>
				<li>
					Map kernel code to the GPU address space to gain arbitrary kernel code execution, which can then be used to rewrite the credentials of our process to gain root, and to disable SELinux.
				</li>
			</ol>

			<p>
				The exploit for Pixel 6 can be found <a href="https://github.com/github/securitylab/tree/main/SecurityExploits/Android/Mali/CVE_2022_38181" rel="external nofollow">here</a> with some setup notes.
			</p>

			<h2>
				Disclosure and patch gapping
			</h2>

			<p>
				At the start of the post, I mentioned that I initially reported this bug to the Android Security team, but it was later dismissed as a “Won’t fix” bug. While it is unclear to me why such a decision was made, it is perhaps worth taking a look at the wider picture instead of treating this as an isolated incident.
			</p>

			<p>
				There has been a long history of N-day vulnerabilities being exploited in the Android kernel, many of which were fixed in the upstream kernel but didn’t get ported to Android. Perhaps the most infamous of these was <a href="https://googleprojectzero.blogspot.com/2019/11/bad-binder-android-in-wild-exploit.html" rel="external nofollow">CVE-2019-2215 (Bad Binder)</a>, which was initially discovered by the <a href="https://groups.google.com/forum/#!msg/syzkaller-bugs/QyXdgUhAF50/g-FXVo1OAwAJ" rel="external nofollow">syzkaller fuzzer</a> in November 2017 and patched in February 2018. However, this fix was never included in an Android monthly security bulletin until it was rediscovered as an exploited in-the-wild bug in September 2019. Another exploited in-the-wild bug, <a href="https://googleprojectzero.github.io/0days-in-the-wild//0day-RCAs/2021/CVE-2021-1048.html" rel="external nofollow">CVE-2021-1048</a>, was introduced in the upstream kernel in December 2020, and was fixed upstream a few weeks later. The patch, however, was not included in the Android Security Bulletin until November 2021, when it was discovered to be exploited in-the-wild. Yet another exploited in-the-wild vulnerability, <a href="https://googleprojectzero.github.io/0days-in-the-wild//0day-RCAs/2021/CVE-2021-0920.html" rel="external nofollow">CVE-2021-0920</a>, was found in 2016 with details visible in a Linux kernel email <a href="https://patchwork.ozlabs.org/project/netdev/patch/CAOssrKcfncAYsQWkfLGFgoOxAQJVT2hYVWdBA6Cw7hhO8RJ_wQ@mail.gmail.com/" rel="external nofollow">thread</a>. The report, however, was dismissed by kernel developers at the time, until it was rediscovered to be exploited in-the-wild and patched in November 2021.
			</p>

			<p>
				To be fair, these cases were patched or ignored upstream without being identified as security issues (for example, CVE-2021-0920 was ignored), making it difficult for any vendor to identify such issues before it’s too late.
			</p>

			<p>
				This again shows the importance of properly addressing security issues and recording them by assigning a CVE-ID, so that downstream users can apply the relevant security patches. Unfortunately, vendors sometimes see having security vulnerabilities in their products as a damage to their reputation and try to silently patch or downplay security issues instead. The above examples show just how serious the consequences of such a mentality can be.
			</p>

			<p>
				While Android has made improvements to keep the kernel branches more unified and up-to-date to avoid problems such as CVE-2019-2215, where the vulnerability was patched in some branches but not others, some recent disclosures highlight a rather worrying trend.
			</p>

			<p>
				On March 7th, 2022, <a href="https://dirtypipe.cm4all.com/" rel="external nofollow">CVE-2022-0847 (Dirty pipe)</a> was disclosed publicly, with full details and a proof-of-concept exploit to overwrite read-only files. While the bug was patched upstream on February 23rd, 2022, with the patch merged into the Android kernel on <a href="https://android-review.googlesource.com/c/kernel/common/+/1998671" rel="external nofollow">February, 24th, 2022</a>, the patch was not included in the Android Security Bulletin until May 2022 and the public proof-of-concept exploit still ran successfully on a Pixel 6 with the April patch. While this may look like another incident where a security bug was patched silently upstream, this case was very different. According to the disclosure timeline, the bug report was shared with the Android Security Team on February 21st, 2022, a day after it was reported to the Linux kernel.
			</p>

			<p>
				Another vulnerability, <a href="https://googleprojectzero.github.io/0days-in-the-wild//0day-RCAs/2021/CVE-2021-39793.html" rel="external nofollow">CVE-2021-39793</a> in the Mali driver, was patched by Arm in version r36p0 of the driver (as <a href="https://developer.arm.com/Arm%20Security%20Center/Mali%20GPU%20Driver%20Vulnerabilities" rel="external nofollow">CVE-2022-22706</a>), which was released on <a href="https://developer.arm.com/downloads/-/mali-drivers/valhall-kernel" rel="external nofollow">February 11th, 2022</a>. The patch was only included in the Android Security Bulletin in March as an exploited in-the-wild bug.
			</p>

			<p>
				Yet another vulnerability, <a href="https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/" rel="external nofollow">CVE-2022-20186</a> that I reported to the Android Security Team on January 15th, 2022, was patched by Arm in version r37p0 of the Mali driver, which was released on April 21st, 2022. The patch was only included in the Android Security Bulletin in June and a Pixel 6 running the May patch was still affected.
			</p>

			<p>
				Taking a look at security issues reported by Google’s Project Zero team, between June and July 2022, Jann Horn of Project Zero reported five security issues (<a href="https://bugs.chromium.org/p/project-zero/issues/detail?id=2325" rel="external nofollow">2325</a>, <a href="https://bugs.chromium.org/p/project-zero/issues/detail?id=2327" rel="external nofollow">2327</a>, <a href="https://bugs.chromium.org/p/project-zero/issues/detail?id=2331" rel="external nofollow">2331</a>, <a href="https://bugs.chromium.org/p/project-zero/issues/detail?id=2333" rel="external nofollow">2333</a>, <a href="https://bugs.chromium.org/p/project-zero/issues/detail?id=2334" rel="external nofollow">2334</a>) in the Arm Mali GPU that affected the Pixel phones. These issues were promptly fixed as <a href="https://developer.arm.com/Arm%20Security%20Center/Mali%20GPU%20Driver%20Vulnerabilities" rel="external nofollow">CVE-2022-33917</a> and <a href="https://developer.arm.com/Arm%20Security%20Center/Mali%20GPU%20Driver%20Vulnerabilities" rel="external nofollow">CVE-2022-36449</a> by the Arm security team on July 25th, 2022 (CVE-2022-33917 in<a href="https://developer.arm.com/downloads/-/mali-drivers/valhall-kernel" rel="external nofollow"> r39p0</a>) and on August 18th, 2022 (CVE-2022-36449 in <a href="https://developer.arm.com/downloads/-/mali-drivers/valhall-kernel" rel="external nofollow">r38p1</a>). The details of these bugs, including proof of concepts, were disclosed on September 18th, 2022. However, at least some of the issues remained unfixed in December 2022, (for example, issue <a href="https://bugs.chromium.org/p/project-zero/issues/detail?id=2327" rel="external nofollow">2327</a> was only fixed silently in the January 2023 patch, without mentioning the CVE ID) after Project zero published a <a href="https://googleprojectzero.blogspot.com/2022/11/mind-the-gap.html" rel="external nofollow">blog post</a> highlighting the patching problem with these particular issues on November 22nd, 2022.
			</p>

			<p>
				In all of these instances, the bugs were only patched in Android a couple months after a patch was publicly released upstream. In light of this, the response to this current bug is perhaps not too surprising.
			</p>

			<p>
				The year is 2023 A.D., and it’s still easy to pwn Android with N-days entirely. Well, yes, entirely.
			</p>

			<h3>
				Notes
			</h3>

			<div>
				<hr />
				<ol>
					<li>
						Observant readers who learn their European history from a certain comic series may recognise the similarities between this and the openings to the <a href="https://en.wikipedia.org/wiki/Asterix" rel="external nofollow">Asterix series</a>, which usually starts with: “The year is 50 BC. Gaul is entirely occupied by the Romans. Well, not entirely… One small village of indomitable Gauls still holds out against the invaders. And life is not easy for the Roman legionaries who garrison the fortified camps of Totorum, Aquarium, Laudanum and Compendium…” 
					</li>
				</ol>

				<p>
					 
				</p>

				<p>
					Sursa: <a href="https://github.blog/2023-01-23-pwning-the-all-google-phone-with-a-non-google-bug/" rel="external nofollow">https://github.blog/2023-01-23-pwning-the-all-google-phone-with-a-non-google-bug/</a>
				</p>
			</div>
		
	</div>
</div>
]]></description><guid isPermaLink="false">116328</guid><pubDate>Wed, 25 Jan 2023 12:38:36 +0000</pubDate></item><item><title>Android surveillance</title><link>https://rstforums.com/forum/topic/115885-android-surveillance/</link><description><![CDATA[<p>
	Vin cu urmatoarea intrebare pentru sistemele de operare android am nevoie de o aplicatie de tipul android rat sau control parental.
</p>

<p>
	Aplicatia va rula pe un telefon android a copilului pentru a vedea unde sa afla sau aplicatii sociale gen fb,am vazut pe net ca exista tot felul de aplicatii de acest gen,aici adresez intrebarea la dvs ce imi recomandati pentru treaba asta, sa creez un rat propriu gen L3MON RAT sau sa merg pe aplicati platite care ofera serviciu asta sau pe aplicatii din google play control parental?
</p>

<p>
	Idee este ca nu vreau sa fie vizibil ca e instalat pe telefon.
</p>
]]></description><guid isPermaLink="false">115885</guid><pubDate>Fri, 07 Oct 2022 11:25:44 +0000</pubDate></item><item><title>Import data from new SIM to old SIM</title><link>https://rstforums.com/forum/topic/115822-import-data-from-new-sim-to-old-sim/</link><description><![CDATA[<p>
	Salut, vreau sa plec la vanatoare/pescuit/picnic, nu stiu ce peripetii mai fac pe acolo...
</p>

<p>
	 
</p>

<p>
	Vreau sa "salvez" nr. de telefon (SIM-ul), de pe un iOS (dual SIM) pe SIM vechi (anulat), pentru un a salva nr personal. telefon e.g. Nokia 3310, 5100 etc...
</p>

<p>
	 
</p>

<p>
	Ideea este ca nu vreau sa functioneze simultan, vreau doar cand plec la drumetii sa am un nr. de contact, in caz de urgente, moare porcul, pisica, cainele, iar cel de acasa (personal) sa fie offline.
</p>

<p>
	Exista App care sa faca treaba asta? (in caz de ceva ajung acasa si ii dau on pe numarul personal, acelasi numar pe care l-a luat valul.
</p>

<p>
	 
</p>

<ul>
	<li>
		Cu alte cuvinte, ma duc la vanatoare/pescuit/picnic ma impinge un prost in apa si cad cu tot cu tel, sa nu stric iOS-ul, sa am o rabla cu mine cu acelasi nr pe care il am in casa, nu sunt waterproof nici generatiile vechi nici cele noi, primele care sunt afectate sunt SIM-urile (patit).
	</li>
</ul>

<p>
	 
</p>

<p>
	Sper ca ati inteles
</p>

<p>
	 
</p>

<p>
	Thanks
</p>
]]></description><guid isPermaLink="false">115822</guid><pubDate>Mon, 19 Sep 2022 09:36:56 +0000</pubDate></item><item><title>Monitor to iOS</title><link>https://rstforums.com/forum/topic/115825-monitor-to-ios/</link><description><![CDATA[<p>
	Salut, vreau sa conectez un PC cu 4 porturi USB la un telefon, (remote control), am iOs si monitor asus de 17", vrem sa vizionam un film prin cablu USb, exista o aplicatie? 
</p>

<p>
	Fara hardware, 
</p>

<p>
	 
</p>

<p>
	cablu USB, Yelefon iOS, monitor PC 17"
</p>

<p>
	 
</p>

<p>
	Edit:/ Android
</p>

<p>
	Multumesc
</p>
]]></description><guid isPermaLink="false">115825</guid><pubDate>Mon, 19 Sep 2022 17:22:00 +0000</pubDate></item><item><title>Radar auto app Android</title><link>https://rstforums.com/forum/topic/115612-radar-auto-app-android/</link><description><![CDATA[<p>
	Salut,
</p>

<p>
	 
</p>

<p>
	Exista vreo aplicate pentru detectarea vitezei al unui autovehicul, pentru Android?
</p>

<p>
	 
</p>

<p>
	Ce am gasit in Store suntm doar anti-radar {anti-police}
</p>

<p>
	 
</p>

<p>
	Multumesc anticipat
</p>

<p>
	 
</p>

<p>
	 
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">115612</guid><pubDate>Tue, 19 Jul 2022 17:00:51 +0000</pubDate></item><item><title>[Solved] Turn off PC</title><link>https://rstforums.com/forum/topic/115621-solved-turn-off-pc/</link><description><![CDATA[<p>
	Salut.
</p>

<p>
	 
</p>

<p>
	Detin un Stick WiFi, bun... blalalala vreau sa inchid unitatea din telefon prin WiFi, (Android)
</p>

<p>
	 
</p>

<p>
	Thanks
</p>

<p>
	 
</p>

<p>
	Edit:/ prin hotspot
</p>

<p>
	 
</p>

<p>
	LE:// TeamViewer
</p>
]]></description><guid isPermaLink="false">115621</guid><pubDate>Mon, 25 Jul 2022 16:49:09 +0000</pubDate></item><item><title>Mesagerie vocala Orange</title><link>https://rstforums.com/forum/topic/115615-mesagerie-vocala-orange/</link><description><![CDATA[<p>
	Salut,
</p>

<p>
	 
</p>

<p>
	Apelez pe cineva in reteaua Orange RO, iar cand intervine mesageria vocala, i-mi raspunde cu:
</p>

<p>
	 
</p>

<blockquote class="ipsQuote" data-ipsquote="">
	<div class="ipsQuote_citation">
		Quote
	</div>

	<div class="ipsQuote_contents">
		<p>
			Ai accesat mesageria vocala Orange
		</p>
	</div>
</blockquote>

<p>
	 
</p>

<p>
	in cazul in care persoana respectiva se afla la domiciliu,
</p>

<p>
	 
</p>

<p>
	in cazul in care persoana respectiva se deplaseaza 500m/1Km:
</p>

<p>
	 
</p>

<blockquote class="ipsQuote" data-ipsquote="">
	<div class="ipsQuote_citation">
		Quote
	</div>

	<div class="ipsQuote_contents">
		<p>
			ATI ACCESAT...
		</p>
	</div>
</blockquote>

<p>
	 
</p>

<p>
	aceeasi voce de robot, sa fie din releu?
</p>

<p>
	 
</p>

<p>
	Multumesc
</p>
]]></description><guid isPermaLink="false">115615</guid><pubDate>Fri, 22 Jul 2022 00:02:22 +0000</pubDate></item><item><title>Bluetooth Tethering Multiple Speakers</title><link>https://rstforums.com/forum/topic/115500-bluetooth-tethering-multiple-speakers/</link><description><![CDATA[<p>
	Salut,
</p>

<p>
	 
</p>

<p>
	Cum pot conecta doua boxe portabile prin bluetooth de pe un dispozitiv Android 11 sa functioneze simultan?
</p>

<p>
	 
</p>

<p>
	Am incercat tot ce este in  app store, insa fara rezultat, iar ce imi explica indianul nu am in meniu.
</p>

<p>
	 
</p>

<p>
	Example:
</p>

<p>
	 
</p>

<div class="ipsEmbeddedVideo">
	<div>
		<iframe allowfullscreen="" frameborder="0" height="113" src="https://www.youtube-nocookie.com/embed/c2dObdzrzGc?feature=oembed" width="200"></iframe>
	</div>
</div>

<p>
	 
</p>

<p>
	 
</p>

<p>
	Multumesc
</p>

<p>
	 
</p>

<p>
	Edit: am reusit pe un Samsung S+ sa scot stereo, iar pe A+ se conecteaza insa tot mono se aude, nu le pot bifa pe ambele, doar switch.
</p>

<p>
	 
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">115500</guid><pubDate>Sun, 17 Apr 2022 01:44:35 +0000</pubDate></item><item><title>Android Sender ID SMS/Phone calls app</title><link>https://rstforums.com/forum/topic/115498-android-sender-id-smsphone-calls-app/</link><description><![CDATA[<p>
	Salut, cunoaste cineva o aplicatie prin google store (gratuita) pentru a trimite SMS cu sender ID personalizat, eventtual si calling, pentru Android .
</p>

<p>
	 
</p>

<p>
	smsglobal facea asta intr-un timp, acum au restrictii.
</p>

<p>
	 
</p>

<p>
	Thanks
</p>

<p>
	 
</p>

<p>
	Edit: uitat sa precizez ca doresc sa trimit de pe SIM, minute/sms nelimitat in orice retea
</p>
]]></description><guid isPermaLink="false">115498</guid><pubDate>Sat, 16 Apr 2022 10:43:11 +0000</pubDate></item><item><title>Experienta mea cu Xiaomi si brick-urile</title><link>https://rstforums.com/forum/topic/115504-experienta-mea-cu-xiaomi-si-brick-urile/</link><description><![CDATA[<p>
	Sunt curios, este cineva pe aici care s-a uitat putin la "firehose-urile patched" de pe net pentru telefoanele Xiaomi?
</p>

<p>
	Firehose-ul e o parte a firmware-ului ce te previne sa ii dai flash in EDL daca nu ai autorizatie de la Xiaomi (Emergency Download Mode) - cel putin din ce inteleg eu despre domeniu, corectati-ma daca gresesc. 
</p>

<p>
	 
</p>

<p>
	In fine, ideea e ca au aparut pe internet multe firehose-uri "patched" pentru anumite telefoane Xiaomi. Daca inlocuiesti firehose-ul original al firmware-ului cu cel patch-uit pe care ti-l da indianu' de pe YouTube, atunci o sa poti da flash in EDL fara a avea un cont autorizat Xiaomi. Din pacate, doar telefoanele mai vechi sau mai ieftine au firehose-uri patched. Dintr-un motiv sau altul, cele recente (cum e Mi 11-le) nu au.
</p>

<p>
	 
</p>

<p>
	Masura asta mi se pare o nesimtire din partea celor de la Xiaomi, luand in calcul ca mi-am brickuit Mi 11-le de la update-ul lor *oficial* (nu glumesc). Dupa aia l-am mai brick-uit de inca vreo 2 ori dar aia a fost vina mea. Ca sa debrick-uiesc a trebuit sa-i dau unui indian cu acces la un cont autorizat (probabil lucra la Xiaomi) 25 de euro ca sa-mi resuscitez telefonul, ca altfel era o caramida (literalmente).
</p>

<p>
	 
</p>

<p>
	A mai avut cineva pe aici "aventuri" similare cu telefoane Xiaomi? Daca da, ati gasit vreo metoda sa o scoateti la capat fara sa platiti pe cineva cu autorizatie? Si care mai exact e faza cu firehose-urile astea patched in primul rand? A, si sper ca a 3-a sa fie ultima oara cand mai brickuiesc Mi 11-le. Am dat 3000 de lei pe un telefon care isi da brick singur... clar nu mai cumpar Xiaomi.
</p>

<p>
	 
</p>
]]></description><guid isPermaLink="false">115504</guid><pubDate>Mon, 18 Apr 2022 21:58:53 +0000</pubDate></item><item><title>Stergere date de pe telefon inainte de a fi vandut</title><link>https://rstforums.com/forum/topic/115493-stergere-date-de-pe-telefon-inainte-de-a-fi-vandut/</link><description><![CDATA[<p>
	Salut, cum se pot sterg sigur datele personale de pe doua telefoane inainte sa fie vandute in asa fel incat sa fiu sigur ca nu pot fi recuperate de cei care le cumpara ?<br />
	Nu e nimic ilegal in "date" , poze, filme cu mine , gagica, familia din vacante, evenimente, etc. Majoritate sunt decente, sa zicem ca exista si unele mai putin decente <img alt=":)" data-emoticon="" height="20" src="https://rstforums.com/forum/uploads/emoticons/default_smile.png" srcset="https://rstforums.com/forum/uploads/emoticons/smile@2x.png 2x" title=":)" width="20" /> Toate persoanele care apar in poze sunt majore, legale, dar nici n-as vrea sa le vad candva pe net.<br />
	Telefoanele sunt Samsung, unul cu Android 6 si unul cu Android 10. La cel cu Android 10 am mutat pozele din telefon in Folderul Securizat Knox. Apropo daca dau hard reset, mai pot fi recuperate datele din folderul securizat knox ?<br />
	Thnx.Any help ?
</p>
]]></description><guid isPermaLink="false">115493</guid><pubDate>Tue, 12 Apr 2022 17:47:31 +0000</pubDate></item><item><title>Are cineva UFS?</title><link>https://rstforums.com/forum/topic/115487-are-cineva-ufs/</link><description><![CDATA[<p>
	Are cineva de vanzare UFS3 functional? sau UFS3turbo de la sarasoft?
</p>

<p>
	 
</p>

<p>
	Multumesc!
</p>
]]></description><guid isPermaLink="false">115487</guid><pubDate>Tue, 05 Apr 2022 22:43:48 +0000</pubDate></item><item><title>Removing a RAT from phone</title><link>https://rstforums.com/forum/topic/115359-removing-a-rat-from-phone/</link><description><![CDATA[<p>
	My phone has a RAT on it I'm sure as I'm talking about it my phone automatically connects to a site that i was saying had something to do with the I installation. Playing with me. How do I get it off. Send me a link of where to find out please
</p>
]]></description><guid isPermaLink="false">115359</guid><pubDate>Wed, 16 Feb 2022 01:41:25 +0000</pubDate></item><item><title>How to detect IMSI catchers</title><link>https://rstforums.com/forum/topic/115437-how-to-detect-imsi-catchers/</link><description><![CDATA[
	<div>
		<div>
			<h1>
				How to detect IMSI catchers
			</h1>
			 

			<h3>
				Defending against the most effective mobile attacks.
			</h3>
		</div>
	</div>


<div>
	<div>
		<div>
			<div>
				
					<ol>
						<li>
							<a href="https://armadillophone.com/" rel="external nofollow">HOME</a>
						</li>
						<li>
							<a href="https://armadillophone.com/blog" rel="external nofollow">BLOG</a>
						</li>
						<li>
							HOW TO DETECT IMSI CATCHERS
						</li>
					</ol>
				

				
					<p>
						IMSI catchers are one of the most effective surveillance techniques of all time. They’re used by police, governments and criminals to spy on victim’s phones. This spy tech is rarely deployed with a warrant. Western governments buy commercial products from US companies like the “Stingray” from Harris Corp. Criminals can also buy IMSI catchers, from unregulated online Chinese and Israeli vendors. These IMSI catchers have been used for <a href="https://www.techdirt.com/2015/08/14/israeli-made-stingray-device-found-hands-south-african-businessmen/" rel="external nofollow">corporate espionage</a> and blackmail. They’ve been found at <a href="https://www.cbc.ca/news/politics/imsi-cellphones-spying-ottawa-1.4050049" rel="external nofollow">embassies</a>, <a href="https://www.cbc.ca/news/canada/montreal/trudeau-airport-spying-1.4055803" rel="external nofollow">airports</a>, <a href="https://www.computerweekly.com/news/252485535/Police-secrecy-over-IMSI-catcher-mass-surveillance-of-mobile-phones" rel="external nofollow">political protests</a> and <a href="https://www.wired.com/2016/01/govs-plan-keep-super-bowl-safe-massive-surveillance/" rel="external nofollow">sports events</a>.
					</p>

					<p>
						IMSI catchers work by intercepting the traffic from all phones in an area. Operators can track a victim’s location, read their SMS, listen to phone calls and intercept data. An attacker can target thousands of devices. IMSI catchers can be mounted on people, cars or airplanes that can spy on entire cities at once.
					</p>

					<p>
						Apple and Google seem unwilling to help their users against IMSI catchers. However, if you have the right tools you can at least catch them spying on you.
					</p>

					<p>
						<img alt="imsi_catchers_blackfin.PNG" src="https://armadillophone.com/assets/images/blog/imsi_catchers_blackfin.PNG" />The “BlackFin” IMSI catcher from <a href="https://theintercept.com/document/2015/12/17/government-cellphone-surveillance-catalogue/" rel="external nofollow">leaked NSA catalogues.</a>
					</p>

					<hr />
					<h2>
						Radio Sentinel
					</h2>

					<p>
						<a href="https://armadillophone.com/about#applications" rel="external nofollow">Radio Sentinel</a> is an app that’s included with <a href="https://armadillophone.com/" rel="external nofollow">Armadillo Phone</a>. It’s capable of detecting cellular attacks over 2G, 3G, 4G and 5G. Besides IMSI catchers, Radio Sentinel can also detect silent SMS and some SS7 attacks.
					</p>

					<p>
						It works offline, without needing to upload data to a third-party server. Radio Sentinel requires extensive modifications to Android, so unfortunately it can’t easily be ported to other devices.
					</p>

					<p>
						Radio Sentinel will trigger a notification when a warning is detected. If that attack is high severity, you will automatically be disconnected from the cellular network. By default, while Radio Sentinel is active only 4G and 5G networks are allowed. This is to prevent “downgrade attacks”, caused when an IMSI catcher forces the victim to use an older or weaker network so it can be attacked.
					</p>

					<p>
						Radio Sentinel has a wide range of warnings to detect different attacks. This includes warnings about incorrect frequencies, unknown networks, frequent location updates, empty paging requests, TAU rejects, silent SMS, cell reselect offsets and other behaviours that indicate a cellular attack. Radio Sentinel was tested extensively in Vancouver during development. It has been tested by early adopters against real attack equipment successfully. Now that it’s been released, we are continuing to improve it using the bug reports customers send us. We’re in the process of arranging a formal third-party audit to test Radio Sentinel against more attack equipment. If you have an IMSI catcher and would like to attack an Armadillo Phone, please <a href="https://armadillophone.com/contact" rel="external nofollow">contact us</a>.
					</p>

					<hr />
					<h2>
						Phone apps
					</h2>

					<p>
						There are apps you can download that claim to detect IMSI catchers. These include “Android IMSI-Catcher Detector”, “Cell Spy Catcher”, “Darshak”, “SnoopSnitch” and others. Many are fake or <a href="https://github.com/CellularPrivacy/Android-IMSI-Catcher-Detector" rel="external nofollow">useless</a>. Some can detect IMSI catchers, however there are caveats. Most importantly, these apps can’t work on a normal phone. Apple and Google have restricted access to radio information that’s needed to detect attacks. To bypass this, these detection apps require a rooted phone, which weakens security protections. This means your phone is more vulnerable to hackers.
					</p>

					<p>
						Every app we tested had at least two of the following problems:
					</p>

					<ul>
						<li>
							Can’t detect the attacks they claim to
						</li>
						<li>
							Only detect attacks on one type of network ( i.e: only 3G and not 4G )
						</li>
						<li>
							Only detect one type of attack ( i.e: only silent SMS )
						</li>
						<li>
							Very old and don’t work on modern versions of Android
						</li>
						<li>
							Generates constant false positives, making them impractical
						</li>
						<li>
							Rely on crowdsourced data, which can be easily compromised
						</li>
						<li>
							Uploads data to a third-party server
						</li>
						<li>
							Only runs on a specific brand and model of phone
						</li>
						<li>
							Required a rooted phone ( less security )
						</li>
					</ul>

					<p>
						<a href="https://opensource.srlabs.de/projects/snoopsnitch" rel="external nofollow">SnoopSnitch</a> is one of the best apps… but that’s not saying much. It’s nearly a decade old, requires root, and only works on ancient devices like the Nexus 5X. SnoopSnitch also requires an internet connection to their server. This means you could track people who are using SnoopSnitch. Although some of the uploaded data is anonymized, there is still lots of sensitive data like build properties and radio infromation being sent. These problems could open you up to new privacy and security concerns besides IMSI catchers.
					</p>

					<hr />
					<h2>
						First Point
					</h2>

					<p>
						<a href="https://www.firstpoint-mg.com/imsi-catcher-protection/" rel="external nofollow">FirstPoint</a> is a company based in Israel that sells special SIM cards that can be inserted into any device. They developed an applet on the SIM that sends information over to their backend network. This information from the device combined with their backend infrastructure allows them to detect IMSI catchers. Although their heuristics appear to be great, the approach uploads a lot of sensitive data to FirstPoint’s servers, which could be problematic for organizations that want to control their own data.
					</p>

					<hr />
					<h2>
						Crocodile Hunter
					</h2>

					<p>
						<a href="https://github.com/EFForg/crocodilehunter" rel="external nofollow">Crocodile Hunter</a> is a tool developed by the <a href="https://www.eff.org/pages/crocodile-hunter" rel="external nofollow">EFF</a> to detect IMSI catchers. It requires an SDR ( software defined radio ) along with a dedicated Linux laptop or Raspberry Pi. Crocodile Hunter is a relatively simple project. It first gets the GPS location, then looks up cell tower IDs from the same location in the crowdsourced website <a href="https://wigle.net/" rel="external nofollow">WiGLE</a>. WiGLE uses data uploaded by ordinary people. It compares the cell towers from WiGLE to the nearby cell towers and sees if they match. If there is a nearby tower that is not in WiGLE, it detects it as a potential IMSI catcher.
					</p>

					<p>
						Unfortunately Crocodile Hunter has many flaws:
					</p>

					<ul>
						<li>
							It relies on WiGLE data which can be easily compromised. Attackers could simply upload their malicious tower ID to WiGLE’s database. They could also search WiGLE for an existing tower ID in the same location and use that instead.
						</li>
						<li>
							Average people can’t use it. It requires expert knowledge and assembling electronics.
						</li>
						<li>
							Its bulky and impractical. You could probably fit this in a backpack but not your pocket ( and definitely not on an airplane, unless you want to be cavity searched ).
						</li>
						<li>
							It sends the user’s GPS location to WiGLE
						</li>
					</ul>

					<hr />
					<h2>
						The future of IMSI catchers
					</h2>

					<p>
						<img alt="imsi_catchers_drt.PNG" src="https://armadillophone.com/assets/images/blog/imsi_catchers_drt.PNG" />A popular IMSI catcher capable of monitoring 10,000 people at once.
					</p>

					<p>
						You cannot truly “prevent” an attack, only react to it. This is because IMSI catchers exploit vulnerabilities at the protocol level. The best you can do is detect the attack afterwards and disconnect from the network. Although 4G and 5G have brought increased network security, IMSI catchers will continue to pose a threat for decades. Some researchers are already speculating on <a href="https://arxiv.org/pdf/2108.11861.pdf" rel="external nofollow">new security for 6G networks</a>.
					</p>

					<p>
						Detecting cellular attacks requires information that Google and Apple do not want to give to consumers. So solutions to mitigate the attacks are expensive, bulky or limited to a narrow selection of devices. There are many fake or ineffective solutions that rely on false positives to fool consumers The global cellular network is so diverse and anomalous to make many heuristic detection difficult, but not impossible. Deep investigation is required to actually track down if an IMSI catcher was ever used. Although boutique solutions can detect IMSI catchers it remains limited to specific devices or come with other drawbacks.
					</p>

					<p>
						Radio Sentinel is the most effective solution we are aware of for detecting IMSI catchers. It’s our hope eventually more solutions will emerge that become commonplace enough to deter IMSI catcher use.
					</p>

					<p>
						 
					</p>

					<p>
						Sursa: <a href="https://armadillophone.com/blog/how-to-detect-imsi-catchers" rel="external nofollow">https://armadillophone.com/blog/how-to-detect-imsi-catchers</a>
					</p>
				
			</div>
		</div>
	</div>
</div>
]]></description><guid isPermaLink="false">115437</guid><pubDate>Sun, 20 Mar 2022 12:48:30 +0000</pubDate></item></channel></rss>
