Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTFIX: UI changes and warning on mobsf.live #2051

Merged
merged 2 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mobsf/MobSF/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

logger = logging.getLogger(__name__)

VERSION = '3.6.0'
VERSION = '3.6.1'
BANNER = """
__ __ _ ____ _____ _____ __
| \/ | ___ | |__/ ___|| ___|_ _|___ / / /_
Expand Down
1 change: 1 addition & 0 deletions mobsf/MobSF/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
re_path(r'^download/', home.download),
re_path(r'^download_scan/', home.download_apk),
re_path(r'^about$', home.about, name='about'),
re_path(r'^donate$', home.donate, name='donate'),
re_path(r'^api_docs$', home.api_docs, name='api_docs'),
re_path(r'^recent_scans/$', home.recent_scans, name='recent'),
re_path(r'^delete_scan/$', home.delete_scan),
Expand Down
10 changes: 10 additions & 0 deletions mobsf/MobSF/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ def about(request):
return render(request, template, context)


def donate(request):
"""Donate Route."""
context = {
'title': 'Donate',
'version': settings.MOBSF_VER,
}
template = 'general/donate.html'
return render(request, template, context)


def error(request):
"""Error Route."""
context = {
Expand Down
66 changes: 11 additions & 55 deletions mobsf/static/landing/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,64 +213,20 @@ div#textnode {
transition: font-size 175ms;
}
/* TOP NAV */
/* Add a black background color to the top navigation */
.topnav {
overflow: hidden;
background-color: #312f2f;
position: fixed;
top: 0;
width: 100%;
z-index: 1;
}

/* Style the links inside the navigation bar */
.topnav a {
float: left;
color: #a7a6a6;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 20px;
}

/* Change the color of links on hover */
.topnav a:hover {
color: #fff;
}

/* Centered section inside the top navigation */
.topnav-centered a {
float: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 999;
}

.topnav-centered a:hover {
background-color: #312f2f;
}

/* Right-aligned section inside the top navigation */
.topnav-right {
float: right;
}

/* Responsive navigation menu - display links on top of each other instead of next to each other (for mobile devices) */
@media screen and (max-width: 600px) {
.topnav a, .topnav-right {
float: none;
display: block;
@media (min-width: 768px) {
.navbar-brand.abs
{
position: absolute;
width: auto;
left: 50%;
transform: translateX(-50%);
text-align: center;
font-size: 20px;
}
}


.topnav-centered a {
position: relative;
top: 0;
left: 0;
transform: none;
}
}
/* PROGRESS BAR */

progress {
Expand Down
5 changes: 3 additions & 2 deletions mobsf/templates/base/base_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'recent' %}" class="nav-link">RECENT SCANS</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'home' %}" class="nav-link">STATIC ANALYZER</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'dynamic' %}" class="nav-link">DYNAMIC ANALYZER</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'api_docs' %}" class="nav-link">API DOCS</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="https://opensecurity.in/donate" class="nav-link">DONATE ♥</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'api_docs' %}" class="nav-link">REST API</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'donate' %}" class="nav-link">DONATE ♥</a></li>
<li class="nav-item d-none d-sm-inline-block"><a target="_blank" href="https://mobsf.github.io/docs/#/" class="nav-link">DOCS</a></li>
<li class="nav-item d-none d-sm-inline-block"><a href="{% url 'about' %}" class="nav-link">ABOUT</a></li>
</ul>

Expand Down
70 changes: 70 additions & 0 deletions mobsf/templates/general/donate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{% extends "base/base_layout.html" %}
{% block sidebar_option %}
sidebar-collapse
{% endblock %}
{% block content %}
<div class="content-wrapper">
<div class="content-header">
</div>
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h1>Donate to MobSF Project</h1>
<p class="lead">
You're Awesome! Thank you for your support ♥
</p>
<div class="row">

<div class="col-lg-6">

<div class="card">
<div class="card-header ui-sortable-handle" >
<h3 class="card-title">
Github Sponsors
</h3>
</div><!-- /.card-header -->
<div class="card-body">
<p style="text-align: center;">
Donate to MobSF project through Github Sponsors. Github will match the first $5000 in donations.
</br>
</br>
<iframe src="https://github.com/sponsors/ajinabraham/button" title="Sponsor ajinabraham" height="35" width="116" style="border: 0;"></iframe>
</p>
</div><!-- /.card-body -->
</div>
</div>
<div class="col-lg-6">
<div class="card">
<div class="card-header ui-sortable-handle" >
<h3 class="card-title">
Paypal Donations
</h3>
</div><!-- /.card-header -->
<div class="card-body">
<p style="text-align: center;">
You can also donate to MobSF project through PayPal.
</br>
</br>

<form style="text-align: center;" action="https://www.paypal.com/donate" method="post" target="_top">
<input type="hidden" name="business" value="BRZ59TKT48GPS" />
<input type="hidden" name="no_recurring" value="0" />
<input type="hidden" name="item_name" value="towards MobSF Project" />
<input type="hidden" name="currency_code" value="USD" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>

</p>
</div><!-- /.card-body -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
96 changes: 66 additions & 30 deletions mobsf/templates/general/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,47 @@
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>
<body>
<div class="topnav">
<!-- Centered link -->
<div class="topnav-centered">
<a>
<img src="{% static "img/mobsf_logo.png" %}" width="20%" height="20%"/>
</a>
</div>
<!-- Left-aligned links (default) -->
<a href="{% url 'recent' %}">RECENT SCANS</a>
<a href="{% url 'dynamic' %}">DYNAMIC ANALYZER</a>

<!-- Right-aligned links -->
<div class="topnav-right">
<a href="{% url 'api_docs' %}">API DOCS</a>
<a href="{% url 'about' %}">ABOUT</a>
<a>
<form action="/search" method="GET">
<input name="md5" type="text" class="form-control" placeholder="Search MD5">
</form>
</a>
</div>

<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand abs">
<img src="{% static "img/mobsf_logo.png" %}" width="20%" height="20%"/>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsingNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="collapsingNavbar">
<ul class="navbar-nav">
<li class="nav-item active">
<a data-toggle="collapse" class="nav-link" href="{% url 'recent' %}">RECENT</a>
</li>
<li class="nav-item">
<a data-toggle="collapse" class="nav-link" href="{% url 'dynamic' %}">DYNAMIC ANALYZER</a>
</li>
<li class="nav-item">
<a data-toggle="collapse" class="nav-link" href="{% url 'api_docs' %}">REST API</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" target="_blank" href="https://mobsf.github.io/docs/#/">DOCS</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'about' %}">ABOUT</a>
</li>
<li class="nav-item">
<a>
<form action="/search" method="GET">
<input name="md5" type="text" class="form-control" placeholder="Search MD5">
</form>
</a>
</li>
</ul>
</div>
</div>
<div class="site-wrapper">
</nav>

<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix">
Expand Down Expand Up @@ -71,7 +88,8 @@ <h5 id="status"></h5>


<div class="inner">
<h6> <a href="{% url 'recent' %}">RECENT SCANS</a> | <a href="{% url 'dynamic' %}">DYNAMIC ANALYZER</a> | <a href="{% url 'api_docs' %}">API DOCS</a> | <a href="https://opensecurity.in/donate">DONATE ♥</a> | <a href="{% url 'about' %}">ABOUT</a></h6>
<h6> <a href="{% url 'recent' %}">RECENT SCANS</a> | <a href="{% url 'dynamic' %}">DYNAMIC ANALYZER</a> | <a href="{% url 'api_docs' %}">REST API</a> | <a href="{% url 'donate' %}">DONATE ♥</a> | <a target="_blank"
href="https://mobsf.github.io/docs/#/">DOCS</a> | <a href="{% url 'about' %}">ABOUT</a></h6>
</br>
<p>&copy; {% now "Y" %} Mobile Security Framework - MobSF {{ version }}</p>
</div>
Expand All @@ -88,8 +106,10 @@ <h6> <a href="{% url 'recent' %}">RECENT SCANS</a> | <a href="{% url 'dynamic'

<script src="{% static "adminlte/plugins/jquery.min.js" %}"></script>
<script src="{% static "others/js/notify.min.js" %}"></script>
<!-- Bootstrap 4 -->
<script src="{% static "adminlte/plugins/bootstrap/bootstrap.bundle.min.js" %}"></script>
<script>

let warning = "This is a demo MobSF instance. Anything uploaded here will be publicly available. Do you want to continue?";
// Result View
function load_result(url){
hide_loader();
Expand Down Expand Up @@ -293,9 +313,16 @@ <h6> <a href="{% url 'recent' %}">RECENT SCANS</a> | <a href="{% url 'dynamic'
document.querySelector("#drop").style.visibility = "hidden";
document.querySelector("#drop").style.opacity = 0;
document.querySelector("#textnode").style.fontSize = "42px";
if(e.dataTransfer.files.length > 0)
{
handleFiles(e.dataTransfer.files);
if(e.dataTransfer.files.length > 0) {
if (document.location.host === 'mobsf.live'){
if (confirm(warning) == true) {
handleFiles(e.dataTransfer.files);
} else {
return;
}
} else {
handleFiles(e.dataTransfer.files);
}
}
});

Expand All @@ -306,11 +333,20 @@ <h6> <a href="{% url 'recent' %}">RECENT SCANS</a> | <a href="{% url 'dynamic'
if (_("uploadFile").files.length === 0) {
return;
}
_("uploadFile").style.display = "none";
var files = _("uploadFile").files;
handleFiles(files);
if (document.location.host === 'mobsf.live'){
if (confirm(warning) == true) {
_("uploadFile").style.display = "none";
handleFiles(files);
} else {
return;
}
} else {
_("uploadFile").style.display = "none";
handleFiles(files);
}
});
});
</script>
</body>
</html>
</html>
17 changes: 10 additions & 7 deletions mobsf/templates/general/recent.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,24 @@ <h3 class="box-title"><i class="fa fa-rocket"></i> Recent Scans</h3>
<tbody>
{% for e in entries %}
<tr>
<td align="center">
<td style="text-align: center;">
<img id="app_icon" src="/download/{{ e.MD5 }}-icon.png" onerror="this.src='{% static 'img/no_icon.png' %}'">
{% if e.PACKAGE_NAME %}
<br/><strong>{{ e.APP_NAME }} {% if e.VERSION_NAME %} - {{ e.VERSION_NAME }} {% endif %}</strong>
</br>{{ e.PACKAGE_NAME }}
<p> <a href="../appsec_dashboard/{{ e.MD5 }}/" class="btn btn-link btn-sm" role="button"><i class="fas fa-user-shield"></i> MobSF Scorecard</a></p>
<p> <a href="../appsec_dashboard/{{ e.MD5 }}/" class="btn btn-sm btn-outline-primary" role="button"><i class="fas fa-user-shield"></i> MobSF Scorecard</a></p>
<p><a class="btn btn-primary btn-sm" href="../{{ e.ANALYZER }}/?name={{e.FILE_NAME}}&amp;checksum={{e.MD5}}&amp;type={{e.SCAN_TYPE}}"><i class="fas fa-eye"></i> Static Report</a>
{% if '.apk' == e.FILE_NAME|slice:"-4:" or '.xapk' == e.FILE_NAME|slice:"-5:" or '.apks' == e.FILE_NAME|slice:"-5:"%}
<a class="btn btn-success btn-sm {% if not e.DYNAMIC_REPORT_EXISTS %}disabled{% endif %}" href="../dynamic_report/{{ e.MD5 }}"><i class="fa fa-mobile"></i> Dynamic Report</a>
{% endif %}
</p>
{% else %}
</br><span class="badge bg-warning">scan not completed</span>
{% endif %}
</td>
<td>{{ e.FILE_NAME }}
</td>
<td align="center">
<td style="text-align: center;">
{% if '.apk' == e.FILE_NAME|slice:"-4:"%}<i class="fab fa-android fa-3x"></i>
{% elif '.xapk' == e.FILE_NAME|slice:"-5:"%}<i class="fab fa-android fa-3x"></i>
{% elif '.apks' == e.FILE_NAME|slice:"-5:"%}<i class="fab fa-android fa-3x"></i>
Expand All @@ -76,14 +81,12 @@ <h3 class="box-title"><i class="fa fa-rocket"></i> Recent Scans</h3>
</td>
<td>{{ e.MD5 }}</td>
<td>{{ e.TIMESTAMP }}</td>
<td><p><a class="btn btn-primary btn-sm" href="../{{ e.ANALYZER }}/?name={{e.FILE_NAME}}&amp;checksum={{e.MD5}}&amp;type={{e.SCAN_TYPE}}"><i class="fas fa-eye"></i> Static Report</a>
</p><p>
<td><p>
<a class="btn btn-outline-primary btn-sm" href="../pdf/?md5={{ e.MD5 }}"><i class="fas fa-file-pdf"></i></a>
<a class="btn btn-outline-info btn-sm" href="../{{ e.ANALYZER }}/?name={{e.FILE_NAME}}&amp;checksum={{e.MD5}}&amp;type={{e.SCAN_TYPE}}&amp;rescan=1"><i class="fas fa-sync-alt"></i></a>
</p>
{% if '.apk' == e.FILE_NAME|slice:"-4:" or '.xapk' == e.FILE_NAME|slice:"-5:" or '.apks' == e.FILE_NAME|slice:"-5:"%}
<p><a class="btn btn-success btn-sm {% if not e.DYNAMIC_REPORT_EXISTS %}disabled{% endif %}" href="../dynamic_report/{{ e.MD5 }}"><i class="fa fa-mobile"></i> Dynamic Report</a>
</p><p><a class="diffButton btn btn-warning btn-sm" id="{{ e.MD5 }}_{{ e.FILE_NAME }}"><i class="fas fa-not-equal"></i> Diff or Compare</a>
<p><a class="diffButton btn btn-warning btn-sm" id="{{ e.MD5 }}_{{ e.FILE_NAME }}"><i class="fas fa-not-equal"></i> Diff or Compare</a>
</p>
{% endif %}
<p> <a class="btn btn-danger btn-sm" id="{{ e.MD5 }}" onclick="delete_scan(this)" href="#"><i class="fa fa-trash"></i> Delete Scan</a> </p>
Expand Down