, 15 tweets, 3 min read Read on Twitter
Hey kids! Wanna research some shitty Atrient Android apps? Follow along with me, this is going to be fun. (1/?)
So it turns out Atrient has been creating and releasing shitty Android apps in their customers' names. After having a closer look, I realized that Atrient packaged their clients' private RSA keys into the aforementioned apps, most likely used for backend communications. (2/?)
First you find Atrient's client list (tip: it's on their website at atrient.com/about/client-l…) and look up Android apps released in their name. Download them using the tool `gplaycli', or pull the APKs off some sketchy-looking site online. (3/?)
Once you've downloaded the APK (`gplaycli -d name-of-app'), you do two things: First run `d2j-dex2jar com.vendor.package.apk' to convert Android .dex to Java .class. Then you extract the app using `apktool d com.vendor.package.apk'. (4/?)
`apktool' will create the `com.vendor.package' directory in your current directory. When you've done this, open the `com.vendor.package-dex2jar.jar' file d2j generated in the `jd-gui' program - it's a Java decompiler. (5/?)
With `jd-gui' purring nicely, hit Ctrl+Shift+S, check all the "Search For" boxes, and search for "PKCS12". It *should* come up with `NetworkManager.class', double click it and it'll take you to the matching code. (6/?)
You should either find the password in cleartext in a string nearby, or something like `paramContext.getString(2131492865);`. If you come across the number, open `R.class', Ctrl+F for it, and copy the variable identifier. (7/?)
Then look for it in the apktool directory, in `com.vendor.package/res/values/strings.xml' - the password should be there, in plaintext. (8/?)
Anyway, once you have the password, move to `com.vendor.package/assets', find the `.p12' files, and run `keytool -list -v -keystore <KEYSTORE_FILE> -storetype PKCS12 -storepass "<PASSWORD_HERE>"'. It'll spit out a bunch of data, including an encrypted RSA key at the top. (9/?)
Copy that key (with the header and footer) to a separate file, name it something like "thedomain.tld.key.enc", and run `openssl rsa -in domain.tld.key.enc -out domain.tld.key'. The password should be the same, and you'll have the decrypted key. (10/11)
Once you have the RSA private key, you could do something funky, like MitM-attacks or impersonating the server. Or whatever your heart desires! I suspect these keys are used for backend communications, as the crypto. fingerprints differ from the ones on the websites. (11/11)
POST SCRIPTUM: These apps were publicly released by Atrient, and with them, the casinos' private RSA keys. The decryption passwords were also shockingly easy to find, and to make matters worse, it turns out most of the certificates are wildcard DV certs.
CORRECTION: You can combine the keytool and openssl command into one: `openssl pkcs12 -in keystorefile.p12 -nodes -nocerts -out privatekey.pem'
Update: I archived all the Atrient applications, the originals as published on Google Play: duniel.no/atrient_apps/
Another update: I can confirm that the keys are used for backend comms.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Daniel Isaksen
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!