Web Hacking: JavaScript Essentials (TryHackMe)

J3bitokJ3bitok
2 min read

In this article, I will write a write-up for Web Hacking: Javascript Essentials that covers the Essentials Concepts, Javascript Overview, Integrating Javascript in HTML, Abusing Dialogue Functions, Bypassing Control Flow Statements, Exploring Minified Files, and Best Practices.

  1. What term allows you to run a code block multiple times as long as it is a condition? loop

  2. What is the code output if the value of x is changed to 10? The result is: 20

  3. Is JavaScript a compiled or interpreted language? Interpreted

  4. Which type of JavaScript integration places the code directly within the HTML document? Internal

  5. Which method is better for reusing JS across multiple web pages? External

  6. What is the name of the external JS file that is being called by external_test.html? thm_external.js

  7. What attribute links an external JS file in the <script> tag? src

  8. In the file invoice.html, how many times does the code show the alert Hacked? 3

  9. Which of the JS interactive elements should be used to display a dialogue box that asks the user for input? prompt

  10. If the user enters Tesla, what value is stored in the carName= prompt("What is your car name?")? in the carName variable? Tesla

  11. What is the message displayed if you enter the age less than 18? You are a minor.

  12. What is the password for the user admin? ComplexPassword

  13. What is the alert message shown after running the file hello.html? Welcome to THM

  14. What is the value of the age variable in the following obfuscated code snippet?age=0x10x247e+0x35-0x2e+-0x1ae3; 21

Obfuscation is still unclear to me but there’s this YouTube Video that has a walkthrough from around minute 26 and also use this Javascript Obfuscator Tool as well as tools like ChatGPT for more deep dive into the topic 15. Is it a good practice to blindly include JS in your code from any source (yea/nay)? nay

Thank you for reading my article. Please leave any questions or comments on improving my learning journey and the THM challenges. We can also connect more on LinkedIn or X.

0
Subscribe to my newsletter

Read articles from J3bitok directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

J3bitok
J3bitok

Software Developer Learning Cloud and Cybersecurity Open for roles * If you're in the early stages of your career in software development (student or still looking for an entry-level role) and in need of mentorship you can book a session with me on Mentorlst.com.