Commit Graph
112 Commits
Author SHA1 Message Date
L1ghtn1ng fa2dedd38b Refactor and standardize output handling with new utilities in theHarvester.lib.output, add tests for print_linkedin_sections and sorted_unique. Fix regex inaccuracies and enhance CORS validation. 2026-01-24 11:28:20 +00:00
L1ghtn1ng ffe1f3a832 Synchronize api-keys.yaml with Core class API key references and add a test to ensure consistency 2026-01-18 01:15:26 +00:00
L1ghtn1ng 3d7489c962 Add security tests and enhance input sanitization mechanisms
- Introduced comprehensive security tests, including CORS configuration, XML injection prevention, path traversal prevention, and information disclosure protection.
- Improved input sanitization for filenames and XML content to mitigate injection attacks and ensure safe handling.
- Updated CORS middleware to restrict HTTP methods and block credentials with wildcard origins.
- Removed traceback exposure in API error responses, even in debug mode.
- Verified rate limiting and input validation for sensitive API endpoints.
- Ensured no hardcoded secrets are present in the main codebase.
2026-01-17 01:05:40 +00:00
L1ghtn1ng bc2fce07cc Update proxy parameter handling in tests: expand default structure to include both "http" and "socks5" fields 2026-01-06 22:14:02 +00:00
RandGitHub 86ad5ad945 feat(discovery): add THC subdomain enumeration module (#2221)
* feat(discovery): add THC subdomain enumeration module

Add new THC module integrating ip.thc.org for subdomain discovery.

Features:
- Free service, no API key required
- No rate limits
- Fast plain-text response parsing

Includes 24 comprehensive tests covering:
- API endpoint validation
- Subdomain search functionality
- Edge cases (empty, unicode, special chars)
- Proxy support
- Response format validation
- Integration with theHarvester framework

Closes #2217

* fix: translate test comments to English

Accidentally pushed the Spanish version of the test file.
This commit updates all docstrings and comments to English.

* fix: correct rate limit documentation and add rate limit header test

- Remove 'no rate limits' claim from README.md
- Add test_api_returns_rate_limit_headers to verify x-ratelimit-* headers

* feat: add explicit rate limit handling

Based on bravesearch.py pattern:
- Detect HTTP 429 status code
- Read x-ratelimit-remaining header
- Implement retry logic with backoff (3 retries, 2s base delay)
- Handle rate limit exceptions

Added test for rate limit settings initialization.
2025-12-31 09:42:17 +00:00
Branch VincentandGitHub 26c8d639be Merge pull request #2220
* support python 3.14

* fix syntax warnings

* bump dockerfile to 3.14, optimize build time + size
2025-12-30 09:36:19 +00:00
L1ghtn1ng 2bb20d29ad Refactor hackertarget module follow core logic to make it consistent with the rest of the code base since the api key support got added. 2025-12-21 05:31:38 +00:00
Raghav ChowdaryandGitHub 4c803566a0 Merge pull request #2142
* feat: add Hackertarget API key support (fixes #2122)

* feat(hackertarget): add API key support + tests (fixes #2122)

* style: run ruff fixes
2025-12-21 05:13:39 +00:00
L1ghtn1ng 3f7450b35b Refactor test_otx.py: Remove unused test_api and refine exception handling in test_search 2025-10-12 00:58:20 +01:00
L1ghtn1ng be106ad779 Add missing @pytest.mark.asyncio decorators to async tests and improve error handling in otxsearch.py 2025-10-12 00:03:13 +01:00
L1ghtn1ng 2b4732497f Replace requests with httpx for improved async support and update related tests accordingly. 2025-08-29 03:20:58 +01:00
L1ghtn1ng 61eb9f8893 Add tests for SearchBaidu to validate parsing, pagination limits, and proxy usage. 2025-08-09 19:00:58 +01:00
L1ghtn1ng e2b044e109 Add tests for SearchGithubCode process; handle edge cases in pagination and retries
- Implemented unittests to validate `process` method behavior under error, retry, and pagination conditions.
- Introduced safeguards against infinite loops in pagination and retries within `SearchGithubCode`.
2025-08-09 03:45:31 +01:00
L1ghtn1ng 51d76e4ed1 Fix mypy errors lee to qa 2025-08-08 01:51:44 +01:00
L1ghtn1ng 7a539ae155 Fix #2012 2025-07-08 21:56:54 +01:00
L1ghtn1ng e758a94f26 remove anubis module as the site has been down for a while now 2025-05-26 23:24:01 +01:00
L1ghtn1ng d1a983f6fb fix ci/cd error 2025-05-18 18:48:38 +01:00
L1ghtn1ng 93966a4a24 fix mypy errors 2025-01-26 06:28:18 +00:00
L1ghtn1ng 13a0cdd62a Add async pagination helper and update pytest settings
Introduce the `next_page_or_end` method in `githubcode.py` to handle pagination. Additionally, modify the test case and upgrade pytest settings in `pyproject.toml` to the latest versions, ensuring compatibility and updated configurations.
2024-10-27 01:02:05 +01:00
L1ghtn1ng 467a33fd3a remove test that is not stable enough due to the site not always being up or is getting blocked intermittently 2023-12-16 13:46:38 +00:00
L1ghtn1ng cddcb5f383 Fix otx test 2023-11-12 22:24:45 +00:00
Branch VincentandGitHub 4d825aaf33 build: migrate to pep517 backend (#1505)
* build: migrate to pep517 backend

* test loading config files
2023-10-08 19:45:23 +01:00
J.TownsendandGitHub 76ce3b3c6f lint fix 2023-10-02 00:18:00 +01:00
J.Townsend c397275cac fix test 2023-09-24 16:15:35 +00:00
yoonthegoonandJ.Townsend c13843ec0d #1492 run black . and isort . 2023-07-27 01:34:21 +01:00
éclairevoyantandJ.Townsend bbe3f02a07 Delete qwant tests (see #1390) 2023-05-04 08:52:04 +01:00
MattandGitHub 90082dbaa0 Added 4 new sources, Removed 2 Sources, Added custom DNS resolver, backported to python3.9, and other misc changes (#1381)
* Added call to api endpoint to explicitly gather subdomains from zoomeye, updated user agents, replaced orjson with ujson, and fixed substring not found error.

* Updated orjson to ujson.

* Fixed semantic error in html check in google workaround.

* Fixed flake8 errors.

* Fixed VT to use API.

* Fixed virustotal module.

* Fixed possible edge case that could possibly cause an infinite loop.

* Removed broken modules.

* Added 4 new sources: brave, criminalip, hunterhow, and subdomainfinderc99, added dnsresolve, and other misc changes.

* Added TODO comment.

* Fixed bin\theHarvester to allow python3.9

* Pep8 newline at end of file.

* Fixed error when passing in comma seperated resolvers and allow for user to pass in --dns-resolve flag with no arguments to use default resolvers that user has.
2023-04-10 18:51:04 +01:00
J.TownsendandGitHub b50f2ad2c5 remove sublist3r test as the domain no longer works 2023-04-06 12:59:07 +01:00
L1ghtn1ng 3a2c180295 Remove missed omnisint ci removal and version import fix 2022-11-13 01:33:01 +00:00
L1ghtn1ng f175269941 add a boat load of static typing fixes 2022-10-31 00:51:59 +00:00
L1ghtn1ng 56fe724a1c sublist3r Skipping on Github CI due unstable site 2022-08-14 03:03:04 +01:00
J.TownsendandGitHub 72d8dcad21 Flake8 fixes (#1181)
* Flake8 fixes

* Remove test due to bufferover run moving to api only
2022-08-14 01:23:56 +01:00
J.TownsendandGitHub 22e1eb9bdb A lot of changes and fixes (#1168)
* add pytest.ini file and fix test warning in qwantsearch

* ignore unsed imports

* Remove n45ht as the api is down

* Remove modules that use google as google blocks you after one go

* Remove missed code from when removing modules that use google

* Remove missed code from when removing modules that use google

* Add new vt-py dep and update pytest

* WIP virustotal migration to api

* Remove test that fails due to how the api returns not found entries

* Remove entries from myparser re google

* update fastapi and starlette

* update version

* Update dockerfile to use dev ubuntu version

* remove spyse module

* remove spyse dep

* fix tests by removing un-needed tests and indentation fix

* fix some mypy errors

* remove spyse and remove color output and fix mypy error

* flake8 fixes

* bump version and set it a dev version
2022-08-03 23:12:59 +01:00
J.TownsendandGitHub 15fe11130c Add new n45ht module, lots of results returned (#899)
* Add new fullhunt module

* Remove python checks in the run script as they are not needed anymore

* Remove netcraft from ci as it is not needed

* Update Dockerfile to fix security issues

* Add new n45ht module, lots of results returned
2021-10-24 04:10:37 +01:00
L1ghtn1ng 8f978821af Fix omnisint module 2021-10-04 00:57:57 +01:00
L1ghtn1ng 65baabbdcf debug info to see what github actions is doing 2021-08-22 04:35:40 +01:00
L1ghtn1ng 6c71979308 debug info to see what github actions is doing 2021-08-22 04:28:24 +01:00
L1ghtn1ng cca6652512 debug info to see what github actions is doing 2021-08-22 04:23:03 +01:00
L1ghtn1ng 448aa402c4 debug info to see what github actions is doing 2021-08-22 04:22:01 +01:00
L1ghtn1ng 59ac74e629 Found an even better way of checking if running on GH actions and to skip with pytest and tidyer as well 2021-08-22 03:59:34 +01:00
L1ghtn1ng f43854ef0f Adjust if statment for is_github_action() 2021-08-22 02:20:38 +01:00
L1ghtn1ng aa5760f419 Adjust unitests to be able to skip if run on github 2021-08-22 02:12:08 +01:00
L1ghtn1ng f3f62232a4 Add bufferover unit test 2021-06-30 01:15:30 +01:00
L1ghtn1ng f8e911ee17 flake8 test fix 2021-06-28 01:19:10 +01:00
L1ghtn1ng faf7b23af2 update threatminer unit test 2021-06-21 00:28:03 +01:00
L1ghtn1ng 3244fac0cf update sublist3r unit test 2021-06-21 00:19:52 +01:00
L1ghtn1ng d28393b9a2 Add new module anubis and unit test for it. Update shodan related things 2021-06-21 00:19:27 +01:00
L1ghtn1ng c0e2b38a51 fix omnisint unit test 2021-05-17 22:04:36 +01:00
L1ghtn1ng ae6216a4ef fix test 2020-12-14 22:18:30 +00:00
L1ghtn1ng 8032d3fdc9 update otx test 2020-09-21 18:36:36 +01:00