Learn Any Programming Language (from scratch)
Key Takeaways
The video teaches viewers how to learn any programming language from scratch, with a focus on JavaScript, and covers various concepts such as variables, data types, operators, control structures, and cybersecurity. Tools and frameworks demonstrated include JavaScript, Vanta, ISO 27001, GDPR, and HIPAA.
Full Transcript
we're going to step through the phases of learning a programming language from scratch so that we have functional and working knowledge to apply to our day-to-day work as security practitioners you can apply this approach to learning any new programming language but I'll be using JavaScript as our example throughout this video the goal here isn't Mastery but useful working knowledge so that when you need to whip up a script fix an exploit or review some code you're ready to go as always if you enjoy the video don't forget to like And subscribe and let's dive in pardon Interruption this video is brought to you by vanta many of you like me in the past are responsible for your organization's security and that means dealing with a lot of complexity from dozens of spreadsheets and screenshots to fragmented tools and manual Security reviews managing the requirements for modern compliance and Security Programs is increasingly challenging so if you're looking for one solution then continuous monitoring from vanta is what you're after vanta is the leading trust management platform that helps you centralize your efforts to establish trust and enable growth across your organization it automates up to 90% of the work for Frameworks like sock 2 ISO 2701 gdpr hippo etc etc there are so many Frameworks these days so instead you can focus on strategy and security not just maintaining compliance so to learn why over 6,000 companies partner with vanta to automate compliance strengthen their security posture streamline Security reviews and reduce third party risk you can go to ban.com menal and of course there is a link in the description below so first up we need some core programming Concepts and if you've learned any programming languages before you'll be able to fly through this section and just pay attention to the quirks or differences along the way but if you're new to programming or need a refresher then let's take a look at some of these before we move on all right so here we are at our VM and we're going to quickly look at some of the basics of JavaScript and of course if you're not interested in JavaScript feel free to skip ahead a bit but if you're just starting out then this is a good place to be so first up variables are used to store data values and in JavaScript values can be declared using VAR let or const and the choice between these usually depends on the scope and the reasonability if you need it so for example we have VAR which has function scope and can be redeclared and updated so I can just have that message equals Jeremy like this and then we can have something like let which has block scope and this can be updated but not redeclared within the same scope so let's let pi equal 3.14 and notice that we don't have to declare the type and Pi is definitely not 23 and here it's automatically going to detect and use the type for us and then we have const which is also block scope but must be initialized at declaration and cannot be redeclared so we can have something like const and let's say count equals 10 and if we want to test these out and make sure that this is working we can just say hey console.log and we can pass in our variables so for example we can pass in message and let's be more consistent with these and also close our brackets and you're getting some insight into how I write code which is with lots and lots of syntax errors and if we just run this then you can see we get Jeremy 3.14 and 10 in the console and it's important just to kind of run through the basics so that we really understand what's happening and and what variables are and how they're used and then of course move on to useful projects later on so very quickly we want to be moving onto something that's actually functional rather than just creating variables and printing them to the console and next up we have data types so as I mentioned before we don't need to declare the type of variable so we don't need to say hey this is an in this is a string for example and the type can change as the program is running so the main types in JavaScript are numbers strings booleans undefined null and symbols and non-primitive types are objects which are things like arrays and functions etc etc so let's take a look at some different types so so we can have age for example so let age equals 25 which show is 25 again and this of course is a number and then we can have let's name equals Jeremy and of course this is a string not a strong and of course we could let is registered equals true and of course this is a Boolean and then of course we could do something like let's address equals null and the type of this is of course null and then we could let job and not declare it at all and this is undefined and if we want to see the type of a variable so when we're working with it we could do something like console.log type of and then the variable name so here we have age and let's just do like this to save a little bit of [Music] time and we run this and here you can see we have number string Boolean object and undefined as we saw and next up we have operators and there are a few different types of operators that we need to know about so first up we have arithmetic operators so things like plus minus multiply divide and then of course we have comparison operators so we have equals equals not equals to uh greater than less than etc etc and we also have logical operators like and or or not for example so we can take a look at some of these so for example we could let result equals 20 + 5 like this and then we could console.log result * 2 and so here result is going to be 25 because of this arithmetic operator and then we're going to multiply the result by two when we output it to the console so hopefully we will see 50 in the console and here we are we get 50 and then within our application we might want an age checks so we might have something like hey let is adults equals results is greater than 18 and this will of course equal true because we're still using this result and the initial value of this is 25 so if we run result is greater than 18 we're going to get true back and then we can do something like hey console.log is adult and the result is less than 30 and we can combine these as well so when we run this we get true back here because both of these statements are true because the result which is 25 is greater than 18 and it's less than 30 and if we did less than 20 here for example and run this we get false so understanding these logical operators is really the Cornerstone of programming and one last thing which is to do with types so we could do something like console. log which is result equals equal 25 now we know that this is a number now we know that this is a number and the result of the number is 25 so this should return true because we're using two equals we're not actually doing a comparison of the type even though this is a number and this is a string if we wanted to do a number we would leave out the quotes like this so this will return true here and this will also return true and this does lead to some interesting vulnerabilities like type juggling and loose comparison but we can also use console.log result equals equals equs 25 and this also compares the types so the values have to be the same and then the types have to be the same as well and as you can see here the comparison is false because the number 25 is not equal to the string 25 and of course just to prove our point we can take out the quotes again and then everything is back to true and one last thing before we move on is control structures so control structures direct the flow of a program based on conditions and the most common types are conditional statements so if else else if and switch and then we also have loops so four Loops while Loops do while four in four of etc etc and both conditional statements and Loops are both really really fundamental to programming so let's take a quick look so if we have let score equals 75 like this and then we have if score is greater than or equal to 90 for example and we open and close some curly braces we could do something like console.log grade A not a score that I'm used to unfortunately and this is useful because we can say hey okay so if the score is greater than or equal to 25 we get grade A and we could copy and paste this and say hey okay so if the score is for example greater than or equal to 80 and also score is less than 90 we could continue and then say hey this is Grade B but this is a little bit of an ugly way to do this having lots and lots of if statements so instead we could do something like else if and we can open score is greater than or equal to 80 and then we could do something like else if score is greater than equal to 70 and we can keep going like this and then of course we can put our result in here so let's say b or c and so when we run this we have a score of 75 so we should get a grade C which is good probably my average grade but obviously if we change this to 85 and run this again we get B and then if we change this to 95 top of the class we get grade A and then very quickly before we wrap up I'm just going to show you a for Loop because I think for Loops are really really important and probably a fun fundamental parts of programming so if we for let I equals z so this initiates a variable called I and then we're setting the value to the number zero and then we're going to run the loop while the value of I is less than 5 and then every time we run the loop we go I ++ so we increment I by one and then let's console.log and we want something like number plus I like this and when we run this we should get 0 1 2 3 4 and we won't get five because this is only going to run when the variable I is less than five so we won't get five itself and as you can see in the console we get 0 1 2 3 4 5 and as you can see in the console we get 0 1 2 3 4 and then of course if we wanted to include the five we could go less than or equal to five and we get number five or we could do something like add an extra increment this number by one and then of course we'd be going to less than six and once again we get 0 to6 Oops I Did greater than and as usual I typo things and here we are 025 all right that's it for some of the really core fundamentals of programming languages and these Concepts like operators and control operators and variables and data structures apply to pretty much every programming language so don't get bog down in the details think about the concepts and the logic behind it and you're good to go so with these Concepts out of the way let's take a closer look at JavaScript first it's an interpreted language meaning that it's executed line by line at runtime without needing to compile it it's also dynamically types so this means that types are associated with values rather than variables and the same variable can hold different types at different times and JavaScript supports functional programming as well as objectoriented programming you probably know that it was initially designed to run in the browser so that we can manipulate the Dom within web applications but of course with no. JS we can now run JavaScript serers side and this has become steadily more popular from a design philosophy perspective much of JavaScript revolves around handling asynchronous events like user interactions and on the whole is a versatile language that can be used for simple scripts as well as complex server side applications I think it's important that when you read up on a new language or technology to do a little bit of digging into the pH philosophy behind it and the intentions of the creators it's going to give you some good insights into when and why to utilize it one last thing about JavaScript before we move on is that JavaScript runs with a single thread but uses asynchronous Behavior so this means that it has a single-threaded execution model but uses callbacks promises and async and await to handle operations that might block that single thread and with that out of the way let's take a look at some simple projects that we might build to get a head around the syntax and solidify a foundation that we can build on top of when we explore more complex topics or features within the language itself when building your first project I want to lay out a few ideal constraints first it should be an hour or less because you're going to be learning a bunch of new things and you want those Concepts to come together as an end product before taking on other New Concepts or complexity put another way we want to learn something and see its impact before learning something else otherwise we will get lost in complexity second I recommend following along with some tutorials or guides that are free but include explanations of the code and finally if you can build something in context so that you can understand where it fits and how it interacts with the environment around it so for example with JavaScript once we passed the very Basics instead of just typing commands into the console try to build a small application this will put you much further ahead in terms of your understanding and I'm going to recommend this video and playlist no need to go through all of them but the weather app in particular I think is a great one to get started with as you'll gain a load of new skills and insights with not just JavaScript but also apis and CSS and HTML and building small applications as a whole this is a great place to start and like I say not too complicated and should take you about an hour once we have a couple of projects out of the way it's time to dig deeper and work on our ability to write troubleshoot and review our own code as well as the code of others and the biggest thing I find between those that are confident with programming and those that shy away from writing code is the willingness to read documentation more often than not it's easy to find a rough working example of something that we need for our project but being able to understand technical documentation is going to help you when you have an edge case or a weird situation or when you're doing code review and you need to know precisely what's going on not just trying to get the code to run without errors and really for a lot of security practitioners then this is enough working knowledge and the ability to understand and troubleshoot code we're by no means software engineers at this point and nor should we try to become one unless that's something that you're really interested in then of course go for it but for security engineering and pentesting and even appsec working knowledge is often enough and gives us a huge return on the time investment to get to this point I would say that you should try and dedicate a little bit of time to continue your learning and make sure that you stay sharp but no need to go nuts having a small side project or doing some regular code review is probably enough for most of us and that's it for this video I hope this guide helps you into picking up new and valuable skills that you can use in your cyber security career catch you next time
Original Description
To learn why over 6,000 companies partner with Vanta to automate compliance, strengthen security posture, streamline security reviews, and reduce third-party risk, go to https://vanta.com/mentor to watch their 3 minute demo video!
00:00 Intro
00:30 Vanta sponsor message
01:40 Programming core concepts
05:39 Operators
08:30 Control structures
12:00 Digging deeper into JS
13:27 Projects to learn programming
16:11 Thanks for watching!
Sponsor a Video: https://www.tcm.rocks/Sponsors
Pentests & Security Consulting: https://tcm-sec.com
Get Trained: https://academy.tcm-sec.com
Get Certified: https://certifications.tcm-sec.com
Merch: https://merch.tcm-sec.com
📱Social Media📱
___________________________________________
Twitter: https://twitter.com/thecybermentor
Twitch: https://www.twitch.tv/thecybermentor
Instagram: https://instagram.com/thecybermentor
LinkedIn: https://www.linkedin.com/in/heathadams
TikTok: https://tiktok.com/@thecybermentor
Discord: https://discord.gg/tcm
💸Donate💸
___________________________________________
Like the channel? Please consider supporting me on Patreon:
https://www.patreon.com/thecybermentor
Support the stream (one-time): https://streamlabs.com/thecybermentor
Hacker Books:
Penetration Testing: A Hands-On Introduction to Hacking: https://amzn.to/31GN7iX
The Hacker Playbook 3: https://amzn.to/34XkIY2
Hacking: The Art of Exploitation: https://amzn.to/2VchDyL
The Web Application Hacker's Handbook: https://amzn.to/30Fj21S
Real-World Bug Hunting: A Field Guide to Web Hacking: https://amzn.to/2V9srOe
Social Engineering: The Science of Human Hacking: https://amzn.to/31HAmVx
Linux Basics for Hackers: https://amzn.to/34WvcXP
Python Crash Course, 2nd Edition: https://amzn.to/30gINu0
Violent Python: https://amzn.to/2QoGoJn
Black Hat Python: https://amzn.to/2V9GpQk
My Build:
lg 32gk850g-b 32" Gaming Monitor:https://amzn.to/30C0qzV
darkFlash Phantom Black ATX Mid-Tower Case: https://amzn.to/30d1UW1
EVGA 2080TI: https://amzn.to/30d2lj7
MSI Z390 Mo
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from The Cyber Mentor · The Cyber Mentor · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Buffer Overflows Made Easy - Part 1: Introduction
The Cyber Mentor
Buffer Overflows Made Easy - Part 2: Spiking
The Cyber Mentor
Buffer Overflows Made Easy - Part 3: Fuzzing
The Cyber Mentor
Buffer Overflows Made Easy - Part 4: Finding the Offset
The Cyber Mentor
Buffer Overflows Made Easy - Part 5: Overwriting the EIP
The Cyber Mentor
Buffer Overflows Made Easy - Part 6: Finding Bad Characters
The Cyber Mentor
Buffer Overflows Made Easy - Part 7: Finding the Right Module
The Cyber Mentor
Buffer Overflows Made Easy - Part 8: Generating Shellcode and Gaining Shells
The Cyber Mentor
HackTheBox - Sunday Walkthrough (Re-Up)
The Cyber Mentor
Networking for Ethical Hackers - TCP, UDP, and the Three-Way Handshake (Re-Up)
The Cyber Mentor
Networking for Ethical Hackers - Network Subnetting (Re-Up)
The Cyber Mentor
Networking for Ethical Hackers - Network Subnetting Part 2: The Challenge (Re-Up)
The Cyber Mentor
Networking for Ethical Hackers - Building A Basic Network with Cisco Packet Tracer (Re-Up)
The Cyber Mentor
HackTheBox - Fighter Walkthrough (Re-Up)
The Cyber Mentor
Beginner Linux for Ethical Hackers - Navigating the File System
The Cyber Mentor
Beginner Linux for Ethical Hackers - Users and Privileges
The Cyber Mentor
Beginner Linux for Ethical Hackers - Common Network Commands
The Cyber Mentor
Beginner Linux for Ethical Hackers - Viewing, Creating, and Editing Files
The Cyber Mentor
Beginner Linux for Ethical Hackers - Controlling Kali Services
The Cyber Mentor
Beginner Linux for Ethical Hackers - Scripting with Bash
The Cyber Mentor
Beginner Linux for Ethical Hackers - Installing and Updating Tools
The Cyber Mentor
Cracking Linux Password Hashes with Hashcat
The Cyber Mentor
Reminder: Twitch Hacking Live Stream Tonight! 2/26/19 at 8PM EST
The Cyber Mentor
Hacking Live Stream: Episode 1 - Kioptrix Level 1, HackTheBox Jerry, and Career Q&A / AMA
The Cyber Mentor
Hacking Live Stream: Episode 2 - HackTheBox Active, Vulnserver Buffer Overflow, and Career Q&A / AMA
The Cyber Mentor
Hacking Live Stream: Episode 3 - Hack The Box Blue, Devel, and Career Q&A / AMA
The Cyber Mentor
New Zero to Hero Pentest Course, New Website, and 2K Subs?!
The Cyber Mentor
Zero to Hero Pentesting: Episode 1 - Course Introduction, Notekeeping, Introductory Linux, and AMA
The Cyber Mentor
Zero to Hero Pentesting: Episode 2 - Python 101
The Cyber Mentor
Zero to Hero Pentesting: Episode 3 - Python 102, Building a Terrible Port Scanner, and a Giveaway
The Cyber Mentor
Zero to Hero Pentesting: Episode 4 - Five Phases of Hacking + Passive OSINT
The Cyber Mentor
Zero to Hero Pentesting: Episode 5 - Scanning Tools (Nmap, Nessus, BurpSuite, etc.) & Tactics
The Cyber Mentor
Zero to Hero Pentesting: Episode 6 - Enumeration (Kioptrix & Hack The Box)
The Cyber Mentor
Zero to Hero Pentesting: Episode 7 - Exploitation, Shells, and Some Credential Stuffing
The Cyber Mentor
Installing Windows Server 2016 on VMWare in 5 Minutes
The Cyber Mentor
Zero to Hero: Week 8 - Building an AD Lab, LLMNR Poisoning, and NTLMv2 Cracking with Hashcat
The Cyber Mentor
A Day in the Life of an Ethical Hacker / Penetration Tester
The Cyber Mentor
Active Directory Exploitation - LLMNR/NBT-NS Poisoning
The Cyber Mentor
Zero to Hero: Week 9 - NTLM Relay, Token Impersonation, Pass the Hash, PsExec, and more
The Cyber Mentor
Zero to Hero: Episode 10 - MS17-010/EternalBlue, GPP/cPasswords, and Kerberoasting
The Cyber Mentor
Writing a Pentest Report
The Cyber Mentor
Zero to Hero: Week 11 - File Transfers, Pivoting, and Reporting Writing
The Cyber Mentor
The Complete Linux for Ethical Hackers Course for 2019
The Cyber Mentor
Full Ethical Hacking Course - Beginner Network Penetration Testing (2019)
The Cyber Mentor
Popping a Shell with SMB Relay and Empire
The Cyber Mentor
Pentesting for n00bs: Episode 1 - Legacy (hackthebox)
The Cyber Mentor
Pentesting for n00bs: Episode 2 - Lame
The Cyber Mentor
Pentesting for n00bs: Episode 3 - Blue
The Cyber Mentor
Web App Testing: Episode 1 - Enumeration
The Cyber Mentor
Pentesting for n00bs: Episode 4 - Devel
The Cyber Mentor
Pentesting for n00bs: Episode 5 - Jerry
The Cyber Mentor
Web App Testing: Episode 2 - Enumeration, XSS, and UI Bypassing
The Cyber Mentor
Pentesting for n00bs: Episode 6 - Nibbles
The Cyber Mentor
Web App Testing: Episode 3 - XSS, SQL Injection, and Broken Access Control
The Cyber Mentor
How NOT to Approach a Cybersecurity Mentor
The Cyber Mentor
Web App Testing: Episode 4 - XXE, Input Validation, Broken Access Control, and More XSS
The Cyber Mentor
Pentesting for n00bs: Episode 7 - Optimum (hackthebox)
The Cyber Mentor
Pentesting for n00bs: Episode 8 - Bashed (hackthebox)
The Cyber Mentor
Pentesting for n00bs: Episode 9 - Grandpa
The Cyber Mentor
Top 5 Internal Pentesting Methods
The Cyber Mentor
More on: Prompt Craft
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
Security Belongs on the Blueprint
Medium · Cybersecurity
# A 4-Line HTML File Stole the Admin’s Secret — Intigriti LeakyJar CTF Writeup
Medium · Cybersecurity
The Digital Gateway to Arabic Cybersecurity
Medium · Cybersecurity
Cybersecurity vs Cloud Computing – Which Career Will Dominate 2026? ☁️
Medium · Cybersecurity
Chapters (8)
Intro
0:30
Vanta sponsor message
1:40
Programming core concepts
5:39
Operators
8:30
Control structures
12:00
Digging deeper into JS
13:27
Projects to learn programming
16:11
Thanks for watching!
🎓
Tutor Explanation
DeepCamp AI