Initial commit: Laravel OSINT platform
Multi-user OSINT investigation tool with owner-controlled per-user and per-group access grants. Includes Sherlock, theHarvester, crt.sh, WHOIS, and ip-api.com collectors wired through a pluggable Runner/queue pipeline, investigation search, and printable/CSV/JSON reporting. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Osint\Runners;
|
||||
|
||||
use App\Models\Target;
|
||||
use App\Osint\Runner;
|
||||
use App\Osint\RunnerException;
|
||||
use App\Osint\RunnerResult;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class IpApiRunner implements Runner
|
||||
{
|
||||
public function run(Target $target): RunnerResult
|
||||
{
|
||||
if ($target->type !== 'ip') {
|
||||
throw new RunnerException('ip-api.com only supports "ip" targets.');
|
||||
}
|
||||
|
||||
$response = Http::timeout((int) config('osint.run_timeout'))
|
||||
->get("http://ip-api.com/json/{$target->value}", [
|
||||
'fields' => 'status,message,country,regionName,city,zip,lat,lon,timezone,isp,org,as,query',
|
||||
]);
|
||||
|
||||
if (! $response->successful()) {
|
||||
throw new RunnerException('ip-api.com request failed with status '.$response->status().'.');
|
||||
}
|
||||
|
||||
$data = $response->json();
|
||||
|
||||
if (($data['status'] ?? null) !== 'success') {
|
||||
throw new RunnerException('ip-api.com lookup failed: '.($data['message'] ?? 'unknown error'));
|
||||
}
|
||||
|
||||
$summary = sprintf(
|
||||
'%s, %s, %s (%s)',
|
||||
$data['city'] ?? 'Unknown city',
|
||||
$data['regionName'] ?? 'Unknown region',
|
||||
$data['country'] ?? 'Unknown country',
|
||||
$data['isp'] ?? $data['org'] ?? 'Unknown ISP'
|
||||
);
|
||||
|
||||
return new RunnerResult(raw: $data, summary: $summary);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user