Skip to content

Commit

Permalink
Now is possible to specify in scope file a domain name, fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nullt3r committed Jun 3, 2022
1 parent 386544d commit 98fecaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jfscan/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (1, 5, 0)
VERSION = (1, 5, 1)

__version__ = ".".join(map(str, VERSION))
17 changes: 10 additions & 7 deletions jfscan/core/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,12 @@ def target_in_scope(self, target):

scope_item = scope_item.strip()

# If scope item is just IP
if target == scope_item:
return True

# If scope item is in CIDR notation
if Validator.is_ipv6_cidr(scope_item):
elif Validator.is_ipv6_cidr(scope_item):

# If checked target is just IP
if Validator.is_ipv6(target):
Expand Down Expand Up @@ -342,12 +346,11 @@ def target_in_scope(self, target):
if network.supernet_of(ipaddress.ip_network(target)) is True:
return True

# If scope item is just IP
elif target == scope_item:
return True

elif target in utils.resolve_host(scope_item):
return True
elif Validator.is_domain(scope_item) is True:
resolved_scope_item = utils.resolve_host(scope_item)
if resolved_scope_item is not None:
if target in resolved_scope_item:
return True

# By default, we want to return False
return False

0 comments on commit 98fecaf

Please sign in to comment.