GithubHelp home page GithubHelp logo

alessandrodd / apk_api_key_extractor Goto Github PK

View Code? Open in Web Editor NEW
225.0 10.0 46.0 22.05 MB

Automatically extracts API Keys from APK files

License: Apache License 2.0

Python 92.76% Smali 6.56% Dockerfile 0.68%
api key apikey apk android mining python3 python

apk_api_key_extractor's Issues

No module named 'string_classifier'

I installed all requirements but I still get this errors always when I try to run the script
this is the error

Traceback (most recent call last):
File "main.py", line 17, in
import apk_analyzer
File "/media/mahmoud/MyFiles/Programming/Android/apks/apk_api_key_extractor-master/apk_analyzer.py", line 9, in
import string_classifier
ModuleNotFoundError: No module named 'string_classifier'

I tried to install 'string_classifier' by this command

sudo pip3 install string_classifier

But I get this error

Collecting string_classifier
Could not find a version that satisfies the requirement string_classifier (from versions: )
No matching distribution found for string_classifier

Anyone has a solution?

Support python 3.12

Module "imp" has been removed in python 3.12 in favour of importlib

ModuleNotFoundError: No module named 'imp'

If you're okay with it I can take a look

running error

python3 main.py
Traceback (most recent call last):
File "main.py", line 12, in
from mongodb_dump import MongoDBDump
File "/home/mru/apk_api_key_extractor/mongodb_dump.py", line 12, in
import config
File "/home/mru/apk_api_key_extractor/config.py", line 11, in
with open(os.path.join(location, CONFIG_PATH), 'r') as ymlfile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/mru/apk_api_key_extractor/config.yml'

root ERROR Magic number does not match

Moving @shikhaverma2009 comment from #2 here.

Hi !
getting these errors would you be able to help ?

root ERROR Apktool:
S: WARNING: Could not write to (C:\Users\AppData\Local\apktool\framework), using C:\Users\dheeraj\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/player_seekbar_progress_disable.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/player_center_hint_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/player_seekbar_progress.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/player_seekbar_secondary.9.png". Renaming it to *.png.
S: Could not decode file, replacing by FALSE value: raw/keep.xml
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/play_slow_tips_background.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/play_slow_tips_background_click.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/player_seekbar_secondary_disable.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/player_seekbar_background.9.png". Renaming it to *.png.

07-24 10:24 root ERROR Magic number does not match
{'name': 'v0', 'value': '115_{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/a/d', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/a/l', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '306d195ab748c753ac2701799d5a3129', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/database/CommonDB_Impl', 'method_name': 'b', 'in_array': False, 'parameter_of': 'Landroid/a/b/b/h.', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '4067d0eca511b41d17767aa24e30f671', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '4067d0eca511b41d17767aa24e30f671', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '18a469d5124057754188d669ea2ea941', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': 'f7c81df3ba970e4b4b661db3169b09f2', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '51a5eb6e85033f42271535aad119a2f4', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': 'e600ec04b1c20ee84d830ed14af7cbfc', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': 'ee43c43dfd14e668188e2561178fb3f2', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '3fad024f2dcbe3ee693c96f350f8e376', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': '339b464f54e1aa211b968bfda89a70e5', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/biz/e/a', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/util/HashMap.put', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'a', 'value': 'b316230fc5008d27ad', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/common/a/e', 'method_name': '', 'in_array': False, 'parameter_of': None, 'string_type': 'TYPE_STATIC_VAR', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '\u9a8c\u8bc1\u7ed3\u679c\uff1asize\u5c0f\u4e8e\u9600\u503c', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/i/ak', 'method_name': 'a', 'in_array': False, 'parameter_of': 'Lcom/mobile/indiapp/utils/ag.b', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/i/am', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/i/ao', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/k/a', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/k/f', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/k/h', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v3', 'value': '\u4e0b\u8f7d\u4efb\u52a1 \u52a8\u4f5c\uff1a\u91cd\u542f\u4efb\u52a1-> \u975ewifi\uff0c\u6682\u4e0d\u91cd\u542f', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/manager/a$2', 'method_name': 'run', 'in_array': False, 'parameter_of': 'Ljava/lang/StringBuilder.append', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '9apps \u5904\u4e8e\u524d\u53f0 \u6682\u505c \u4e0b\u8f7d\u7ebf\u7a0b', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/manager/a$4', 'method_name': 'handleMessage', 'in_array': False, 'parameter_of': 'Lcom/mobile/indiapp/utils/ag.a', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v5', 'value': '\u672a\u83b7\u53d6\u5230 wifi \u81ea\u52a8\u66f4\u65b0\u914d\u7f6e\uff0c\u6682\u4e0d\u5f00\u59cb', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/manager/a', 'method_name': 'i', 'in_array': False, 'parameter_of': 'Lcom/mobile/indiapp/utils/ag.a', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '9Apps\u5728\u540e\u53f05mins\uff0c\u89e6\u53d1\u6346\u7ed1\u4e0b\u8f7d\u903b\u8f91', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/manager/g$1', 'method_name': 'run', 'in_array': False, 'parameter_of': 'Lcom/mobile/indiapp/utils/ag.b', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v5', 'value': '--\u6ee1\u8db3\u4e0b\u8f7d\u6761\u4ef6\uff0c\u8bf7\u6c42\u63a5\u53e3', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/manager/g', 'method_name': 'c', 'in_array': False, 'parameter_of': 'Ljava/lang/StringBuilder.append', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '36c411b7e4401f3afb132e85c30e2ea8', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/message/agoo/c', 'method_name': 'a', 'in_array': False, 'parameter_of': 'Lcom/taobao/accs/AccsClientConfig$Builder.setAppSecret', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v3', 'value': '36c411b7e4401f3afb132e85c30e2ea8', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/message/agoo/c', 'method_name': 'c', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': 'b268a05645a114f0ff4cce5af6ee18ab', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/p/a/a', 'method_name': 'a', 'in_array': False, 'parameter_of': 'Lcom/google/gson/JsonArray.toString', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '0614c6f98c0872c1fc0eb7f3cec0b925', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/p/a/a', 'method_name': 'b', 'in_array': False, 'parameter_of': 'Ljava/lang/System.currentTimeMillis', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': 'b268a05645a114f0ff4cce5af6ee18ab', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/p/a/a', 'method_name': 'c', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v1', 'value': '\u8d44\u6e90\u4fe1\u606f\u5bf9\u8c61\u4e3a\u7a7a\uff0c\u653e\u5f03\u4e0b\u8f7d', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/story/c/a', 'method_name': 'a', 'in_array': False, 'parameter_of': 'Lcom/mobile/indiapp/utils/ag.a', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v2', 'value': 'aabcff5158b30a848ceed70e9f7a7978', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/track/database/TrackInfoDatabase_Impl', 'method_name': 'b', 'in_array': False, 'parameter_of': 'Landroid/a/b/b/h.', 'string_type': 'TYPE_METHOD_PARAMETER', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'a', 'value': 'b316230fc5008d27ad', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/utils/t', 'method_name': '', 'in_array': False, 'parameter_of': None, 'string_type': 'TYPE_STATIC_VAR', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/widget/HomeSimpleTabLayout', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'v0', 'value': '115
{\u5165\u53e3ID}{\u4f4d\u7f6e}{\u8d44\u6e90\u6a21\u5757}_0', 'source': 'TYPE_LOCAL_VAR', 'class_name': 'Lcom/mobile/indiapp/widget/HomeTabLayout', 'method_name': 'a', 'in_array': False, 'parameter_of': None, 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}
{'name': 'libppapkpatchso.so', 'value': 'Z6getZFFP13_CDFHLISTHeadiPPcS1', 'source': 'TYPE_LIB_STRING', 'package': 'com.mobile.indiapp', 'versionCode': 175, 'versionName': '3.3.4.900'}

Originally posted by @shikhaverma2009 in #2 (comment)

Error while running Main.py

File "C:\Users\muham\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\Users\muham\AppData\Local\Programs\Python\Python36-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "api_key_detector_main
.py", line 19, in
from dataset_plotter import generate_3d_scatterplot
File "api_key_detector\dataset_plotter.py", line 5, in
from string_classifier import generate_training_set
File "api_key_detector\string_classifier.py", line 6, in
from sklearn.neural_network import MLPClassifier
File "C:\Users\muham\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn_init
.py", line 134, in
from .base import clone
File "C:\Users\muham\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\base.py", line 11, in
from scipy import sparse

TypeError: load() missing 1 required positional argument: 'Loader'

➜  apk_api_key_extractor git:(master) ✗ python main.py --analyze-apk temp/example.apk
Traceback (most recent call last):
  File "apk_api_key_extractor/main.py", line 25, in <module>
    import apk_analyzer
  File "apk_api_key_extractor/apk_analyzer.py", line 9, in <module>
    from api_key_detector import string_classifier
  File "apk_api_key_extractor/api_key_detector/string_classifier.py", line 10, in <module>
    from .gibberish_detector.gibberish_singleton import gib_detector
  File "apk_api_key_extractor/api_key_detector/gibberish_detector/gibberish_singleton.py", line 7, in <module>
    from api_key_detector.gibberish_detector import config
  File "apk_api_key_extractor/api_key_detector/gibberish_detector/config.py", line 12, in <module>
    cfg = yaml.load(ymlfile)
          ^^^^^^^^^^^^^^^^^^
TypeError: load() missing 1 required positional argument: 'Loader'

TypeError: load() missing 1 required positional argument: 'Loader'

docker run -it apk_key_extractor:latest

Traceback (most recent call last):
  File "/apk_api_key_extractor/main.py", line 25, in <module>
    import apk_analyzer
  File "/apk_api_key_extractor/apk_analyzer.py", line 9, in <module>
    from api_key_detector import string_classifier
  File "/apk_api_key_extractor/api_key_detector/string_classifier.py", line 10, in <module>
    from .gibberish_detector.gibberish_singleton import gib_detector
  File "/apk_api_key_extractor/api_key_detector/gibberish_detector/gibberish_singleton.py", line 7, in <module>
    from api_key_detector.gibberish_detector import config
  File "/apk_api_key_extractor/api_key_detector/gibberish_detector/config.py", line 12, in <module>
    cfg = yaml.load(ymlfile)
TypeError: load() missing 1 required positional argument: 'Loader'

i cant install

what version of python need to install program requirements???!!!

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.