obfuscated

This commit is contained in:
2025-05-28 12:37:31 +03:00
parent b7d2c524d6
commit ab47e74b58
3 changed files with 34 additions and 34 deletions

View File

@@ -7,14 +7,6 @@
</head>
<body>
<h1>WASM Example</h1>
<div>
<label for="userAgent">User Agent:</label>
<input type="text" id="userAgent" placeholder="Например, Mozilla/5.0">
</div>
<div>
<label for="url">URL:</label>
<input type="text" id="url" placeholder="Например, http://example.com">
</div>
<button id="getSecretValue">Получить секретное значение</button>
<p id="result"></p>
@@ -26,41 +18,49 @@
document.getElementById('getSecretValue').addEventListener('click', async () => {
const userAgent = document.getElementById('userAgent').value || navigator.userAgent;
const secretValue = get_secret_value(BigInt(Math.floor(Date.now() / 1000)), userAgent, url);
const tmp = Math.floor(Date.now() / 1000);
const secretValue = get_secret_value(
BigInt(tmp),
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36',
'/api/v1/guestlogin'
);
document.getElementById('result').innerText = secretValue;
// const txt = 'https://api.id.hublab.ru/api/v1/guestlogin?given_time=' +
// serverTs.timestamp +
// '&user_agent=' + userAgent +
// '&gotten_sign=' + secretValue;
const txt = 'https://api.id.hublab.ru/api/v1/guestlogin'
//const response1 = await makePostRequest(txt)
const response1 = await makePostRequest(
txt,
{
'X-SIGN': secretValue,
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36',
'Accept-Time': tmp
}
)
});
}
// async function makePostRequest(url) {
// try {
// const response = await fetch(url, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json', // Указываем, что отправляем данные в формате JSON
// },
// });
// if (!response.ok) {
// throw new Error(`HTTP error! Статус: ${response.status}`);
// }
// const responseData = await response.json(); // Получаем ответ как JSON
// return responseData; // Возвращаем полученные данные
// } catch (error) {
// console.error('Ошибка при выполнении POST-запроса:', error);
// throw error; // Пробрасываем ошибку дальше
// }
// }
async function makePostRequest(url, headers) {
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
...headers, // Расширяем заголовки
},
});
if (!response.ok) {
throw new Error(`HTTP error! Статус: ${response.status}`);
}
const responseData = await response.json(); // Получаем ответ как JSON
return responseData; // Возвращаем полученные данные
} catch (error) {
console.error('Ошибка при выполнении POST-запроса:', error);
throw error; // Пробрасываем ошибку дальше
}
}

Binary file not shown.