Files
osint/app/Osint/RunnerRegistry.php
T
cedry2k1992andClaude Sonnet 5 86f73c46b2 Add Gravatar and DNS Records collectors
Two pure-PHP collectors, no Python/venv/subprocess needed:
- GravatarRunner (email): checks gravatar.com/avatar/{md5}?d=404 for a
  200 vs 404. Scoped to that binary signal since Gravatar's profile
  JSON endpoint now requires API auth even for real, public profiles
  (confirmed against Gravatar's own creator's email).
- DnsRunner (domain): dns_get_record() for A/AAAA/MX/NS/TXT/CNAME. Raw
  payload is naturally keyed by record type, which the existing
  generic list-renderer on the investigation page turns into one
  collapsible section per type with no UI changes needed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-20 11:59:20 +03:00

48 lines
1.3 KiB
PHP

<?php
namespace App\Osint;
use App\Osint\Runners\CrtShRunner;
use App\Osint\Runners\DnsRunner;
use App\Osint\Runners\GravatarRunner;
use App\Osint\Runners\HoleheRunner;
use App\Osint\Runners\IpApiRunner;
use App\Osint\Runners\SherlockRunner;
use App\Osint\Runners\TheHarvesterRunner;
use App\Osint\Runners\WhoisRunner;
class RunnerRegistry
{
/**
* Maps a sources.key value to the Runner implementation that handles it.
* A source with no entry here (or a null `runner` column) isn't
* integrated yet.
*
* @var array<string, class-string<Runner>>
*/
private const RUNNERS = [
'sherlock' => SherlockRunner::class,
'crtsh' => CrtShRunner::class,
'whois' => WhoisRunner::class,
'ip-api' => IpApiRunner::class,
'theharvester' => TheHarvesterRunner::class,
'holehe' => HoleheRunner::class,
'gravatar' => GravatarRunner::class,
'dns' => DnsRunner::class,
];
public function has(string $sourceKey): bool
{
return isset(self::RUNNERS[$sourceKey]);
}
public function resolve(string $sourceKey): Runner
{
if (! $this->has($sourceKey)) {
throw new RunnerException("No runner registered for source [{$sourceKey}].");
}
return app(self::RUNNERS[$sourceKey]);
}
}