# Path: moth/views/base/form_template_view.py
# class FormTemplateView(VulnerableTemplateView):
#     template_name = "moth/vulnerability-form.html"
#     form_klass = GenericForm
#     
#     def get(self, request, *args, **kwargs):
#         form = self.form_klass()
#         return render(request, self.template_name,
#                       self.get_context_data(form=form))


from django.shortcuts import render
from moth.views.base.form_template_view import FormTemplateView
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit
        return render(request, self.template_name, context)


class PostImpossibleCredsLoginFormView(PostGuessableCredsLoginFormView):
    description = title = 'Complex credentials in form authentication'
    tags = ['impossible', 'not guessable', 'POST']
    url_path = 'impossible.py'
    users = (('admin', 'admin1ad0min2admin3admi0n4'),)


class PasswordOnlyGuessableCredsLoginFormView(FormTemplateView):
    title = 'Guessable credentials in form authentication'
    description = 'This login form only requires a password'
    tags = ['trivial', 'POST', 'password only']
    url_path = 'guessable_pass_only.py'
    passwords = ('1234',)
    form_klass = PasswordOnlyLoginForm
    references = ['https://github.com/andresriancho/w3af/issues/799']
    
    def post(self, request, *args, **kwds):
        context = self.get_context_data()
        
        if request.POST['password'] in self.passwords:
            context['message'] = AUTH_SUCCESS
        else:
            context['message'] = AUTH_ERROR
        
        return render(request, self.template_name, context)



# Path: moth/views/base/form_template_view.py
# class FormTemplateView(VulnerableTemplateView):
#     template_name = "moth/vulnerability-form.html"
#     form_klass = GenericForm
#     
#     def get(self, request, *args, **kwargs):
#         form = self.form_klass()
#         return render(request, self.template_name,
#                       self.get_context_data(form=form))


# Path: moth/views/vulnerabilities/bruteforce/form.py
from django.shortcuts import render
from moth.views.base.form_template_view import FormTemplateView
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Submit

        return render(request, self.template_name, context)


class PostImpossibleCredsLoginFormView(PostGuessableCredsLoginFormView):
    description = title = 'Complex credentials in form authentication'
    tags = ['impossible', 'not guessable', 'POST']
    url_path = 'impossible.py'
    users = (('admin', 'admin1ad0min2admin3admi0n4'),)


class PasswordOnlyGuessableCredsLoginFormView(FormTemplateView):
    title = 'Guessable credentials in form authentication'
    description = 'This login form only requires a password'
    tags = ['trivial', 'POST', 'password only']
    url_path = 'guessable_pass_only.py'
    passwords = ('1234',)
    form_klass = PasswordOnlyLoginForm
    references = ['https://github.com/andresriancho/w3af/issues/799']
    
    def post(self, request, *args, **kwds):
        context = self.get_context_data()
        
        if request.POST['password'] in self.passwords:
            context['message'] = AUTH_SUCCESS
        else:
            context['message'] = AUTH_ERROR
        
        return render(request, self.template_name, context)



class GetGuessableCredsLoginFormView(FormTemplateView):