Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Domain Validation in 'check_dns_without_connection' Function #379

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions modules/flowalerts/flowalerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from slips_files.common.imports import *
from .TimerThread import TimerThread
from .set_evidence import Helper
from urllib.parse import urlparse
from slips_files.core.helpers.whitelist import Whitelist
import multiprocessing
import json
Expand Down Expand Up @@ -722,15 +723,16 @@ def check_dns_without_connection(
# - When there is an NXDOMAIN as answer, it means
# the domain isn't resolved, so we should not expect any connection later

parsed_domain = urlparse('http://' + domain).hostname

if (
'arpa' in domain
or '.local' in domain
or '*' in domain
or '.cymru.com' in domain[-10:]
or len(domain.split('.')) == 1
or domain == 'WPAD'
'arpa' in parsed_domain
or '.local' in parsed_domain
or '*' in parsed_domain
or parsed_domain.endswith('.cymru.com')
or len(parsed_domain.split('.')) == 1
or parsed_domain == 'WPAD'
or rcode_name != 'NOERROR'

):
return False
# One DNS query may not be answered exactly by UID, but the computer can re-ask the domain,
Expand Down