Package: glorifiedgrep
DOCSGlorified Grepglorifiedgrepis exactly what it sounds like... glorified grep.What motivated this project is seeing lots of tools for static analysis of applications specially Android applications. But most of these applications are all pretty much doing the same thing.The aim ofglorifiedgrepis to have a python module that allows the creation of such tools without the extra heavy lifting required. Underneath,glorifiedgrepusesripgrepto search for predefined patterns.Best effort has been given to document and reference all the methods. Refer to the docs for further documentation.What canglorifiedgrepbe used for?Analyze applications pythonicallyBuild tools for application analysis without the overhead of writing all of your own code.If you are not sure what a method is called, glorified grep offers a helper method to search for them.from glorifiedgrep import GlorifiedAndroid
g = GlorifiedAndroid('/path/to/apk')
print(g.search_methods('webview'))

['code_webview_content_access', 'code_webview_database', 'code_webview_debug_enabled', 'code_webview_file_access', 'code_webview_get_request', 'code_webview_js_enabled', 'code_webview_post_request', 'owasp_webview_cert_pinning', 'owasp_webview_loadurl', 'owasp_webview_native_function', 'owasp_webview_ssl_ignore']Hard requirementsglorifiedgrephas one hard dependency. ripgrep. It will attempt to loadrgfrom path, but this can be overwritten usingrg_pathparamter in the class. Refer to the docs for more info.InstallIf you are using Python 3.8,cffimight not install correctly, and you have to follow instructions on their site on how to solve that.PypiDeveloped using python 3.7It is recommended that you use virtualenv to install as some dependencies might break your other libs.pip3 install glorifiedgrepDev buildgit clone https://github.com/securisec/glorifiedgrep.git
cd glorifiedgrep
pip install .OSXlibmagicis required. Easiest way to install it isbrew install libmagicCoverageAndroidCurrently,glorifiedgrepsupports Android APK analysis OOB. It takes an apk file path, decompiles it using jadx, and then performs various analysis depending on the methods called.TheGlorifiedAndroidclass does support flexiblity.If you dont want to use the built in req of jadx, and want to use your pwn decompiler, then you can usefrom glorifiedgrep.android import CodeAnalysisThis class takessource_pathas a paramter. The source_path should include all of you decompiled java codes.It also supports the concept of projects. By default,GlorifiedAndroidclass will will setup all the output into/tmp/GlorifiedAndroid/directory. This can be overwritten using theoutput_dirparameter. In the future, if theapk_pathandoutput_dirparameters are both specified, then it will not try to decompile again.Android sub modulesglorifiedgrepoffers the following Android sub modules that can be used independantly of the mainGlorifiedAndroidclass. Invoke asfrom glorifiedgrep.android import ClassNameCertAnalysis: Perform analysis on an Android RSA signing cert. Takes the path to the cert as an argument.CodeAnalysis: Perform code analysis on a directory that contains the decompiled java classes. Takes the path to the source directory as an argument.ManifestAnalysis: Perform analysis on the Android application manifest file. Takes path to the manifest file as an argument.OtherAnalysis: Perform other source code related analysis.OWASPAnalysis: Perform source code analysis based on OWASP MASVS.There are a few other modules that are available which includesmalware,utilsandreact. Refer to the docs for more information.Usagefrom glorifiedgrep import GlorifiedAndroid
glory = GlorifiedAndroid('/path/to/apk')dotNetNot implemented yetJSNot implemented yetTested onUbuntuOSXDoes not work properly onWindowsPull requestsAll pull requests must accompany test cases. If not, they will be rejected.