Commit acadf937 authored by Mindiell's avatar Mindiell

Initial commit

parents
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Retency Auto-Exclusion</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>Merci d'avoir participé à cette exclusion !</p>
<iframe id="frame" width="0" height="0" frameborder="0"></iframe>
<script>
var iframe = document.getElementById('frame');
var html = " \
<!DOCTYPE html> \
<html lang='en'> \
<head> \
<meta charset='utf-8'> \
<title>Frame</title> \
<link rel='stylesheet' href='style.css'> \
</head> \
<body> \
Hello world ! \
<form id='test' action='https://retency.com/stats/optout.php' method='post'> \
<input type='hiddden' name='wm' id='wifi' value='' /> \
<input type='hiddden' name='bm' id='bluetooth' value='' /> \
<input type='hiddden' id='sub' value=\"M'exclure\" /> \
</form> \
</body> \
</html> \
";
document.body.appendChild(iframe);
iframe.contentWindow.document.open();
iframe.contentWindow.document.write(html);
iframe.contentWindow.document.close();
// On cherche une adresse MAC au hasard
mac_address = '';
for (let i=0;i<6;i++) {
// On prend un nomre entre 0 et 255
segment = Math.floor(Math.random()*60).toString(16);
if (segment.length<2)
mac_address += '0' + segment;
else
mac_address += segment;
if (i<5)
mac_address += ':';
}
// On l'assigne au WiFi 70% du temps, et au Bluetooth à 30%
if (Math.random()<0.3) {
iframe.contentWindow.document.getElementById('bluetooth').value = mac_address;
iframe.contentWindow.document.getElementById('wifi').value = '';
} else {
iframe.contentWindow.document.getElementById('bluetooth').value = '';
iframe.contentWindow.document.getElementById('wifi').value = mac_address;
}
// On soumet le formulaire
iframe.contentWindow.document.getElementById('test').submit();
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment