Skip to content

Commit

Permalink
Fix NoneType error when querying SOA records (#42)
Browse files Browse the repository at this point in the history
* Fix `NoneType` error

* Remove deprecated versions of python

* Prepare the release candidate

* Update minimal required version of python

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update setup.py

---------

Co-authored-by: mschwager <mschwager@users.noreply.github.com>
  • Loading branch information
maxkrivich and mschwager authored Jul 31, 2023
1 parent 99eca52 commit f32f639
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
- macos-latest
- windows-latest
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand Down
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,143 @@
# Change Log

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]

### Fixed

- Add proper error handling for cases when SOA record is None

### Removed

- Official Python 3.6 support
- Official Python 3.7 support

## [1.5.0] - 2021-12-05

### Added

- Official Python 3.9 support
- Official Python 3.10 support

### Changed

- Improved various error handling

### Removed

- Official Python 3.5 support

## [1.4.0] - 2019-11-07

### Added

- Official Python 3.8 support
- The --tcp flag to use TCP instead of UDP DNS queries

### Removed

- Official Python 3.4 support, it's EOL

## [1.3.0] - 2019-05-15

### 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
- Official Python 3.7 support

### Fixed

- Prevent out of bounds error when expanding IPs near 0.0.0.0 or 255.255.255.255

## [1.2.2] - 2018-04-24

### Changed

- Python 3 is now a requirement when installing via setup.py (including pip)
- The README markdown is now included in the package's long description

## [1.2.1] - 2018-03-01

### Changed

- Nearby IP reverse queries are now multithread, which improves performance significantly
- Updated development dependencies
- Subdomain lists use package_data instead of data_files

### Added

- Gracefully handle users exiting the script with Ctrl+C
- Gracefully handle incorrect file or IP range arguments

### Removed

- Official Python 3.3 support, it's EOL

## [1.2.0] - 2017-05-07

### Added

- Official Python 3.6 support

### Fixed

- Handling of subdomains specified that are actually FQDNs
- Gracefully handling timeouts when querying nameservers
- Gracefully handling timeouts when querying zone transfers

## [1.1.5] - 2017-01-08

### Fixed

- Fixed bug with CNAME records pointing to an A record without an associated IP
- Fixed bug with connections being closed by remote peer

## [1.1.4] - 2016-08-30

### Fixed

- Undo a PR that was breaking everything

## [1.1.3] - 2016-08-30

### Fixed

- Fixed a subdomain concatenation bug

## [1.1.2] - 2016-08-15

### Changed

- PyPI is absolutely ridiculous and needs a new version to upload the same package

## [1.1.1] - 2016-08-11

### Changed

- Better error handling when making network connections
- PEP8 formatting

## [1.1.0] - 2016-05-16

### Added

- Intelligent subdomain file searching
- PyPI classifiers

### Changed

- Using more modern setuptools instead of distutils
- Small README improvements

## [1.0.0] - 2016-05-08

### Added

- Initial release of Fierce
8 changes: 6 additions & 2 deletions fierce/fierce.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,12 @@ def fierce(**kwargs):
if soa:
soa_mname = soa[0].mname
master = query(resolver, soa_mname, record_type='A', tcp=kwargs["tcp"])
master_address = master[0].address
print("SOA: {} ({})".format(soa_mname, master_address))
if master:
master_address = master[0].address
print("SOA: {} ({})".format(soa_mname, master_address))
else:
print("SOA: failure")
fatal("Failed to lookup NS/SOA, Domain does not exist")
else:
print("SOA: failure")
fatal("Failed to lookup NS/SOA, Domain does not exist")
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Security',
],
install_requires=install_requires,
tests_require=tests_require,
python_requires='>=3.0',
python_requires='>=3.8',
entry_points={
'console_scripts': [
'fierce = fierce.fierce:main',
Expand Down

0 comments on commit f32f639

Please sign in to comment.