Web Hacking: JavaScript Essentials (TryHackMe)
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.
What term allows you to run a code block multiple times as long as it is a condition?
loop
What is the code output if the value of x is changed to 10?
The result is: 20
Is JavaScript a compiled or interpreted language?
Interpreted
Which type of JavaScript integration places the code directly within the HTML document?
Internal
Which method is better for reusing JS across multiple web pages?
External
What is the name of the external JS file that is being called by external_test.html?
thm_external.js
What attribute links an external JS file in the <script> tag?
src
In the file invoice.html, how many times does the code show the alert Hacked?
3
Which of the JS interactive elements should be used to display a dialogue box that asks the user for input?
prompt
If the user enters Tesla, what value is stored in the carName= prompt("What is your car name?")? in the carName variable?
Tesla
What is the message displayed if you enter the age less than 18?
You are a minor.
What is the password for the user admin?
ComplexPassword
What is the alert message shown after running the file hello.html?
Welcome to THM
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.
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.