diff --git a/bbot/scanner/target.py b/bbot/scanner/target.py index e7a3679ea3..7c50ecd0f3 100644 --- a/bbot/scanner/target.py +++ b/bbot/scanner/target.py @@ -80,7 +80,11 @@ def add(self, targets, data=None): targets = [targets] event_seeds = set() for target in targets: - event_seed = EventSeed(target) + try: + event_seed = EventSeed(target) + except ValidationError as e: + log.warning(str(e)) + continue if not event_seed._target_type in self.accept_target_types: log.warning(f"Invalid target type for {self.__class__.__name__}: {event_seed.type}") continue diff --git a/bbot/test/test_step_1/test_event_seeds.py b/bbot/test/test_step_1/test_event_seeds.py index 5a6ada3e25..f5b39cf525 100644 --- a/bbot/test/test_step_1/test_event_seeds.py +++ b/bbot/test/test_step_1/test_event_seeds.py @@ -158,3 +158,7 @@ def test_event_seeds(): assert blacklist_regex_seed.host == None assert blacklist_regex_seed.input == "REGEX:evil[0-9]{3}" assert blacklist_regex_seed._target_type == "BLACKLIST" + + # invalid target + with pytest.raises(ValidationError, match="Unable to autodetect data type from"): + EventSeed("asdf:::asdf") diff --git a/bbot/test/test_step_1/test_python_api.py b/bbot/test/test_step_1/test_python_api.py index 1282110400..60ab892861 100644 --- a/bbot/test/test_step_1/test_python_api.py +++ b/bbot/test/test_step_1/test_python_api.py @@ -84,10 +84,6 @@ def test_python_api_sync(): def test_python_api_validation(): from bbot.scanner import Scanner, Preset - # invalid target - with pytest.raises(ValidationError) as error: - Scanner("asdf:::asdf") - assert str(error.value) == 'Unable to autodetect data type from "asdf:::asdf"' # invalid module with pytest.raises(ValidationError) as error: Scanner(modules=["asdf"]) diff --git a/pyproject.toml b/pyproject.toml index a92032cbf6..f512a29c93 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bbot" -version = "2.4.1" +version = "2.4.2" description = "OSINT automation for hackers." authors = [ "TheTechromancer", @@ -109,7 +109,7 @@ lint.ignore = ["E402", "E711", "E713", "E721", "E741", "F401", "F403", "F405", " [tool.poetry-dynamic-versioning] enable = true metadata = false -format-jinja = 'v2.4.1{% if branch == "dev" %}.{{ distance }}rc{% endif %}' +format-jinja = 'v2.4.2{% if branch == "dev" %}.{{ distance }}rc{% endif %}' [tool.poetry-dynamic-versioning.substitution] files = ["*/__init__.py"]