diff --git a/app/Http/Controllers/HoneypotController.php b/app/Http/Controllers/HoneypotController.php index e5528db..488e418 100644 --- a/app/Http/Controllers/HoneypotController.php +++ b/app/Http/Controllers/HoneypotController.php @@ -33,17 +33,33 @@ class HoneypotController extends Controller $ip = (string) $request->ip(); + $meta = [ + 'ua' => Str::limit((string) $request->userAgent(), 190), + 'method' => $request->method(), + 'query' => Str::limit((string) $request->getQueryString(), 190), + ]; + + // Capture the credentials a prober typed into the fake login — their guesses, which are + // threat intel (a legitimate user never reaches a decoy). The field names span the + // impersonated apps: WordPress (log/pwd), phpMyAdmin (pma_username/pma_password), and the + // generic form (username/password). This is the attacker's OWN submission, so logging + + // banning stays keyed to their IP — no reflected-victim risk. + $user = $request->input('log') ?? $request->input('pma_username') ?? $request->input('username'); + $pass = $request->input('pwd') ?? $request->input('pma_password') ?? $request->input('password'); + if (is_string($user) && $user !== '') { + $meta['tried_user'] = Str::limit($user, 120); + } + if (is_string($pass) && $pass !== '') { + $meta['tried_pass'] = Str::limit($pass, 120); + } + AuditEvent::create([ 'user_id' => null, 'actor' => 'system', 'action' => 'security.honeypot_hit', 'target' => Str::limit($request->path(), 190), 'ip' => $ip, - 'meta' => [ - 'ua' => Str::limit((string) $request->userAgent(), 190), - 'method' => $request->method(), - 'query' => Str::limit((string) $request->getQueryString(), 190), - ], + 'meta' => $meta, ]); app(BruteforceGuard::class)->banNow($ip, 'honeypot'); @@ -209,7 +225,7 @@ form.login legend{background:#e5e5e5;border:1px solid #a0a0a0;border-radius:4px;