Add
This commit is contained in:
parent
915d2c2249
commit
719fa7c1df
|
|
@ -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') {
|
||||
|
|
|
|||
|
|
@ -143,17 +143,20 @@
|
|||
// ----- بخشهای محافظت شده با سشن -----
|
||||
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']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user