lib/tasks/threat/search_blcheck_list.rb
def run
    super
    entity_name = _get_entity_name
    entity_type = _get_entity_type_string

    file = File.open "#{$intrigue_basedir}/data/blcheck.json"
    blacklists = JSON.load file

    # Initialisation
    dns_obj = Resolv::DNS.new()
    # Check IP if they are listed in one of 117 blacklists
    if entity_type == "IpAddress"
      inves = entity_name
      check_blcheck inves, dns_obj, blacklists
    elsif entity_type == "Domain"
      # Resolv domin name address
      inves = dns_obj.getaddress(entity_name)
      check_blcheck inves, dns_obj, blacklists
    else
      _log_error "Unsupported entity type"
    end
  end
## Default method, subclasses must override this
Default method, subclasses must override this
Default method subclasses must override this
def run
    super
    entity_name = _get_entity_name
    entity_type = _get_entity_type_string
    file = File.open "#{$intrigue_basedir}/data/blcheck.json"
    blacklists = JSON.load file
    dns_obj = Resolv::DNS.new()
    if entity_type == "IpAddress"
      inves = entity_name
      check_blcheck inves, dns_obj, blacklists
    elsif entity_type == "Domain"
      inves = dns_obj.getaddress(entity_name)
      check_blcheck inves, dns_obj, blacklists
    else
      _log_error "Unsupported entity type"
    end
  end
def run super entity_name = _get_entity_name entity_type = _get_entity_type_string file = File . open "#{$intrigue_basedir}/data/blcheck.json" blacklists = JSON . load file dns_obj = Resolv :: DNS . new ( ) if entity_type == "IpAddress" inves = entity_name check_blcheck inves , dns_obj , blacklists elsif entity_type == "Domain" inves = dns_obj . getaddress ( entity_name ) check_blcheck inves , dns_obj , blacklists else _log_error "Unsupported entity type" end end
Default method, subclasses must override this
Default method subclasses must override this
# Initialisation # Check IP if they are listed in one of 117 blacklists # Resolv domin name address