Beispiel #1
0
def scan(request):
    """
    :param request:
        domain: 127.0.0.1,erevus.me
        poc_name: struts;
        task_name: xxxx;
    :return:{
        status:1 目标都已有扫描结果或正在扫描
        status:200 可以去扫描
    """
    if request.method == 'POST':
        domains = str(request.POST.get('domains', "bilibili.com"))
        poc_name = request.POST.get('poc_name', "")
        task_name = request.POST.get('task_name', "")
        # mode = request.POST.get('mode', 1)

        targets = list(set(domains.split(',')))
        tmp_targets = list(set(domains.split(',')))
        # 已有数据或者在扫描的目标不进行扫描
        for target in tmp_targets:
            cannt_scan_target,status = check_status(target)
            if cannt_scan_target:
                targets.remove(cannt_scan_target)
        if targets:
            Task_control().launch(targets, poc_name, task_name)
            return JsonResponse({"status": 200})
        else:
            return JsonResponse({"status": 1})
Beispiel #2
0
def scan(request):
    """
    :param request:
        domain: 127.0.0.1,erevus.me
        poc_name: struts;
        task_name: xxxx;
    :return:{
        status:1 目标都已有扫描结果或正在扫描
        status:200 可以去扫描
    """
    if request.method == 'POST':
        domains = str(request.POST.get('domains', "bilibili.com"))
        poc_name = request.POST.get('poc_name', "")
        task_name = request.POST.get('task_name', "")
        # mode = request.POST.get('mode', 1)

        targets = list(set(domains.split(',')))
        tmp_targets = list(set(domains.split(',')))
        # 已有数据或者在扫描的目标不进行扫描
        for target in tmp_targets:
            cannt_scan_target, status = check_status(target)
            if cannt_scan_target:
                targets.remove(cannt_scan_target)
        if targets:
            Task_control().launch(targets, poc_name, task_name)
            return JsonResponse({"status": 200})
        else:
            return JsonResponse({"status": 1})
Beispiel #3
0
def scan(request):
    """
    :param request:
        domain: 127.0.0.1,erevus.me
        poc_name: struts;
        task_name: xxxx;
    :return:{
        status:1 目标都已有扫描结果或正在扫描
        status:200 可以去扫描
    """
    if request.method == 'POST':
        domains = str(request.POST.get('domains', "bilibili.com"))
        poc_name = request.POST.get('poc_name', "")
        task_name = request.POST.get('task_name', "")
        mode = int(request.POST.get('mode', 1))

        targets = list(set(domains.split(',')))
        tmp_targets = list(set(domains.split(',')))
        # 已有数据或者在扫描的目标不进行扫描
        if mode == 0:
            for target in tmp_targets:
                cannt_scan_target, status = check_status(target)
                if cannt_scan_target:
                    targets.remove(cannt_scan_target)
            if targets:
                Task_control().launch(targets, poc_name, task_name)
                return JsonResponse({"status": 200})
            else:
                return JsonResponse({"status": 1})
        else:
            cookie = request.POST.get('cookie', "")
            ua = request.POST.get(
                'ua',
                "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36"
            )
            if targets:
                for target in targets:
                    # 放爬虫
                    crawler.delay(target, cookie, ua)
                    return JsonResponse({"status": 200})
            else:
                return JsonResponse({"status": 1})
Beispiel #4
0
def scancheck(request):
    module = request.POST.get('module')
    if module == 'pocscan':
        domains = str(request.POST.get('domains', "bilibili.com"))
        targets = list(set(domains.split(',')))
        tmp_targets = list(set(domains.split(',')))
        for target in tmp_targets:
            cannt_scan_target, status = check_status(target)
            if cannt_scan_target:
                targets.remove(cannt_scan_target)
        if targets:
            Task_control().launch(targets, "", "")
            return JsonResponse({"status": 200})
        else:
            return JsonResponse({"status": 1})
    elif module == 'sqlmap':
        chromeapi(request)
    else:
        return JsonResponse({'status': "error"})
    return JsonResponse({'status': "200"})
Beispiel #5
0
def scancheck(request):
    module = request.POST.get('module')
    if module == 'pocscan':
        domains = str(request.POST.get('domains', "dhgate.com"))
        targets = list(set(domains.split(',')))
        tmp_targets = list(set(domains.split(',')))
        for target in tmp_targets:
            cannt_scan_target, status = check_status(target)
            if cannt_scan_target:
                targets.remove(cannt_scan_target)
        if targets:
            Task_control().launch(targets, "", "")
            return JsonResponse({"status": 200})
        else:
            return JsonResponse({"status": 1})
    elif module == 'sqlmap':
        print(1)
    else:
        return JsonResponse({'status': "error"})
    return JsonResponse({'status': "200"})
Beispiel #6
0
def scan(request):
    """
    :param request:
        domain: 127.0.0.1,erevus.me
        poc_name: struts;
        task_name: xxxx;
    :return:{
        status:1 目标都已有扫描结果或正在扫描
        status:200 可以去扫描
    """
    if request.method == 'POST':
        domains = str(request.POST.get('domains', "bilibili.com"))
        poc_name = request.POST.get('poc_name', "")
        task_name = request.POST.get('task_name', "")
        mode = int(request.POST.get('mode', 1))

        targets = list(set(domains.split(',')))
        tmp_targets = list(set(domains.split(',')))
        # 已有数据或者在扫描的目标不进行扫描
        if mode == 0:
            for target in tmp_targets:
                cannt_scan_target, status = check_status(target)
                if cannt_scan_target:
                    targets.remove(cannt_scan_target)
            if targets:
                Task_control().launch(targets, poc_name, task_name)
                return JsonResponse({"status": 200})
            else:
                return JsonResponse({"status": 1})
        else:
            cookie = request.POST.get('cookie', "")
            ua = request.POST.get('ua',
                                  "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36")
            if targets:
                for target in targets:
                    # 放爬虫
                    crawler.delay(target, cookie, ua)
                    return JsonResponse({"status": 200})
            else:
                return JsonResponse({"status": 1})