Skip to content

Commit

Permalink
Merge a0e0207 into db5d464
Browse files Browse the repository at this point in the history
  • Loading branch information
timmc committed Apr 18, 2019
2 parents db5d464 + a0e0207 commit 8121cdc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This project adheres to [CHANGELOG](http://keepachangelog.com/).

## [Unreleased]
### Changed
- Print out all A records for wildcard, not just first one

### Added
- Filter out subdomains with an A record matching a wildcard A record

## [1.2.2] - 2018-04-24
### Changed
- Python 3 is now a requirement when installing via setup.py (including pip)
Expand Down
9 changes: 7 additions & 2 deletions fierce/fierce.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ def fierce(**kwargs):
random_subdomain = str(random.randint(1e10, 1e11))
random_domain = concatenate_subdomains(domain, [random_subdomain])
wildcard = query(resolver, random_domain, record_type='A')
print("Wildcard: {}".format(wildcard[0].address if wildcard else "failure"))
wildcard_ips = set([rr.address for rr in wildcard.rrset]) if wildcard else None
print("Wildcard: {}".format(', '.join(wildcard_ips) if wildcard_ips else "failure"))

subdomains = get_subdomains(
kwargs["subdomains"],
Expand All @@ -359,7 +360,11 @@ def fierce(**kwargs):
if record is None or record.rrset is None:
continue

ip = ipaddress.IPv4Address(record[0].address)
ips = [rr.address for rr in record.rrset]
if len(wildcard_ips.intersection(ips)) != 0:
continue

ip = ipaddress.IPv4Address(ips[0])

http_connection_headers = None
if kwargs.get('connect') and not ip.is_private:
Expand Down

0 comments on commit 8121cdc

Please sign in to comment.