Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
Updated links to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixEditor committed Mar 25, 2024
1 parent 360d5b9 commit 3f42bd9
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MAST-F is a comprehensive Mobile Application Security Testing Framework designed
## Documentation & Help

The documentation for MAST-F is available on [Github-Pages](https://mastframework.github.io/MAST-F/). It contains detailed information about the framework, its usage, configuration options, and various testing techniques. We highly recommend referring to the documentation to get started with MAST-F. Please visit the [Discussions](https://github.com/orgs/MAST-Framework/discussions) tab to ask questions or get help.
The documentation for MAST-F is available on [Github-Pages](https://mastframework.github.io/ mastf/). It contains detailed information about the framework, its usage, configuration options, and various testing techniques. We highly recommend referring to the documentation to get started with MAST-F. Please visit the [Discussions](https://github.com/orgs/MAST-Framework/discussions) tab to ask questions or get help.

## Key Features

Expand Down Expand Up @@ -53,7 +53,7 @@ The above diagram provides an overview of the MAST-F project architecture. It sh

## Setup

To set up MAST-F, please follow the instructions provided in the documentation on [Github Pages](https://mastframework.github.io/MAST-F/). The setup process involves configuring the required dependencies and performing necessary configurations before running the containers. You can find the setup commands and detailed guidelines on the documentation page. To simply run the containers, just execute
To set up MAST-F, please follow the instructions provided in the documentation on [Github Pages](https://mastframework.github.io/ mastf/). The setup process involves configuring the required dependencies and performing necessary configurations before running the containers. You can find the setup commands and detailed guidelines on the documentation page. To simply run the containers, just execute
```bash
./bin/webui.sh [-d]
```
Expand Down
2 changes: 1 addition & 1 deletion bin/webui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if [[ -z "${VIRTUAL_ENV}" ]]; then
exit 1
fi
else
printf "[+] python venv already activate or run without venv:\n @: ${VIRTUAL_ENV}\n"
printf "[+] python venv already active or run without venv:\n @: ${VIRTUAL_ENV}\n"
fi

cd "${install_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/, aborting...\e[0m\n" "${install_dir}"; exit 1; }
Expand Down
3 changes: 3 additions & 0 deletions mastf/MASTF/web/views/web_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ def post(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
if result.status_code == 409:
messages.error(request, "Username already present or password too short")

if result.status_code == 405:
messages.error(request, "Registration not allowed")

return redirect("User-Registration")


Expand Down
20 changes: 20 additions & 0 deletions mastf/android/tools/apktool.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
to extract sources or resources separately or extract an APK file
completely.
"""
import os
import subprocess
import apkInspector


def extractrsc(apk_path: str, dest_path: str, apktool_path: str = "apktool") -> None:
Expand Down Expand Up @@ -79,3 +81,21 @@ def run_apktool_decode(
except subprocess.CalledProcessError as err:
# Raise a RuntimeError if apktool fails to decode the APK file
raise RuntimeError(err.stdout.decode()) from err


def apkinspector_extract(apk: apkInspector.headers.ZipEntry, dest_path: str) -> None:
cd = apk.central_directory
lh = apk.local_headers
error = apkInspector.extract.extract_all_files_from_central_directory(
apk, cd, lh, dest_path
)
if error != 0:
raise RuntimeError(f"Failed to extract files from APK. error={error}")

# convert manifest file
manifest_file = os.path.join(dest_path, "AndroidManifest.xml")
with open(manifest_file, "rb") as f:
xml_data = f.read()

with open(manifest_file, "w", encoding="utf-8") as f:
f.write(apkInspector.axml.get_manifest(xml_data))
8 changes: 6 additions & 2 deletions mastf/core/files/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def apk_handler(src_path: pathlib.Path, dest_dir: pathlib.Path, settings, **kwar
if observer:
observer.update("Extracting APK file with apktool...")

# TODO: move to apkInspector as apktool may not be able to extract
# all resources
apktool.extractrsc(str(src_path), str(contents), settings.APKTOOL)
smali_dir = src / "smali"
smali_dir.mkdir(exist_ok=True)
Expand All @@ -218,8 +220,10 @@ def apk_handler(src_path: pathlib.Path, dest_dir: pathlib.Path, settings, **kwar
dex_files = list(contents.glob(r"*/**/*.dex")) + list(contents.glob(r"*.dex"))
for path in dex_files:
logger.debug(
"Decompiling classes with %s: classes=%s -> to=%s"
% (tool, str(path), str(smali_dir))
"Decompiling classes with %s: classes=%s -> to=%s",
tool,
str(path),
str(smali_dir),
)
if observer:
observer.update("Decompiling %s with %s to /src/smali", path.name, tool)
Expand Down
9 changes: 4 additions & 5 deletions mastf/core/files/tpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from typing import Generator, Any


def parse_name(full_name: str) -> tuple[str, str]:
if not full_name:
return None, None
Expand All @@ -31,15 +30,15 @@ def parse_name(full_name: str) -> tuple[str, str]:
gid, aid = full_name.split("::")
return (gid, aid)

elif ":" in full_name: # group id : artifact id
if ":" in full_name: # group id : artifact id
gid, aid = full_name.split(":")
return (gid, aid)

elif "-" in full_name: # artifact id
if "-" in full_name: # artifact id
return None, full_name

else: # only groupId
return full_name, None
# only groupId
return full_name, None


class TPL:
Expand Down
2 changes: 1 addition & 1 deletion mastf/templates/auth/sign-in.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="page-body">
<div class="container container-tight py-4 align-self-center">
<div class="text-center mb-4">
<a href="." class="navbar-brand navbar-brand-autodark">
<a href="." class="navbar-brand">
<img src="{% static 'static/new-logo-base.svg' %}" height="64" alt="">
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion mastf/templates/auth/sign-up.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% block page_body %}
<div class="container container-tight py-4">
<div class="text-center mb-4">
<a href="." class="navbar-brand navbar-brand-autodark"><img src="{% static 'static/new-logo-base.svg' %}" height="64" alt=""></a>
<a href="." class="navbar-brand "><img src="{% static 'static/new-logo-base.svg' %}" height="64" alt=""></a>
</div>
<form class="card card-md" action="{% url 'User-Registration' %}" method="POST" autocomplete="off">
{% csrf_token %}
Expand Down
4 changes: 2 additions & 2 deletions mastf/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
<h1 class="navbar-brand d-none-navbar-horizontal pe-0 pe-md-3">
<a href="{% url 'Index' %}">
<!-- <img src="{% static "static/new-logo-base.svg"%}" width="110" height="32" alt="Tabler" class="navbar-brand-image"> -->
MAST-Framework
Expand Down Expand Up @@ -280,7 +280,7 @@ <h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-m
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" /><path d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7" /></svg>
</a>
</li>
<li class="list-inline-item"><a href="https://mastframework.github.io/MAST-F/" target="_blank" class="link-secondary">Documentation</a></li>
<li class="list-inline-item"><a href="https://mastframework.github.io/ mastf/" target="_blank" class="link-secondary">Documentation</a></li>
<li class="list-inline-item"><a href="{% url 'License' %}" class="link-secondary">License</a></li>
<li class="list-inline-item"><a href="https://github.com/MASTFramework/mastf" target="_blank" class="link-secondary" rel="noopener">Source code</a></li>

Expand Down
2 changes: 1 addition & 1 deletion mastf/templates/project/project-scanners.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<!-- Vertical navigation bar for each scanner -->
<div class="col-3 border-end">
<div class="nav flex-column nav-tabs text-center" role="tablist" aria-orientation="vertical">
<h1 class="navbar-brand navbar-brand-autodark d-none-navbar-vertical pe-0 pe-md-3 mb-2">
<h1 class="navbar-brand d-none-navbar-vertical pe-0 pe-md-3 mb-2">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-target-arrow" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"></path>
Expand Down
4 changes: 2 additions & 2 deletions mastf/templates/project/project-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h3 class="card-title">Project ID</h3>
</div>
<div class="card-footer">
<div class="row align-items-center">
<div class="col">Learn more about <a href="https://mastframework.github.io/MAST-F/api/utils/enum.html#mastf.MASTF.utils.enum.Visibility">Visibility Types</a></div>
<div class="col">Learn more about <a href="https://mastframework.github.io/ mastf/api/utils/enum.html#mastf.MASTF.utils.enum.Visibility">Visibility Types</a></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -199,7 +199,7 @@ <h3 class="card-title">Project ID</h3>
</div>
<div class="card-footer">
<div class="row align-items-center">
<div class="col">Learn more about <a href="https://mastframework.github.io/MAST-F/ref/models/base_models.html#mastf.MASTF.models.Team">Teams</a></div>
<div class="col">Learn more about <a href="https://mastframework.github.io/ mastf/ref/models/base_models.html#mastf.MASTF.models.Team">Teams</a></div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion mastf/templates/setup/wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="page page-center">
<div class="container container-tight py-4">
<div class="text-center mb-4">
<a href="." class="navbar-brand navbar-brand-autodark">
<a href="." class="navbar-brand ">
<img src="{% static 'static/new-logo-base.svg' %}" height="64" alt="">
</a>
</div>
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ lief==0.14.0
google_play_scraper==1.2.6
nibarchive==1.1.0
umbrella-py==0.0.3
caterpillar@git+https://github.com/MatrixEditor/caterpillar.git
caterpillar@git+https://github.com/MatrixEditor/caterpillar.git
apkInspector

0 comments on commit 3f42bd9

Please sign in to comment.