Coder Social home page Coder Social logo

Support scanning AAR/JAR about apkid HOT 8 OPEN

ajinabraham avatar ajinabraham commented on May 23, 2024 1
Support scanning AAR/JAR

from apkid.

Comments (8)

ajinabraham avatar ajinabraham commented on May 23, 2024 1

If APKiD does the scanning only at DEX level, it makes sense to not support additional format out of the box.

However, here is an example of missed detection from a converted DEX using d8.

(venv-py3.10) ➜  ./d8 --release MTestApp-1.0.0-Android-release-r8.jar
(venv-py3.10) ➜   ls classes.dex 
classes.dex
(venv-py3.10) ➜ apkid classes.dex 
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io
[*] classes.dex
 |-> compiler : unknown (please file detection issue!)
(venv-py3.10) ➜  ./d8 --release MTestApp-1.0.0-Android-release-r8.aar 
(venv-py3.10) ➜  apkid classes.dex                                                         
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io
[*] classes.dex
 |-> compiler : unknown (please file detection issue!)

from apkid.

strazzere avatar strazzere commented on May 23, 2024

from apkid.

ajinabraham avatar ajinabraham commented on May 23, 2024

Trying to ID AAR/JAR just like we do on DEX or APK. I did the DEX conversion to see if APKiD can work with the converted DEX format.

(venv-py3.10) ➜  testfiles apkid MTestApp-1.0.0-Android-release-r8.apk 
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io

[*] MTestApp-1.0.0-Android-release-r8.apk!classes.dex
 |-> anti_vm : Build.FINGERPRINT check, Build.HARDWARE check, Build.MANUFACTURER check, Build.MODEL check, Build.PRODUCT check, possible Build.SERIAL check
 |-> compiler : r8
(venv-py3.10) ➜  testfiles apkid MTestApp-1.0.0-Android-release-r8.aar
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io
(venv-py3.10) ➜  testfiles apkid MTestApp-1.0.0-Android-release-r8.jar 
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io

All these binaries share pretty much same code and compiler but are built differently as APK, JAR and AAR.

from apkid.

strazzere avatar strazzere commented on May 23, 2024

from apkid.

strazzere avatar strazzere commented on May 23, 2024

from apkid.

enovella avatar enovella commented on May 23, 2024

If APKiD does the scanning only at DEX level, it makes sense to not support additional format out of the box.

However, here is an example of missed detection from a converted DEX using d8.

(venv-py3.10) ➜  ./d8 --release MTestApp-1.0.0-Android-release-r8.jar
(venv-py3.10) ➜   ls classes.dex 
classes.dex
(venv-py3.10) ➜ apkid classes.dex 
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io
[*] classes.dex
 |-> compiler : unknown (please file detection issue!)
(venv-py3.10) ➜  ./d8 --release MTestApp-1.0.0-Android-release-r8.aar 
(venv-py3.10) ➜  apkid classes.dex                                                         
[+] APKiD 2.1.5 :: from RedNaga :: rednaga.io
[*] classes.dex
 |-> compiler : unknown (please file detection issue!)

Hi @ajinabraham,

It would be great to add this compiler in APKiD. I don't think I will have the time to work on this in the near future, but maybe someone else wants to dig into it. Thanks for opening the ticket!

Best,
Edu

from apkid.

dustty0 avatar dustty0 commented on May 23, 2024

R8 (and / or d8, L8) compiler leaves string artifacts inside dex.

eg.

~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":24,"pg-map-id":"5820188","r8-mode":"full","version":"8.0.46"}

Such artifacts can be retrieved by using r8's ExtractMarker feature.

Refs:

Matching signatures like ~~R8 can detect newer dex compilers (I think).

from apkid.

CalebFenton avatar CalebFenton commented on May 23, 2024

We already do something like this.

https://github.com/rednaga/APKiD/blob/master/apkid/rules/dex/compilers.yara#L178

Anyone want to take a stab at it? I may have time next week.

from apkid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.