Javascript Essentials

https://tryhackme.com/room/javascriptessentials

Abusing Dialogue Functions

Alert window

alert("Hello THM")     # shows a dialogue window with the message Hello THM
# Annoying little script that displays the message "Hacked" 500 times
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Hacked</title>
</head>
<body>
    <script>
        for (let i = 0; i < 500; i++) {
            alert("Hacked");
        }
    </script>
</body>
</html>

Prompt - Opens a window with a text field for user to enter data

Confirm - window with a "cancel" and "OK"

Conditional statement

A terrible example of how not to store credentials ☺️

Exploring Minified Files & Obfuscator

Obfuscator above takes a simple code like this:

And makes it unreadable for humans. It's the same code. But just scrambled.

Deobfuscate

Use this tool to unscrabmle the code. It will literaly reverse the proccess

Last updated