Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Random Redirect</title>
- <script>
- var redirectedPath;
- function generateRandomString(length) {
- var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
- var result = '';
- for (var i = 0; i < length; i++) {
- result += characters.charAt(Math.floor(Math.random() * characters.length));
- }
- return result;
- }
- function randomRedirect() {
- var randomPath = generateRandomString(32);
- redirectedPath = "/promotion-" + randomPath;
- setTimeout(function() {
- window.location.href = redirectedPath;
- }, 100);
- }
- function performActionsOnRedirect() {
- if (!localStorage.getItem('redirected')) {
- localStorage.setItem('redirected', 'true');
- randomLmao();
- }
- }
- function randomLmao() {
- document.write(unescape('some html code obfuscated'));
- }
- </script>
- </head>
- <body onload="randomLmao(); performActionsOnRedirect();">
- <p>If you are not redirected, <a href="#" onclick="randomRedirect(); return false;">click here</a>.</p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment