Cross-Site Request Forgery (CSRF) Explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 268

  • @forceboxed
    @forceboxed ปีที่แล้ว +70

    @4:53
    one of the important things to mention here is that the csrf token is good only as long as it is mapped to the user's session ID in the backend. Otherwise, the attacker might simply obtain a valid CSRF token by visiting the main website themself and inject it into the malicious requests.
    Tying the token to the user's session and validating that on the backend for each request is very important.

  • @justforyoutube1319
    @justforyoutube1319 5 ปีที่แล้ว +72

    i came from LiveOverflow channel , i so glad to be here !
    your channel is interesting , love it . keep up the good work

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

    Man, I tried researching how CSRF attacks worked last year and I never got a solid grasp of it.
    This video changed that.
    As a cybersecurity enthusiast and web developer, this is super helpful!

  • @hydr0nium_
    @hydr0nium_ 5 ปีที่แล้ว +320

    Seriously cant say it enough. I freaking love your videos

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

      I second that notion

  • @dragonballZbigBang
    @dragonballZbigBang 5 ปีที่แล้ว +116

    There's tens of thousands of videos on Csrf but you easily beat all of them. Yet the number of views you got aren't nearly as close as theirs. Niche youtubers like you are ahead of the time. I hope people like you are revered in coming 5 years

    • @PwnFunction
      @PwnFunction  5 ปีที่แล้ว +38

      Yeah, late in the game, but it's totally fine, I'm just trying to give somethin back to the community.

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

      Look at it now ;)

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

      Damn, dude really planted the seed and let it grow

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

    "Cat-Site Request Forgery"

  • @a.yashwanth
    @a.yashwanth 4 ปีที่แล้ว +18

    I watched around 15 videos regarding csrf and you are the only one who explained it clearly. Also not everyone stressed on "the browser automatically sends the cookies".

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

      truuu

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

      I still don't understand it. What does it mean? What cookies? All the cookies from all the tabs opened in the browser are sent with all POST requests that are being made on whichever tab?

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

      @@kornelijekovac9793 All the cookies from one website will be sent to the server of that website on each request (with website I mean domain, not origin). The most important cookie is the one with the session id (SID), which identifies the user. More about this can be found if you search for "session management".

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

      @@bsmldy8681 But how can cookies from two different tabs intermingle?

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

      not sure what you mean by that

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

    No words to describe how much informational these videos are.
    Thank you.

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

    I genuinely don't understand why you stop creating videos. Your style is so cool.

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

      He's back!

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

    we need more of these.
    literally a free service to everyone genuinely interested

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

    the music and naration in the intro made me feel like I'm discovering a mistery in another new world, lol. great video

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

    Wow , I love the graphical explanatory video, really easy to follow and understand in concordance with explication

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

    I really enjoyed your theme of explanation and the background music. sounded adventurous

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

    was curious if tokens really work since you could just make a GET and read the token then post. glad you answered that question very quickly. awesome video. i will subscribe

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

    Third video of yours that came up, and perfectly described the concept. Subscribed

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

    Great Video and your drawing is amazing bro that google logo and the adobe logo was so perfect.

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

    You are just awesome man. Why doesn't TH-cam show such search results at the top. I couldn't find you when I needed but now I am happy. Thanks bro..

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

    Bruh you need to create more content like this. Also you give example are to fast but over all your the best. 11/10.

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

    Just came by from watching LiveOverflow's video. I subbed and put on the bell notification on. This channel looks so cool

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

    Incredibly amazing video as always. Very great explanation, and I love your color choices and how you draw/write everything

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

    Came from Stök's channel. Absolutely loving it now! Subscribed and belled👏

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

    I often find it hard to focus on educational videos like this, but somehow your videos have all of my attention. Not sure what voodoo you're using but it's working!

  • @ph0sgene967
    @ph0sgene967 8 หลายเดือนก่อน

    As someone who pioneered csrf in 2007 this is a great video

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

    Great content. I can't believe this is free!
    PS: I love your colour scheme

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

    Wunderbar...................U r one awsme teacher. Hats off to the effort you put in, for us mere novices.

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

    You explained this better than the skillsoft guys, that's for sure

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

    You put lots of effort into your videos. Transitions are amazing. Wonderful production.

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

    As I understand it, fetch and XHR require `useCredentials` to send the cookies along with the request which needs to be explicitly stated on the CORS header Access-Control-Allow-Credentials. Otherwise cookies are not being sent and the CSRF fails.

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

    This is one of the best channel I have encountered 😍

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

    Thankyou for your videos. I would very much like to see a video on Insecure CORS and ways to escalate it :)

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

    you concept and style of teaching is lovely!..keep it up

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

    I found a CSRF on a large website with > 500k members, so it's more common than you think! It allowed me to send their coins to my account, and those coins were bought with real money, so it was a decently critical flaw

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

    Was watching live overflows vid a month ago, and look at me now, watching each video of yours everyday

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

    Awesome video. I hope that you explain some bugs like vulnerable flash files, JSONP and email spoofing

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

    Amazing content as always, big fan of your videos and tutorials, thank you so much ;D

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

    Amazing 😅 , i learn a lot of new concepts in one video , but i think i will re-watch it later , some of them seem confusing !

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

    You definitely deserve more subs ;)

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

    *Sees **11:42*
    *Cries with Respect*

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

    You need more likes. Your work is needed for every developer.

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

    Videos are so interesting and clear with basic to advance. Keep going 😀

  • @VietnamSteven
    @VietnamSteven 4 หลายเดือนก่อน

    incredibly informative!

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

    Such a good video. I love the voice as well: cute and reliable

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

    I Love PwnFunction Video's ILLUSTRATION🔥🙌⚡😍

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

    Great explanation bro, Keep up the good work.
    Wish ya da best.

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

    Great video, to the point and thoroughly explained the main concept.

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

    Love the style of explanation!

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

    the best channel, thanks brother for the knowledge

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

    Fucking A . i had to do couple of days of deep research to understand some of those concepts in order to have some idea about where the exploits would be . you just explained it PERFECTLY in simple terms and visuals and confirmed some of my thoughts :D . u did share some valuable and accurate information despite supid youtube terms n policies. Thank you sir for the clues XD

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

    you should make more cyber security videos i LOVE them!!!

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

    this made me rethink my web security holy shit.

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

    Before sending the delete request, isn't the browser sending a preflight OPTIONS request to the server which will return an error and the delete request won't happen anymore ?

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

      I was thinking the same. Ideally CORS would have stopped this.

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

      yes. In case of Ajax request , SOP will stop the request as the preflight will return error

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

      yeah. Just as a note, It seems that you can actually send a simple request to the server and the request will go through but you won't be able to read the response due to cors. namely if you don't have any headers on your request but then again that means you won't have any cookies and won't be carrying any state so pretty useless all in all.

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

      As cors is just client sided, for a hacker this isn't difficult to bypass it

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

      @Orora Brian You can still do CSRF for non-authenticated requests, such as an anonymous message on a blog post or something, which is not entirely harmless

  • @samuelk3076
    @samuelk3076 4 หลายเดือนก่อน

    Very nice video, I love the explanation!

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

    Hi PwnFunction , just found your channel , your animations on this video are fantastic , can you share what app you use ? Thanks & Great Job

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

      Adobe animate to draw, Audacity/Auditions to edit sound and Premiere pro for editing vid.

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

    Crystal clear explanation. Thanks a ton

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

    I love your videos there amazing , professional ! but I guess slow down a little bit for new people,
    other than that your the best I have ever being taught

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

    This is very well explained, appreciated

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

    probably the best explanation out there

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

    wtf you deserve way more likes on this

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

    Best explanation I've ever heard!

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

    12:47
    I dont understand why the json data + the content type header are first passed through a redirect(?) then to the vulnerable site?

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

      Because simply flash will forward the request as string and then the site will convert it into header and “ key = value “ type so that it would be readable by the API of vuln.com!

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

    Thanks for making this. Really nice!

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

    that is so cool.
    Mama told me to go on CS degree🤣

  • @miss-sw3qu
    @miss-sw3qu 4 ปีที่แล้ว

    Your videos are amazing. Clean, informational, and perfect. I should have found your channel earlier.

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

    Great videos.........Thank you for posting them

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

    FLASH ISN’T GONE!!
    Thanks to projects like Ruffle, people can emulate Adobe flash, and Actionscript 1 & 2!

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

    came from BuferOverflow :p he mentioned u

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

    Very clear explanation. Thanks!

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

    Very informative but couldn't ignore the sharp pitch whenever you pronounce 's'.

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

    God has sent you for a special purpose !! Teach us kid.

  • @matthewdraevich4214
    @matthewdraevich4214 3 หลายเดือนก่อน

    Great explained, thanks🔥

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

    most of the cases of being bypassed by other domains for a kind of request is by using */wildcard in CORS

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

    not to mention the sick ass intro

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

    Thank you for the great explanation! How did you made that animated slides, what tool is it?

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

    your channel is a gold mine !!

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

    Awesome explanation! Tks!

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

    Amazing video, so clear!
    thank you

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

    this is the best. freaking cool

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

    Ok, good stuff. Subscribed.

  • @J18040-n
    @J18040-n 3 หลายเดือนก่อน

    🔥

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

    That's crazy explanation, Thanks a lot

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

    Well done sir, keep them coming! :)

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

    Nice video thanks for the amazing content

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

    Question: Why not just use postman and set the headers?
    Thanks

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

      You can.... If you want to hack only yourself.

  • @HarujiCat
    @HarujiCat 8 หลายเดือนก่อน

    You saved me. Thank you so much

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

    Love your videos! Please make more :3

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

    Subscribed you brainy Penguin!

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

    Does the Flash CSRF JSON trick still work?

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

      yes it does, it requires the victim to allow flash though, but it works neverthless

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

    Is it true that SOP allows to send request cross domain but not read the responses? Why would even a request be even triggered by the browser if there is a SOP?

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

    Great Explanation ✅

  • @yeshwanth.alampalli
    @yeshwanth.alampalli 4 ปีที่แล้ว +2

    Basic question 😐=> If the same origin policy blocks the request from different domain, how can cat.com make request on behalf of vulnerable.com? 🤔

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

      Thats an example of Cross Origin Request, you can make requests to any website, but the response can't be read due to SOP unless the site let's you explicitly.

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

    Come on more video , u r just awesome !!!

  • @kds-2049
    @kds-2049 4 ปีที่แล้ว

    Explained well, props to you

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

    Great video, can you please shed a bit more light on how a csrf token actually protect against a csrf attack?

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

    that the office reference :')

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

    MASHA ALLAH

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

    Hey Bro, your videos is amazing, where do you get your knowledge from?

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

      LiveOverflow is my senpai.

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

    For when pwn videos ?
    Very good stuff :)

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

    Awesome ! Thank you !

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

    love your videos this is a god's work

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

    You're videos are awesome