Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, task_id, target, params, project_uuid):
AsyncTask.__init__(self, task_id, 'masscan', target, params, project_uuid)
self.proc = None
self.exit_code = None
self.stdout = []
self.stderr = []
""" Keeps class with the interfaces that are pulled by worker
to manager the launched instance of scan. """
import re
import json
import signal
import asyncio
from asyncio.subprocess import PIPE
from black.workers.common.async_task import AsyncTask
from black.workers.masscan.db_save import save_raw_output
class MasscanTask(AsyncTask):
""" Major class for working with masscan """
def __init__(self, task_id, target, params, project_uuid):
AsyncTask.__init__(self, task_id, 'masscan', target, params, project_uuid)
self.proc = None
self.exit_code = None
self.stdout = []
self.stderr = []
if type(self.target) == list:
self.target = ",".join(self.target)
async def start(self):
""" Launch the task and readers of stdout, stderr """
print(self.params, self.target)
""" Keeps class with the interfaces that are pulled by worker
to manager the launched instance of scan. """
import re
import json
import signal
import asyncio
from asyncio.subprocess import PIPE
from black.workers.common.async_task import AsyncTask
from black.workers.amass.db_save import Saver
from common.logger import log
@log
class AmassTask(AsyncTask):
""" Major class for working with amass """
def __init__(self, task_id, target, params, project_uuid):
AsyncTask.__init__(self, task_id, 'amass', target, params, project_uuid)
self.proc = None
self.exit_code = None
self.stdout = []
self.stderr = []
async def start(self):
""" Launch the task and readers of stdout, stderr """
try:
self.command = ['amass', 'enum' '-d'] + [self.target] + [self.params['program']['argv']]
print(' '.join(self.command))
import asyncio
import aiodns
import time
import json
import itertools
from collections import defaultdict
from black.workers.common.async_task import AsyncTask
from .save import save
domain_to_brute = 'anatoly.tech'
class DNSScanTask(AsyncTask):
""" Major class for working with dnsscan """
def __init__(self, task_id, target, params, project_uuid):
AsyncTask.__init__(self, task_id, 'dnsscan', target, params, project_uuid)
# program_params = params['program']
# self.params_object = program_params
self.request_queue = asyncio.Queue()
self.resolver = aiodns.DNSResolver()
self.pool_size = 10
self.new_ips_ids = list()
self.new_hosts_ids = list()
def send_notification(self, command):