Files
osint/database/seeders/SourceSeeder.php
T
cedry2k1992andClaude Sonnet 5 dc4388eabf Add OpenCorporates collector for org targets, gated on an API token
Closes the last coverage gap for org (person remains intentionally
unaddressed — no good free/non-scraping option exists). Unlike the
other 8 sources, OpenCorporates now requires an API token even on its
free tier (confirmed: keyless request gets 401). RunnerRegistry::has()
checks services.opencorporates.token is configured before exposing the
source as runnable, so it degrades to "not yet integrated" in the UI
rather than a broken Run button, until OPENCORPORATES_API_TOKEN is set.

Also fixes a real bug hit while building this: a RunnerRegistry::REQUIRES
class constant mapping source key to a closure crashed on file load
(PHP class constants can't hold closures) — inlined the one check
instead of building an abstraction for a single case.

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

87 lines
3.3 KiB
PHP

<?php
namespace Database\Seeders;
use App\Models\Source;
use Illuminate\Database\Seeder;
class SourceSeeder extends Seeder
{
/**
* Catalog of free/open-source OSINT tools. `runner` is a display-only
* label; the actual dispatch is App\Osint\RunnerRegistry, keyed by `key`.
*/
public function run(): void
{
$sources = [
[
'key' => 'sherlock',
'name' => 'Sherlock',
'description' => 'Checks a username for presence across 400+ social media and community sites.',
'target_types' => ['username'],
'runner' => 'python:sherlock',
],
[
'key' => 'theharvester',
'name' => 'theHarvester',
'description' => 'Gathers emails, subdomains, and hosts for a domain from public sources (crt.sh, OTX, HackerTarget, CertSpotter, ThreatMiner, RapidDNS, Anubis).',
'target_types' => ['domain'],
'runner' => 'python:theharvester',
],
[
'key' => 'crtsh',
'name' => 'crt.sh',
'description' => 'Certificate transparency log search, used to enumerate subdomains for a domain.',
'target_types' => ['domain'],
'runner' => 'http:crtsh',
],
[
'key' => 'whois',
'name' => 'WHOIS',
'description' => 'Domain registration lookup (registrar, dates, name servers).',
'target_types' => ['domain'],
'runner' => 'python:whois',
],
[
'key' => 'ip-api',
'name' => 'ip-api.com',
'description' => 'Free IP geolocation lookup.',
'target_types' => ['ip'],
'runner' => 'http:ip-api',
],
[
'key' => 'holehe',
'name' => 'Holehe',
'description' => 'Checks whether an email address is registered on 120+ sites via the password-reset-oracle technique.',
'target_types' => ['email'],
'runner' => 'python:holehe',
],
[
'key' => 'gravatar',
'name' => 'Gravatar',
'description' => 'Checks whether an email address has a registered Gravatar image.',
'target_types' => ['email'],
'runner' => 'http:gravatar',
],
[
'key' => 'dns',
'name' => 'DNS Records',
'description' => 'Looks up A, AAAA, MX, NS, TXT, and CNAME records for a domain.',
'target_types' => ['domain'],
'runner' => 'dns:records',
],
[
'key' => 'opencorporates',
'name' => 'OpenCorporates',
'description' => 'Company registration search by name. Requires a free OpenCorporates API token (OPENCORPORATES_API_TOKEN) — hidden from "runnable" sources until one is configured.',
'target_types' => ['org'],
'runner' => 'http:opencorporates',
],
];
foreach ($sources as $source) {
Source::updateOrCreate(['key' => $source['key']], $source);
}
}
}