mirror of
https://github.com/androguard/androguard.git
synced 2024-11-23 05:00:11 +00:00
Updated Home (markdown)
parent
f4d4ce66ee
commit
0ed1093f88
146
Home.md
146
Home.md
@ -25,81 +25,137 @@ or the same thing using pip and the GitHub URL of the project:
|
||||
pip install git+https://github.com/androguard/androguard
|
||||
~~~~
|
||||
|
||||
### Androguard is now available to be used as a CLI and as a library.
|
||||
|
||||
|
||||
You can now directly start to play with some APK !!
|
||||
|
||||
```
|
||||
python3 cli.py apkid download-eded3bc3451011237ec5cfba1f723c41e6d46cfed5124ffd4659c8895b88e62f.apk
|
||||
|
||||
2022-07-20 15:51:31.132 | INFO | androguard.core.axml:__init__:371 - AXMLParser
|
||||
{
|
||||
"download-eded3bc3451011237ec5cfba1f723c41e6d46cfed5124ffd4659c8895b88e62f.apk": [
|
||||
"it.toscana.regione.smartsst",
|
||||
"36010",
|
||||
"3.0.6"
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
All events are saved in the file 'androguard.db' which is basically a sqlite db (easily readable with https://sqlitebrowser.org/). There is 3 tables:
|
||||
### Sessions
|
||||
All events are saved in the file 'androguard.db' which is basically a sqlite db (easily readable with https://sqlitebrowser.org/). There are 3 tables:
|
||||
* information (related to all APK/DEX/... analyzed during a session)
|
||||
* session (unique key to identify a particular session done)
|
||||
* pentest (events from frida saved)
|
||||
|
||||
Please note that the sessions are work in progress!
|
||||
|
||||
|
||||
## Pypi (TBD)
|
||||
# CLI
|
||||
The CLI serves as the primary and easiest way for interacting with Androguard.
|
||||
Upon installing androguard with any of the methods shown above, the tool should be available in your path as `androguard`
|
||||
|
||||
~~~~
|
||||
Usage: androguard [OPTIONS] COMMAND [ARGS]...
|
||||
|
||||
Androguard is a full Python tool to reverse Android Applications.
|
||||
|
||||
Options:
|
||||
--version Show the version and exit.
|
||||
--verbose, --debug Print more
|
||||
--help Show this message and exit.
|
||||
|
||||
Commands:
|
||||
analyze Open a IPython Shell and start reverse engineering.
|
||||
apkid Return the packageName/versionCode/versionName per APK as...
|
||||
arsc Decode resources.arsc either directly from a given file or...
|
||||
axml Parse the AndroidManifest.xml.
|
||||
cg Create a call graph based on the data of Analysis and...
|
||||
decompile Decompile an APK and create Control Flow Graphs.
|
||||
disassemble Disassemble Dalvik Code with size SIZE starting from an...
|
||||
dtrace Start dynamically an installed APK on the phone and start...
|
||||
dump Start and dump dynamically an installed APK on the phone
|
||||
sign Return the fingerprint(s) of all certificates inside an APK.
|
||||
trace Push an APK on the phone and start to trace all...
|
||||
|
||||
~~~~
|
||||
|
||||
The following sections have some basic examples of the available options:
|
||||
|
||||
|
||||
# CLI Commands
|
||||
|
||||
The cli.py is the main and quickest entry points to play with Androguard. This tool is divided in different components.
|
||||
|
||||
```
|
||||
python cli.py OPTIONS COMMAND OPTIONS
|
||||
```
|
||||
|
||||
## analyze
|
||||
|
||||
The 'analyze' command will directly bring you into the IPython session and provide some analyzed objects.
|
||||
The 'analyze' command opens an IPython session and provides an interactive way to explore the capabilities of androguard:
|
||||
~~~~
|
||||
# androguard analyze minimal.apk
|
||||
>>> filename
|
||||
minimal.apk
|
||||
>>> a
|
||||
<androguard.core.apk.APK object at 0x7f9ac182f730>
|
||||
>>> d
|
||||
[<androguard.core.dex.DEX object at 0x7f9ac18a4cd0>]
|
||||
>>> dx
|
||||
<analysis.Analysis VMs: 1, Classes: 3, Methods: 7, Strings: 1>
|
||||
|
||||
```
|
||||
python cli.py analyze test.apk
|
||||
```
|
||||
Androguard version 4.0.2 started
|
||||
~~~~
|
||||
|
||||
## apkid
|
||||
Return the packageName/versionCode/versionName per APK:
|
||||
~~~~
|
||||
# androguard apkid minimal.apk
|
||||
{
|
||||
"erev0s_minimal.apk": [
|
||||
"com.erev0s.minimal",
|
||||
"1",
|
||||
"1.0"
|
||||
]
|
||||
}
|
||||
~~~~
|
||||
|
||||
## arsc
|
||||
Decode resources either directly from a given file or from an APK:
|
||||
~~~~
|
||||
# androguard arsc minimal.apk
|
||||
<resources>
|
||||
<public type="drawable" name="$ic_launcher_foreground__0" id="0x7f010000"/>
|
||||
<public type="drawable" name="ic_launcher_background" id="0x7f010001"/>
|
||||
[...]
|
||||
~~~~
|
||||
|
||||
## axml
|
||||
Parse the AndroidManifest.xml:
|
||||
~~~~
|
||||
androguard axml minimal.apk
|
||||
<manifest xmlns:android=......
|
||||
~~~~
|
||||
|
||||
## cg
|
||||
The resurrected callgraph option that allows to create a call graph based on the data available from Analysis:
|
||||
~~~~
|
||||
# androguard cg minimal.apk
|
||||
> creates a callgraph.gml
|
||||
~~~~
|
||||
|
||||
## decompile
|
||||
Decompile an APK and create Control Flow Graphs. Note that you might need to install `graphviz` in your system for the output.
|
||||
~~~~
|
||||
# androguard decompile minimal.apk -o test_decompile -f png
|
||||
Dump information minimal.apk in test_decompile
|
||||
Create directory test_decompile
|
||||
Decompilation ... End
|
||||
Dump Lcom/erev0s/minimal/MainActivity; <init> ()V ... png ... source codes ... bytecodes ...
|
||||
Dump Lcom/erev0s/minimal/MainActivity; onCreate (Landroid/os/Bundle;)V ... png ... bytecodes ...
|
||||
~~~~
|
||||
|
||||
## disassemble
|
||||
|
||||
## strace
|
||||
|
||||
The 'strace' command will directly analyze the provided APK, install it on the default connected phone and run it and start to trace all syscalls.
|
||||
|
||||
```
|
||||
python3 cli.py strace test.apk
|
||||
```
|
||||
Disassemble Dalvik Code with size SIZE starting from an offset
|
||||
|
||||
## trace
|
||||
|
||||
The 'trace' command will directly analyze the provided APK, install it on the default connected phone and run it and start to trace all events specified in the modules list.
|
||||
Push an APK on the phone and start to trace all interesting methods from the modules list
|
||||
~~~~
|
||||
androguard trace test.APK -m "ipc/*" -m "webviews/*" -m "modules/**"
|
||||
~~~~
|
||||
|
||||
```
|
||||
python3 cli.py trace test.apk -m "androguard/pentest/modules/**"
|
||||
```
|
||||
## dtrace
|
||||
|
||||
The list of modules via the `-m` option is using glob module so you can use any recursive directory. You can also specify multiples location like:
|
||||
```
|
||||
-m "androguard/pentest/modules/**" -m "MY_DIRECTORY/**" -m "ANOTHER_DIRECTORY/test.js"
|
||||
```
|
||||
Start dynamically an installed APK on the phone and start to trace all interesting methods from the modules list
|
||||
~~~~
|
||||
androguard dtrace package_name -m "ipc/*" -m "webviews/*" -m "modules/**"
|
||||
~~~~
|
||||
|
||||
# Developpers
|
||||
|
||||
|
||||
|
||||
# Library (TBD)
|
||||
|
||||
## APK
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user