Exemple #1
0
def sslscan(request):
    """

    :return:
    """
    global sslscan_output
    all_sslscan = sslscan_result_db.objects.all()

    if request.method == 'POST':
        scan_url = request.POST.get('scan_url')
        project_id = request.POST.get('project_id')
        scan_id = uuid.uuid4()

        try:
            sslscan_output = subprocess.check_output(['sslscan', '--no-colour', scan_url])
            print(sslscan_output)

        except Exception as e:
            print (e)

        dump_scans = sslscan_result_db(scan_url=scan_url,
                                       scan_id=scan_id,
                                       project_id=project_id,
                                       sslscan_output=sslscan_output)

        dump_scans.save()

    return render(request,
                  'sslscan_list.html',
                  {'all_sslscan': all_sslscan}

                  )
Exemple #2
0
def sslscan(request):
    """

    :return:
    """
    global sslscan_output
    all_sslscan = sslscan_result_db.objects.all()

    if request.method == 'POST':
        scan_url = request.POST.get('scan_url')
        project_id = request.POST.get('project_id')
        scan_id = uuid.uuid4()

        try:
            sslscan_output = subprocess.check_output(['sslscan', '--no-colour', scan_url])
            print(sslscan_output)

        except Exception as e:
            print (e)

        dump_scans = sslscan_result_db(scan_url=scan_url,
                                       scan_id=scan_id,
                                       project_id=project_id,
                                       sslscan_output=sslscan_output)

        dump_scans.save()

    return render(request,
                  'sslscan_list.html',
                  {'all_sslscan': all_sslscan}

                  )
Exemple #3
0
def sslscan(request):
    """

    :return:
    """
    username = request.user.username
    global sslscan_output
    all_sslscan = sslscan_result_db.objects.filter(username=username)

    user = request.user

    if request.method == 'POST':
        scan_url = request.POST.get('scan_url')
        project_id = request.POST.get('project_id')

        scan_item = str(scan_url)
        value = scan_item.replace(" ", "")
        value_split = value.split(',')
        split_length = value_split.__len__()
        for i in range(0, split_length):
            scan_id = uuid.uuid4()
            scans_url = value_split.__getitem__(i)

            try:
                sslscan_output = subprocess.check_output(
                    ['sslscan', '--no-colour', scans_url])
                notify.send(user, recipient=user, verb='SSLScan Completed')

            except Exception as e:
                print(e)

            dump_scans = sslscan_result_db(
                scan_url=scans_url,
                scan_id=scan_id,
                project_id=project_id,
                sslscan_output=sslscan_output,
                username=username,
            )

            dump_scans.save()
            return HttpResponseRedirect(reverse('tools:sslscan'))

    return render(request, 'sslscan_list.html', {'all_sslscan': all_sslscan})
Exemple #4
0
def sslscan(request):
    """

    :return:
    """
    global sslscan_output
    all_sslscan = sslscan_result_db.objects.all()

    if request.method == 'POST':
        scan_url = request.POST.get('scan_url')
        project_id = request.POST.get('project_id')

        scan_item = str(scan_url)
        value = scan_item.replace(" ", "")
        value_split = value.split(',')
        split_length = value_split.__len__()
        for i in range(0, split_length):
            scan_id = uuid.uuid4()
            scans_url = value_split.__getitem__(i)

            try:
                sslscan_output = subprocess.check_output(['sslscan', '--no-colour', scans_url])
                print(sslscan_output)

            except Exception as e:
                print (e)

            dump_scans = sslscan_result_db(scan_url=scans_url,
                                           scan_id=scan_id,
                                           project_id=project_id,
                                           sslscan_output=sslscan_output)

            dump_scans.save()

    return render(request,
                  'sslscan_list.html',
                  {'all_sslscan': all_sslscan}

                  )