This commit is contained in:
mcoder 2026-04-18 15:59:20 +03:30
parent 915d2c2249
commit 719fa7c1df
2 changed files with 14 additions and 11 deletions

View File

@ -88,7 +88,7 @@
const startBtn = document.getElementById('start-btn');
// Words we want to check against the victim's private database
const targetWords = ['guest', 'confidential', 'public', 'project_x', 'random_word', 'admin_rezvan'];
const targetWords = ['guest', 'confidential', 'public', 'project_x', 'random_word', 'admin_panel'];
const THRESHOLD_MS = 400; // If response takes > 400ms, assume the DB did work (HIT)
function log(msg, type = 'info') {

View File

@ -142,20 +142,23 @@
// ----- بخش‌های محافظت شده با سشن -----
Route::middleware(['web', 'auth'])->group(function () {
// XS-Leak Target API
Route::get('/api/private-search', function (Illuminate\Http\Request $request) {
$query = strtolower($request->query('q', ''));
$privateKeywords = ['confidential', 'admin_rezvan', 'project_x'];
$privateKeywords = ['confidential', 'admin_panel', 'project_x'];
if (in_array($query, $privateKeywords)) {
// Keyword exists: Simulate DB fetching taking 600ms
usleep(600000);
} else {
// Keyword missing: Fast return 50ms
usleep(50000);
$hash = 'start';
for ($i = 0; $i < 100000; $i++)
{
$hash = md5($hash . $query);
}
}
else
{
$hash = md5($query);
}
return response()->json(['status' => 'search_complete']);
})->name('user.api.search');