Running an SQL Injection Attack - Computerphile

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 มิ.ย. 2016
  • Just how bad is it if your site is vulnerable to an SQL Injection? Dr Mike Pound shows us how they work.
    Cookie Stealing: • Cookie Stealing - Comp...
    Rob Miles on Game Playing AI: • AI's Game Playing Chal...
    Secure Web Browsing: • Secure Web Browsing - ...
    Deep Learning: • Deep Learning - Comput...
    Tom Scott on SQL Injection: • Hacking Websites with ...
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscomputer
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

ความคิดเห็น • 2.1K

  • @martinpet100
    @martinpet100 4 ปีที่แล้ว +3275

    How to avoid jail: "I`ve given myself the permission"

    • @elisttm
      @elisttm 4 ปีที่แล้ว +114

      officer i swear what i did wasnt illegal, i gave myself permission to rob him!

    • @georgek4416
      @georgek4416 4 ปีที่แล้ว +57

      @@elisttm ok ur free

    • @ajinkc1031
      @ajinkc1031 3 ปีที่แล้ว +2

      XDDD

    • @revenevan11
      @revenevan11 3 ปีที่แล้ว +32

      @@elisttm this reads like a privilege escalation exploit lol

    • @bxnkroll
      @bxnkroll 3 ปีที่แล้ว +6

      I'm using it

  • @barkeeper7887
    @barkeeper7887 4 ปีที่แล้ว +3590

    imagine not giving yourself permission to do this on your own website and then you sue yourself, win the lawsuit and then land in prison

    • @costafinkel
      @costafinkel 3 ปีที่แล้ว +180

      Well, at least you would be able to win your own money. Thats more than what can be said for some married / divorced folks.

    • @barkeeper7887
      @barkeeper7887 3 ปีที่แล้ว +23

      You’re pretty damn right m8

    • @aviddavid8793
      @aviddavid8793 3 ปีที่แล้ว +15

      mmmMM the court fee and if you have 1000 iq your lawyar takes about 30%

    • @heeheehawhawheehee
      @heeheehawhawheehee 3 ปีที่แล้ว +12

      Then become mr robot

    • @imho2278
      @imho2278 3 ปีที่แล้ว +22

      Write it off as a tax deduction.

  • @karldavis7392
    @karldavis7392 2 ปีที่แล้ว +276

    Decades ago, my brother named his bowling team "select *". This was in the early days of computers, so there wasn't modern security. The bowling alley printed the statistics, and when his team arrived, the employee presented an entire ream of paper and demanded they choose a different name.

    • @bsvenss2
      @bsvenss2 2 ปีที่แล้ว +29

      Hehehe... funny. It's like the first Unix systems where you couldn't have a user named "Ed".

    • @karldavis7392
      @karldavis7392 2 ปีที่แล้ว +18

      @@bsvenss2 Would it start the editor?

    • @Deeeve
      @Deeeve 8 หลายเดือนก่อน +7

      @@karldavis7392 it would lol

  • @randomuser-vs3oe
    @randomuser-vs3oe 4 ปีที่แล้ว +235

    alright youtube, this has been in my recommended for 2 years now, ill watch it, you win.

    • @universenerdd
      @universenerdd 3 ปีที่แล้ว +6

      Underrated

    • @jamesmccabe2286
      @jamesmccabe2286 3 ปีที่แล้ว +5

      Interesting and informative, but the other guy is almost as basic as "So, what's that in front of you? Is it a computer?"

    • @user-ys9kg6ye8u
      @user-ys9kg6ye8u 2 ปีที่แล้ว +1

      lowkey joke

    • @sachinfulsunge9977
      @sachinfulsunge9977 2 ปีที่แล้ว +3

      You just wasted 2 years

    • @user-ys9kg6ye8u
      @user-ys9kg6ye8u 2 ปีที่แล้ว

      @@sachinfulsunge9977 hahaha

  • @clementella
    @clementella 6 ปีที่แล้ว +2538

    Me: Can I SQL Injection Attack your website
    Me:Sure

    • @katherinegonzales4916
      @katherinegonzales4916 5 ปีที่แล้ว +25

      That's what he did

    • @kubadzejkob332
      @kubadzejkob332 4 ปีที่แล้ว +102

      Imagine he has schizofrenia and fires a lawsuit against himself.

    • @kubadzejkob332
      @kubadzejkob332 4 ปีที่แล้ว +25

      Or simply changes his mind.

    • @Shubhankar31
      @Shubhankar31 3 ปีที่แล้ว +8

      *Mr. Robot intesifies*

    • @kennylo850
      @kennylo850 3 ปีที่แล้ว

      😂

  • @soweliLuna
    @soweliLuna 6 ปีที่แล้ว +3023

    the intro had "" and the outro ""... smart... love the attention to detail

    • @rixogtr
      @rixogtr 5 ปีที่แล้ว +12

      what that means ?

    • @rixogtr
      @rixogtr 5 ปีที่แล้ว +24

      oh now that makes sense :D Thanks

    • @andy.robinson
      @andy.robinson 5 ปีที่แล้ว +175

      Being the pedantic developer I am, it's more like XML since HTML doesn't support a tag.

    • @sirturnables
      @sirturnables 5 ปีที่แล้ว +11

      What are u doing here if u don't know that?? lol

    • @toyotaae86truenogt-apex97
      @toyotaae86truenogt-apex97 5 ปีที่แล้ว +137

      @@sirturnables learning.

  • @pandasworld4168
    @pandasworld4168 5 ปีที่แล้ว +1640

    The interviewer thought the text editor was already the hacking part

    • @davidprice6462
      @davidprice6462 4 ปีที่แล้ว +147

      I noticed his excitement as well.

    • @arielfenomenon9233
      @arielfenomenon9233 4 ปีที่แล้ว +151

      I loved when he nervously asked...so where are u typing that now....as if the whole world was going to blow up >^

    • @paulaxa1
      @paulaxa1 4 ปีที่แล้ว +178

      you know he probably knows but he just asks for the content right?

    • @georgek4416
      @georgek4416 4 ปีที่แล้ว +37

      He knows

    • @andrewhennessy620
      @andrewhennessy620 4 ปีที่แล้ว +10

      at least he's willing to learn

  • @JDSileo
    @JDSileo 2 ปีที่แล้ว +46

    This is defense against the dark arts for Computer Science

  • @tommytomtomtomestini3894
    @tommytomtomtomestini3894 7 ปีที่แล้ว +7310

    Instructions unclear, NSA is outside my house.

    • @Drummerdude998
      @Drummerdude998 7 ปีที่แล้ว +65

      😂😂😂

    • @baho644
      @baho644 7 ปีที่แล้ว +12

      John Doe FAV hahahahaa

    • @adamwood1706
      @adamwood1706 6 ปีที่แล้ว +5

      😂😂😂

    • @blackham7
      @blackham7 6 ปีที่แล้ว +44

      WTF HOW DID YOU GET NSA OUTSIDE YOUR HOUSE OBVIOUSLY YOU UNDERSTOOD THE INSTRUCTIONS ARE YOU IN PRISON NOW?

    • @thatonegooze
      @thatonegooze 6 ปีที่แล้ว +47

      blackham7 wooosh

  • @MrDeeb8
    @MrDeeb8 7 ปีที่แล้ว +6428

    Thank you Peter Parker

    • @tomascanevaro4292
      @tomascanevaro4292 6 ปีที่แล้ว +178

      He's the cool version of Peter Parker, from Spiderman 3

    • @ashharryman19
      @ashharryman19 6 ปีที่แล้ว +71

      Underrated post

    • @RedditNovelties
      @RedditNovelties 6 ปีที่แล้ว +49

      I thought I was the only mofo thinking he looked like Peter Parker from Spider-Man 😂

    • @warpman345
      @warpman345 6 ปีที่แล้ว +47

      Or Frodo from the lordof the rings

    • @DanIel-fl1vc
      @DanIel-fl1vc 6 ปีที่แล้ว +8

      FRODO!

  • @mattshnoop
    @mattshnoop 4 ปีที่แล้ว +214

    It’s crazy how different my understanding of this video is since the first time I watched it. I watched it back in high school, now I’m halfway through a university degree and have taken web development courses... Funky.

    • @sadimehti9934
      @sadimehti9934 3 ปีที่แล้ว +5

      Got Same feelings haha

    • @BaconTrainss
      @BaconTrainss 2 ปีที่แล้ว

      i feel attacked

    • @shrimps69
      @shrimps69 2 ปีที่แล้ว +3

      Just came back after 5 years and I'm second year into IT

  • @samuelokirby
    @samuelokirby 4 ปีที่แล้ว +17

    Okay TH-cam, I'll watch it. Recommending it to me for years.

  • @habiks
    @habiks 7 ปีที่แล้ว +3351

    ..what is illegal? running sql attack or making shitty web apps? Coz my real name is "'; DROP table users; SELECT '"

    • @atomheartother
      @atomheartother 7 ปีที่แล้ว +143

      Both.

    • @modernkennnern
      @modernkennnern 7 ปีที่แล้ว +34

      releasing the information is illegal.

    • @jan_harald
      @jan_harald 7 ปีที่แล้ว +326

      attacking someone without their permission is illegal by law
      making shitty apps is illegal by community

    • @Padarom
      @Padarom 7 ปีที่แล้ว +84

      Making your application insecure towards attacks and putting your user's sensitive informations at risk of being stolen and released is illegal.
      @jan harald: What is "illegal by community" supposed to mean?

    • @harrisonharris6988
      @harrisonharris6988 7 ปีที่แล้ว +57

      I wonder if you could change your legal name to that.

  • @travispetit2410
    @travispetit2410 7 ปีที่แล้ว +5699

    Imagine naming your child "LIKE'%' UNION SELECT * FROM TABLEBASE" so that when they register its name, you'll get the information on all of the country's database

    • @ilyasssaadi9594
      @ilyasssaadi9594 7 ปีที่แล้ว +54

      Travis Petit probem is, you should rather imagine that names of people would contain else than alphabet (numbers and symbols)

    • @1wOOrking1
      @1wOOrking1 6 ปีที่แล้ว +160

      Why is PHP better then Python please?

    • @Minecraftsomebody
      @Minecraftsomebody 6 ปีที่แล้ว +10

      ^^^^^^^^^^

    • @siisihqdaa
      @siisihqdaa 5 ปีที่แล้ว +10

      US government sites use Drupal which uses PHP, so US government actually uses PHP

    • @ithinkitsaurus
      @ithinkitsaurus 5 ปีที่แล้ว +104

      my birth name is actually ':-- DROP DATABASE

  • @armonfrohlich6348
    @armonfrohlich6348 4 ปีที่แล้ว +61

    The whole computerphile series is just great. Much that I can only see through here, although I speak only moderately English.
    Your enthusiasm and your fascination for the topic leaves even a slightly boring topic to last interesting.
    And that with every clip.

  • @SpencerDavis2000
    @SpencerDavis2000 4 ปีที่แล้ว +4

    this was one of the most interesting videos I have seen in a while. gotta watch more now

  • @bennyboy968
    @bennyboy968 7 ปีที่แล้ว +2759

    I love how he explains things non-pretentiously. It seems a lot of people in the computing field really like to think they're better than everyone else.

    • @AngrySkipperGC
      @AngrySkipperGC 5 ปีที่แล้ว +184

      Prince Benny it’s usually not their fault.
      Having worked with Tech Mobs for the Gold Coast commonwealth games, it’s just how IT dudes are and there is actually a job for people to take what the IT guy says and explains it to the project manager in a way that makes sense.

    • @morten1
      @morten1 5 ปีที่แล้ว +51

      Yeah he's a great teacher too

    • @americancitizen748
      @americancitizen748 5 ปีที่แล้ว +56

      Or with a foreign accent so heavy you can't even tell they are speaking English.

    • @froyorex4856
      @froyorex4856 5 ปีที่แล้ว +15

      Yeah we do 😎

    • @MrX-nc8cm
      @MrX-nc8cm 5 ปีที่แล้ว +15

      Yes we are

  • @AriannaEuryaleMusic
    @AriannaEuryaleMusic 7 ปีที่แล้ว +1638

    So the best defense is to disable the "Search" box

    • @Ioganstone
      @Ioganstone 5 ปีที่แล้ว +123

      Only criminals need search boxes.

    • @saeedbaig4249
      @saeedbaig4249 5 ปีที่แล้ว +315

      The best defence is to take down your own website, destroy your computer, isolate yourself from technology & civilisation and go live in the woods.

    • @ShokoCC
      @ShokoCC 5 ปีที่แล้ว +151

      No client can't hack you if you have no clients #LifeHack
      @@saeedbaig4249

    • @adamatlas1113
      @adamatlas1113 5 ปีที่แล้ว +33

      Nah, silly lol Just ban "UNION" from your search box...

    • @chadtowers8556
      @chadtowers8556 5 ปีที่แล้ว +6

      From memory it's possible to use your browser search bar to run an SQL query

  • @madnessguy010101
    @madnessguy010101 5 ปีที่แล้ว

    I had known and understood what sql injection was previously, but I had never heard of blind sql attacks and using database-specific syntax in order to obtain information on the underlying database. Very informative video

  • @joylox
    @joylox 2 ปีที่แล้ว +2

    That program you had was literally something I had to make for a class in web development. I think it was the PHP class. Thankfully, we also have a mandatory information security course I'm in now and learning about these. We did talk about making sure quotes don't get in, which is important.

  • @SuperManitu1
    @SuperManitu1 7 ปีที่แล้ว +1486

    The hacking videos are the best and most interesting for me as comp science student. Keep them coming!

    • @Ownage4lif31
      @Ownage4lif31 7 ปีที่แล้ว +37

      Just wait until you learn MySQL and Javascript. Then you'll be able to learn some very interesting things.

    • @SuperManitu1
      @SuperManitu1 7 ปีที่แล้ว +44

      BlackenGames lol, I can program in over 20 languages, including those two. The point is not to learn them, but to learn against them. Possible weaknesses you have to remember when programming.

    • @Stigsnake5
      @Stigsnake5 7 ปีที่แล้ว +51

      >Javascript
      When I'm feeling like a masochist perhaps.

    • @SuperManitu1
      @SuperManitu1 7 ปีที่แล้ว +12

      Blaze I really hate Javascript, but you should try typescript. I have made my peace with javascript that way

    • @Ownage4lif31
      @Ownage4lif31 7 ปีที่แล้ว +7

      SuperManitu1 Then you should be able to exploit things easily.
      I don't know how to program in a lot of languages. Only 2 and I know how to do some nice exploits.

  • @zanzlanz
    @zanzlanz 7 ปีที่แล้ว +1481

    This is a very well done demonstration! I liked being able to see how it worked in an actual example.
    Someone ran one of those scripts on my site to try to hack my database a couple years ago. The only thing it helped me realize is that I needed stronger spam protection, because it left thousands of failed injection comments on one of my pages, haha.

    • @ZweiSpeedruns
      @ZweiSpeedruns 7 ปีที่แล้ว +39

      That sounds more like xss than sql injection

    • @jarmo_kiiski
      @jarmo_kiiski 7 ปีที่แล้ว +17

      You need some of that htmlspecialchars(), a stripslashes() and str_replace()

    • @empiter3359
      @empiter3359 7 ปีที่แล้ว +15

      htmlspecialchars() for the output as xss protection.
      in case of php & mysql it would be mysql_real_escape_string() against sql injections in quoted values.
      but people shouldn't think they would be save when just using these functions. someone can do an sql injection without using any control chars at all if you didn't put quotes around the variable in the query: for example "SELECT * FROM posts WHERE postId = $postId"... the value of $postId could just be "1 UNION (SELECT 1, 2, 3)-- " without any quotes.
      in this case you would be save with casting the variable to an int, but best practice in general is using prepared statements.

    • @empiter3359
      @empiter3359 7 ปีที่แล้ว +1

      meh, forgot about the ; in the example injection - but you get the point...
      use prepared statements / stored procedures :-)

    • @AchrafAlmouloudi
      @AchrafAlmouloudi 7 ปีที่แล้ว +37

      No, it is a SQL injection attempt, not an XSS attack, the hacker was using the comments form as a gateway to the database, just like Michael in the video used the search box to send malicious queries. The difference is a comments form will store those requests as comments while a search box doesn't store search queries.

  • @PaulBunkey
    @PaulBunkey ปีที่แล้ว

    This is the best explanation of SQL injection video ever. I've recommended it to a non-technical friend and he got the info-sec job.

  • @Towzlie
    @Towzlie 5 ปีที่แล้ว +11

    That's why you use PDO and bind requests. Also don't forget to sanitize user input before the query

  • @TheMrYakobo
    @TheMrYakobo 7 ปีที่แล้ว +585

    I thought I loved Scott. Then I discovered this man, the man that doesn't pronounce SQL like Sequel. He's brilliant

    • @denvernaicker8250
      @denvernaicker8250 5 ปีที่แล้ว +1

      oh snap i've been pronouncing it incorrectly

    • @jackrogers1115
      @jackrogers1115 5 ปีที่แล้ว +22

      Us in the UK dont tend to prononce it sequel...

    • @13am22
      @13am22 5 ปีที่แล้ว +4

      @@jackrogers1115 Well isn't Tom Scott from the UK, though? You see, he's the one in question who tends to do so.

    • @jackrogers1115
      @jackrogers1115 5 ปีที่แล้ว

      @@13am22 what

    • @jackrogers1115
      @jackrogers1115 5 ปีที่แล้ว +3

      In the uk, we tend to say s q l, not sequel. Thats what i'm say. And yes hes from the uk

  • @antiHUMANDesigns
    @antiHUMANDesigns 7 ปีที่แล้ว +207

    I made a website many years ago, and obviously made sure SQL injection wasn't possible, and I also logged stuff, and I did see some people trying to do SQL injection on my website.

    • @211212112
      @211212112 4 ปีที่แล้ว +12

      peas give me website address and permission to practice pen test

    • @antiHUMANDesigns
      @antiHUMANDesigns 4 ปีที่แล้ว +7

      @@211212112 This was well over 10 years ago. That website no longer exists.

    • @jmvr
      @jmvr 3 ปีที่แล้ว +3

      anti/HUMAN Designs :(

  • @abandoned7501
    @abandoned7501 5 ปีที่แล้ว +71

    Quantity in stock: A D M I N

  • @feliper.150
    @feliper.150 3 ปีที่แล้ว +66

    Alternative title: Tyrell Wellick runs an SQL Injection attack.

  • @Wolle704
    @Wolle704 7 ปีที่แล้ว +34

    I always struggled with some parts of this. But I finally understand how it works so I'd have to say this is probably the best explaination of SQL injections I've ever come across. Thanks

  • @Rougeman0
    @Rougeman0 7 ปีที่แล้ว +4

    I really love how Mike stepped up his game lately. Easily one of my regulars on Computerphile, keep it up!

  • @meptalon
    @meptalon 4 ปีที่แล้ว +1

    Subcription at first video :) This is the best explanation of an SQL injection that I've ever heard. Pretty sure that even non-coders would understand

  • @dhananjaydj543
    @dhananjaydj543 2 ปีที่แล้ว

    I'm only halfway through the video, Its easy to understand what he is trying to say due to those practical examples in a simplified way. Its half a decade old and still best videos to watch out for on this topic.

  • @Rippertear
    @Rippertear 7 ปีที่แล้ว +235

    you gave yourself permission? is that in writing? is it notarized? who knows, maybe you'll change your mind and press charges on yourself!

  • @VexillariusMusicEDM
    @VexillariusMusicEDM 7 ปีที่แล้ว +10

    Dude this guy is crazy I love watching vids with this dude

  • @raiker02
    @raiker02 3 ปีที่แล้ว +82

    alert("hello world");
    -I'm in.

  • @eminem2
    @eminem2 5 ปีที่แล้ว +135

    Imagine explaining that to inmates in jail: "I... I... put the wrong text in a database on purpose".
    Inmates be like: "Somebody get me a restriction order, you ain't coming 5 cells away from me, what is wrong with you!"

    • @Jibblets
      @Jibblets 3 ปีที่แล้ว

      Funny haha

  • @harrygreene6746
    @harrygreene6746 7 ปีที่แล้ว +3

    Would love to see more videos like this about possible software attacks. This was eye-opening

  • @Lmaoboat
    @Lmaoboat 7 ปีที่แล้ว +44

    This guy is by far the best on this channel. Especially with his practical examples!

  • @BladeGamester
    @BladeGamester 4 ปีที่แล้ว +5

    OKAY TH-cam I FINALLY WATCHED IT! This video has been in my recommended for years now.

  • @n1c98
    @n1c98 3 ปีที่แล้ว

    I love this channel, some videos I understand, and some I have no ******* idea what they are talking about. These guys are super epic and advanced. I'm an uber beginner LOL. Been learning the basics and enjoying it. Thank you for such incredible material, I really appreciate you guys, and of course, TH-cam too is just simply awesome

  • @Adam92326
    @Adam92326 7 ปีที่แล้ว +31

    That's why I use prepared statements everywhere, even when I get something from my own database, and do a query on something else.

  • @Werdna12345
    @Werdna12345 7 ปีที่แล้ว +63

    Would love to see a video on second order SQL injections!

  • @jorgemarcelo4708
    @jorgemarcelo4708 3 ปีที่แล้ว

    I really enjoyed this video! Very informative and the professor speaks really well

  • @Nalopotato
    @Nalopotato 5 ปีที่แล้ว +12

    One of my accomplishments at my first job was rewriting all of our (then) inline SQL queries and stored procs in C# to implement SQL injection prevention! It was a lot of fun :) And very rewarding when I was done

  • @deejaykaye
    @deejaykaye 7 ปีที่แล้ว +28

    This guy is quality, I could listen to him all day

  • @PashaSiraja
    @PashaSiraja 7 ปีที่แล้ว +714

    A 2rd degree attack would be me naming my children ";--"

  • @chrisalister2297
    @chrisalister2297 6 ปีที่แล้ว

    Amazing how this was posted in 2016 and these were concerns I had to address in 1996. Filtering, stored procedures and permissions are your friend.

  • @darshandani1
    @darshandani1 3 ปีที่แล้ว +4

    I learnt more from this video than my entire DBMS coursework.

  • @chasebrower7816
    @chasebrower7816 7 ปีที่แล้ว +666

    You don't go to jail if you don't get caught.

    • @chasebrower7816
      @chasebrower7816 7 ปีที่แล้ว +1

      Iceborn Gauntlet probably you.

    • @36nuts18
      @36nuts18 7 ปีที่แล้ว +4

      Chase Brower no, not just me. EVERYONE.

    • @rasheedhadi2714
      @rasheedhadi2714 6 ปีที่แล้ว +1

      Frank zapper

    • @malharjajoo7393
      @malharjajoo7393 5 ปีที่แล้ว +13

      you don't go to jail if you never try to learn this stuff. * makes the meme face *.

    • @americancitizen748
      @americancitizen748 5 ปีที่แล้ว +12

      That's what Hillary told me.

  • @rchandraonline
    @rchandraonline 7 ปีที่แล้ว +547

    user name consisting of SQL? must be Little Bobby Tables

    • @tiggerbiggo
      @tiggerbiggo 7 ปีที่แล้ว +1

      rchandraonline I know of that site, but this is a full in depth explanation as to exactly how it works.

    • @fluck6159
      @fluck6159 7 ปีที่แล้ว +6

      I will name my son as Little Bobby Tables

    • @jcfawerd
      @jcfawerd 7 ปีที่แล้ว +14

      I suddenly remember a man named "null"

    • @GioGziro95
      @GioGziro95 7 ปีที่แล้ว +2

      Where's the "Students" table?

    • @CreamyRootBeer
      @CreamyRootBeer 7 ปีที่แล้ว +13

      Oh, I love that comic. "Oh little Bobby Tables, we call him."

  • @nicktech2152
    @nicktech2152 4 ปีที่แล้ว +12

    WPF in C# 2010 Book on the background - Busted!

  • @Rhyden
    @Rhyden 5 ปีที่แล้ว

    I learned more about databases in this one video than I did during a semester long class in Uni about databases.

  • @dustin_echoes
    @dustin_echoes 7 ปีที่แล้ว +8

    Thanks! This video explains it better than my database subject lectures.

  • @sdHansy
    @sdHansy 7 ปีที่แล้ว +7

    This man is is an amazing teacher.

  • @GetCTOwned
    @GetCTOwned 4 ปีที่แล้ว +30

    Reminds me of the days when I had to 'recover' lost wordpress credentials for customers. Luckily web security has gotten much better but this is still a very valid video.

    • @MrSkinkarde
      @MrSkinkarde 2 ปีที่แล้ว

      Wordpress has never been secure in any way And it should never be used commercially

  • @PlayGrum
    @PlayGrum 4 ปีที่แล้ว

    just started doing a Cyber Security Course at college, enjoying your videos to supplement my learning :)

  • @baldeepbirak
    @baldeepbirak 6 ปีที่แล้ว +228

    Useful to see as this does work on my website.

    • @Rosson311
      @Rosson311 6 ปีที่แล้ว +158

      Baldeep Birak so what website you run.? Asking for a friend lol

    • @TeeKayMTrove
      @TeeKayMTrove 6 ปีที่แล้ว +18

      Cheeky.

    • @gavbag1234
      @gavbag1234 5 ปีที่แล้ว +88

      Hey now, let's none of us go Ball Deep on Baldeep.

    • @IAmESG
      @IAmESG 5 ปีที่แล้ว +8

      mind if I take a look on your website?

    • @cosminxxx5287
      @cosminxxx5287 5 ปีที่แล้ว +3

      @@Rosson311 but even as a joke you shouldnt try it cause when police will be at your door ,it wont hold honestly. like, i go with a knife at your house and you call police and i tell them 'oh ,its was just a joke,for fun,didn't mean to do anything'. not so sure someone will bite that even if it would be truth.so yea, don't even think to try just to see if it works.you would be the dumbest hacker in that jail yard.

  • @PanetMaster
    @PanetMaster 7 ปีที่แล้ว +3

    I'm so glad I stumbled upon this channel. So interesting. Excellent and informative use of CGI woven into the videos as well. Thanks Computerphile!!

  • @javcube
    @javcube 5 ปีที่แล้ว

    Great explanation!!!, Glad youtube finally recommends me something I am really interested. Keep iy up!

  • @jc_777
    @jc_777 5 ปีที่แล้ว

    It was so much fun watching this. Well instructed.

  • @christophernetherton9389
    @christophernetherton9389 7 ปีที่แล้ว +9

    Insightful..Thank you for taking the time to go through it..Not a database guy but found it very interesting.

  • @hrnekbezucha
    @hrnekbezucha 7 ปีที่แล้ว +264

    Now this is art. I can totally imagine people do stuff like this cause it's fun. Like chess.

    • @orlagskapten9829
      @orlagskapten9829 4 ปีที่แล้ว +2

      Juan2003gtr why are you calling him a noob?

    • @stylz1
      @stylz1 4 ปีที่แล้ว +1

      Like gambling.

  • @otis3744
    @otis3744 3 ปีที่แล้ว

    i’ve been looking for this, computer related channels that have the same or similar delivery as history channels and economics channels just stuff i can watch while relaxed

  • @Fowlerffs
    @Fowlerffs 6 ปีที่แล้ว +1

    Well done Sir! I'm very impressed

  • @_martinedwards
    @_martinedwards 4 ปีที่แล้ว +14

    That nearly finished Rubik's cube on his desk is playing havoc with my OCD

    • @Sharpless2
      @Sharpless2 2 ปีที่แล้ว +1

      here to remind you of that unfinished cube lol

    • @_martinedwards
      @_martinedwards 2 ปีที่แล้ว +2

      😭

  • @SpencerFcp
    @SpencerFcp 5 ปีที่แล้ว +3

    I used to work for a consulting company and you'd be surprised how shitty the majority of companies are at protecting your data. Mostly smaller businesses, but even some of the large ones lack basic security measures. It was pretty eye opening.

  • @jbyagenrok
    @jbyagenrok 10 หลายเดือนก่อน

    Felt like I was listening to an SQL injection tutorial as presented by James Acaster. And loved every second of it of course

  • @Minitomate
    @Minitomate 4 ปีที่แล้ว +1

    Very well explained.
    I liked a lot this explainatory video.

  • @B20C0
    @B20C0 7 ปีที่แล้ว +5

    The most scary fact about this is that it's still an issue in 2016. I did this kind of stuff 15 years ago and back then I already thought "this is way too easy". The bad news was that there were no such things as prepared statements, so you really had to do all the work with escaping.

  • @tomchapman128
    @tomchapman128 4 ปีที่แล้ว +133

    "Ah, I'm sure my website will be fine."
    *checks it*
    "ohno"

  • @ruslanshamsiev6528
    @ruslanshamsiev6528 5 ปีที่แล้ว

    Inspiring, you must do more videos, thank you

  • @Yeldur
    @Yeldur 6 ปีที่แล้ว

    Incredibly informative!

  • @leonhill8447
    @leonhill8447 2 ปีที่แล้ว +6

    As a SQL beginner this was super helpful, thank you.

  • @vinkuu
    @vinkuu 7 ปีที่แล้ว +72

    The password for user Joe is 'administrator'.
    ./john /vagrant/x --show
    ?:administrator
    1 password hash cracked, 0 left

    • @CJBurkey
      @CJBurkey 7 ปีที่แล้ว +3

      What was the salt?

    • @vinkuu
      @vinkuu 7 ปีที่แล้ว +12

      The whole hash is
      $1$V32.4G/.$0PKnjhXYUmYLJZZ8vEt/b/
      so i guess the salt is 'V32.4G/.'. I'm not familiar with the format of md5, but in bcrypt that would be the salt.

    • @CJBurkey
      @CJBurkey 7 ปีที่แล้ว +1

      vinkuu So, essentially, if you get into the database, you can use the salt that is with the password to crack it by brute forcing it?

    • @vinkuu
      @vinkuu 7 ปีที่แล้ว +8

      Yes correct. And that is the reason md5 is considered a bad choice of hashing algorithms to use for hashing passwords. It's very fast to brute force md5 hashes compared to eg. bcrypt with a cost setting of 15. It directly equates to cost (€) of the brute force cracking setup.

    • @ZombieCakeHD
      @ZombieCakeHD 7 ปีที่แล้ว +1

      Or just type in administrator??????

  • @kwakuamoh-aboagye
    @kwakuamoh-aboagye 5 ปีที่แล้ว

    Nice video, easy to understand. Well demonstrated examples too....

  • @LincolnChamberlin
    @LincolnChamberlin 4 ปีที่แล้ว +1

    This was fun, can you do more of these vids where you show what this is actually like?

  • @JonSmith-cx7gr
    @JonSmith-cx7gr 4 ปีที่แล้ว +14

    What was the price for the 7mm nails? I'm re-upholstering a chair currently and think 8mm would be too long.
    Thanks.

    • @ZaHandle
      @ZaHandle 3 ปีที่แล้ว +1

      admin

  • @black_platypus
    @black_platypus 7 ปีที่แล้ว +3

    Next up: *Second Order injections*, then?
    How does that happen? Simply when something gets unescaped and evaluated by the server?

  • @TechOnScreen
    @TechOnScreen 2 ปีที่แล้ว

    Amazing demonstration.

  • @tz2014
    @tz2014 3 ปีที่แล้ว

    Hi sir, thank you for the knowledge, u really make computer science fun
    I just want to ask how can i get the playlist of all your videos in security staffs?
    I have been watching ur videos and its awesome and very informative and i would like to check all of them because they help me alot

  • @club6525
    @club6525 2 ปีที่แล้ว +4

    Just to clarify: It's not a malformed query. You're actually getting outside of the query that the website wants you to. Basically, you get to create your own little query which is pretty terrible cause then some dude can query for everyone's passwords.

  • @an3ssh
    @an3ssh 4 ปีที่แล้ว +3

    Thank you TH-cam for suggesting me this video after my DBMS exam .....wouldve done great if i had watched this video

  • @geekbeer5846
    @geekbeer5846 3 ปีที่แล้ว +1

    What a crazy interesting video. Any chance we could get a video / any information on rainbow table cracking, and Man in the Middle attacks? I feel like the latter is still used quite frequently, but these are some older techniques that with newer tools & ideas applied to them, are crazy effective. Would love to see your take on them.

  • @matlilly8795
    @matlilly8795 5 ปีที่แล้ว

    At one point, I created and maintained a server. You have to know how to crack your own system to know how to defend it. I launched campaigns against my server on a somewhat regular basis. Great explanation.

  • @combatking0
    @combatking0 7 ปีที่แล้ว +14

    When putting together a SQL driven site, I put all text input variables through a function which filters out all potentially hostile characters and replaces them with something which cannot be interpreted as SQL code. It could also be possible to get the PHP to check for multiple attempts to submit SQL injections. One or two could be accidental, but more than that could be viewed as an attack, so I could make the PHP block all traffic from that IP for an hour, or return some decoy tables, or even a fake page warning the hacker that a virus is being uploaded to their computer, complete with a progress bar :)

    • @13am22
      @13am22 5 ปีที่แล้ว +7

      If you're still learning PHP, SQL and all that stuff and didn't already - please have a read on PDO and prepared statements. It's the "new" easy way of dealing with everything. :)

    • @elliotc4268
      @elliotc4268 2 ปีที่แล้ว +1

      make it return what they would want to see, but the wrong information. a fake error or a fake full table

  • @kimlau4285
    @kimlau4285 4 ปีที่แล้ว +10

    Me: Going through lecture slides to past my sql exam.
    You: Playing black magic with sql query.

  • @caicu4865
    @caicu4865 4 ปีที่แล้ว

    awesome, back in few years ago I tried to study the topic but I was so confused, no idea why it makes sense now but awesome video, liked.

  • @roguishowl3915
    @roguishowl3915 2 ปีที่แล้ว

    Very interesting and informative content, love the work, instant sub and like.

  • @colee6133
    @colee6133 4 ปีที่แล้ว +44

    the illegal part of this is having an unsolved cube on your desk with super easy PLL case :c

  • @raf.nogueira
    @raf.nogueira 6 ปีที่แล้ว +28

    This why we should use PreparedStatements in PHP , JSP, Servlets, C# and ASP.. :)

    • @13am22
      @13am22 5 ปีที่แล้ว +4

      That wasn't alway a thing before sadly. As of today, it's the only way to go basically. :)

  • @tizziejames9040
    @tizziejames9040 3 ปีที่แล้ว

    This is all such great stuff.

  • @Codetutor-DemystifyCoding
    @Codetutor-DemystifyCoding 2 ปีที่แล้ว +1

    Just perfect!!! Rather than talking about how it's done, show how it's done.

  • @philadams9254
    @philadams9254 7 ปีที่แล้ว +308

    "; DROP ALL DATABASES; --

    • @josephthapa5848
      @josephthapa5848 6 ปีที่แล้ว +19

      Thats bad

    • @cristalmen9104
      @cristalmen9104 5 ปีที่แล้ว

      :D

    • @user-bp5fk9ln2h
      @user-bp5fk9ln2h 5 ปีที่แล้ว

      OMG...

    • @chrisellis5860
      @chrisellis5860 5 ปีที่แล้ว +34

      Only if the account has been granted DROP permissions. For a site that just shows records it should only be created and given SELECT permission.

    • @fireboltofdeath
      @fireboltofdeath 5 ปีที่แล้ว +49

      +Chris Ellis
      Do you really think someone who isn't going to escape user input, would think about that?
      Because I honestly don't.

  • @MrMichaeledavis83
    @MrMichaeledavis83 5 ปีที่แล้ว +3

    As a learning web developer that uses php and sql all the time, this is pretty creepy. Luckily I learned to sanitize my queries early on, but I need to learn more about how hackers might attack a website.

  • @imranemokhtari5433
    @imranemokhtari5433 5 ปีที่แล้ว

    well explained may the One bless increase your knowledge

  • @hosmanadam
    @hosmanadam 5 ปีที่แล้ว

    Excellent content, thank you!

  • @harrisonharris6988
    @harrisonharris6988 7 ปีที่แล้ว +106

    +Computerphile could you do a video on hashing/breaking hashes?

    • @michaelpound9891
      @michaelpound9891 7 ปีที่แล้ว +75

      Coming soon - using a 4x Titan X GPU server ;)

    • @jimkennedy4509
      @jimkennedy4509 7 ปีที่แล้ว +1

      Usually you need to find out what type of hash they use. Then you could try a dictionary attack. Have a program try each word until the hashed value = the one you got.

    • @hammode1538
      @hammode1538 7 ปีที่แล้ว

      md5 :)

    • @4pThorpy
      @4pThorpy 7 ปีที่แล้ว +3

      I think you're misunderstanding what salting does, you can reverse lookup a hash by having a list of hashed common words/used passwords, lists of billions upon billions of possible passwords...what salting does is change each hash with a "salt". So having two of the same passwords would produce two different hashes, thus making reverse lookup a less likely decryption method.

    • @billy653
      @billy653 7 ปีที่แล้ว +3

      Is this the actual Michael from the video. If it is I'm happy you're reading the comments. These videos have been quite refreshing on computerphile.

  • @srider33
    @srider33 3 ปีที่แล้ว +3

    15:15 "Thank you for saving us some time." - Malicious people.

  • @marcopetaccia88
    @marcopetaccia88 3 ปีที่แล้ว

    Thanks!! Really informative and entertaining video !!

  • @HarshaVardhan-xx6ii
    @HarshaVardhan-xx6ii 2 ปีที่แล้ว

    These videos are very helpful