def start_scan_helper(target_urls, scan_profile, scan_info_setup):
 scan_info = ScanInfo()
 SCANS[get_new_scan_id()] = scan_info
 scan_info.w3af_core = w3af_core = w3afCore()
 scan_info.target_urls = target_urls
 scan_info.output = RESTAPIOutput()
 scan_info_setup.set()
 (scan_profile_file_name, profile_path) = create_temp_profile(scan_profile)
 om.manager.set_output_plugins([])
 try:
  w3af_core.profiles.use_profile(scan_profile_file_name, workdir=profile_path)
  target_options = w3af_core.target.get_options()
  target_option = target_options['target']
  target_option.set_value([URL(u) for u in target_urls])
  w3af_core.target.set_options(target_options)
  w3af_core.plugins.init_plugins()
  om.manager.set_output_plugin_inst(scan_info.output)
  w3af_core.verify_environment()
  w3af_core.start()
 except Exception as e:
  scan_info.exception = e
  try:
   w3af_core.stop()
  except AttributeError:
   pass
 finally:
  scan_info.finished = True
  try:
   os.unlink(os.path.join(profile_path, scan_profile_file_name))
  except (AttributeError, IOError) as _:
   pass

def start_scan_helper ( target_urls , scan_profile , scan_info_setup ) : scan_info = ScanInfo ( ) SCANS [ get_new_scan_id ( ) ] = scan_info scan_info . w3af_core = w3af_core = w3afCore ( ) scan_info . target_urls = target_urls scan_info . output = RESTAPIOutput ( ) scan_info_setup . set ( ) ( scan_profile_file_name , profile_path ) = create_temp_profile ( scan_profile ) om . manager . set_output_plugins ( [ ] ) try : w3af_core . profiles . use_profile ( scan_profile_file_name , workdir = profile_path ) target_options = w3af_core . target . get_options ( ) target_option = target_options [ 'target' ] target_option . set_value ( [ URL ( u ) for u in target_urls ] ) w3af_core . target . set_options ( target_options ) w3af_core . plugins . init_plugins ( ) om . manager . set_output_plugin_inst ( scan_info . output ) w3af_core . verify_environment ( ) w3af_core . start ( ) except Exception as e : scan_info . exception = e try : w3af_core . stop ( ) except AttributeError : pass finally : scan_info . finished = True try : os . unlink ( os . path . join ( profile_path , scan_profile_file_name ) ) except ( AttributeError , IOError ) as _ : pass
create a new instance of w3afcore .