├── media └── .tmp ├── static └── .tmp ├── config ├── __init__.py ├── settings │ └── __init__.py ├── fieldkeys │ ├── 1 │ └── meta └── wsgi.py ├── manati ├── static │ ├── fonts │ │ └── .gitkeep │ ├── sass │ │ ├── custom_bootstrap_vars.scss │ │ └── project.scss │ ├── images │ │ └── favicon.ico │ ├── css │ │ └── project.css │ └── js │ │ └── project.js ├── ip_profiles │ ├── __init__.py │ ├── migrations │ │ └── __init__.py │ ├── templates │ │ └── ip_profiles │ │ │ ├── base.html │ │ │ ├── new.html │ │ │ └── index.html │ ├── admin.py │ ├── tests.py │ ├── models.py │ ├── apps.py │ ├── views.py │ └── urls.py ├── share_modules │ ├── __init__.py │ └── constants.py ├── templates │ ├── base_footer.html │ ├── pages │ │ ├── home.html │ │ └── about.html │ ├── 404.html │ ├── errors │ │ ├── 403_csrf.html │ │ ├── maintenance-page.html │ │ ├── 503.html │ │ ├── 500.html │ │ ├── 404.html │ │ ├── 403.html │ │ ├── rate-limit-error.html │ │ └── 504.html │ ├── home.html │ ├── bootstrap4 │ │ └── layout │ │ │ └── field_errors_block.html │ ├── account │ │ ├── base.html │ │ ├── account_inactive.html │ │ ├── password_reset_from_key_done.html │ │ ├── signup_closed.html │ │ ├── verification_sent.html │ │ ├── password_set.html │ │ ├── password_reset_done.html │ │ ├── password_change.html │ │ ├── logout.html │ │ ├── signup.html │ │ ├── verified_email_required.html │ │ ├── password_reset.html │ │ ├── password_reset_from_key.html │ │ ├── email_confirm.html │ │ └── login.html │ ├── 500.html │ ├── users │ │ ├── user_list.html │ │ ├── user_form.html │ │ └── user_detail.html │ ├── messages.html │ ├── base_nav.html │ └── base_login.html ├── analysis_sessions │ ├── __init__.py │ ├── tests │ │ └── __init__.py │ ├── migrations │ │ ├── __init__.py │ │ ├── 0025_whoisconsult_deleting.py │ │ ├── 0008_auto_20160927_1243.py │ │ ├── 0009_auto_20160927_1438.py │ │ ├── 0022_weblog_was_whois_related.py │ │ ├── 0023_analysissession_uuid.py │ │ ├── 0030_auto_20170926_1740.py │ │ ├── 0024_analysissession_status.py │ │ ├── 0002_auto_20160817_1047.py │ │ ├── 0017_comment_user.py │ │ ├── 0029_auto_20170627_0944.py │ │ └── 0021_fixing_whois_related_attribute.py │ ├── templates │ │ └── manati_ui │ │ │ ├── index.html │ │ │ ├── analysis_session │ │ │ ├── table_options.html │ │ │ ├── modal_vt.html │ │ │ └── hotkeys_list.html │ │ │ └── user │ │ │ └── edit.html │ ├── admin.py │ ├── static │ │ └── manati_ui │ │ │ ├── images │ │ │ ├── c1.png │ │ │ ├── c3.png │ │ │ ├── v1.png │ │ │ ├── v2.png │ │ │ ├── favicon.ico │ │ │ └── ajax-loader.gif │ │ │ ├── css │ │ │ ├── images │ │ │ │ ├── sort_asc.png │ │ │ │ ├── sort_both.png │ │ │ │ ├── sort_desc.png │ │ │ │ ├── sort_asc_disabled.png │ │ │ │ └── sort_desc_disabled.png │ │ │ ├── libs │ │ │ │ ├── colReorder.bootstrap.min.css │ │ │ │ ├── colReorder.dataTables.min.css │ │ │ │ ├── metisMenu.min.css │ │ │ │ ├── fluid-labels.css │ │ │ │ ├── bootstrap-toggle.min.css │ │ │ │ └── buttons.bootstrap.min.css │ │ │ └── scss │ │ │ │ └── style_ui.scss │ │ │ ├── fonts │ │ │ ├── context-menu-icons.eot │ │ │ ├── context-menu-icons.ttf │ │ │ ├── context-menu-icons.woff │ │ │ ├── context-menu-icons.woff2 │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── font-awesome │ │ │ └── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ │ └── js │ │ │ ├── modules │ │ │ └── helpers │ │ │ │ └── alert_message_helper.js │ │ │ ├── sb-admin-2.js │ │ │ └── libs │ │ │ └── metisMenu.min.js │ ├── apps.py │ ├── models │ │ ├── __init__.py │ │ ├── app_parameter.py │ │ ├── base.py │ │ └── comment.py │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ ├── _private.py │ │ │ └── createsuperuser2.py │ ├── templatetags │ │ └── __init__.py │ ├── serializers.py │ ├── forms.py │ ├── helpers.py │ ├── signals.py │ └── utils.py ├── api_manager │ ├── management │ │ ├── __init__.py │ │ └── commands │ │ │ ├── __init__.py │ │ │ └── _private.py │ ├── migrations │ │ ├── 0007_auto_20171128_1156.py │ │ ├── __init__.py │ │ ├── 0003_remove_externalmodule_acronym.py │ │ ├── 0006_auto_20171019_0043.py │ │ └── 0002_externalmodule_status.py │ ├── modules │ │ ├── bulk_labeling_whois_relation.py │ │ └── __init__.py │ ├── __init__.py │ ├── common │ │ ├── __init__.py │ │ └── abstracts.py │ ├── core │ │ └── __init__.py │ ├── tests.py │ ├── admin.py │ ├── views.py │ └── apps.py ├── user_profiles │ ├── migrations │ │ ├── __init__.py │ │ └── 0002_auto_20171101_1828.py │ ├── templates │ │ └── userena │ │ │ ├── base_userena.html │ │ │ ├── emails │ │ │ ├── activation_email_subject.txt │ │ │ ├── confirmation_email_subject_new.txt │ │ │ ├── confirmation_email_subject_old.txt │ │ │ ├── confirmation_email_subject_new.html │ │ │ ├── activation_email_message.txt │ │ │ ├── confirmation_email_message_old.txt │ │ │ ├── confirmation_email_message_new.txt │ │ │ ├── password_reset_message.txt │ │ │ ├── activation_email_message.html │ │ │ ├── confirmation_email_message_old.html │ │ │ ├── confirmation_email_message_new.html │ │ │ └── password_reset_message.html │ │ │ ├── signout.html │ │ │ ├── password_reset_done.html │ │ │ ├── email_confirm_complete.html │ │ │ ├── password_complete.html │ │ │ ├── password_reset_complete.html │ │ │ ├── password_reset_form.html │ │ │ ├── email_confirm_fail.html │ │ │ ├── password_reset_confirm_form.html │ │ │ ├── disabled.html │ │ │ ├── activate_fail.html │ │ │ ├── activate_retry.html │ │ │ ├── email_change_complete.html │ │ │ ├── activate_retry_success.html │ │ │ ├── signup_complete.html │ │ │ ├── signup_form.html │ │ │ ├── profile_form.html │ │ │ ├── email_form.html │ │ │ ├── signin_form.html │ │ │ └── password_form.html │ ├── tests.py │ ├── __init__.py │ ├── admin.py │ ├── views.py │ ├── apps.py │ ├── urls.py │ ├── signals.py │ └── models.py ├── contrib │ ├── __init__.py │ └── sites │ │ ├── __init__.py │ │ └── migrations │ │ ├── __init__.py │ │ ├── 0002_alter_domain_unique.py │ │ ├── 0001_initial.py │ │ └── 0003_set_site_domain_and_name.py ├── __init__.py └── login │ ├── __init__.py │ ├── migrations │ └── __init__.py │ ├── tests.py │ ├── admin.py │ ├── models.py │ ├── apps.py │ ├── urls.py │ ├── forms.py │ └── views.py ├── .gitattributes ├── utility ├── runtime.txt ├── Procfile ├── .env-docker.pro ├── heroku_uwsgi.ini ├── requirements-trusty.apt ├── requirements-xenial.apt ├── requirements-jessie.apt ├── redis_worker.sh ├── production_settings │ └── ubuntu │ │ ├── uwsgi_params │ │ ├── manati_uwsgi.ini │ │ ├── manati_nginx.conf │ │ └── supervisor-manati.conf ├── local.yml.example ├── production.yml.example ├── gunicorn_start.bash ├── .env.pro └── install_python_dependencies.sh ├── CONTRIBUTORS.txt ├── .dockerignore ├── docs ├── db_modeling.mwb ├── db_modeling.png ├── __init__.py ├── pycharm │ └── images │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 7.png │ │ ├── 8.png │ │ ├── f1.png │ │ ├── f2.png │ │ ├── f3.png │ │ ├── f4.png │ │ ├── issue1.png │ │ └── issue2.png ├── deploy.rst ├── install.rst ├── heroku_commands.txt └── index.rst ├── .coveragerc ├── compose ├── local │ ├── nginx │ │ ├── Dockerfile │ │ └── conf.d │ │ │ └── web.conf │ └── django │ │ ├── celery │ │ ├── worker │ │ │ └── start.sh │ │ └── beat │ │ │ └── start.sh │ │ ├── start.sh │ │ ├── Dockerfile │ │ └── Dockerfile.example └── production │ ├── caddy │ ├── Dockerfile │ └── Caddyfile │ ├── django │ ├── celery │ │ ├── beat │ │ │ └── start.sh │ │ └── worker │ │ │ └── start.sh │ ├── gunicorn.sh │ ├── Dockerfile │ ├── Dockerfile.example │ └── entrypoint.sh │ └── postgres │ ├── list-backups.sh │ ├── Dockerfile │ ├── backup.sh │ └── restore.sh ├── static1 ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 └── js │ └── scale.fix.js ├── pytest.ini ├── requirements.txt ├── .env-docker.example ├── setup.cfg ├── .pylintrc ├── requirements ├── test.txt ├── local.txt └── production.txt ├── .editorconfig ├── .env.example ├── manage.py ├── .travis.yml └── docker-compose.yml /media/.tmp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/.tmp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/settings/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/static/fonts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /manati/ip_profiles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/share_modules/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/templates/base_footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/analysis_sessions/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utility/runtime.txt: -------------------------------------------------------------------------------- 1 | python-2.7.14 2 | -------------------------------------------------------------------------------- /manati/analysis_sessions/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/api_manager/management/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/ip_profiles/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/user_profiles/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/static/sass/custom_bootstrap_vars.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/api_manager/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/api_manager/management/commands/_private.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CONTRIBUTORS.txt: -------------------------------------------------------------------------------- 1 | Raúl Benítez Netto 2 | Sebastián García 3 | -------------------------------------------------------------------------------- /manati/templates/pages/home.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | -------------------------------------------------------------------------------- /manati/templates/pages/about.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .* 2 | !.coveragerc 3 | !.env 4 | !.pylintrc 5 | /.pytest_cache/ 6 | -------------------------------------------------------------------------------- /manati/analysis_sessions/templates/manati_ui/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | -------------------------------------------------------------------------------- /manati/ip_profiles/templates/ip_profiles/base.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/base_userena.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | -------------------------------------------------------------------------------- /docs/db_modeling.mwb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/db_modeling.mwb -------------------------------------------------------------------------------- /docs/db_modeling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/db_modeling.png -------------------------------------------------------------------------------- /docs/__init__.py: -------------------------------------------------------------------------------- 1 | # Included so that Django's startproject comment runs against the docs directory 2 | -------------------------------------------------------------------------------- /manati/ip_profiles/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /manati/ip_profiles/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /manati/user_profiles/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /docs/pycharm/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/1.png -------------------------------------------------------------------------------- /docs/pycharm/images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/2.png -------------------------------------------------------------------------------- /docs/pycharm/images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/3.png -------------------------------------------------------------------------------- /docs/pycharm/images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/4.png -------------------------------------------------------------------------------- /docs/pycharm/images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/7.png -------------------------------------------------------------------------------- /docs/pycharm/images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/8.png -------------------------------------------------------------------------------- /manati/user_profiles/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'manati.user_profiles.apps.UserProfilesConfig' 2 | -------------------------------------------------------------------------------- /manati/user_profiles/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /docs/pycharm/images/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/f1.png -------------------------------------------------------------------------------- /docs/pycharm/images/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/f2.png -------------------------------------------------------------------------------- /docs/pycharm/images/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/f3.png -------------------------------------------------------------------------------- /docs/pycharm/images/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/f4.png -------------------------------------------------------------------------------- /docs/deploy.rst: -------------------------------------------------------------------------------- 1 | Deploy 2 | ======== 3 | 4 | This is where you describe how the project is deployed in production. 5 | -------------------------------------------------------------------------------- /docs/pycharm/images/issue1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/issue1.png -------------------------------------------------------------------------------- /docs/pycharm/images/issue2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/docs/pycharm/images/issue2.png -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | include = manati/* 3 | omit = *migrations*, *tests* 4 | plugins = 5 | django_coverage_plugin 6 | -------------------------------------------------------------------------------- /compose/local/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.11.1 2 | RUN rm /etc/nginx/conf.d/default.conf 3 | ADD conf.d/ /etc/nginx/conf.d -------------------------------------------------------------------------------- /docs/install.rst: -------------------------------------------------------------------------------- 1 | Install 2 | ========= 3 | 4 | This is where you write how to get a new laptop to run this project. 5 | -------------------------------------------------------------------------------- /manati/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/static/images/favicon.ico -------------------------------------------------------------------------------- /compose/production/caddy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM abiosoft/caddy:0.10.6 2 | 3 | COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile 4 | -------------------------------------------------------------------------------- /manati/user_profiles/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from . import forms 3 | from userena import views as userena_views 4 | -------------------------------------------------------------------------------- /manati/ip_profiles/models.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.db import models 4 | 5 | # Create your models here. 6 | -------------------------------------------------------------------------------- /utility/Procfile: -------------------------------------------------------------------------------- 1 | web: bin/start-nginx bin/start-pgbouncer-stunnel uwsgi heroku_uwsgi.ini 2 | worker: python manage.py rqworker high default low 3 | -------------------------------------------------------------------------------- /static1/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/static1/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static1/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/static1/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static1/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/static1/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | DJANGO_SETTINGS_MODULE=config.settings.test 3 | python_files = tests.py test_*.py *_tests.py 4 | addopts= 5 | --reuse-db 6 | 7 | -------------------------------------------------------------------------------- /static1/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/static1/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /manati/analysis_sessions/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | class UserAdmin(admin.ModelAdmin): 4 | list_filter = ('is_staff', 'company') 5 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/images/c1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/images/c1.png -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/images/c3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/images/c3.png -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/images/v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/images/v1.png -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/images/v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/images/v2.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # This file is here because many Platforms as a Service look for 2 | # requirements.txt in the root directory of a project. 3 | -r requirements/test.txt 4 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/images/favicon.ico -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/activation_email_subject.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans with site.name as site %}Your signup at {{ site }}.{% endblocktrans %} 3 | -------------------------------------------------------------------------------- /compose/production/django/celery/beat/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | 7 | 8 | celery -A manati.taskapp beat -l INFO 9 | -------------------------------------------------------------------------------- /config/fieldkeys/meta: -------------------------------------------------------------------------------- 1 | {"encrypted": false, "versions": [{"status": "PRIMARY", "versionNumber": 1, "exportable": false}], "type": "AES", "name": "Test", "purpose": "DECRYPT_AND_ENCRYPT"} -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/css/images/sort_asc.png -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/images/ajax-loader.gif -------------------------------------------------------------------------------- /compose/production/django/celery/worker/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | 7 | 8 | celery -A manati.taskapp worker -l INFO 9 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/css/images/sort_both.png -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/css/images/sort_desc.png -------------------------------------------------------------------------------- /.env-docker.example: -------------------------------------------------------------------------------- 1 | DOCKER_COMPOSE=True 2 | POSTGRES_PASSWORD=password 3 | POSTGRES_USER=manati_db_user 4 | POSTGRES_DB=manati_db 5 | REDISTOGO_URL_DOCKER=redis://redis/0 6 | DB_SERVICE=postgres 7 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.eot -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.ttf -------------------------------------------------------------------------------- /config/fieldkeys/1: -------------------------------------------------------------------------------- 1 | {"hmacKey": {"hmacKeyString": "4cBwiIrjWvBM0y3-aIGnjymfj6R6jmDwj6EK9k3kak0", "size": 256}, "aesKeyString": "Si0iRHmnIlu6_DEE4BymzCqxVYqhd994M2vGntK5uMc", "mode": "CBC", "size": 256} -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.woff -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/context-menu-icons.woff2 -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_subject_new.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans with site.name as site %}Email verification for {{ site }}.{% endblocktrans %} 3 | 4 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/images/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/css/images/sort_asc_disabled.png -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/images/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/css/images/sort_desc_disabled.png -------------------------------------------------------------------------------- /utility/.env-docker.pro: -------------------------------------------------------------------------------- 1 | DOCKER_COMPOSE=True 2 | POSTGRES_PASSWORD=password 3 | POSTGRES_USER=manati_db_user 4 | POSTGRES_DB=manati_db 5 | REDISTOGO_URL_DOCKER=redis://redis:6379 6 | DB_SERVICE=postgres 7 | -------------------------------------------------------------------------------- /compose/local/django/celery/worker/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | set -o xtrace 7 | 8 | 9 | celery -A manati.taskapp worker -l INFO 10 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stratosphereips/Manati/HEAD/manati/analysis_sessions/static/manati_ui/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /compose/local/django/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | set -o xtrace 7 | 8 | 9 | python manage.py migrate 10 | python manage.py runserver_plus 0.0.0.0:8000 11 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_subject_old.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% blocktrans with site.name as site %}A request to change your email address is made at {{ site }}.{% endblocktrans %} 3 | 4 | -------------------------------------------------------------------------------- /compose/local/django/celery/beat/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | set -o xtrace 7 | 8 | 9 | rm -f './celerybeat.pid' 10 | celery -A manati.taskapp beat -l INFO 11 | -------------------------------------------------------------------------------- /manati/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | To understand why this file is here, please read: 3 | 4 | http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django 5 | """ 6 | -------------------------------------------------------------------------------- /manati/ip_profiles/apps.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.apps import AppConfig 4 | 5 | 6 | class IpProfilesConfig(AppConfig): 7 | name = 'manati.ip_profiles' 8 | verbose_name = "IP Profiles" 9 | -------------------------------------------------------------------------------- /compose/production/postgres/list-backups.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | 7 | 8 | echo "listing available backups" 9 | echo "-------------------------" 10 | ls /backups/ 11 | -------------------------------------------------------------------------------- /manati/contrib/sites/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | To understand why this file is here, please read: 3 | 4 | http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django 5 | """ 6 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_subject_new.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | 3 | 4 | {% blocktrans with site.name as site %}Email verification for {{ site }}.{% endblocktrans %} 5 | 6 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules 4 | 5 | [pycodestyle] 6 | max-line-length = 120 7 | exclude=.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules 8 | -------------------------------------------------------------------------------- /manati/contrib/sites/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | To understand why this file is here, please read: 3 | 4 | http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django 5 | """ 6 | -------------------------------------------------------------------------------- /manati/analysis_sessions/apps.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.apps import AppConfig 4 | 5 | 6 | class AnalysisSessionsConfig(AppConfig): 7 | name = 'manati.analysis_sessions' 8 | verbose_name = "Analysis Sessions" 9 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/libs/colReorder.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255,255,255,0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#337ab7;z-index:201} 2 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/libs/colReorder.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.DTCR_clonedTable.dataTable{position:absolute !important;background-color:rgba(255,255,255,0.7);z-index:202}div.DTCR_pointer{width:1px;background-color:#0259C4;z-index:201} 2 | -------------------------------------------------------------------------------- /manati/templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block title %}Page not found{% endblock %} 4 | 5 | {% block content %} 6 |

Page not found

7 | 8 |

This is not the page you were looking for.

9 | {% endblock content %} 10 | -------------------------------------------------------------------------------- /compose/production/django/gunicorn.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | 7 | 8 | python /app/manage.py collectstatic --noinput 9 | /usr/local/bin/gunicorn config.wsgi -w 4 -b 0.0.0.0:5000 --chdir=/app 10 | -------------------------------------------------------------------------------- /manati/templates/errors/403_csrf.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | 3 | {% block title %}Forbidden (403){% endblock %} 4 | 5 | {% block content %} 6 |

Forbidden (403)

7 | 8 |

CSRF verification failed. Request aborted.

9 | {% endblock content %} 10 | -------------------------------------------------------------------------------- /manati/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_login.html' %} 2 | 3 | {% block content %} 4 |
5 |
6 | 7 |
8 |

Hello

9 |

You are on your Dashboard

10 |
11 |
12 |
13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /manati/templates/bootstrap4/layout/field_errors_block.html: -------------------------------------------------------------------------------- 1 | 2 | {% if form_show_errors and field.errors %} 3 | {% for error in field.errors %} 4 |

{{ error }}

5 | {% endfor %} 6 | {% endif %} 7 | 8 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_common, pylint_django 3 | 4 | [FORMAT] 5 | max-line-length=120 6 | 7 | [MESSAGES CONTROL] 8 | disable=missing-docstring,invalid-name 9 | 10 | [DESIGN] 11 | max-parents=13 12 | 13 | [TYPECHECK] 14 | generated-members=REQUEST,acl_users,aq_parent,"[a-zA-Z]+_set{1,2}",save,delete 15 | -------------------------------------------------------------------------------- /utility/heroku_uwsgi.ini: -------------------------------------------------------------------------------- 1 | [uwsgi] 2 | http-socket = /tmp/nginx.socket 3 | master = true 4 | processes = 4 5 | die-on-term = true 6 | memory-report = true 7 | enable-threads = true 8 | hook-accepting1 = exec:touch /tmp/app-initialized 9 | env = DJANGO_SETTINGS_MODULE=config.settings.test 10 | module = config.wsgi:application 11 | -------------------------------------------------------------------------------- /manati/ip_profiles/templates/ip_profiles/new.html: -------------------------------------------------------------------------------- 1 | {% extends "ip_profiles/base.html" %} 2 | {% block title %} 3 | New IP Profile 4 | {% endblock %} 5 | {% block content %} 6 |
7 |
8 |

It works!

9 |
10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /manati/ip_profiles/templates/ip_profiles/index.html: -------------------------------------------------------------------------------- 1 | {% extends "ip_profiles/base.html" %} 2 | {% block title %} 3 | IP Profiles List 4 | {% endblock %} 5 | {% block content %} 6 |
7 |
8 |

It works!

9 |
10 |
11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /manati/templates/account/base.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | {% block title %}{% block head_title %}{% endblock head_title %}{% endblock title %} 3 | 4 | {% block content %} 5 |
6 |
7 | {% block inner %}{% endblock %} 8 |
9 |
10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /manati/templates/account/account_inactive.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Account Inactive" %}{% endblock %} 6 | 7 | {% block inner %} 8 |

{% trans "Account Inactive" %}

9 | 10 |

{% trans "This account is inactive." %}

11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /manati/user_profiles/apps.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.apps import AppConfig 4 | 5 | 6 | class UserProfilesConfig(AppConfig): 7 | name = 'manati.user_profiles' 8 | verbose_name = "User Profiles" 9 | 10 | def ready(self): 11 | import manati.user_profiles.signals 12 | pass 13 | -------------------------------------------------------------------------------- /manati/user_profiles/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include,url 2 | from . import forms 3 | 4 | urlpatterns = [ 5 | url(r'^(?P[\.\w-]+)/edit/$', 'userena.views.profile_edit', 6 | {'edit_profile_form': forms.EditProfileFormExtra,'success_url': '/'}, name='edit-profile'), 7 | url(r'^', include('userena.urls')), 8 | ] 9 | -------------------------------------------------------------------------------- /manati/__init__.py: -------------------------------------------------------------------------------- 1 | __title__ = 'ManaTI Project' 2 | __version__ = '0.12.2a' 3 | __author__ = 'Raul Carmelo Benitez Netto' 4 | __copyright__ = 'Copyright 2016-2018 CISCO - CTU - FEL' 5 | __version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')]) 6 | 7 | # Version synonym 8 | VERSION = __version__ 9 | -------------------------------------------------------------------------------- /manati/templates/account/password_reset_from_key_done.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 5 | 6 | {% block inner %} 7 |

{% trans "Change Password" %}

8 |

{% trans 'Your password is now changed.' %}

9 | {% endblock %} 10 | 11 | -------------------------------------------------------------------------------- /manati/templates/account/signup_closed.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Sign Up Closed" %}{% endblock %} 6 | 7 | {% block inner %} 8 |

{% trans "Sign Up Closed" %}

9 | 10 |

{% trans "We are sorry, but the sign up is currently closed." %}

11 | {% endblock %} 12 | 13 | -------------------------------------------------------------------------------- /compose/production/caddy/Caddyfile: -------------------------------------------------------------------------------- 1 | www.{$DOMAIN_NAME} { 2 | redir https://manatiproject.com 3 | } 4 | 5 | {$DOMAIN_NAME} { 6 | proxy / django:5000 { 7 | header_upstream Host {host} 8 | header_upstream X-Real-IP {remote} 9 | header_upstream X-Forwarded-Proto {scheme} 10 | } 11 | log stdout 12 | errors stdout 13 | gzip 14 | } 15 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/signout.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Signed out" %}{% endblock %} 5 | {% block content_title %}

{% trans "You have been signed out" %}.

{% endblock %} 6 | 7 | {% block content %} 8 |

{% trans "You have been signed out. Till we meet again." %}

9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /manati/templates/500.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block title %}Server Error{% endblock %} 4 | 5 | {% block content %} 6 |

Ooops!!! 500

7 | 8 |

Looks like something went wrong!

9 | 10 |

We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.

11 | {% endblock content %} 12 | 13 | 14 | -------------------------------------------------------------------------------- /requirements/test.txt: -------------------------------------------------------------------------------- 1 | # Test dependencies go here. 2 | -r base.txt 3 | 4 | 5 | 6 | coverage==4.4.2 7 | flake8==3.5.0 # pyup: != 2.6.0 8 | django-test-plus==1.0.22 9 | factory-boy==2.9.2 10 | django-coverage-plugin==1.5.0 11 | 12 | # pytest 13 | pytest-django==3.1.2 14 | pytest-sugar==0.9.1 15 | pytest-selenium==1.12.0 16 | 17 | bat==0.3.4 # to test BRO files, can be useful to analise BRO files too 18 | -------------------------------------------------------------------------------- /compose/production/postgres/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:9.6 2 | 3 | COPY ./compose/production/postgres/backup.sh /usr/local/bin/backup 4 | RUN chmod +x /usr/local/bin/backup 5 | 6 | COPY ./compose/production/postgres/restore.sh /usr/local/bin/restore 7 | RUN chmod +x /usr/local/bin/restore 8 | 9 | COPY ./compose/production/postgres/list-backups.sh /usr/local/bin/list-backups 10 | RUN chmod +x /usr/local/bin/list-backups 11 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/scss/style_ui.scss: -------------------------------------------------------------------------------- 1 | .dataTables_wrapper table tr.row td { 2 | &.normal{ 3 | background-color: whitesmoke; 4 | } 5 | &.malicious{ 6 | background-color: red; 7 | } 8 | &.legitimate{ 9 | background-color: green; 10 | } 11 | &.suspicious{ 12 | background-color: darkorange; 13 | 14 | } 15 | &.falsepositive{ 16 | background-color: lightskyblue; 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/password_reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Password reset email sent" %}{% endblock %} 5 | {% block content_title %}

{% trans "Password reset email sent" %}

{% endblock %} 6 | 7 | {% block content %} 8 |

{% trans "An e-mail has been sent to you which explains how to reset your password." %}

9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /docs/heroku_commands.txt: -------------------------------------------------------------------------------- 1 | heroku login 2 | heroku git:remote -a manati-sys 3 | git add . 4 | git commit -am "make it better" 5 | git push heroku heroku:master 6 | heroku run python manage.py makemigrations guardian 7 | heroku run python manage.py migrate 8 | heroku run python manage.py check_external_modules 9 | 10 | * optional 11 | heroku stack:set cedar-14 -a manati-sys 12 | heroku buildpacks:add --index 1 https://github.com/kuwabarahiroshi/heroku-buildpack-nginx.git 13 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/email_confirm_complete.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Email changed!" %}{% endblock %} 5 | 6 | {% block content_title %}

{% trans 'New email' %}

{% endblock %} 7 | {% block content %} 8 |

{% blocktrans with site.name as site %}Your new email address is saved. You can continue using {{ site }} with this email.{% endblocktrans %}

9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/password_complete.html: -------------------------------------------------------------------------------- 1 | {% load i18n %} 2 | {% block title %}{% trans "Password changed" %}{% endblock %} 3 | {% block content_title %}

{% trans "Your password has been changed" %}.

{% endblock %} 4 | 5 | {% block content %} 6 | 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/password_reset_complete.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Password reset" %}{% endblock %} 5 | {% block content_title %}

{% trans "Your password has been reset" %}

{% endblock %} 6 | {% block content %} 7 | {% url 'userena_signin' as signin_url %} 8 | {% blocktrans %}You can now signin with your new password.{% endblocktrans %} 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/password_reset_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Reset password" %}{% endblock %} 5 | 6 | {% block content %} 7 |
8 |
9 | {% trans "Reset Password" %} 10 | {% csrf_token %} 11 | {{ form.as_p }} 12 |
13 | 14 |
15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/email_confirm_fail.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Email verification failed." %}{% endblock %} 5 | {% block content_title %}

{% trans "Your email could not be verified..." %}

{% endblock %} 6 | 7 | {% block content %} 8 |

{% trans "Your email could not be verified..." %}

9 |

{% trans "You could try changing it again in your account settings." %}

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/password_reset_confirm_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Reset password" %}{% endblock %} 5 | 6 | {% block content %} 7 |
8 |
9 | {% trans "Reset Password" %} 10 | {% csrf_token %} 11 | {{ form.as_p }} 12 |
13 | 14 |
15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /requirements/local.txt: -------------------------------------------------------------------------------- 1 | # Local development dependencies go here 2 | -r base.txt 3 | 4 | coverage==4.4.2 5 | django-coverage-plugin==1.5.0 6 | 7 | Sphinx==1.6.6 8 | django-extensions==1.9.9 9 | Werkzeug==0.14.1 10 | django-test-plus==1.0.22 11 | factory-boy==2.9.2 12 | 13 | django-debug-toolbar==1.9.1 14 | django-debug-toolbar-request-history==0.0.4 15 | django-debug-toolbar-template-profiler==1.0.2 16 | 17 | # improved REPL 18 | ipdb==0.10.3 19 | 20 | pytest-django==3.1.2 21 | pytest-sugar==0.9.0 22 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/disabled.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Disabled account" %}{% endblock %} 5 | {% block content_title %}

{% trans "Your account has been disabled" %}

{% endblock %} 6 | {% block content %} 7 |

{% trans "It seems your account has been disabled." %}

8 |

{% trans "If you feel that injustice has been done to you, feel free to contact the administrators to find out why" %}

9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /manati/templates/account/verification_sent.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %} 6 | 7 | {% block inner %} 8 |

{% trans "Verify Your E-mail Address" %}

9 | 10 |

{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}

11 | 12 | {% endblock %} 13 | 14 | -------------------------------------------------------------------------------- /manati/templates/users/user_list.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | {% load static i18n %} 3 | {% block title %}Members{% endblock %} 4 | 5 | {% block content %} 6 |
7 |

Users

8 | 9 |
10 | {% for user in user_list %} 11 | 12 |

{{ user.username }}

13 |
14 | {% endfor %} 15 |
16 |
17 | {% endblock content %} 18 | -------------------------------------------------------------------------------- /utility/requirements-trusty.apt: -------------------------------------------------------------------------------- 1 | ##basic build dependencies of various Django apps for Ubuntu Trusty 14.04 2 | #build-essential metapackage install: make, gcc, g++, 3 | build-essential 4 | #required to translate 5 | gettext 6 | python3-dev 7 | 8 | ##shared dependencies of: 9 | ##Pillow, pylibmc 10 | zlib1g-dev 11 | 12 | ##Postgresql and psycopg2 dependencies 13 | libpq-dev 14 | 15 | ##Pillow dependencies 16 | libtiff4-dev 17 | libjpeg8-dev 18 | libfreetype6-dev 19 | liblcms1-dev 20 | libwebp-dev 21 | 22 | ##django-extensions 23 | graphviz-dev 24 | -------------------------------------------------------------------------------- /utility/requirements-xenial.apt: -------------------------------------------------------------------------------- 1 | ##basic build dependencies of various Django apps for Ubuntu Xenial 16.04 2 | #build-essential metapackage install: make, gcc, g++, 3 | build-essential 4 | #required to translate 5 | gettext 6 | python3-dev 7 | 8 | ##shared dependencies of: 9 | ##Pillow, pylibmc 10 | zlib1g-dev 11 | 12 | ##Postgresql and psycopg2 dependencies 13 | libpq-dev 14 | 15 | ##Pillow dependencies 16 | libtiff5-dev 17 | libjpeg8-dev 18 | libfreetype6-dev 19 | liblcms2-dev 20 | libwebp-dev 21 | 22 | ##django-extensions 23 | graphviz-dev 24 | -------------------------------------------------------------------------------- /utility/requirements-jessie.apt: -------------------------------------------------------------------------------- 1 | ##basic build dependencies of various Django apps for Debian Jessie 8.x 2 | #build-essential metapackage install: make, gcc, g++, 3 | build-essential 4 | #required to translate 5 | gettext 6 | python3-dev 7 | 8 | ##shared dependencies of: 9 | ##Pillow, pylibmc 10 | zlib1g-dev 11 | 12 | ##Postgresql and psycopg2 dependencies 13 | libpq-dev 14 | 15 | ##Pillow dependencies 16 | libtiff5-dev 17 | libjpeg62-turbo-dev 18 | libfreetype6-dev 19 | liblcms2-dev 20 | libwebp-dev 21 | 22 | ##django-extensions 23 | graphviz-dev 24 | -------------------------------------------------------------------------------- /manati/templates/account/password_set.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load crispy_forms_tags %} 5 | 6 | {% block head_title %}{% trans "Set Password" %}{% endblock %} 7 | 8 | {% block inner %} 9 |

{% trans "Set Password" %}

10 | 11 |
12 | {% csrf_token %} 13 | {{ form|crispy }} 14 | 15 |
16 | {% endblock %} 17 | 18 | -------------------------------------------------------------------------------- /manati/templates/users/user_form.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | {% load crispy_forms_tags %} 3 | 4 | {% block title %}{{ user.username }}{% endblock %} 5 | 6 | {% block content %} 7 |

{{ user.username }}

8 |
9 | {% csrf_token %} 10 | {{ form|crispy }} 11 |
12 |
13 | 14 |
15 |
16 |
17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/activate_fail.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Account activation failed." %}{% endblock %} 5 | {% block content_title %}

{% trans "Your account could not be activated..." %}

{% endblock %} 6 | 7 | {% block content %} 8 |

{% trans "Your account could not be activated. This could be because your activation link has aged." %}

9 |

{% trans "Please try signing up again or contact us if you think something went wrong." %}

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/activate_retry.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | 5 | {% block title %}{% trans "Account activation failed." %}{% endblock %} 6 | {% block content_title %}

{% trans "Your account could not be activated..." %}

{% endblock %} 7 | 8 | {% block content %} 9 |

{% trans "Your account could not be activated because activation link is expired." %}

10 |

{% trans "Request a new activation link." %}

11 | {% endblock %} 12 | -------------------------------------------------------------------------------- /manati/templates/account/password_reset_done.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Password Reset" %}{% endblock %} 7 | 8 | {% block inner %} 9 |

{% trans "Password Reset" %}

10 | 11 | {% if user.is_authenticated %} 12 | {% include "account/snippets/already_logged_in.html" %} 13 | {% endif %} 14 | 15 |

{% blocktrans %}We have sent you an e-mail. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}

16 | {% endblock %} 17 | 18 | -------------------------------------------------------------------------------- /manati/static/css/project.css: -------------------------------------------------------------------------------- 1 | /* These styles are generated from project.scss. */ 2 | 3 | .alert-debug { 4 | color: black; 5 | background-color: white; 6 | border-color: #d6e9c6; 7 | } 8 | 9 | .alert-error { 10 | color: #b94a48; 11 | background-color: #f2dede; 12 | border-color: #eed3d7; 13 | } 14 | 15 | /* Display django-debug-toolbar. 16 | See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 17 | and https://github.com/pydanny/cookiecutter-django/issues/317 18 | */ 19 | [hidden][style="display: block;"] { 20 | display: block !important; 21 | } 22 | -------------------------------------------------------------------------------- /manati/templates/account/password_change.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load crispy_forms_tags %} 5 | 6 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 7 | 8 | {% block inner %} 9 |

{% trans "Change Password" %}

10 | 11 |
12 | {% csrf_token %} 13 | {{ form|crispy }} 14 | 15 |
16 | {% endblock %} 17 | 18 | -------------------------------------------------------------------------------- /requirements/production.txt: -------------------------------------------------------------------------------- 1 | # Pro-tip: Try not to put anything here. Avoid dependencies in 2 | # production that aren't in development. 3 | -r base.txt 4 | 5 | 6 | 7 | # WSGI Handler 8 | # ------------------------------------------------ 9 | gevent==1.2.2 10 | gunicorn==19.7.1 11 | 12 | # Static and Media Storage 13 | # ------------------------------------------------ 14 | boto3==1.5.20 15 | django-storages==1.6.5 16 | 17 | 18 | # Email backends for Mailgun, Postmark, SendGrid and more 19 | # ------------------------------------------------------- 20 | django-anymail==1.2 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. ManaTI Project documentation master file, created by 2 | sphinx-quickstart. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to ManaTI Project's documentation! 7 | ==================================================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | install 15 | deploy 16 | docker_ec2 17 | tests 18 | 19 | 20 | 21 | Indices and tables 22 | ================== 23 | 24 | * :ref:`genindex` 25 | * :ref:`modindex` 26 | * :ref:`search` 27 | -------------------------------------------------------------------------------- /static1/js/scale.fix.js: -------------------------------------------------------------------------------- 1 | var metas = document.getElementsByTagName('meta'); 2 | var i; 3 | if (navigator.userAgent.match(/iPhone/i)) { 4 | for (i=0; i{% trans "Sign Out" %} 9 | 10 |

{% trans 'Are you sure you want to sign out?' %}

11 | 12 |
13 | {% csrf_token %} 14 | {% if redirect_field_value %} 15 | 16 | {% endif %} 17 | 18 |
19 | 20 | 21 | {% endblock %} 22 | 23 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/email_change_complete.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Email verification" %}{% endblock %} 5 | {% block content_title %}

{% trans 'Confirm your new email' %}

{% endblock %} 6 | 7 | {% block content %} 8 |

{% blocktrans with viewed_user.userena_signup.email_unconfirmed as email %}You have received an email at {{ email }}.{% endblocktrans %}

9 |

{% blocktrans with viewed_user.username as username %}To associate this email address with your account ({{ username }}) click on the link provided in this email.{% endblocktrans %}

10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_message_old.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | {% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %} 3 | {% endif %} 4 | {% blocktrans with site.name as site %}There was a request to change your email address at {{ site }}.{% endblocktrans %} 5 | 6 | {% blocktrans %}An email has been send to {{ new_email }} which contains a verification link. Click on the link in this email to activate it.{% endblocktrans %} 7 | 8 | {% trans "Thanks for using our site!" %} 9 | 10 | {% trans "Sincerely" %}, 11 | {{ site.name }} 12 | {% endautoescape %} 13 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_message_new.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | {% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %} 3 | {% endif %} 4 | {% blocktrans with site.name as site %}You requested a change of your email address at {{ site }}.{% endblocktrans %} 5 | 6 | 7 | {% trans "Please confirm this email address by clicking on the link below:" %} 8 | 9 | {{ protocol }}://{{ site.domain }}{% url 'userena_email_confirm' confirmation_key %} 10 | 11 | 12 | {% trans "Thanks for using our site!" %} 13 | 14 | {% trans "Sincerely" %}, 15 | {{ site.name }} 16 | {% endautoescape %} 17 | -------------------------------------------------------------------------------- /compose/local/django/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:2.7 2 | ENV PYTHONUNBUFFERED 1 3 | RUN groupadd -r manati \ 4 | && useradd -r -g manati manati_user 5 | 6 | RUN apt-get update && apt-get install -y gcc 7 | RUN apt-get install -y python python-pip python-dev libpq-dev python-setuptools \ 8 | build-essential \ 9 | software-properties-common 10 | RUN apt-get install -y libssl-dev libffi-dev 11 | RUN mkdir /code 12 | WORKDIR /code/ 13 | ADD ./requirements/base.txt /code/ 14 | ADD ./requirements/local.txt /code/ 15 | RUN pip install --upgrade pip 16 | RUN pip install --no-cache-dir setuptools 17 | RUN pip install --no-cache-dir -r local.txt 18 | ADD . /code/ 19 | -------------------------------------------------------------------------------- /manati/ip_profiles/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from django.views.decorators.csrf import csrf_exempt 3 | from django.contrib.auth.decorators import login_required 4 | import logging 5 | # Get an instance of a logger 6 | logger = logging.getLogger(__name__) 7 | REDIRECT_TO_LOGIN = "/manati_project/login" 8 | 9 | @login_required(login_url=REDIRECT_TO_LOGIN) 10 | @csrf_exempt 11 | def index(request): 12 | context = {} 13 | return render(request, 'ip_profiles/index.html', context) 14 | 15 | @login_required(login_url=REDIRECT_TO_LOGIN) 16 | @csrf_exempt 17 | def new(request): 18 | context = {} 19 | return render(request, 'ip_profiles/new.html', context) 20 | 21 | 22 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/activate_retry_success.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | 5 | {% block title %}{% trans "Account re-activation succeeded." %}{% endblock %} 6 | {% block content_title %}

{% trans "Account re-activation" %}

{% endblock %} 7 | 8 | {% block content %} 9 |

{% blocktrans %}You requested a new activation of your account..{% endblocktrans %}

10 |

{% blocktrans %}You have been sent an e-mail with an activation link to the supplied email.{% endblocktrans %}

11 |

{% blocktrans %}We will store your signup information for {{ userena_activation_days }} days on our server. {% endblocktrans %}

12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /compose/production/django/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:2.7 2 | ENV PYTHONUNBUFFERED 1 3 | RUN groupadd -r manati \ 4 | && useradd -r -g manati manati_user 5 | 6 | RUN apt-get update && apt-get install -y gcc 7 | RUN apt-get install -y python python-pip python-dev libpq-dev python-setuptools \ 8 | build-essential \ 9 | software-properties-common 10 | RUN apt-get install -y libssl-dev libffi-dev 11 | RUN mkdir /code 12 | WORKDIR /code/ 13 | ADD ./requirements/base.txt /code/ 14 | ADD ./requirements/production.txt /code/ 15 | RUN pip install --upgrade pip 16 | RUN pip install --no-cache-dir setuptools 17 | RUN pip install --no-cache-dir -r production.txt 18 | ADD . /code/ 19 | -------------------------------------------------------------------------------- /manati/analysis_sessions/models/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 8/25/18. 5 | from .models import get_anonymous_user_instance, MESSAGE_TAGS 6 | from .base import TimeStampedModel 7 | from .app_parameter import AppParameter 8 | from .comment import Comment 9 | from .consult import VTConsult, WhoisConsult 10 | from .metric import Metric 11 | from .models import User, IOC, Weblog, WeblogHistory, ModuleAuxWeblog, AnalysisSession, AnalysisSessionUsers, \ 12 | WHOISRelatedIOC 13 | from .models import RegisterStatus 14 | -------------------------------------------------------------------------------- /utility/redis_worker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | function checkIt() 3 | { 4 | number=$(ps aux | grep $1 | wc -l) 5 | 6 | if [ $number -gt 1 ]; then 7 | return=true 8 | else 9 | return=false 10 | fi; 11 | } 12 | 13 | checkIt "redis-server" 14 | echo "Redis Server running:" 15 | echo $return 16 | if [ "$return" != "true" ]; then 17 | echo "Run redis" 18 | redis-server /usr/local/etc/redis.conf & 19 | fi; 20 | 21 | checkIt "rqworker" 22 | echo "RQ Worker running:" 23 | echo $return 24 | if [ "$return" != "true" ]; then 25 | echo "Run rqworker" 26 | python ./manage.py rqworker high default low & 27 | fi; 28 | 29 | 30 | echo "Check new external modules" 31 | python ./manage.py check_external_modules 32 | -------------------------------------------------------------------------------- /manati/api_manager/migrations/0007_auto_20171128_1156.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.7 on 2017-11-28 10:56 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('api_manager', '0006_auto_20171019_0043'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AlterField( 17 | model_name='ioc_whois_relatedexecuted', 18 | name='ioc', 19 | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='whois_relation_executions', to='analysis_sessions.IOC'), 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /manati/analysis_sessions/models/app_parameter.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 8/26/18. 5 | from django.db import models 6 | from .base import TimeStampedModel 7 | from model_utils import Choices 8 | 9 | 10 | class AppParameter(TimeStampedModel): 11 | KEY_OPTIONS = Choices(('virus_total_key_api', 'Virus Total Key API')) 12 | key = models.CharField(choices=KEY_OPTIONS, default='', max_length=20, null=False) 13 | value = models.CharField(null=False, default='', max_length=255) 14 | 15 | class Meta: 16 | db_table = 'manati_app_parameters' 17 | -------------------------------------------------------------------------------- /utility/production_settings/ubuntu/uwsgi_params: -------------------------------------------------------------------------------- 1 | 2 | uwsgi_param QUERY_STRING $query_string; 3 | uwsgi_param REQUEST_METHOD $request_method; 4 | uwsgi_param CONTENT_TYPE $content_type; 5 | uwsgi_param CONTENT_LENGTH $content_length; 6 | 7 | uwsgi_param REQUEST_URI $request_uri; 8 | uwsgi_param PATH_INFO $document_uri; 9 | uwsgi_param DOCUMENT_ROOT $document_root; 10 | uwsgi_param SERVER_PROTOCOL $server_protocol; 11 | uwsgi_param REQUEST_SCHEME $scheme; 12 | uwsgi_param HTTPS $https if_not_empty; 13 | 14 | uwsgi_param REMOTE_ADDR $remote_addr; 15 | uwsgi_param REMOTE_PORT $remote_port; 16 | uwsgi_param SERVER_PORT $server_port; 17 | uwsgi_param SERVER_NAME $server_name; -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/password_reset_message.txt: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | {% blocktrans %}You're receiving this e-mail because you requested a password reset 3 | for your user account at {{ site_name }}{% endblocktrans %}. 4 | 5 | {% trans "Please go to the following page and choose a new password:" %} 6 | {% block reset_link %} 7 | {{ protocol }}://{{ domain }}{% url 'userena_password_reset_confirm' uid token %} 8 | {% endblock %} 9 | 10 | {% if not without_usernames %}{% blocktrans with user.username as username %} 11 | Your username, in case you've forgotten: {{ username }} 12 | {% endblocktrans %} 13 | {% endif %} 14 | {% trans "Thanks for using our site!" %} 15 | 16 | {% trans "Sincerely" %}, 17 | {{ site_name }} 18 | {% endautoescape %} 19 | -------------------------------------------------------------------------------- /utility/local.yml.example: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | volumes: 4 | postgres_data_local: {} 5 | postgres_backup_local: {} 6 | 7 | services: 8 | django: 9 | build: 10 | context: . 11 | dockerfile: ./compose/local/django/Dockerfile 12 | depends_on: 13 | - postgres 14 | volumes: 15 | - .:/app 16 | environment: 17 | - POSTGRES_USER=manati 18 | - USE_DOCKER=yes 19 | ports: 20 | - "8000:8000" 21 | command: /start.sh 22 | 23 | postgres: 24 | build: 25 | context: . 26 | dockerfile: ./compose/production/postgres/Dockerfile 27 | volumes: 28 | - postgres_data_local:/var/lib/postgresql/data 29 | - postgres_backup_local:/backups 30 | environment: 31 | - POSTGRES_USER=manati 32 | 33 | 34 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/activation_email_message.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | 3 | 4 | {% if not without_usernames %}

{% blocktrans with user.username as username %}Dear {{ username }},

{% endblocktrans %}{% endif %} 5 | {% blocktrans with site.name as site %}

Thank you for signing up at {{ site }}.

{% endblocktrans %} 6 |

7 | {% trans "To activate your account you should click on the link below:" %}
8 | {{ protocol }}://{{ site.domain }}{% url 'userena_activate' activation_key %} 9 |

10 |

11 | {% trans "Thanks for using our site!" %}
12 | {% trans "Sincerely" %},
13 | {{ site.name }} 14 |

15 | 16 | 17 | {% endautoescape %} 18 | -------------------------------------------------------------------------------- /manati/analysis_sessions/models/base.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 8/25/18. 5 | from django.db import models 6 | from model_utils.fields import AutoCreatedField, AutoLastModifiedField 7 | from django.utils.translation import ugettext_lazy as _ 8 | 9 | 10 | class TimeStampedModel(models.Model): 11 | """ 12 | An abstract base class model that provides self-updating 13 | ``created`` and ``modified`` fields. 14 | 15 | """ 16 | created_at = AutoCreatedField(_('created_at')) 17 | updated_at = AutoLastModifiedField(_('updated_at')) 18 | 19 | class Meta: 20 | abstract = True 21 | -------------------------------------------------------------------------------- /manati/templates/account/signup.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load crispy_forms_tags %} 5 | 6 | {% block head_title %}{% trans "Signup" %}{% endblock %} 7 | 8 | {% block inner %} 9 |

{% trans "Sign Up" %}

10 | 11 |

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}

12 | 13 | 21 | 22 | {% endblock %} 23 | 24 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/signup_complete.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Signup almost done!" %}{% endblock %} 5 | 6 | {% block content_title %}

{% trans "Signup" %}

{% endblock %} 7 | 8 | {% block content %} 9 |

{% trans "Thank you for signing up with us!" %}

10 | 11 | {% if userena_activation_required %} 12 |

{% blocktrans %}You have been sent an e-mail with an activation link to the supplied email.{% endblocktrans %}

13 |

{% blocktrans %}We will store your signup information for {{ userena_activation_days }} days on our server. {% endblocktrans %}

14 | {% else %} 15 |

{% blocktrans %}You can now use the supplied credentials to signin.{% endblocktrans %}

16 | {% endif %} 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_message_old.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | 3 | 4 | {% if not without_usernames %}

{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}

{% endif %} 5 |

6 | {% blocktrans with site.name as site %}There was a request to change your email address at {{ site }}.{% endblocktrans %} 7 |

8 | 9 |

10 | {% blocktrans %}An email has been send to {{ new_email }} which contains a verification link. Click on the link in this email to activate it.{% endblocktrans %} 11 |

12 | 13 |

{% trans "Thanks for using our site!" %}

14 | 15 |

16 | {% trans "Sincerely" %},
17 | {{ site.name }} 18 |

19 | 20 | 21 | {% endautoescape %} 22 | -------------------------------------------------------------------------------- /utility/production_settings/ubuntu/manati_uwsgi.ini: -------------------------------------------------------------------------------- 1 | 2 | # manati_uwsgi.ini file 3 | [uwsgi] 4 | # Django-related settings 5 | # the base directory (full path) 6 | chdir = /var/www/manati 7 | # Django's wsgi file 8 | module = config.wsgi:application 9 | # the virtualenv (full path) 10 | home = /var/www/manati/.vmanati 11 | # process-related settings 12 | # master 13 | master = true 14 | # maximum number of worker processes 15 | processes = 4 16 | # the socket (use the full path to be safe) 17 | socket = /var/run/manati.sock 18 | # ... with appropriate permissions - may be needed 19 | chmod-socket = 666 20 | # clear environment on exit 21 | vacuum = true 22 | # create a pidfile 23 | pidfile = /var/run/manati.pid 24 | # background the process & log 25 | #daemonize = /code/logs/uwsgi.log 26 | 27 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/confirmation_email_message_new.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | 3 | 4 | {% if not without_usernames %}

{% blocktrans with user.username as username %}Dear {{ username }},

{% endblocktrans %}{% endif %} 5 |

6 | {% blocktrans with site.name as site %}You requested a change of your email address at {{ site }}.{% endblocktrans %} 7 |

8 |

9 | {% trans "Please confirm this email address by clicking on the link below:" %}
10 | {{ protocol }}://{{ site.domain }}{% url 'userena_email_confirm' confirmation_key %} 11 |

12 |

13 | {% trans "Thanks for using our site!" %}
14 | {% trans "Sincerely" %},
15 | {{ site_name }} 16 |

17 | 18 | 19 | {% endautoescape %} 20 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/libs/metisMenu.min.css: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | 10 | .arrow{float:right;line-height:1.42857}.glyphicon.arrow:before{content:"\e079"}.active>a>.glyphicon.arrow:before{content:"\e114"}.fa.arrow:before{content:"\f104"}.active>a>.fa.arrow:before{content:"\f107"}.plus-times{float:right}.fa.plus-times:before{content:"\f067"}.active>a>.fa.plus-times{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.plus-minus{float:right}.fa.plus-minus:before{content:"\f067"}.active>a>.fa.plus-minus:before{content:"\f068"} -------------------------------------------------------------------------------- /manati/api_manager/modules/bulk_labeling_whois_relation.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 1/28/18. 5 | from api_manager.core.modules_manager import ModulesManager 6 | from api_manager.common.abstracts import Module 7 | 8 | 9 | class BulklabelingWhoisrelation(Module): 10 | 11 | module_name = 'bulk_labeling_whois_relation' 12 | description = 'FAKE MODULE FOR BULK WHOIS LABELING. THIS PROCESS IS IMPLEMENTED IN modules_manage.py' 13 | version = 'v0.1' 14 | authors = ['Raul B. Netto'] 15 | events = [ModulesManager.MODULES_RUN_EVENTS.by_request] 16 | 17 | def run(self, **kwargs): 18 | pass 19 | 20 | 21 | module_obj = BulklabelingWhoisrelation() 22 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/js/modules/helpers/alert_message_helper.js: -------------------------------------------------------------------------------- 1 | var updateAlertBox = function(html){ 2 | var container = $("#flash-messages-container"); 3 | (html != "") ? container.html(html).show().delay(5000).fadeOut(3000) : container.html(html).hide(); 4 | } 5 | var eventAlertBox = function (){ 6 | var container = $("#flash-messages-container"); 7 | if(container.html().length > 0){ 8 | container.show().delay(5000).fadeOut(3000); 9 | }else{ 10 | container.hide(); 11 | } 12 | } 13 | var updateAlertBoxText = function (msg, state){ 14 | var temp_html = "
"; 15 | temp_html += msg; 16 | temp_html += "" 17 | temp_html += "
"; 18 | updateAlertBox(temp_html); 19 | }; -------------------------------------------------------------------------------- /compose/production/postgres/backup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | 7 | 8 | # we might run into trouble when using the default `postgres` user, e.g. when dropping the postgres 9 | # database in restore.sh. Check that something else is used here 10 | if [ "$POSTGRES_USER" == "postgres" ] 11 | then 12 | echo "creating a backup as the postgres user is not supported, make sure to set the POSTGRES_USER environment variable" 13 | exit 1 14 | fi 15 | 16 | # export the postgres password so that subsequent commands don't ask for it 17 | export PGPASSWORD=$POSTGRES_PASSWORD 18 | 19 | echo "creating backup" 20 | echo "---------------" 21 | 22 | FILENAME=backup_$(date +'%Y_%m_%dT%H_%M_%S').sql.gz 23 | pg_dump -h postgres -U $POSTGRES_USER | gzip > /backups/$FILENAME 24 | 25 | echo "successfully created backup $FILENAME" 26 | -------------------------------------------------------------------------------- /manati/user_profiles/signals.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 1/28/18. 5 | 6 | from django.contrib.auth.models import User 7 | from django.db.models.signals import post_save 8 | from manati.user_profiles.models import UserProfile 9 | from django.dispatch import receiver 10 | from django.core import management 11 | 12 | 13 | @receiver(post_save, sender=User) 14 | def create_user_profile(sender, instance, created, **kwargs): 15 | if created: 16 | UserProfile.objects.create(user=instance) 17 | management.call_command('check_permissions') 18 | 19 | 20 | @receiver(post_save, sender=User) 21 | def save_user_profile(sender, instance, **kwargs): 22 | instance.profile.save() 23 | 24 | 25 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/signup_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Signup" %}{% endblock %} 5 | 6 | {% block content %} 7 |
8 | {% csrf_token %} 9 |
10 | {% trans "Signup" %} 11 | {{ form.non_field_errors }} 12 | {% for field in form %} 13 | {{ field.errors }} 14 | {% comment %} Displaying checkboxes differently {% endcomment %} 15 | {% if field.name == 'tos' %} 16 |

17 | 18 |

19 | {% else %} 20 |

21 | {{ field.label_tag }} 22 | {{ field }} 23 |

24 | {% endif %} 25 | {% endfor %} 26 |
27 | 28 |
29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /compose/local/django/Dockerfile.example: -------------------------------------------------------------------------------- 1 | FROM python:3.5 2 | 3 | ENV PYTHONUNBUFFERED 1 4 | 5 | # Requirements have to be pulled and installed here, otherwise caching won't work 6 | COPY ./requirements /requirements 7 | RUN pip install -r /requirements/local.txt 8 | 9 | COPY ./compose/production/django/entrypoint.sh /entrypoint.sh 10 | RUN sed -i 's/\r//' /entrypoint.sh 11 | RUN chmod +x /entrypoint.sh 12 | 13 | COPY ./compose/local/django/start.sh /start.sh 14 | RUN sed -i 's/\r//' /start.sh 15 | RUN chmod +x /start.sh 16 | 17 | COPY ./compose/local/django/celery/worker/start.sh /start-celeryworker.sh 18 | RUN sed -i 's/\r//' /start-celeryworker.sh 19 | RUN chmod +x /start-celeryworker.sh 20 | 21 | COPY ./compose/local/django/celery/beat/start.sh /start-celerybeat.sh 22 | RUN sed -i 's/\r//' /start-celerybeat.sh 23 | RUN chmod +x /start-celerybeat.sh 24 | 25 | WORKDIR /app 26 | 27 | ENTRYPOINT ["/entrypoint.sh"] 28 | -------------------------------------------------------------------------------- /manati/static/js/project.js: -------------------------------------------------------------------------------- 1 | /* Project specific Javascript goes here. */ 2 | 3 | /* 4 | Formatting hack to get around crispy-forms unfortunate hardcoding 5 | in helpers.FormHelper: 6 | 7 | if template_pack == 'bootstrap4': 8 | grid_colum_matcher = re.compile('\w*col-(xs|sm|md|lg|xl)-\d+\w*') 9 | using_grid_layout = (grid_colum_matcher.match(self.label_class) or 10 | grid_colum_matcher.match(self.field_class)) 11 | if using_grid_layout: 12 | items['using_grid_layout'] = True 13 | 14 | Issues with the above approach: 15 | 16 | 1. Fragile: Assumes Bootstrap 4's API doesn't change (it does) 17 | 2. Unforgiving: Doesn't allow for any variation in template design 18 | 3. Really Unforgiving: No way to override this behavior 19 | 4. Undocumented: No mention in the documentation, or it's too hard for me to find 20 | */ 21 | $('.form-group').removeClass('row'); 22 | -------------------------------------------------------------------------------- /manati/templates/messages.html: -------------------------------------------------------------------------------- 1 | {#{% if messages %}#} 2 | {#
#} 3 | {# {% for message in messages %}#} 4 | {#
#} 5 | {# #} 6 | {# {{ message }}.#} 7 | {#
#} 8 | {# {% endfor %}#} 9 | {#
#} 10 | {##} 11 | {#
    #} 12 | {# {% for message in messages %}#} 13 | {# {{ message }}#} 14 | {# {% endfor %}#} 15 | {#
#} 16 | {#{% endif %}#} 17 |
18 |
19 | -------------------------------------------------------------------------------- /manati/templates/account/verified_email_required.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | 5 | {% block head_title %}{% trans "Verify Your E-mail Address" %}{% endblock %} 6 | 7 | {% block inner %} 8 |

{% trans "Verify Your E-mail Address" %}

9 | 10 | {% url 'account_email' as email_url %} 11 | 12 |

{% blocktrans %}This part of the site requires us to verify that 13 | you are who you claim to be. For this purpose, we require that you 14 | verify ownership of your e-mail address. {% endblocktrans %}

15 | 16 |

{% blocktrans %}We have sent an e-mail to you for 17 | verification. Please click on the link inside this e-mail. Please 18 | contact us if you do not receive it within a few minutes.{% endblocktrans %}

19 | 20 |

{% blocktrans %}Note: you can still change your e-mail address.{% endblocktrans %}

21 | 22 | 23 | {% endblock %} 24 | 25 | -------------------------------------------------------------------------------- /manati/templates/users/user_detail.html: -------------------------------------------------------------------------------- 1 | {% extends "base_login.html" %} 2 | {% load static %} 3 | 4 | {% block title %}User: {{ object.username }}{% endblock %} 5 | 6 | {% block content %} 7 |
8 | 9 |
10 |
11 | 12 |

{{ object.username }}

13 | {% if object.name %} 14 |

{{ object.name }}

15 | {% endif %} 16 |
17 |
18 | 19 | {% if object == request.user %} 20 | 21 |
22 | 23 |
24 | My Info 25 | E-Mail 26 | 27 |
28 | 29 |
30 | 31 | {% endif %} 32 | 33 | 34 |
35 | {% endblock content %} 36 | 37 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/emails/password_reset_message.html: -------------------------------------------------------------------------------- 1 | {% load i18n %}{% autoescape off %} 2 | 3 | 4 |

5 | {% blocktrans %}You're receiving this e-mail because you requested a password reset 6 | for your user account at {{ site_name }}{% endblocktrans %}. 7 |

8 |

9 | {% trans "Please go to the following page and choose a new password:" %}
10 | {% block reset_link %} 11 | {{ protocol }}://{{ domain }}{% url 'userena_password_reset_confirm' uid token %} 12 | {% endblock %} 13 |

14 | {% if not without_usernames %} 15 |

{% blocktrans with user.username as username %}Your username, in case you've forgotten: {{ username }}{% endblocktrans %}

16 | {% endif %} 17 |

18 | {% trans "Thanks for using our site!" %}
19 | {% trans "Sincerely" %},
20 | {{ site_name }} 21 |

22 | 23 | 24 | {% endautoescape %} 25 | -------------------------------------------------------------------------------- /utility/production.yml.example: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | volumes: 4 | postgres_data: {} 5 | postgres_backup: {} 6 | caddy: {} 7 | 8 | services: 9 | django: 10 | build: 11 | context: . 12 | dockerfile: ./compose/production/django/Dockerfile 13 | depends_on: 14 | - postgres 15 | - redis 16 | env_file: .env 17 | command: /gunicorn.sh 18 | 19 | postgres: 20 | build: 21 | context: . 22 | dockerfile: ./compose/production/postgres/Dockerfile 23 | volumes: 24 | - postgres_data:/var/lib/postgresql/data 25 | - postgres_backup:/backups 26 | env_file: .env 27 | 28 | caddy: 29 | build: 30 | context: . 31 | dockerfile: ./compose/production/caddy/Dockerfile 32 | depends_on: 33 | - django 34 | volumes: 35 | - caddy:/root/.caddy 36 | env_file: .env 37 | ports: 38 | - "0.0.0.0:80:80" 39 | - "0.0.0.0:443:443" 40 | 41 | redis: 42 | image: redis:3.0 43 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/libs/fluid-labels.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | font-family: 'Helvetica'; 4 | } 5 | .fluid-label { 6 | position: relative; 7 | border: 1px solid lightgray; 8 | } 9 | 10 | .fluid-label input, 11 | .fluid-label textarea { 12 | font-size: 16px; 13 | border: none; 14 | outline: none; 15 | /*background-color:#fafafa;*/ 16 | } 17 | 18 | 19 | .fluid-label label { 20 | font-size: 10px; 21 | top: 5px; 22 | } 23 | 24 | .fluid-label.focused { 25 | /*border-color: #298eea;*/ 26 | } 27 | 28 | .fluid-label.focused label { 29 | color: #298eea; 30 | } 31 | .fluid-label { 32 | position: relative; 33 | padding: 10px; 34 | border-radius: 2px; 35 | display: inline-block; 36 | } 37 | 38 | .fluid-label input, .fluid-label textarea { 39 | border: none; 40 | outline: none; 41 | position: relative; 42 | } 43 | 44 | .fluid-label label { 45 | position: absolute; 46 | top: 5px; 47 | font-weight: 400 !important; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /manati/login/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/api_manager/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/analysis_sessions/models/comment.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 8/26/18. 5 | 6 | from django.db import models 7 | from .base import TimeStampedModel 8 | from django.contrib.contenttypes.models import ContentType 9 | from django.contrib.contenttypes.fields import GenericForeignKey 10 | from django.contrib.auth.models import User 11 | 12 | 13 | class Comment(TimeStampedModel): 14 | user = models.ForeignKey(User, on_delete=models.CASCADE, default=1) 15 | content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) # Weblog or AnalysisSession 16 | object_id = models.CharField(max_length=20) 17 | content_object = GenericForeignKey('content_type', 'object_id') 18 | text = models.CharField(max_length=255) 19 | 20 | class Meta: 21 | db_table = 'manati_comments' 22 | -------------------------------------------------------------------------------- /manati/api_manager/common/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/api_manager/core/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/api_manager/modules/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/login/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/api_manager/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/templates/account/password_reset.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block head_title %}{% trans "Password Reset" %}{% endblock %} 8 | 9 | {% block inner %} 10 | 11 |

{% trans "Password Reset" %}

12 | {% if user.is_authenticated %} 13 | {% include "account/snippets/already_logged_in.html" %} 14 | {% endif %} 15 | 16 |

{% trans "Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it." %}

17 | 18 |
19 | {% csrf_token %} 20 | {{ form|crispy }} 21 | 22 |
23 | 24 |

{% blocktrans %}Please contact us if you have any trouble resetting your password.{% endblocktrans %}

25 | {% endblock %} 26 | 27 | -------------------------------------------------------------------------------- /manati/analysis_sessions/management/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/analysis_sessions/templates/manati_ui/analysis_session/table_options.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/analysis_sessions/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/analysis_sessions/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/analysis_sessions/management/commands/_private.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/profile_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load crispy_forms_tags %} 3 | 4 | {% load i18n %} 5 | 6 | {% block title %}{% trans "Account setup" %}{% endblock %} 7 | 8 | {% block content_title %}

{% blocktrans with profile.user.username as username %}Account » {{ username }}{% endblocktrans %}

{% endblock %} 9 | 10 | {% block content %} 11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {% crispy form %} 19 |
20 |
21 |
22 |
23 |
24 | 25 |
26 |
27 | 28 | 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /manati/templates/base_nav.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manati/user_profiles/models.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.db import models 4 | from django.contrib.auth.models import User 5 | from django.utils.translation import ugettext as _ 6 | from userena.models import UserenaBaseProfile 7 | from encrypted_fields import EncryptedTextField, EncryptedEmailField 8 | from model_utils.fields import AutoCreatedField, AutoLastModifiedField 9 | 10 | 11 | class UserProfile(UserenaBaseProfile): 12 | user = models.OneToOneField(User, unique=True, related_name='profile') 13 | passivetotal_key_api = EncryptedTextField(null=True, max_length=255) 14 | passivetotal_user = EncryptedEmailField(null=True, max_length=60) 15 | virustotal_key_api = EncryptedTextField(null=True, max_length=255) 16 | threshold_whois_distance = models.IntegerField(default=75, null=True) 17 | created_at = AutoCreatedField(_('created_at')) 18 | updated_at = AutoLastModifiedField(_('updated_at')) 19 | 20 | class Meta: 21 | db_table = 'manati_users_profiles' 22 | 23 | -------------------------------------------------------------------------------- /manati/login/tests.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.test import TestCase 22 | 23 | # Create your tests here. 24 | -------------------------------------------------------------------------------- /manati/api_manager/tests.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.test import TestCase 22 | 23 | # Create your tests here. 24 | -------------------------------------------------------------------------------- /manati/login/admin.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.contrib import admin 22 | 23 | # Register your models here. 24 | -------------------------------------------------------------------------------- /manati/api_manager/admin.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.contrib import admin 22 | 23 | # Register your models here. 24 | -------------------------------------------------------------------------------- /manati/api_manager/views.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.shortcuts import render 22 | 23 | # Create your views here. 24 | -------------------------------------------------------------------------------- /utility/production_settings/ubuntu/manati_nginx.conf: -------------------------------------------------------------------------------- 1 | # manati_nginx.conf 2 | 3 | # the upstream component nginx needs to connect to 4 | upstream manati { 5 | # server 127.0.0.1:8001; 6 | server unix:///var/run/manati.sock; # for a file socket, more effective 7 | } 8 | 9 | # configuration of the server 10 | server { 11 | # the port your site will be served on 12 | listen 80; 13 | server_name .manatiproject.com; 14 | charset utf-8; 15 | # max upload size 16 | client_max_body_size 75M; # adjust to taste 17 | # Django media 18 | location /media { 19 | alias /var/www/manati/media; # your Django project's media files - amend as required 20 | } 21 | location /static { 22 | alias /var/www/manati/staticfiles; # your Django project's static files - amend as required 23 | } 24 | # Finally, send all non-media requests to the Django server. 25 | location / { 26 | uwsgi_pass manati; 27 | include /var/www/manati/uwsgi_params; # the uwsgi_params file you installed 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/email_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block content_title %}

{% blocktrans with user.username as username %}Account » {{ username }}{% endblocktrans %}

{% endblock %} 5 | 6 | {% block content %} 7 |
8 | 14 | {% csrf_token %} 15 |
16 | {% trans "Change email address" %} 17 | {{ form.as_p }} 18 |
19 | 20 |
21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /compose/local/nginx/conf.d/web.conf: -------------------------------------------------------------------------------- 1 | map $http_upgrade $connection_upgrade { 2 | default upgrade; 3 | '' close; 4 | } 5 | 6 | server { 7 | 8 | listen 80 default_server; 9 | server_name _; 10 | charset utf-8; 11 | client_max_body_size 50M; 12 | 13 | #location / { 14 | # root /usr/share/nginx/html; 15 | # index index.html index.htm; 16 | #} 17 | 18 | #error_page 404 /404.html; 19 | 20 | # redirect server error pages to the static page /50x.html 21 | error_page 500 502 503 504 /50x.html; 22 | location = /50x.html { 23 | root /usr/share/nginx/html; 24 | } 25 | 26 | location /static/ { 27 | alias /code/staticfiles/; 28 | } 29 | 30 | location /media/ { 31 | alias /code/staticfiles/; 32 | } 33 | 34 | location / { 35 | proxy_pass http://unix:/run/gunicorn.sock; 36 | proxy_set_header Host $host; 37 | proxy_set_header X-Real-IP $remote_addr; 38 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /utility/gunicorn_start.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NAME="manati" # Name of the application 4 | DJANGODIR=. # Django project directory 5 | NUM_WORKERS=10 # how many worker processes should Gunicorn spawn 6 | DJANGO_SETTINGS_MODULE=config.settings.local # which settings file should Django use 7 | DJANGO_WSGI_MODULE=config.wsgi # WSGI module name 8 | PORT=8000 9 | 10 | echo "Starting $NAME as `whoami`" 11 | 12 | export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE 13 | export PYTHONPATH=$DJANGODIR:$PYTHONPATH 14 | 15 | # Create the run directory if it doesn't exist 16 | RUNDIR=$(dirname $SOCKFILE) 17 | test -d $RUNDIR || mkdir -p $RUNDIR 18 | 19 | # Start your Django Unicorn 20 | # Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon) 21 | exec gunicorn ${DJANGO_WSGI_MODULE}:application \ 22 | --name $NAME \ 23 | --workers $NUM_WORKERS \ 24 | --bind=127.0.0.1:$PORT \ 25 | --log-level=info \ 26 | --log-file=- 27 | -------------------------------------------------------------------------------- /manati/templates/account/password_reset_from_key.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load crispy_forms_tags %} 5 | {% block head_title %}{% trans "Change Password" %}{% endblock %} 6 | 7 | {% block inner %} 8 |

{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}

9 | 10 | {% if token_fail %} 11 | {% url 'account_reset_password' as passwd_reset_url %} 12 |

{% blocktrans %}The password reset link was invalid, possibly because it has already been used. Please request a new password reset.{% endblocktrans %}

13 | {% else %} 14 | {% if form %} 15 |
16 | {% csrf_token %} 17 | {{ form|crispy }} 18 | 19 |
20 | {% else %} 21 |

{% trans 'Your password is now changed.' %}

22 | {% endif %} 23 | {% endif %} 24 | {% endblock %} 25 | 26 | -------------------------------------------------------------------------------- /manati/login/models.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from __future__ import unicode_literals 22 | 23 | from django.db import models 24 | 25 | # Create your models here. 26 | -------------------------------------------------------------------------------- /manati/templates/account/email_confirm.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account %} 5 | 6 | {% block head_title %}{% trans "Confirm E-mail Address" %}{% endblock %} 7 | 8 | 9 | {% block inner %} 10 |

{% trans "Confirm E-mail Address" %}

11 | 12 | {% if confirmation %} 13 | 14 | {% user_display confirmation.email_address.user as user_display %} 15 | 16 |

{% blocktrans with confirmation.email_address.email as email %}Please confirm that {{ email }} is an e-mail address for user {{ user_display }}.{% endblocktrans %}

17 | 18 |
19 | {% csrf_token %} 20 | 21 |
22 | 23 | {% else %} 24 | 25 | {% url 'account_email' as email_url %} 26 | 27 |

{% blocktrans %}This e-mail confirmation link expired or is invalid. Please issue a new e-mail confirmation request.{% endblocktrans %}

28 | 29 | {% endif %} 30 | 31 | {% endblock %} 32 | 33 | -------------------------------------------------------------------------------- /manati/login/apps.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from __future__ import unicode_literals 22 | 23 | from django.apps import AppConfig 24 | 25 | 26 | class LoginConfig(AppConfig): 27 | name = 'manati.login' 28 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # PostgreSQL 2 | POSTGRES_PASSWORD=password 3 | POSTGRES_USER=manati_db_user 4 | POSTGRES_DB=manati_db 5 | POSTGRES_HOST=localhost 6 | POSTGRES_PORT=5432 7 | DATABASE_URL=postgres://manati_db_user:password@localhost:5432/manati_db 8 | CONN_MAX_AGE= 9 | 10 | # Domain name, used by caddy 11 | DOMAIN_NAME=manatiproject.com 12 | 13 | # General settings 14 | # DJANGO_READ_DOT_ENV_FILE=True 15 | DJANGO_ADMIN_URL= 16 | DJANGO_SETTINGS_MODULE=config.settings.local 17 | DJANGO_SECRET_KEY=ZkZas*1kYc0@xyGC4oh8_+/%EEyUVkrpR2=dq1eyh62zgledwH 18 | DJANGO_ALLOWED_HOSTS=.manatiproject.com 19 | 20 | 21 | # AWS Settings 22 | DJANGO_AWS_ACCESS_KEY_ID= 23 | DJANGO_AWS_SECRET_ACCESS_KEY= 24 | DJANGO_AWS_STORAGE_BUCKET_NAME= 25 | 26 | # Used with email 27 | DJANGO_MAILGUN_API_KEY= 28 | DJANGO_SERVER_EMAIL= 29 | MAILGUN_SENDER_DOMAIN= 30 | 31 | # Security! Better to use DNS for this task, but you can use redirect 32 | DJANGO_SECURE_SSL_REDIRECT=False 33 | 34 | # django-allauth 35 | DJANGO_ACCOUNT_ALLOW_REGISTRATION=True 36 | 37 | # django debug 38 | DJANGO_DEBUG=True 39 | 40 | # Redis Settings 41 | REDIS_URL=redis://127.0.0.1:6379 42 | REDIS_PASSWORD= 43 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local') 7 | 8 | try: 9 | from django.core.management import execute_from_command_line 10 | except ImportError: 11 | # The above import may fail for some other reason. Ensure that the 12 | # issue is really that Django is missing to avoid masking other 13 | # exceptions on Python 2. 14 | try: 15 | import django # noqa 16 | except ImportError: 17 | raise ImportError( 18 | "Couldn't import Django. Are you sure it's installed and " 19 | "available on your PYTHONPATH environment variable? Did you " 20 | "forget to activate a virtual environment?" 21 | ) 22 | raise 23 | 24 | # This allows easy placement of apps within the interior 25 | # manati directory. 26 | current_path = os.path.dirname(os.path.abspath(__file__)) 27 | sys.path.append(os.path.join(current_path, 'manati')) 28 | 29 | execute_from_command_line(sys.argv) 30 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/signin_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'userena/base_userena.html' %} 2 | {% load i18n %} 3 | 4 | {% block title %}{% trans "Signin" %}{% endblock %} 5 | 6 | {% block content %} 7 |
8 | {% csrf_token %} 9 |
10 | {% trans "Signin" %} 11 | {{ form.non_field_errors }} 12 | {% for field in form %} 13 | {{ field.errors }} 14 | {% comment %} Displaying checkboxes differently {% endcomment %} 15 | {% if field.name == 'remember_me' %} 16 |

17 | 18 |

19 | {% else %} 20 |

21 | {{ field.label_tag }} 22 | {{ field }} 23 |

24 | {% endif %} 25 | {% endfor %} 26 |
27 | 28 |

{% trans "Forgot your password?" %}

29 | {% if next %}{% endif %} 30 |
31 | {% endblock %} 32 | -------------------------------------------------------------------------------- /manati/user_profiles/templates/userena/password_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% load i18n %} 3 | {% load crispy_forms_tags %} 4 | {% block title %} 5 | {% trans "Change password" %} 6 | {% endblock %} 7 | {% block content_title %}

{% blocktrans with user.username as username %}Account » {{ username }}{% endblocktrans %}

{% endblock %} 8 | {% block content %} 9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {% csrf_token %} 17 | {{ form | crispy }} 18 | 19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /manati/login/urls.py: -------------------------------------------------------------------------------- 1 | #!python 2 | # 3 | # Copyright (c) 2017 Stratosphere Laboratory. 4 | # 5 | # This file is part of ManaTI Project 6 | # (see ). It was created by 'Raul B. Netto ' 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU Affero General Public License as 10 | # published by the Free Software Foundation, either version 3 of the 11 | # License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU Affero General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU Affero General Public License 19 | # along with this program. See the file 'docs/LICENSE' or see 20 | # for copying permission. 21 | # 22 | from django.conf.urls import url 23 | from . import views 24 | 25 | # We are adding a URL called /home 26 | urlpatterns = [ 27 | url(r'^$', views.home, name='home'), 28 | ] 29 | -------------------------------------------------------------------------------- /manati/static/sass/project.scss: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | // project specific CSS goes here 6 | 7 | //////////////////////////////// 8 | //Variables// 9 | //////////////////////////////// 10 | 11 | // Alert colors 12 | 13 | $white: #fff; 14 | $mint-green: #d6e9c6; 15 | $black: #000; 16 | $pink: #f2dede; 17 | $dark-pink: #eed3d7; 18 | $red: #b94a48; 19 | 20 | //////////////////////////////// 21 | //Alerts// 22 | //////////////////////////////// 23 | 24 | // bootstrap alert CSS, translated to the django-standard levels of 25 | // debug, info, success, warning, error 26 | 27 | .alert-debug { 28 | background-color: $white; 29 | border-color: $mint-green; 30 | color: $black; 31 | } 32 | 33 | .alert-error { 34 | background-color: $pink; 35 | border-color: $dark-pink; 36 | color: $red; 37 | } 38 | 39 | //////////////////////////////// 40 | //Django Toolbar// 41 | //////////////////////////////// 42 | 43 | // Display django-debug-toolbar. 44 | // See https://github.com/django-debug-toolbar/django-debug-toolbar/issues/742 45 | // and https://github.com/pydanny/cookiecutter-django/issues/317 46 | 47 | [hidden][style="display: block;"] { 48 | display: block !important; 49 | } 50 | -------------------------------------------------------------------------------- /manati/api_manager/apps.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from __future__ import unicode_literals 22 | 23 | from django.apps import AppConfig 24 | 25 | 26 | class ApiManagerConfig(AppConfig): 27 | name = 'manati.api_manager' 28 | verbose_name = "API Manager" 29 | -------------------------------------------------------------------------------- /utility/.env.pro: -------------------------------------------------------------------------------- 1 | # PostgreSQL 2 | POSTGRES_PASSWORD=password 3 | POSTGRES_USER=manati_db_user 4 | POSTGRES_DB=manati_db 5 | POSTGRES_HOST=postgres 6 | POSTGRES_PORT=5432 7 | DATABASE_URL=postgres://manati_db_user:password@postgres:5432/manati_db 8 | DATABASE_TEST_URL=postgres://manati_db_user:password@postgres:5432/manati_db_test 9 | CONN_MAX_AGE=60 10 | 11 | # Domain name, used by caddy 12 | DOMAIN_NAME=manatiproject.com 13 | 14 | # General settings 15 | # DJANGO_READ_DOT_ENV_FILE=True 16 | DJANGO_ADMIN_URL= 17 | DJANGO_SETTINGS_MODULE=config.settings.production 18 | DJANGO_SECRET_KEY=ZkZas*1kYc0@xyGC4oh8_+/%EEyUVkrpR2=dq1eyh62zgledwH 19 | DJANGO_ALLOWED_HOSTS=* 20 | 21 | 22 | # AWS Settings 23 | DJANGO_AWS_ACCESS_KEY_ID= 24 | DJANGO_AWS_SECRET_ACCESS_KEY= 25 | DJANGO_AWS_STORAGE_BUCKET_NAME= 26 | 27 | # Used with email 28 | DJANGO_MAILGUN_API_KEY= 29 | DJANGO_SERVER_EMAIL= 30 | MAILGUN_SENDER_DOMAIN= 31 | 32 | # Security! Better to use DNS for this task, but you can use redirect 33 | DJANGO_SECURE_SSL_REDIRECT=False 34 | 35 | # django-allauth 36 | DJANGO_ACCOUNT_ALLOW_REGISTRATION=True 37 | 38 | # django debug 39 | DJANGO_DEBUG=True 40 | 41 | # Redis Settings 42 | REDIS_URL=redis://redis:6379 43 | -------------------------------------------------------------------------------- /manati/share_modules/constants.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from model_utils import Choices 22 | 23 | class Constant: 24 | URL_ATTRIBUTES_AVAILABLE = ["http.url", "http_url", "host"] 25 | IP_DEST_ATTRIBUTES_AVAILABLE = ["endpoints.server", "endpoints_server", "id.resp_h"] -------------------------------------------------------------------------------- /manati/ip_profiles/urls.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.conf.urls import url 22 | from manati.ip_profiles import views 23 | 24 | app_name = 'ip_profiles' 25 | 26 | urlpatterns = [ 27 | url(r'^$', views.index, name='index'), 28 | url(r'^new$', views.new, name='new'), 29 | ] 30 | -------------------------------------------------------------------------------- /compose/production/django/Dockerfile.example: -------------------------------------------------------------------------------- 1 | FROM python:3.5 2 | 3 | ENV PYTHONUNBUFFERED 1 4 | 5 | RUN groupadd -r django \ 6 | && useradd -r -g django django 7 | 8 | # Requirements have to be pulled and installed here, otherwise caching won't work 9 | COPY ./requirements /requirements 10 | RUN pip install --no-cache-dir -r /requirements/production.txt \ 11 | && rm -rf /requirements 12 | 13 | COPY ./compose/production/django/gunicorn.sh /gunicorn.sh 14 | RUN sed -i 's/\r//' /gunicorn.sh 15 | RUN chmod +x /gunicorn.sh 16 | RUN chown django /gunicorn.sh 17 | 18 | COPY ./compose/production/django/entrypoint.sh /entrypoint.sh 19 | RUN sed -i 's/\r//' /entrypoint.sh 20 | RUN chmod +x /entrypoint.sh 21 | RUN chown django /entrypoint.sh 22 | 23 | COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh 24 | RUN sed -i 's/\r//' /start-celeryworker.sh 25 | RUN chmod +x /start-celeryworker.sh 26 | 27 | COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh 28 | RUN sed -i 's/\r//' /start-celerybeat.sh 29 | RUN chmod +x /start-celerybeat.sh 30 | 31 | COPY . /app 32 | 33 | RUN chown -R django /app 34 | 35 | USER django 36 | 37 | WORKDIR /app 38 | 39 | ENTRYPOINT ["/entrypoint.sh"] 40 | -------------------------------------------------------------------------------- /manati/user_profiles/migrations/0002_auto_20171101_1828.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9.7 on 2017-11-01 17:28 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import encrypted_fields.fields 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | dependencies = [ 12 | ('user_profiles', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.AddField( 17 | model_name='userprofile', 18 | name='threshold_whois_distance', 19 | field=models.IntegerField(default=75, null=True), 20 | ), 21 | migrations.AlterField( 22 | model_name='userprofile', 23 | name='passivetotal_user', 24 | field=encrypted_fields.fields.EncryptedEmailField(max_length=60, null=True), 25 | ), 26 | migrations.AlterField( 27 | model_name='userprofile', 28 | name='privacy', 29 | field=models.CharField(choices=[(b'open', 'Open'), (b'registered', 'Registered'), (b'closed', 'Closed')], default=b'closed', help_text='Designates who can view your profile.', max_length=15, verbose_name='privacy'), 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /manati/contrib/sites/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | import django.contrib.sites.models 2 | from django.contrib.sites.models import _simple_domain_name_validator 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [] 9 | 10 | operations = [ 11 | migrations.CreateModel( 12 | name='Site', 13 | fields=[ 14 | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 15 | ('domain', models.CharField( 16 | max_length=100, verbose_name='domain name', validators=[_simple_domain_name_validator] 17 | )), 18 | ('name', models.CharField(max_length=50, verbose_name='display name')), 19 | ], 20 | options={ 21 | 'ordering': ('domain',), 22 | 'db_table': 'django_site', 23 | 'verbose_name': 'site', 24 | 'verbose_name_plural': 'sites', 25 | }, 26 | bases=(models.Model,), 27 | managers=[ 28 | ('objects', django.contrib.sites.models.SiteManager()), 29 | ], 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /manati/analysis_sessions/templates/manati_ui/analysis_session/modal_vt.html: -------------------------------------------------------------------------------- 1 | 2 | 28 | -------------------------------------------------------------------------------- /manati/contrib/sites/migrations/0003_set_site_domain_and_name.py: -------------------------------------------------------------------------------- 1 | """ 2 | To understand why this file is here, please read: 3 | 4 | http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django 5 | """ 6 | from django.conf import settings 7 | from django.db import migrations 8 | 9 | 10 | def update_site_forward(apps, schema_editor): 11 | """Set site domain and name.""" 12 | Site = apps.get_model('sites', 'Site') 13 | Site.objects.update_or_create( 14 | id=settings.SITE_ID, 15 | defaults={ 16 | 'domain': 'manatiproject.com', 17 | 'name': 'ManaTI Project' 18 | } 19 | ) 20 | 21 | 22 | def update_site_backward(apps, schema_editor): 23 | """Revert site domain and name to default.""" 24 | Site = apps.get_model('sites', 'Site') 25 | Site.objects.update_or_create( 26 | id=settings.SITE_ID, 27 | defaults={ 28 | 'domain': 'example.com', 29 | 'name': 'example.com' 30 | } 31 | ) 32 | 33 | 34 | class Migration(migrations.Migration): 35 | 36 | dependencies = [ 37 | ('sites', '0002_alter_domain_unique'), 38 | ] 39 | 40 | operations = [ 41 | migrations.RunPython(update_site_forward, update_site_backward), 42 | ] 43 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0025_whoisconsult_deleting.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from __future__ import unicode_literals 22 | from django.db import migrations, models 23 | 24 | class Migration(migrations.Migration): 25 | 26 | dependencies = [("analysis_sessions", "0024_analysissession_status")] 27 | 28 | operations = [ 29 | migrations.DeleteModel("WhoisConsult"), 30 | ] 31 | -------------------------------------------------------------------------------- /compose/production/django/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | 6 | # todo: turn on after #1295 7 | # set -o nounset 8 | 9 | 10 | cmd="$@" 11 | 12 | # This entrypoint is used to play nicely with the current cookiecutter configuration. 13 | # Since docker-compose relies heavily on environment variables itself for configuration, we'd have to define multiple 14 | # environment variables just to support cookiecutter out of the box. That makes no sense, so this little entrypoint 15 | # does all this for us. 16 | export REDIS_URL=redis://redis:6379 17 | 18 | # the official postgres image uses 'postgres' as default user if not set explictly. 19 | if [ -z "$POSTGRES_USER" ]; then 20 | export POSTGRES_USER=postgres 21 | fi 22 | 23 | export DATABASE_URL=postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@postgres:5432/$POSTGRES_USER 24 | 25 | 26 | function postgres_ready(){ 27 | python << END 28 | import sys 29 | import psycopg2 30 | try: 31 | conn = psycopg2.connect(dbname="$POSTGRES_USER", user="$POSTGRES_USER", password="$POSTGRES_PASSWORD", host="postgres") 32 | except psycopg2.OperationalError: 33 | sys.exit(-1) 34 | sys.exit(0) 35 | END 36 | } 37 | 38 | until postgres_ready; do 39 | >&2 echo "Postgres is unavailable - sleeping" 40 | sleep 1 41 | done 42 | 43 | >&2 echo "Postgres is up - continuing..." 44 | exec $cmd 45 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/js/sb-admin-2.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // $('#side-menu').metisMenu(); 4 | 5 | }); 6 | 7 | //Loads the correct sidebar on window load, 8 | //collapses the sidebar on window resize. 9 | // Sets the min-height of #page-wrapper to window size 10 | $(function() { 11 | $(window).bind("load resize", function() { 12 | topOffset = 50; 13 | width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; 14 | if (width < 768) { 15 | $('div.navbar-collapse').addClass('collapse'); 16 | topOffset = 100; // 2-row-menu 17 | } else { 18 | $('div.navbar-collapse').removeClass('collapse'); 19 | } 20 | 21 | height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; 22 | height = height - topOffset; 23 | if (height < 1) height = 1; 24 | if (height > topOffset) { 25 | $("#page-wrapper").css("min-height", (height) + "px"); 26 | } 27 | }); 28 | 29 | var url = window.location; 30 | var element = $('ul.nav a').filter(function() { 31 | return this.href == url || url.href.indexOf(this.href) == 0; 32 | }).addClass('active').parent().parent().addClass('in').parent(); 33 | if (element.is('li')) { 34 | element.addClass('active'); 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /manati/analysis_sessions/templates/manati_ui/user/edit.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %} 3 | User Profile - {{ user.username }} 4 | {% endblock %} 5 | {% block content %} 6 |
7 |
8 |
9 |
10 |
11 |
12 | {% csrf_token %} 13 | {% for field in form %} 14 |
15 | 16 | {{ field.errors }} 17 | 18 |
19 | {% endfor %} 20 | 21 |
22 |
23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /manati/analysis_sessions/management/commands/createsuperuser2.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016-2018 Stratosphere Lab 2 | # This file is part of ManaTI Project - https://stratosphereips.org 3 | # See the file 'docs/LICENSE' for copying permission. 4 | # Created by Raul B. Netto on 1/28/18. 5 | from django.contrib.auth.management.commands import createsuperuser 6 | from django.core.management import CommandError 7 | 8 | 9 | class Command(createsuperuser.Command): 10 | help = 'Crate a superuser, and allow password to be provided' 11 | 12 | def add_arguments(self, parser): 13 | super(Command, self).add_arguments(parser) 14 | parser.add_argument( 15 | '--password', dest='password', default=None, 16 | help='Specifies the password for the superuser.', 17 | ) 18 | 19 | def handle(self, *args, **options): 20 | password = options.get('password') 21 | username = options.get('username') 22 | database = options.get('database') 23 | 24 | if password and not username: 25 | raise CommandError("--username is required if specifying --password") 26 | 27 | super(Command, self).handle(*args, **options) 28 | 29 | if password: 30 | user = self.UserModel._default_manager.db_manager(database).get(username=username) 31 | user.set_password(password) 32 | user.save() 33 | -------------------------------------------------------------------------------- /manati/analysis_sessions/serializers.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from rest_framework import serializers 22 | 23 | 24 | class WeblogSerializer(serializers.Serializer): 25 | id = serializers.CharField(read_only=True) 26 | attributes = serializers.JSONField(required=True) 27 | verdict = serializers.CharField(read_only=True) 28 | register_status = serializers.IntegerField(read_only=True) 29 | analysis_session_id = serializers.IntegerField(read_only=True) 30 | -------------------------------------------------------------------------------- /manati/analysis_sessions/forms.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django import forms 22 | from django.contrib.auth.models import User 23 | 24 | 25 | class UserProfileForm(forms.Form): 26 | username = forms.CharField(max_length=20) 27 | first_name = forms.CharField(max_length=50) 28 | last_name = forms.CharField(max_length=50) 29 | email = forms.EmailField(max_length=50) 30 | 31 | class Meta: 32 | model = User 33 | fields = ['first_name', 'last_name', 'username', 'email'] 34 | 35 | -------------------------------------------------------------------------------- /manati/templates/errors/maintenance-page.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 |
5 | 6 |
7 |

Temporary Maintenance

8 |

The web server for is currently undergoing some maintenance.

9 | Try This Page Again 10 |
11 |
12 | 13 |
14 |
15 |
16 |
17 |

What happened?

18 |

Servers and websites need regular maintnance just like a car to keep them up and running smoothly.

19 |
20 |
21 |

What can I do?

22 |

If you're a site vistor

23 |

If you need immediate assistance, please send us an email instead. We apologize for any inconvenience.

24 |

If you're the site owner

25 |

The maintenance period will mostly likely be very brief, the best thing to do is to check back in a few minutes and everything will probably be working normal agian.

26 |
27 |
28 |
29 |
30 | 31 | {% endblock %} -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0008_auto_20160927_1243.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2016-09-27 12:43 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0007_auto_20160923_1716'), 32 | ] 33 | 34 | operations = [ 35 | migrations.RenameModel( 36 | old_name='Comments', 37 | new_name='Comment', 38 | ), 39 | ] 40 | -------------------------------------------------------------------------------- /manati/api_manager/migrations/0003_remove_externalmodule_acronym.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2016-11-09 20:49 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('api_manager', '0002_externalmodule_status'), 32 | ] 33 | 34 | operations = [ 35 | migrations.RemoveField( 36 | model_name='externalmodule', 37 | name='acronym', 38 | ), 39 | ] 40 | -------------------------------------------------------------------------------- /manati/templates/errors/503.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 |
5 | 6 |
7 |

503 Service Unavailable

8 |

The web server is returning an unexpected temporary error for .

9 | Try This Page Again 10 |
11 |
12 |
13 |
14 |
15 |
16 |

What happened?

17 |

A 503 error status implies that this is a temporary condition due to a temporary overloading or maintenance of the server. This error is normally a brief temporary interuption.

18 |
19 |
20 |

What can I do?

21 |

If you're a site vistor

22 |

If you need immediate assistance, please send us an email instead. We apologize for any inconvenience.

23 |

If you're the site owner

24 |

This error is mostly likely very brief, the best thing to do is to check back in a few minutes and everything will probably be working normal agian.

25 |
26 |
27 |
28 |
29 | 30 | {% endblock %} -------------------------------------------------------------------------------- /manati/api_manager/migrations/0006_auto_20171019_0043.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-10-18 22:43 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('api_manager', '0005_ioc_whois_relatedexecuted'), 32 | ] 33 | 34 | operations = [ 35 | migrations.AlterField( 36 | model_name='externalmodule', 37 | name='description', 38 | field=models.TextField(), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /manati/login/forms.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.contrib.auth.forms import AuthenticationForm 22 | from django import forms 23 | 24 | class LoginForm(AuthenticationForm): 25 | username = forms.CharField(label="Username", max_length=30, 26 | widget=forms.TextInput(attrs={"placeholder": "Username", 'class': 'form-control', 'name': 'username', "autofocus": True})) 27 | password = forms.CharField(label="Password", max_length=30, 28 | widget=forms.TextInput(attrs={'type': 'password', "placeholder": "Password",'class': 'form-control', 'name': 'password'})) -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0009_auto_20160927_1438.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2016-09-27 14:38 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0008_auto_20160927_1243'), 32 | ] 33 | 34 | operations = [ 35 | migrations.AlterField( 36 | model_name='metric', 37 | name='event_name', 38 | field=models.CharField(max_length=200), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0022_weblog_was_whois_related.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-03-03 12:52 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0021_fixing_whois_related_attribute'), 32 | ] 33 | 34 | operations = [ 35 | migrations.AddField( 36 | model_name='weblog', 37 | name='was_whois_related', 38 | field=models.BooleanField(default=False), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0023_analysissession_uuid.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-04-06 10:02 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0022_weblog_was_whois_related'), 32 | ] 33 | 34 | operations = [ 35 | migrations.AddField( 36 | model_name='analysissession', 37 | name='uuid', 38 | field=models.CharField(default='', max_length=40, null=True), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /manati/login/views.py: -------------------------------------------------------------------------------- 1 | #!python 2 | # 3 | # Copyright (c) 2017 Stratosphere Laboratory. 4 | # 5 | # This file is part of ManaTI Project 6 | # (see ). It was created by 'Raul B. Netto ' 7 | # 8 | # This program is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU Affero General Public License as 10 | # published by the Free Software Foundation, either version 3 of the 11 | # License, or (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU Affero General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU Affero General Public License 19 | # along with this program. See the file 'docs/LICENSE' or see 20 | # for copying permission. 21 | # 22 | from django.contrib.auth.decorators import login_required 23 | from django.core.urlresolvers import reverse 24 | from django.http import HttpResponseRedirect 25 | 26 | # Create your views here. 27 | # this login required decorator is to not allow to any 28 | # view without authenticating 29 | @login_required(login_url="/manati_project/login/") 30 | def home(request): 31 | redirect = request.GET.get('redirect_to','') 32 | if redirect == '': 33 | return HttpResponseRedirect(reverse('manati_ui:new_analysis_session')) 34 | else: 35 | return HttpResponseRedirect(str(redirect)) 36 | -------------------------------------------------------------------------------- /manati/templates/base_login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {% load staticfiles %} 12 | {% load bootstrap3 %} 13 | 14 | ManaTI Project 15 | 16 | 17 | {% bootstrap_css %} 18 | 19 | {% bootstrap_javascript %} 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 37 | 38 |
39 | {% block content %}{% endblock %} 40 | 41 |
42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /manati/templates/errors/500.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 |
5 | 6 |
7 |

500 Internal Server Error

8 |

The web server is returning an internal error for . 9 |

10 | Try This Page Again 12 |
13 |
14 |
15 |
16 |
17 |
18 |

What happened?

19 |

A 500 error status implies there is a problem with the web server's software causing it 20 | to malfunction.

21 |
22 |
23 |

What can I do?

24 |

If you're a site vistor

25 |

Nothing you can do at the moment. If you need immediate assistance, please send us an email instead. 26 | We apologize for any inconvenience.

27 |

If you're the site owner

28 |

This error can only be fixed by server admins, please contact your website provider.

29 |
30 |
31 |
32 |
33 | {% endblock %} -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0030_auto_20170926_1740.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-09-26 15:40 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0029_auto_20170627_0944'), 32 | ] 33 | 34 | operations = [ 35 | migrations.RemoveField( 36 | model_name='ioc', 37 | name='whois_related_iocs', 38 | ), 39 | migrations.RunSQL('DROP TABLE IF EXISTS manati_indicators_of_compromise_whois_related_iocs;'), 40 | 41 | ] 42 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0024_analysissession_status.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-04-06 15:01 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0023_analysissession_uuid'), 32 | ] 33 | 34 | operations = [ 35 | migrations.AddField( 36 | model_name='analysissession', 37 | name='status', 38 | field=models.CharField(choices=[('open', 'Open'), ('closed', 'Closed')], default='open', max_length=30), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /manati/templates/errors/404.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 | 5 |
6 | 7 |
8 |

404 Not Found

9 |

We couldn't find what you're looking for on .

10 |

Take Me To The Homepage 11 |

12 |
13 |
14 |
15 |
16 |
17 |
18 |

What happened?

19 |

A 404 error status implies that the file or page that you're looking for could not be 20 | found.

21 |
22 |
23 |

What can I do?

24 |

If you're a site vistor

25 |

Please use your browsers back button and check that you're in the right place. If you need immediate 26 | assistance, please send us an email instead.

27 |

If you're the site owner

28 |

Please check that you're in the right place and get in touch with your website provider if you 29 | believe this to be an error.

30 |
31 |
32 |
33 |
34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /manati/templates/account/login.html: -------------------------------------------------------------------------------- 1 | {% extends "account/base.html" %} 2 | 3 | {% load i18n %} 4 | {% load account socialaccount %} 5 | {% load crispy_forms_tags %} 6 | 7 | {% block head_title %}{% trans "Sign In" %}{% endblock %} 8 | 9 | {% block inner %} 10 | 11 |

{% trans "Sign In" %}

12 | 13 | {% get_providers as socialaccount_providers %} 14 | 15 | {% if socialaccount_providers %} 16 |

{% blocktrans with site.name as site_name %}Please sign in with one 17 | of your existing third party accounts. Or, sign up 18 | for a {{ site_name }} account and sign in below:{% endblocktrans %}

19 | 20 |
21 | 22 |
    23 | {% include "socialaccount/snippets/provider_list.html" with process="login" %} 24 |
25 | 26 | 27 | 28 |
29 | 30 | {% include "socialaccount/snippets/login_extra.html" %} 31 | 32 | {% else %} 33 |

{% blocktrans %}If you have not created an account yet, then please 34 | sign up first.{% endblocktrans %}

35 | {% endif %} 36 | 37 | 46 | 47 | {% endblock %} 48 | 49 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0002_auto_20160817_1047.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2016-08-17 10:47 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0001_initial'), 32 | ] 33 | 34 | operations = [ 35 | migrations.AlterField( 36 | model_name='weblog', 37 | name='verdict', 38 | field=models.CharField(choices=[('malicious', 'malicious'), ('legitimate', 'legitimate'), ('suspicious', 'suspicious'), ('false_positive', 'False Positive')], default='legitimate', max_length=20), 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/libs/bootstrap-toggle.min.css: -------------------------------------------------------------------------------- 1 | /*! ======================================================================== 2 | * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 3 | * http://www.bootstraptoggle.com 4 | * ======================================================================== 5 | * Copyright 2014 Min Hur, The New York Times Company 6 | * Licensed under MIT 7 | * ======================================================================== */ 8 | .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} 9 | .toggle{position:relative;overflow:hidden} 10 | .toggle input[type=checkbox]{display:none} 11 | .toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} 12 | .toggle.off .toggle-group{left:-100%} 13 | .toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} 14 | .toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} 15 | .toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} 16 | .toggle.btn{min-width:59px;min-height:34px} 17 | .toggle-on.btn{padding-right:24px} 18 | .toggle-off.btn{padding-left:24px} 19 | .toggle.btn-lg{min-width:79px;min-height:45px} 20 | .toggle-on.btn-lg{padding-right:31px} 21 | .toggle-off.btn-lg{padding-left:31px} 22 | .toggle-handle.btn-lg{width:40px} 23 | .toggle.btn-sm{min-width:50px;min-height:30px} 24 | .toggle-on.btn-sm{padding-right:20px} 25 | .toggle-off.btn-sm{padding-left:20px} 26 | .toggle.btn-xs{min-width:35px;min-height:22px} 27 | .toggle-on.btn-xs{padding-right:12px} 28 | .toggle-off.btn-xs{padding-left:12px} -------------------------------------------------------------------------------- /manati/templates/errors/403.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 |
5 |
6 |

403 Forbidden

7 |

Sorry! You don't have access permissions for that on . 8 |

9 |

Take Me To The Homepage 10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |

What happened?

18 |

A 403 error status indicates that you don't have permission to access the file or page. 19 | In general, web servers and websites have directories and files that are not open to the public web 20 | for security reasons.

21 |
22 |
23 |

What can I do?

24 |

If you're a site vistor

25 |

Please use your browsers back button and check that you're in the right place. If you need immediate 26 | assistance, please send us an email instead.

27 |

If you're the site owner

28 |

Please check that you're in the right place and get in touch with your website provider if you 29 | believe this to be an error.

30 |
31 |
32 |
33 |
34 | 35 | {% endblock %} -------------------------------------------------------------------------------- /manati/templates/errors/rate-limit-error.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 |
5 | 6 |
7 |

Slow Down

8 |

Rate Limit Exceeded.

9 |

The web server is returning a rate limiting notification .

10 | Try This Page Again 11 |
12 |
13 |
14 |
15 |
16 |
17 |

What happened?

18 |

This error means you have exceeded the request rate limit for the the web server you are accessing.

19 |

Rate Limit Thersholds are set higher than a human browsing this site should be able to reach and mostly for protection against automated requests and attacks.

20 |
21 |
22 |

What can I do?

23 |

If you're a site vistor

24 |

The best thing to do is to slow down with your requests and try again in a few minutes. We apologize for any inconvenience.

25 |

If you're the site owner

26 |

This error is mostly likely very brief, the best thing to do is to check back in a few minutes and everything will probably be working normal agian. If the error persists, contact your website host.

27 |
28 |
29 |
30 |
31 | 32 | {% endblock %} -------------------------------------------------------------------------------- /manati/analysis_sessions/helpers.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.http import Http404, HttpResponseRedirect, HttpResponse, JsonResponse 22 | from django.template.loader import render_to_string, get_template 23 | from django.template import Context, Template 24 | from django.contrib import messages 25 | 26 | # `data` is a python dictionary 27 | def render_to_json(request, data): 28 | # return HttpResponse( 29 | # json.dumps(data, ensure_ascii=False), 30 | # mimetype=request.is_ajax() and "application/json" or "text/html" 31 | # ) 32 | temp = get_template('messages.html') 33 | c = {"stooges": ["Larry", "Curly", "Moe"]} 34 | msg = render_to_string('manati_ui/messages.html', {messages: messages}) 35 | # msg = temp.render(c) 36 | return JsonResponse(dict(data=data, msg=msg )) 37 | 38 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0017_comment_user.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2016-11-07 23:23 23 | from __future__ import unicode_literals 24 | 25 | from django.conf import settings 26 | from django.db import migrations, models 27 | import django.db.models.deletion 28 | 29 | 30 | class Migration(migrations.Migration): 31 | 32 | dependencies = [ 33 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 34 | ('analysis_sessions','0016_whoisconsult'), 35 | ] 36 | 37 | operations = [ 38 | migrations.AddField( 39 | model_name='comment', 40 | name='user', 41 | field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), 42 | ), 43 | ] 44 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/css/libs/buttons.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 3px 8px rgba(0,0,0,0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:0.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}ul.dt-button-collection.dropdown-menu{display:block;z-index:2002;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}ul.dt-button-collection.dropdown-menu.fixed{position:fixed;top:50%;left:50%;margin-left:-75px;border-radius:0}ul.dt-button-collection.dropdown-menu.fixed.two-column{margin-left:-150px}ul.dt-button-collection.dropdown-menu.fixed.three-column{margin-left:-225px}ul.dt-button-collection.dropdown-menu.fixed.four-column{margin-left:-300px}ul.dt-button-collection.dropdown-menu>*{-webkit-column-break-inside:avoid;break-inside:avoid}ul.dt-button-collection.dropdown-menu.two-column{width:300px;padding-bottom:1px;-webkit-column-count:2;-moz-column-count:2;-ms-column-count:2;-o-column-count:2;column-count:2}ul.dt-button-collection.dropdown-menu.three-column{width:450px;padding-bottom:1px;-webkit-column-count:3;-moz-column-count:3;-ms-column-count:3;-o-column-count:3;column-count:3}ul.dt-button-collection.dropdown-menu.four-column{width:600px;padding-bottom:1px;-webkit-column-count:4;-moz-column-count:4;-ms-column-count:4;-o-column-count:4;column-count:4}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;z-index:2001}@media screen and (max-width: 767px){div.dt-buttons{float:none;width:100%;text-align:center;margin-bottom:0.5em}div.dt-buttons a.btn{float:none}} 2 | -------------------------------------------------------------------------------- /manati/analysis_sessions/signals.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from django.db.models.signals import post_save,pre_save,pre_delete 22 | from django.dispatch import receiver 23 | from manati.analysis_sessions.models import Weblog 24 | 25 | 26 | @receiver(pre_save, sender=Weblog) 27 | def check_id(sender, **kwargs): 28 | instance = kwargs.get('instance') 29 | if len(instance.id.split(':')) <= 1: 30 | instance.id = str(instance.analysis_session_id)+":"+str(instance.id) 31 | 32 | 33 | @receiver(post_save, sender=Weblog) 34 | def create_ioc(sender, **kwargs): 35 | instance = kwargs.get('instance') 36 | created = kwargs.get('created') 37 | if created: 38 | instance.create_IOCs() 39 | 40 | 41 | @receiver(pre_delete, sender=Weblog) 42 | def pre_delete_story(sender, instance, **kwargs): 43 | instance.ioc_set.clear() 44 | -------------------------------------------------------------------------------- /config/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for ManaTI Project project. 3 | 4 | This module contains the WSGI application used by Django's development server 5 | and any production WSGI deployments. It should expose a module-level variable 6 | named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover 7 | this application via the ``WSGI_APPLICATION`` setting. 8 | 9 | Usually you will have the standard Django WSGI application here, but it also 10 | might make sense to replace the whole Django WSGI application with a custom one 11 | that later delegates to the Django one. For example, you could introduce WSGI 12 | middleware here, or combine a Django application with an application of another 13 | framework. 14 | 15 | """ 16 | import os 17 | import sys 18 | 19 | from django.core.wsgi import get_wsgi_application 20 | from whitenoise.django import DjangoWhiteNoise 21 | 22 | # This allows easy placement of apps within the interior 23 | # manati directory. 24 | app_path = os.path.dirname(os.path.abspath(__file__)).replace('/config', '') 25 | sys.path.append(os.path.join(app_path, 'manati')) 26 | 27 | 28 | 29 | # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks 30 | # if running multiple sites in the same mod_wsgi process. To fix this, use 31 | # mod_wsgi daemon mode with each site in its own daemon process, or use 32 | # os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.production" 33 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") 34 | 35 | # This application object is used by any WSGI server configured to use this 36 | # file. This includes Django's development server, if the WSGI_APPLICATION 37 | # setting points here. 38 | application = get_wsgi_application() 39 | 40 | application = DjangoWhiteNoise(application) 41 | -------------------------------------------------------------------------------- /manati/analysis_sessions/templates/manati_ui/analysis_session/hotkeys_list.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% block title %} 3 | List of Active Hotkey 4 | {% endblock %} 5 | {% block content %} 6 |
7 |
8 |
9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {% if hotkeys %} 21 | {% for hotkey in hotkeys %} 22 | 23 | 24 | 25 | 26 | 27 | {% endfor %} 28 | {% else %} 29 | 30 | {% endif %} 31 | 32 |
#Description FunctionCommand
{{ forloop.counter }}{{ hotkey.description }}{{ hotkey.command }}
No Hotkey available.
33 |
34 |
35 | 36 |
37 | 38 |
39 | 40 |
41 | {% endblock %} 42 | -------------------------------------------------------------------------------- /manati/api_manager/common/abstracts.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | from abc import ABCMeta, abstractmethod 22 | 23 | 24 | class Module(object): 25 | 26 | __metaclass__ = ABCMeta 27 | module_name = '' 28 | description = '' 29 | version = '' 30 | authors = [] 31 | events = [] 32 | 33 | def __init__(self): 34 | pass 35 | 36 | @abstractmethod 37 | def run(self, *args): 38 | # try: 39 | # self.args = self.parser.parse_args(self.command_line) 40 | # except ArgumentErrorCallback as e: 41 | # self.log(*e.get()) 42 | pass 43 | 44 | def module_key(self): 45 | return self.module_name + "_" + self.version 46 | 47 | def __str__(self): 48 | return "; ".join([self.module_name, ", ".join(self.authors), self.description]) 49 | 50 | def __getitem__(self, key): 51 | return self.module_name 52 | -------------------------------------------------------------------------------- /utility/production_settings/ubuntu/supervisor-manati.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | logfile = /var/log/supervisor/supervisord.log 3 | user = root 4 | 5 | [unix_http_server] 6 | file = /var/run/supervisor.sock 7 | chmod = 0700 8 | 9 | [supervisorctl] 10 | serverurl = unix:///var/run/supervisor.sock 11 | 12 | [program:manati_uwsgi] 13 | command = /var/www/manati/.vmanati/bin/uwsgi --ini /var/www/manati/manati_uwsgi.ini --enable-threads --logto /tmp/manati_uwsgi.log 14 | stopsignal=QUIT 15 | autostart=true 16 | autorestart=true 17 | redirect_stderr=true 18 | environment=DJANGO_SETTINGS_MODULE=config.settings.test,DJANGO_READ_DOT_ENV_FILE=True; 19 | 20 | [program:manati_nginx] 21 | command = /usr/sbin/nginx 22 | user = root 23 | 24 | ;[program:manati_gunicorn] 25 | ;command = /var/www/manati/gunicorn_start.bash ; Command to start app 26 | ;user = root ; User to run as 27 | ;stdout_logfile =/tmp/gunicorn_supervisor.log ; Where to write log messages 28 | ;redirect_stderr = true ; Save stderr in the same log 29 | ;environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8;DJANGO_SETTINGS_MODULE=config.settings.test;DJANGO_READ_DOT_ENV_FILE=True; Set UTF-8 as default encoding 30 | 31 | [program:redis] 32 | command = redis-server /etc/redis/redis.conf 33 | stdout_logfile = /tmp/redis_supervisor.log 34 | redirect_stderr = true ; Save stderr in the same log 35 | environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 36 | 37 | [program:rqworker] 38 | command = /var/www/manati/.vmanati/bin/python /var/www/manati/manage.py rqworker high default low 39 | stdout_logfile = /tmp/rqworker_supervisor.log 40 | redirect_stderr = true ; Save stderr in the same log 41 | environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8,DJANGO_SETTINGS_MODULE=config.settings.test,DJANGO_READ_DOT_ENV_FILE=True; 42 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0029_auto_20170627_0944.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-06-27 09:44 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0028_migrate_weblogs_to_ioc'), 32 | ] 33 | 34 | operations = [ 35 | migrations.RemoveField( 36 | model_name='weblog', 37 | name='was_whois_related', 38 | ), 39 | migrations.RemoveField( 40 | model_name='weblog', 41 | name='whois_related_weblogs', 42 | ), 43 | migrations.AddField( 44 | model_name='ioc', 45 | name='whois_related_iocs', 46 | field=models.ManyToManyField(related_name='_ioc_whois_related_iocs_+', to='analysis_sessions.IOC'), 47 | ), 48 | ] 49 | -------------------------------------------------------------------------------- /manati/analysis_sessions/static/manati_ui/js/libs/metisMenu.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * metismenu - v1.1.3 3 | * Easy menu jQuery plugin for Twitter Bootstrap 3 4 | * https://github.com/onokumus/metisMenu 5 | * 6 | * Made by Osman Nuri Okumus 7 | * Under MIT License 8 | */ 9 | !function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document); -------------------------------------------------------------------------------- /manati/api_manager/migrations/0002_externalmodule_status.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2016-10-21 11:47 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | from django.core import management 27 | 28 | 29 | # def run_migrations_background_task(apps, schema_editor): 30 | # management.call_command("makemigrations", "background_task") 31 | # management.call_command("migrate", "background_task") 32 | 33 | class Migration(migrations.Migration): 34 | 35 | dependencies = [ 36 | ('api_manager', '0001_initial'), 37 | ] 38 | 39 | operations = [ 40 | migrations.AddField( 41 | model_name='externalmodule', 42 | name='status', 43 | field=models.CharField(choices=[('idle', 'idle'), ('running', 'running'), ('removed', 'removed')], default='idle', max_length=20), 44 | ), 45 | # migrations.RunPython(run_migrations_background_task), 46 | ] 47 | -------------------------------------------------------------------------------- /utility/install_python_dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | WORK_DIR="$(dirname "$0")" 4 | PROJECT_DIR="$(dirname "$WORK_DIR")" 5 | 6 | pip --version >/dev/null 2>&1 || { 7 | echo >&2 -e "\npip is required but it's not installed." 8 | echo >&2 -e "You can install it by running the following command:\n" 9 | echo >&2 "wget https://bootstrap.pypa.io/get-pip.py --output-document=get-pip.py; chmod +x get-pip.py; sudo -H python3 get-pip.py" 10 | echo >&2 -e "\n" 11 | echo >&2 -e "\nFor more information, see pip documentation: https://pip.pypa.io/en/latest/" 12 | exit 1; 13 | } 14 | 15 | virtualenv --version >/dev/null 2>&1 || { 16 | echo >&2 -e "\nvirtualenv is required but it's not installed." 17 | echo >&2 -e "You can install it by running the following command:\n" 18 | echo >&2 "sudo -H pip3 install virtualenv" 19 | echo >&2 -e "\n" 20 | echo >&2 -e "\nFor more information, see virtualenv documentation: https://virtualenv.pypa.io/en/latest/" 21 | exit 1; 22 | } 23 | 24 | if [ -z "$VIRTUAL_ENV" ]; then 25 | echo >&2 -e "\nYou need activate a virtualenv first" 26 | echo >&2 -e 'If you do not have a virtualenv created, run the following command to create and automatically activate a new virtualenv named "venv" on current folder:\n' 27 | echo >&2 -e "virtualenv venv --python=\`which python3\`" 28 | echo >&2 -e "\nTo leave/disable the currently active virtualenv, run the following command:\n" 29 | echo >&2 "deactivate" 30 | echo >&2 -e "\nTo activate the virtualenv again, run the following command:\n" 31 | echo >&2 "source venv/bin/activate" 32 | echo >&2 -e "\nFor more information, see virtualenv documentation: https://virtualenv.pypa.io/en/latest/" 33 | echo >&2 -e "\n" 34 | exit 1; 35 | else 36 | 37 | pip install -r $PROJECT_DIR/requirements/local.txt 38 | pip install -r $PROJECT_DIR/requirements/test.txt 39 | pip install -r $PROJECT_DIR/requirements.txt 40 | fi 41 | -------------------------------------------------------------------------------- /manati/templates/errors/504.html: -------------------------------------------------------------------------------- 1 | {% extends 'base_error.html' %} 2 | {% block content %} 3 | 4 |
5 | 6 |
7 |

504 Gateway Timeout

8 |

The web server is returning an unexpected networking error for .

9 | Try This Page Again 10 |
11 |
12 |
13 |
14 | 15 | 16 |
17 |
18 |

What happened?

19 |

A 504 error status implies there is a slow IP communication problem between back-end servers attempting to fulfill this request.

20 |
21 |
22 |

What can I do?

23 |

If you're a site vistor

24 |

Check to see if this website down for everyone or just you. 25 |

31 |

Also, clearing your browser cache and refreshing the page may clear this issue. If the problem persissts and you need immediate assistance, please send us an email instead.

32 |

If you're the site owner

33 |

Clearing your browser cache and refreshing the page may clear this issue. If the problem persissts and you need immediate assistance, please contact your website provider.

34 |
35 |
36 |
37 |
38 | {% endblock %} -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: true 2 | before_install: 3 | - sudo apt-get update -qq 4 | - sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb 5 | - sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev 6 | - sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip 7 | - sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev 8 | - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm 9 | before_script: 10 | - psql -c "create user manati_db_user with password 'password';" -U postgres 11 | - psql -c 'create database manati_db_test;' -U postgres 12 | - psql -c 'grant all privileges on database manati_db_test to manati_db_user;' -U postgres 13 | - psql -c 'alter role manati_db_user createrole createdb;' -U postgres 14 | - sudo redis-server /etc/redis/redis.conf --port 6379 15 | services: 16 | - postgresql 17 | - redis-server 18 | language: python 19 | python: 20 | - "2.7" 21 | install: 22 | - pip install -r requirements/test.txt 23 | script: # command to run tests 24 | - pytest 25 | cache: pip 26 | notifications: 27 | slack: 28 | secure: EBGiTRO7dPrTJMeNTT8GWx0RTtwmeHPqRS2fYA5Cpz2jgxdE2vNAcO4Mi4Vkc8FvlWvqHzgNrcVmq2/5XaGokiy95bxsQLWXooixFhcHxu8gFKiAqc3jDSSExFQObVBnPiT9MFnR0YiAFvHEqnp0RZPfmGjqwlOp5z07//mYnW6QvvwlYVO7Jh4jHaBRUj8e9d5tUu0H/bd77g98ewjt9i62bcrMN+WrBov/ifAVmzwgmntwn7LhHWSioelja0cGV8n+LWLqz1gF23cmvsNHpf4r9pNKpeQqth3u3L2qfuZWprgJ/GMDDQ8k8UQKHaUrk7ZkhgXcTXtrUgZIGuxAx0jNwmjn/3uRDOTbbP26djEh0xUDa/Eicbv+apbun7VZmAeEmAAfBUgNRFIBeFbdPc2xWQK8i0P3JtCO3YwxD31Shzm7anHte7ftQqyhkrCPSbLXuCBRk2ZyG9h2lTtK4SDjhWwayZXIrYVdQ6aE5kDxTBfKfzXAxECkGuoO/uNmgbU+SPyCxhnluWgJE2Se/s800STpNUuQKIc20eDEiRfavJbDEE6Lfbh8xER6vo+G88FU+8T8gR2UjyUhpWY+8wWnCXFAssecWL5ODdlNCA5PgaHINfqBh9kx0QMd7+hQWdOk+1nwt3RenXQ+WJiuH/KkY4u4ZES1W5igmqcNDk4= 29 | on_success: change # default: always 30 | on_failure: always # default: always 31 | -------------------------------------------------------------------------------- /manati/analysis_sessions/migrations/0021_fixing_whois_related_attribute.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | # -*- coding: utf-8 -*- 22 | # Generated by Django 1.9.7 on 2017-02-22 09:42 23 | from __future__ import unicode_literals 24 | 25 | from django.db import migrations, models 26 | 27 | 28 | class Migration(migrations.Migration): 29 | 30 | dependencies = [ 31 | ('analysis_sessions','0020_type_file_migration'), 32 | ] 33 | 34 | operations = [ 35 | migrations.RemoveField( 36 | model_name='weblog', 37 | name='whois_related_weblogs', 38 | ), 39 | migrations.RemoveField( 40 | model_name='whoisrelatedweblog', 41 | name='weblog_domain_a', 42 | ), 43 | migrations.DeleteModel( 44 | name='WhoisRelatedWeblog', 45 | ), 46 | migrations.AddField( 47 | model_name='weblog', 48 | name='whois_related_weblogs', 49 | field=models.ManyToManyField(related_name='_weblog_whois_related_weblogs_+', to='analysis_sessions.Weblog'), 50 | ), 51 | 52 | ] 53 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # also called local.ymml 2 | version: '3' 3 | 4 | services: 5 | nginx: 6 | build: './compose/local/nginx/.' 7 | ports: 8 | - '8080:80' 9 | depends_on: 10 | - web 11 | web: 12 | build: 13 | context: '.' 14 | dockerfile: './compose/local/django/Dockerfile' 15 | image: 'manati' 16 | env_file: 17 | - '.env' 18 | - '.env-docker' 19 | expose: 20 | - "8000" 21 | ports: 22 | - '127.0.0.1:8000:8000' 23 | command: 'bash -c "python manage.py migrate && python manage.py check_external_modules && python manage.py collectstatic --noinput && gunicorn config.wsgi:application -w 2 -b :8000 --capture-output --enable-stdio-inheritance --log-level=debug --access-logfile=- --log-file=-"' 24 | volumes: 25 | - '.:/code' 26 | - 'manati_cachedata:/cache' 27 | - 'manati_mediadata:/media' 28 | links: 29 | - postgres 30 | - redis 31 | depends_on: 32 | - postgres 33 | - redis 34 | 35 | postgres: 36 | restart: always 37 | container_name: 'postgres' 38 | image: 'postgres:9.6.5' 39 | env_file: 40 | - '.env-docker' 41 | ports: 42 | - '127.0.0.1:5432:5432' 43 | volumes: 44 | - 'manati_pgdata:/var/lib/postgresql/data/' 45 | - 'manati_pglog:/var/log/postgresql' 46 | - 'manati_pgetc:/etc/postgresql' 47 | 48 | redis: 49 | container_name: 'redis' 50 | image: 'redis:3.2.0' 51 | ports: 52 | - '127.0.0.1:6379:6379' 53 | volumes: 54 | - 'manati_redisdata:/data' 55 | 56 | rqworker: 57 | build: 58 | context: . 59 | dockerfile: './compose/local/django/Dockerfile' 60 | env_file: 61 | - '.env-docker' 62 | command: "bash -c 'python manage.py rqworker high default low'" 63 | volumes: 64 | - .:/code 65 | depends_on: 66 | - redis 67 | 68 | volumes: 69 | manati_pgdata: 70 | manati_pglog: 71 | manati_pgetc: 72 | manati_redisdata: 73 | manati_cachedata: 74 | manati_mediadata: 75 | 76 | 77 | -------------------------------------------------------------------------------- /manati/analysis_sessions/utils.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Stratosphere Laboratory. 3 | # 4 | # This file is part of ManaTI Project 5 | # (see ). It was created by 'Raul B. Netto ' 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU Affero General Public License as 9 | # published by the Free Software Foundation, either version 3 of the 10 | # License, or (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU Affero General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU Affero General Public License 18 | # along with this program. See the file 'docs/LICENSE' or see 19 | # for copying permission. 20 | # 21 | import linecache 22 | import sys 23 | import logging 24 | from django_enumfield import enum 25 | from threading import Thread 26 | 27 | # Get an instance of a logger 28 | logger = logging.getLogger(__name__) 29 | 30 | 31 | def print_exception(): 32 | logger.error(str(sys.exc_info())) 33 | exc_type, exc_obj, tb = sys.exc_info() 34 | f = tb.tb_frame 35 | lineno = tb.tb_lineno 36 | filename = f.f_code.co_filename 37 | linecache.checkcache(filename) 38 | line = linecache.getline(filename, lineno, f.f_globals) 39 | error = 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj) 40 | print(error) 41 | return error 42 | 43 | 44 | def postpone(function): 45 | def decorator(*args, **kwargs): 46 | t = Thread(target = function, args=args, kwargs=kwargs) 47 | t.daemon = True 48 | t.start() 49 | return decorator 50 | 51 | 52 | class RegisterStatus(enum.Enum): 53 | NOT_SAVE = -1 54 | READY = 0 55 | CLIENT_MODIFICATION = 1 56 | MODULE_MODIFICATION = 3 57 | UPGRADING_LOCK = 2 58 | -------------------------------------------------------------------------------- /compose/production/postgres/restore.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o pipefail 5 | set -o nounset 6 | 7 | 8 | # we might run into trouble when using the default `postgres` user, e.g. when dropping the postgres 9 | # database in restore.sh. Check that something else is used here 10 | if [ "$POSTGRES_USER" == "postgres" ] 11 | then 12 | echo "restoring as the postgres user is not supported, make sure to set the POSTGRES_USER environment variable" 13 | exit 1 14 | fi 15 | 16 | # export the postgres password so that subsequent commands don't ask for it 17 | export PGPASSWORD=$POSTGRES_PASSWORD 18 | 19 | # check that we have an argument for a filename candidate 20 | if [[ $# -eq 0 ]] ; then 21 | echo 'usage:' 22 | echo ' docker-compose -f production.yml.example run postgres restore ' 23 | echo '' 24 | echo 'to get a list of available backups, run:' 25 | echo ' docker-compose -f production.yml.example run postgres list-backups' 26 | exit 1 27 | fi 28 | 29 | # set the backupfile variable 30 | BACKUPFILE=/backups/$1 31 | 32 | # check that the file exists 33 | if ! [ -f $BACKUPFILE ]; then 34 | echo "backup file not found" 35 | echo 'to get a list of available backups, run:' 36 | echo ' docker-compose -f production.yml.example run postgres list-backups' 37 | exit 1 38 | fi 39 | 40 | echo "beginning restore from $1" 41 | echo "-------------------------" 42 | 43 | # delete the db 44 | # deleting the db can fail. Spit out a comment if this happens but continue since the db 45 | # is created in the next step 46 | echo "deleting old database $POSTGRES_USER" 47 | if dropdb -h postgres -U $POSTGRES_USER $POSTGRES_USER 48 | then echo "deleted $POSTGRES_USER database" 49 | else echo "database $POSTGRES_USER does not exist, continue" 50 | fi 51 | 52 | # create a new database 53 | echo "creating new database $POSTGRES_USER" 54 | createdb -h postgres -U $POSTGRES_USER $POSTGRES_USER -O $POSTGRES_USER 55 | 56 | # restore the database 57 | echo "restoring database $POSTGRES_USER" 58 | gunzip -c $BACKUPFILE | psql -h postgres -U $POSTGRES_USER 59 | --------------------------------------------------------------------------------