Skip to content

Add Mojeek search engine#2230

Open
cyberkimchi wants to merge 6 commits intolaramies:masterfrom
cyberkimchi:feat-mojeek
Open

Add Mojeek search engine#2230
cyberkimchi wants to merge 6 commits intolaramies:masterfrom
cyberkimchi:feat-mojeek

Conversation

@cyberkimchi
Copy link

@cyberkimchi cyberkimchi commented Feb 13, 2026

Description

Added Mojeek as a new search provider for host and email discovery

Changes

  • Created theHarvester/discovery/mojeek.py
  • Created tests/discovery/test_mojeek.py
  • Integrated Mojeek into __main__.py and core.py

Quality Check

  • Ruff check passed (no linting issues)
  • Mypy static typing verified (no type errors)
  • Pytest unit tests passed (2/2)
  • Manual functional test successful (found hosts, IP addresses and emails for different domains)
  • Followed project standards for descriptive variable names and static typing

"https://www.mojeek.com/search?q=%40exemple.com&s=10"
]

assert any("mojeek.com" in url for url in called["urls"])

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
mojeek.com
may be at an arbitrary position in the sanitized URL.

assert "admin@exemple.com" in emails
assert "dev@exemple.com" in emails
assert "www.exemple.com" in hosts

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
www.exemple.com
may be at an arbitrary position in the sanitized URL.
assert "admin@exemple.com" in emails
assert "dev@exemple.com" in emails
assert "www.exemple.com" in hosts
assert "api.exemple.com" in hosts

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
api.exemple.com
may be at an arbitrary position in the sanitized URL.
@L1ghtn1ng
Copy link
Collaborator

Thanks for this Alice, pytest is failing as you forgot to add an entry for the api key in the api keys file in data folder

@L1ghtn1ng
Copy link
Collaborator

Can you update README.md file please, you will see others that are in there if you can follow the same setup, hope that makes sense lol

@L1ghtn1ng
Copy link
Collaborator

You have not actually set in the module to use said api key

@cyberkimchi
Copy link
Author

You're right ! I'll add self.api_key = Core.api_keys().get('mojeek', '') to the init method in mojeek.py. This will ensure consistency since I added Mojeek to the api-keys.yaml file. Thank you ! :)

@cyberkimchi
Copy link
Author

Hope this will work correctly haha

@L1ghtn1ng
Copy link
Collaborator

You have added the api key to the module but it's not actually being activated, take a look at say the fullhunt module and you should hopefully see what I mean

@cyberkimchi
Copy link
Author

Do I have to add from theHarvester.discovery.constants import MissingKey and

if self.key is None:
            raise MissingKey('mojeek')

in mojeek.py ?

@cyberkimchi
Copy link
Author

Since Mojeek is a scraping-based engine (similar to Baidu or Bing) and does not require an API key for these queries, I used baidusearch.py as a reference for my first search logic !

@L1ghtn1ng
Copy link
Collaborator

Do I have to add from theHarvester.discovery.constants import MissingKey and


if self.key is None:

            raise MissingKey('mojeek')

in mojeek.py ?

Yeah

@L1ghtn1ng
Copy link
Collaborator

Since Mojeek is a scraping-based engine (similar to Baidu or Bing) and does not require an API key for these queries, I used baidusearch.py as a reference for my first search logic !

As you say it does not need the api key but does support it maybe implement when an api key is given use that if not fallback to using the non api method? Should cater to both situations then☺️

@L1ghtn1ng
Copy link
Collaborator

Any more luck @cyberkimchi with the changes I mentioned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants