Hi, I’m Carrie Anne, and welcome to CrashCourse
Computer Science! Last episode, we talked about the basics of
computer security, principles and techniques used to keep computer systems safe and sound. But, despite our best efforts, the news is
full of stories of individuals, companies and governments getting cyberattacked by hackers,
people who, with their technical knowledge, break into computer systems. Not all hackers are bad though. There are hackers who hunt for bugs and try
to close security holes in software to make systems safer and more resilient. They’re often hired by companies and governments
to perform security evaluations. These hackers are called White Hats, they’re
the good guys. On the flip side, there are Black Hats, malicious
hackers with intentions to steal, exploit and sell computer vulnerabilities and data. Hackers’ motivations also differ wildly. Some hack for amusement and curiosity, while
cybercriminals hack most often for monetary gain. And then there are hacktivists, who use their
skills to promote a social or political goal. And that’s just the tip of the iceberg. Basically, the stereotypical view of a hacker
as some unpopular kid sitting in a dark room full of discarded pizza boxes probably better describes John Green in college than it does hackers. Today, we’re not going to teach you how
to be a hacker. Instead, we’ll discuss some classic examples
of how hackers break into computer systems to give you an idea of how it’s done. INTRO The most common way hackers get into computer
systems isn’t by hacking at all; it’s by tricking users into letting them in. This is called social engineering, where a
person is manipulated into divulging confidential information, or configuring a computer system
so that it permits entry by attackers. The most common type of attack is phishing,
which you most often encounter as an email asking you to login to an account on a website,
say your bank. You’ll be asked to click a link in the email,
which takes you to a site that looks legit to the casual observer, but is really an evil
clone. When you enter your username and password,
that information goes straight to the hackers, who then can login to the real website as
you. Bad news! Even with a 1/10th of one percent success
rate, a million phishing emails might yield a thousand compromised accounts. Another social engineering attack is pretexting,
where attackers call up, let’s say a company, and then confidently pretend to be from their
IT department. Often attackers will call a first number,
and then ask to be transferred to a second, so that the phone number appears to be internal
to the company. Then, the attacker can instruct an unwitting
user to configure their computer in a compromising way, or get them to reveal confidential details,
like passwords or network configurations. Sorry, one sec… Oh. Hey, it’s Susan from It. We’re having some network issues down here, can you go ahead and check a setting for me?” … and it begins. Attackers can be very convincing, especially
with a little bit of research beforehand to find things like key employees’ names. It might take ten phone calls to find an victim,
but you only need one to get in. Emails are also a common delivery mechanism
for trojan horses, programs that masquerade as harmless attachments, like a photo or invoice, but actually contain malicious software, called malware. Malware can take many forms. Some might steal your data, like your banking
credentials. Others might encrypt your files and demand
a ransom, what’s known as ransomware. If they can’t run malware or get a user
to let them in, attackers have to force their way in through other means. One method, which we briefly discussed last
episode, is to brute force a password, try every combination of password until you gain entry. Most modern systems defend against this type
of attack by having you wait incrementally longer periods of time following each failed
attempt, or even lock you out entirely after a certain number of tries. One recent hack to get around this is called
NAND Mirroring, where if you have physical access to the computer, you can attach wires
to the device’s memory chip and make a perfect copy of its contents. With this setup, you can try a series of passwords,
until the device starts making you wait. When this happens, you just reflash the memory
with the original copy you made, essentially resetting it, allowing you to try more passwords
immediately, with no waiting. This technique was shown to be successful
on an iPhone 5C, but many newer devices include mechanisms to thwart this type of attack. If you don’t have physical access to a device,
you have to find a way to hack it remotely, like over the internet. In general, this requires an attacker to find
and take advantage of a bug in a system, and successfully utilizing a bug to gain capabilities
or access is called an exploit. One common type of exploit is a buffer overflow. Buffers are a general term for a block of
memory reserved for storing data. We talked about video buffers for storing
pixel data in Episode 23. As a simple example, we can imagine an operating
system’s login prompt, which has fields for a username and password. Behind the scenes, this operating system uses buffers for storing the text values that are entered. For illustration, let’s say these buffers
were specified to be of size ten. In memory, the two text buffers would look
something like this: Of course, the operating system is keeping
track of a lot more than just a username and password, so there’s going to be data stored
both before and after in memory. When a user enters a username and password,
the values are copied into the buffers, where they can be verified. A buffer overflow attack does exactly what
the name suggests: overflows the buffer. In this case, any password longer than ten
characters will overwrite adjacent data in memory. Sometimes this will just cause a program or
operating system to crash, because important values are overwritten with gobbledygook. Crashing a system is bad, and maybe that’s
all that a mischievous hacker wants to do, be a nuisance. But attackers can also exploit this bug more
cleverly by injecting purposeful new values into a program’s memory, for example, setting
an “is admin” variable to true. With the ability to arbitrarily manipulate
a program’s memory, hackers can bypass things like login prompts, and sometimes even use
that program to hijack the whole system. There are many methods to combat buffer overflow
attacks. The easiest is to always test the length of
input before copying it into a buffer, called bounds checking. Many modern programming languages implement
bounds checking automatically. Programs can also randomize the memory location
of variables, like our hypothetical “is admin” flag, so that hackers don’t know
what memory location to overwrite, and are more likely to crash the program than gain
access. Programs can also leave unused space after
buffers, and keep an eye on those values to see if they change; if they do, they know
an attacker is monkeying around with memory. These regions are called canaries, named after
the small birds miners used to take underground to warn them of dangerous conditions. Another classic hack is code injection. It’s most commonly used to attack websites
that use databases, which pretty much all big websites do. We won’t be covering databases in this series,
so here’s a simple example to illustrate this type of attack. We’ll use Structured Query Language, S-Q-L,
also called sequel, a popular database API. Let’s imagine our login prompt is now running
on a webpage. When a user clicks “login”, the text values
are sent to a server, which executes code that checks if that username exists, and if
it does, verifies the password matches. To do this, the server will execute code,
known as a SQL query, that looks something like this. First, it needs to specify what data we’re
retrieving from the database. In this case, we want to fetch the password. The server also needs to specify from what
place in the database to retrieve the value from. In this case, let’s imagine all the users’
data is stored in a data structure called a table labeled “users”. Finally, the server doesn’t want to get
back a giant list of passwords for every user in the database, so it specifies that it only
wants data for the account whose username equals a certain value. That value is copied into the SQL query by
the server, based on what the user typed in, so the actual command that’s sent to the
SQL database would look something like this, where username equals philbin. Note also that SQL commands end with a semicolon. So how does someone hack this? By sending in a malicious username, with embedded
SQL commands! Like, we could send the server this funky
username: When the server copies this text into the
SQL Query, it ends up looking like this: As I mentioned before, semicolons are used
to separate commands, so the first command that gets executed is this:
If there is a user named ‘whatever’, the database will return the password. Of course, we have no idea what ‘whatever’s’
password is, so we’ll get it wrong and the server will reject us. If there’s no user named ‘whatever’,
the database will return no password or provide an error, and the server will again reject
us. Either way, we don’t care, because it’s
the next SQL command we’re interested in: “drop table users” – a command that
we injected by manipulating the username field. This command instructs the SQL database to
delete the table containing all user data. Wiped clean! Which would cause a lot of headaches at a
place like a bank… or really anywhere. And notice that we didn’t even break into
the system – it’s not like we correctly guessed a username and password. Even with no formal access, we were able to
create mayhem by exploiting a bug. This is a very simple example of code injection,
which almost all servers today have defenses against. With more sophisticated attacks, it’s possible
to add records to the database – like a new administrator account – or even get
the database to reveal data, allowing hackers to steal things like credit card numbers,
social security numbers and all sorts of nefarious goodies. But we’re not going to teach you how to do that. As with buffer overflows, programmers should
always assume input coming from the outside to be potentially dangerous, and examine it
carefully. Most username and password forms on the web
don’t let you include special symbols like semicolons or quotes as a first level of defense. Good servers also sanitize input by removing
or modifying special characters before running database queries. Working exploits are often sold or shared
online. The more prevalent the bug, or the more damaging
the exploit, the higher the price or prestige it commands. Even governments sometimes buy exploits, which
allow them to compromise computers for purposes like spying. When a new exploitable bug is discovered that
the software creators weren’t aware of, it’s called a zero day vulnerability. Black Hat Hackers rush to use the exploit
for maximum benefit before white hat programmers release a patch for the bug. This is why it’s so important to keep your
computer’s software up to date; a lot of those downloads are security patches. If bugs are left open on enough systems, it
allows hackers to write a program that jump from computer to computer automatically which
are called worms. If a hacker can take over a large number of
computers, they can be used together, to form what’s called a botnet. This can have many purposes, like sending
huge volumes of spam, mining bitcoins using other people’s computing power and electricity,
and launching Distributed Denial of Service or DDoS attacks against servers. DDoS is where all the computers in the botnet
send a flood of dummy messages. This can knock services offline, either to
force owners to pay a ransom or just to be evil. Despite all of the hard working white hats,
exploits documented online, and software engineering best practices, cyberattacks happen on a daily
basis. They cost the global economy roughly half
a trillion dollars annually, and that figure will only increase as we become more reliant
on computing systems. This is especially worrying to governments,
as infrastructure is increasingly computer-driven, like powerplants, the electrical grid, traffic
lights, water treatment plants, oil refineries, air traffic control, and lots of other key
systems. Many experts predict that the next major war
will be fought in cyberspace, where nations are brought to their knees not by physical
attack, but rather crippled economically and infrastructurally through cyberwarfare. There may not be any bullets fired, but the
potential for lives lost is still very high… maybe even higher than conventional warfare. So, we should all adopt good cybersecurity
practices. And, as a community interconnected over the
internet, we should ensure our computers are secured against those who wish to use their
great potential for harm. So maybe stop ignoring that update notification? I’ll see you next week.

Hackers & Cyber Attacks: Crash Course Computer Science #32
Tagged on:                                                                                                                         

100 thoughts on “Hackers & Cyber Attacks: Crash Course Computer Science #32

  • October 23, 2017 at 3:18 am
    Permalink

    Excellent call out to XKDC

    Reply
  • October 23, 2017 at 1:11 pm
    Permalink

    Why did you pass over the CAPTCHA test in "what you are" category?

    Reply
  • October 23, 2017 at 5:09 pm
    Permalink

    I have an IT test on Thursday. Completed this series in a week. Much confident now ! Thanks !

    Reply
  • October 23, 2017 at 6:33 pm
    Permalink

    You missed the best attack there is! The Slow Loris attack! It's really clever, and slow! 🙂

    Reply
  • October 23, 2017 at 6:50 pm
    Permalink

    I'm assuming the SQL injection script is wrong intentionally. Well done CrashCourse. Programmers, pro tip, always use parameter based query statements for your dynamic queries, not string concatenation.

    Reply
  • October 26, 2017 at 11:02 am
    Permalink

    I don't usually do this but for quite a sometime I hired [email protected] for phone hack and deleted messages he didn't fail me. I'll always be grateful to his job well done. I'm happy I hired him. Contact him to gain full access to to any bodies phones completely, social media, email, track location too

    Reply
  • October 26, 2017 at 3:35 pm
    Permalink

    Who here has gotten hacked before?

    Reply
  • October 26, 2017 at 3:42 pm
    Permalink

    But What If You Get A Fake Update For Fake Security? How Do You Tackle That?

    Reply
  • October 27, 2017 at 5:13 pm
    Permalink

    Is it legal to use iplogger. com?

    Reply
  • October 27, 2017 at 9:14 pm
    Permalink

    DO NOT LOAD THE CURRENT IPHONE OS UPDATE! None of my apps connect to their severs now.

    Reply
  • October 29, 2017 at 9:20 pm
    Permalink

    CODE TYPO: The username shouldn't have a leading '. That would end up with `username = ''whatever…` and not `= 'whatever…` as shown in the video.

    Reply
  • October 30, 2017 at 5:22 pm
    Permalink

    To bad this video did not come out before the election. The DNC could have used this.

    Reply
  • November 2, 2017 at 8:37 am
    Permalink

    Was that an XKCD reference with the stick person because you're talking about sanitizing your input fields?

    Reply
  • November 4, 2017 at 3:26 am
    Permalink

    Imagine a Call of Duty Cyber Warfare, how would the gameplay be?

    Reply
  • November 4, 2017 at 10:09 pm
    Permalink

    What have you done with Hank..?

    Reply
  • November 6, 2017 at 4:19 am
    Permalink

    What can you do about apps used to spy on peoples smart phones?

    Reply
  • November 6, 2017 at 6:40 am
    Permalink

    HACK THE PLANET!!!

    Reply
  • November 8, 2017 at 5:09 pm
    Permalink

    can we a have an episode on bitcoins?

    Reply
  • November 8, 2017 at 8:59 pm
    Permalink

    This is amazing! Thank you

    Reply
  • November 10, 2017 at 3:11 am
    Permalink

    Propaganda, governments can make cyber attacks happen as well. Why not cover the ways government use this system against us?

    Reply
  • November 10, 2017 at 8:32 pm
    Permalink

    Blake bad white good ok I get it

    Reply
  • November 12, 2017 at 4:52 am
    Permalink

    @7:35 what that a little bobby tables reference? lol

    Reply
  • November 12, 2017 at 6:41 pm
    Permalink

    The hacker at 2:30 on the phone is from Wisconsin!

    Reply
  • November 13, 2017 at 10:03 am
    Permalink

    SELECT password FROM user WHERE username = @UserName

    Just use SqlParameter… SQL Injection solved

    Reply
  • November 17, 2017 at 1:51 am
    Permalink

    They won't be covering databases? That's disappointing.

    Reply
  • November 17, 2017 at 1:51 am
    Permalink

    They won't be covering databases? That's disappointing.

    Reply
  • November 18, 2017 at 6:56 am
    Permalink

    "Describe John Green in college." HAHAHAHAHAHA

    Reply
  • November 22, 2017 at 1:16 pm
    Permalink

    "Sanitizing input" will not work if you forget it just once. And not allowing special characters sound pretty "fake line of defence".

    Reply
  • November 23, 2017 at 3:28 pm
    Permalink

    so glad they didn't mention russian hackers

    Reply
  • December 5, 2017 at 11:15 am
    Permalink

    You should give link of previous or when available next video link in description

    Reply
  • December 6, 2017 at 6:25 pm
    Permalink

    boobs..

    Reply
  • December 12, 2017 at 7:42 pm
    Permalink

    Bitcoin sighted twice, great happyness

    Reply
  • December 15, 2017 at 2:49 am
    Permalink

    then there are the state reps that can just hack in whenever they want to because they can

    i am not to pissed off at the state rep for doing that just more annoyed especially since he knows the NSA is interested in me

    thx for this awesomely ha bisky vid i love this series

    Reply
  • December 22, 2017 at 7:49 am
    Permalink

    Try to slow talk

    Reply
  • December 25, 2017 at 10:15 am
    Permalink

    *runs to update steam*

    Reply
  • December 29, 2017 at 1:40 pm
    Permalink

    please add your videos to turkish subtitles

    Reply
  • January 11, 2018 at 1:50 am
    Permalink

    WW3 USA vs N Korea cpnfirmed. but the second cold war will likely be in cyberspace…. thats if you dont count Russia already messing in global political elections

    Reply
  • January 26, 2018 at 4:32 am
    Permalink

    Great teacher!

    Reply
  • February 9, 2018 at 10:34 am
    Permalink

    "The stereotypical view of a hacker is some unpopular kid sitting in a dark room full of discarded pizza boxes". Umm, that describes me perfectly, and I code and program for fun…

    Reply
  • February 13, 2018 at 11:16 am
    Permalink

    things is idk which updates are fake and which are real

    Reply
  • February 24, 2018 at 12:02 pm
    Permalink

    oh dat asus rog laptop though

    Reply
  • March 4, 2018 at 10:06 am
    Permalink

    Hey, is there a web which tracks cyberattacks in real time?

    Reply
  • March 18, 2018 at 4:05 am
    Permalink

    Hey can you please send me the link of your thumbnail of this video.
    Thank you!

    Reply
  • March 24, 2018 at 5:49 pm
    Permalink

    "cyberwarfare" is great, but tbh, it's a missed opportunity to call it "world war web"

    Reply
  • April 1, 2018 at 12:40 pm
    Permalink

    I just turned my anti virus on after watching this video. Thanks for awareness on cyber security, and great video as well!

    Reply
  • April 5, 2018 at 3:36 pm
    Permalink

    thank you it's great video, well done

    Reply
  • April 10, 2018 at 2:46 am
    Permalink

    Hi I just embed this video and the previous one. thanks

    Reply
  • April 11, 2018 at 8:28 pm
    Permalink

    if you want to be hackers there is a book that touch dome of the basics of being a jacker called "Hacking the art of exploitation"

    Reply
  • May 7, 2018 at 12:32 pm
    Permalink

    People, I need help with PC Optimizer Pro, my computer is full of viruses and I need to do taxes or they will Saw off my fingers!

    Reply
  • May 17, 2018 at 8:56 am
    Permalink

    Drop Tables. We call him Bobby Tables
    XKCD is lovely

    Reply
  • June 13, 2018 at 3:09 am
    Permalink

    Anyone else notice "Ghost in the Wires" on the shelf? The attention to detail in this series is tremendous… well done.

    Reply
  • August 9, 2018 at 8:33 pm
    Permalink

    7:38 More like:
    ' OR '' == ''; DROP USERS;

    Reply
  • August 16, 2018 at 10:10 am
    Permalink

    wow

    Reply
  • August 18, 2018 at 2:57 pm
    Permalink

    Execute, NOW!!😁

    Reply
  • August 20, 2018 at 12:02 am
    Permalink

    These introductions always seem silly to me. You're not actually a hacker unless you've hacked. If you're using other peoples hacks, you're not a hacker. You're a script kiddie. So that being said, there can't be very many hackers in the world. There are probably more hackers on TV shows than there are in real life. Btw, I'm a real hacker, and chances are you're not. This white hat, black hat, hacktivist stuff is nonsense. Who cares?

    Reply
  • August 20, 2018 at 2:17 pm
    Permalink

    So that email with only one word was bad?

    Reply
  • August 31, 2018 at 1:27 pm
    Permalink

    Not trying to gain access or anything. Just saying you look nice in that top.

    Reply
  • September 4, 2018 at 3:38 pm
    Permalink

    But updates take so long or fill up storage…

    Reply
  • September 7, 2018 at 7:23 am
    Permalink

    0:55 Damn, came at his life xD

    Reply
  • September 10, 2018 at 10:40 am
    Permalink

    try breaking the RSA code 357089904779 (what 2 prime numbers make up 357089904779)

    Reply
  • September 16, 2018 at 4:09 pm
    Permalink

    p;ease reduce your talking speed……so listeners depth to your knowledge and to your words will increase and help them not to wate time in reading subtitles……………………

    Reply
  • September 18, 2018 at 8:05 pm
    Permalink

    3:05 – 3:08 happened to my window 10 somebody encrypted my account but did not ask for money and then we deleted the window and installed a new one huh

    Reply
  • October 1, 2018 at 11:14 am
    Permalink

    aap kis aap se edit krte ho

    Reply
  • October 5, 2018 at 10:05 am
    Permalink

    What a beautiful Carrie Anne in this episode 🙂

    Reply
  • October 9, 2018 at 1:14 pm
    Permalink

    leuke video lil pump ga zo door schat.

    Reply
  • October 22, 2018 at 12:38 am
    Permalink

    Thanks : )

    Reply
  • October 27, 2018 at 6:07 am
    Permalink

    I think someone is trying to hack me.

    Reply
  • November 2, 2018 at 9:34 pm
    Permalink

    Social engineering is a form of hacking.

    Reply
  • January 3, 2019 at 9:38 pm
    Permalink

    Hey I'm Nigerian you know >:( and I'm the son of the king (oluwasdesola)

    Reply
  • January 3, 2019 at 9:39 pm
    Permalink

    xD jk

    Reply
  • January 3, 2019 at 9:39 pm
    Permalink

    but I am nigerian

    Reply
  • January 11, 2019 at 2:15 am
    Permalink

    hackers are bad, that you mean good hackers are software debugger

    Reply
  • January 11, 2019 at 6:23 am
    Permalink

    9:44 Microsoft seems to be doing a good job with its 24/7 updates.

    Reply
  • January 13, 2019 at 2:43 am
    Permalink

    The girl in the video is so awesome!!!! So cute and smart!!! Really-really like her!

    Reply
  • February 17, 2019 at 3:19 am
    Permalink

    10:09 中国又被黑了,哈哈

    Reply
  • February 27, 2019 at 1:31 am
    Permalink

    0:31 – Marcus Hutchins is innocent until proven guilty. You imply here that he is guilty and therefore was/is a blackhat hacker. A little bit ignorant for an otherwise accurate series. Shame.

    Reply
  • March 19, 2019 at 1:03 am
    Permalink

    This video is full of segregation!!! Putting black hats down and white hats up 😢

    Reply
  • March 28, 2019 at 4:51 pm
    Permalink

    When she said "John Green "!!😀😄😍

    Reply
  • April 3, 2019 at 5:08 pm
    Permalink

    0:22 to 0:43 is so racist.

    Reply
  • April 9, 2019 at 2:29 am
    Permalink

    I'm getting tracked!! By hackers!!

    Reply
  • April 26, 2019 at 12:06 am
    Permalink

    How do you hack

    Reply
  • April 27, 2019 at 3:27 am
    Permalink

    what are this 10:23 how they monitor the inter net ?

    Reply
  • April 30, 2019 at 8:30 pm
    Permalink

    Watching this again after one year, and it's still the best for me!

    Reply
  • May 8, 2019 at 3:23 pm
    Permalink

    im a nitrotype hacker

    Reply
  • May 8, 2019 at 3:31 pm
    Permalink

    did this just teach me to hack?

    Reply
  • May 16, 2019 at 10:35 pm
    Permalink

    very helpful thank you

    Reply
  • May 23, 2019 at 8:29 pm
    Permalink

    good video. thanks

    Reply
  • May 31, 2019 at 6:51 am
    Permalink

    So you are telling me that for all this time I could have put billions of '1's in the password field to gain adming access to a website

    Reply
  • June 6, 2019 at 12:51 pm
    Permalink

    Am I the only one that watched this video with a Guy Fawkes mask on for maximum effect?

    Reply
  • June 9, 2019 at 9:40 am
    Permalink

    Ahem. Kablam. Code for free, 20 x spark. Dumbfucker gov does not need to apply.

    Reply
  • July 5, 2019 at 1:07 pm
    Permalink

    Curse you Instagram bots!

    Reply
  • July 14, 2019 at 8:57 pm
    Permalink

    bad under the evil system we are living in = good to me.

    Reply
  • July 28, 2019 at 7:23 am
    Permalink

    I hate how I feel how dumb I am as I learn more.

    Reply
  • August 3, 2019 at 12:24 am
    Permalink

    🎅Redhat

    Reply
  • August 28, 2019 at 3:08 pm
    Permalink

    Why did I expect a promotion for dashlane 😂

    Reply
  • August 29, 2019 at 6:08 am
    Permalink

    I'm breaking 4,294,967,296 bit‬ encryption while twiddling my magic spirit fingers on a button an actual computer scientist programmed!

    Reply
  • September 14, 2019 at 10:21 pm
    Permalink

    C++ offers no bounds checking😭

    Reply
  • October 15, 2019 at 2:32 pm
    Permalink

    Please help my FB was desable by black hole

    Reply
  • October 21, 2019 at 5:11 am
    Permalink

    Is this CC Computer Science, or CC ROAST JOHN GREEN

    Reply
  • November 3, 2019 at 12:47 pm
    Permalink

    Who noticed a crepper behind her?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *