Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Dec 22, 2023
1 parent fdba0ac commit ce62751
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions mobsf/MalwareAnalyzer/views/android/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@
'android.permission.CALL_PHONE',
'android.permission.CHANGE_NETWORK_STATE',
'android.permission.CHANGE_WIFI_STATE',
'android.permission.DIAGNOSTIC',
'android.permission.FLASHLIGHT',
'android.permission.FORCE_STOP_PACKAGES',
'android.permission.FOREGROUND_SERVICE',
'android.permission.GET_ACCOUNTS_PRIVELEGED',
'android.permission.MODIFY_AUDIO_SETTINGS',
'android.permission.MOUNT_FORMAT_FILESYSTEMS',
'android.permission.PROCESS_OUTGOING_CALLS',
'android.permission.READ_CALENDAR',
'android.permission.PACKAGE_USAGE_STATS',
Expand Down
2 changes: 2 additions & 0 deletions mobsf/MobSF/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@
CVSS_SCORE_ENABLED = bool(os.getenv('MOBSF_CVSS_SCORE_ENABLED', ''))
# NIAP Scan
NIAP_ENABLED = os.getenv('MOBSF_NIAP_ENABLED', '')
# Permission to Code Mapping
PERM_MAPPING_ENABLED = os.getenv('MOBSF_PERM_MAPPING_ENABLED', '1')
# Dex 2 Smali Conversion
DEX2SMALI_ENABLED = os.getenv('MOBSF_DEX2SMALI_ENABLED', '1')
# Android Shared Object Binary Analysis
Expand Down
3 changes: 3 additions & 0 deletions mobsf/StaticAnalyzer/views/android/code_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from mobsf.MobSF.utils import (
filename_from_path,
get_android_src_dir,
settings_enabled,
)
from mobsf.StaticAnalyzer.views.common.shared_func import (
url_n_email_extract,
Expand All @@ -28,6 +29,8 @@
def get_perm_rules(perm_rules, android_permissions):
"""Get applicablepermission rules."""
try:
if not settings_enabled('PERM_MAPPING_ENABLED'):
return None
if not android_permissions:
return None
dynamic_rules = []
Expand Down
4 changes: 2 additions & 2 deletions mobsf/templates/static_analysis/android_binary_analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ <h5 class="description-header">{{ code_analysis.summary.suppressed }}</h5>
<strong>Top Malware Permissions</strong>
<span class="float-right"><b>{{ malware_permissions.top_malware_permissions | length}}</b>/{{malware_permissions.total_malware_permissions}}</span>
<div class="progress progress-sm">
<div class="progress-bar bg-danger" aria-valuemin="0" style="width: {{ malware_permissions.top_malware_permissions | length}}%;" aria-valuenow="{{ malware_permissions.top_malware_permissions | length}}" aria-valuemax="{{malware_permissions.total_malware_permissions}}"></div>
<div class="progress-bar bg-danger" aria-valuemin="0" style="width: {% widthratio malware_permissions.top_malware_permissions|length malware_permissions.total_malware_permissions 100 %}%;" aria-valuenow="{{ malware_permissions.top_malware_permissions | length}}" aria-valuemax="{{malware_permissions.total_malware_permissions}}"></div>
</div>
<span class="product-description">
{{ malware_permissions.top_malware_permissions | join:", "}}
Expand All @@ -1778,7 +1778,7 @@ <h5 class="description-header">{{ code_analysis.summary.suppressed }}</h5>
<strong>Other Common Permissions</strong>
<span class="float-right"><b>{{ malware_permissions.other_abused_permissions | length}}</b>/{{ malware_permissions.total_other_permissions}}</span>
<div class="progress progress-sm">
<div class="progress-bar bg-warning" aria-valuemin="0" style="width: {{ malware_permissions.other_abused_permissions | length}}%;" aria-valuenow="{{ malware_permissions.other_abused_permissions | length}}" aria-valuemax="{{ malware_permissions.total_other_permissions}}"></div>
<div class="progress-bar bg-warning" aria-valuemin="0" style="width: {% widthratio malware_permissions.other_abused_permissions|length malware_permissions.total_other_permissions 100 %}%;" aria-valuenow="{{ malware_permissions.other_abused_permissions | length}}" aria-valuemax="{{ malware_permissions.total_other_permissions}}"></div>
</div>
<span class="product-description">
{{ malware_permissions.other_abused_permissions | join:", "}}
Expand Down
4 changes: 2 additions & 2 deletions mobsf/templates/static_analysis/android_source_analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ <h5 class="description-header">{{ code_analysis.summary.suppressed }}</h5>
<strong>Top Malware Permissions</strong>
<span class="float-right"><b>{{ malware_permissions.top_malware_permissions | length}}</b>/{{malware_permissions.total_malware_permissions}}</span>
<div class="progress progress-sm">
<div class="progress-bar bg-danger" aria-valuemin="0" style="width: {{ malware_permissions.top_malware_permissions | length}}%;" aria-valuenow="{{ malware_permissions.top_malware_permissions | length}}" aria-valuemax="{{malware_permissions.total_malware_permissions}}"></div>
<div class="progress-bar bg-danger" aria-valuemin="0" style="width: {% widthratio malware_permissions.top_malware_permissions|length malware_permissions.total_malware_permissions 100 %}%;" aria-valuenow="{{ malware_permissions.top_malware_permissions | length}}" aria-valuemax="{{malware_permissions.total_malware_permissions}}"></div>
</div>
<span class="product-description">
{{ malware_permissions.top_malware_permissions | join:", "}}
Expand All @@ -1250,7 +1250,7 @@ <h5 class="description-header">{{ code_analysis.summary.suppressed }}</h5>
<strong>Other Common Permissions</strong>
<span class="float-right"><b>{{ malware_permissions.other_abused_permissions | length}}</b>/{{ malware_permissions.total_other_permissions}}</span>
<div class="progress progress-sm">
<div class="progress-bar bg-warning" aria-valuemin="0" style="width: {{ malware_permissions.other_abused_permissions | length}}%;" aria-valuenow="{{ malware_permissions.other_abused_permissions | length}}" aria-valuemax="{{ malware_permissions.total_other_permissions}}"></div>
<div class="progress-bar bg-warning" aria-valuemin="0" style="width: {% widthratio malware_permissions.other_abused_permissions|length malware_permissions.total_other_permissions 100 %}%;" aria-valuenow="{{ malware_permissions.other_abused_permissions | length}}" aria-valuemax="{{ malware_permissions.total_other_permissions}}"></div>
</div>
<span class="product-description">
{{ malware_permissions.other_abused_permissions | join:", "}}
Expand Down

0 comments on commit ce62751

Please sign in to comment.