Why you should Close Your Files | bin 0x02

  Рет қаралды 319,374

PwnFunction

PwnFunction

3 жыл бұрын

#BinaryExploitation #FileDescriptor #Attack
In this video, we're gonna look at how one can abuse file descriptors in some cases to get access to "sensitive" documents.
🔗 Code + Build Instructions: old.hackercamp.co/
🔗 Original Blog: www.sektioneins.de/en/blog/15...
💬 Discord: / discord
🐤 Twitter: / pwnfunction
🎵 Track: Warriyo - Mortals (feat. Laura Brehm)
NCS link: • Warriyo - Mortals (fea...

Пікірлер: 525
@PwnFunction
@PwnFunction 3 жыл бұрын
Bois I've got covid, I'll be back soon.
@vasa_kot
@vasa_kot 3 жыл бұрын
cool
@KrXYT
@KrXYT 3 жыл бұрын
RIP
@KrXYT
@KrXYT 3 жыл бұрын
the fact you commented 13 minutes ago is insane, ive gotten this in my recommended like every refresh for like the past week and just now decided to watch it
@feyg0
@feyg0 3 жыл бұрын
F
@fdsf9886
@fdsf9886 3 жыл бұрын
rip
@chezcake256
@chezcake256 3 жыл бұрын
0:27 “guys I gotta close my keyboard hold on”
@jhonreydaffon8156
@jhonreydaffon8156 3 жыл бұрын
Unplug it after using XD
@theepicbruhman2254
@theepicbruhman2254 3 жыл бұрын
@@jhonreydaffon8156 just cut the wire
@Barrosy
@Barrosy 3 жыл бұрын
Hold on... Lets close my network socket as well. 0:28
@Lovuschka
@Lovuschka 3 жыл бұрын
"Why you should close your files." "Network sockets are a file" Okay, closed them. How do I connect to the internet again now?
@julians.2597
@julians.2597 3 жыл бұрын
linux be like: "everything is a file" --> sudo shutdown now -h
@Handlessuck1
@Handlessuck1 2 жыл бұрын
@@julians.2597 Wait if everythings a file am I a file?
@Rudxain
@Rudxain 2 жыл бұрын
This is like OOP, everything is an object
@Handlessuck1
@Handlessuck1 2 жыл бұрын
@@Rudxain Imagine programming with FOP
@Rudxain
@Rudxain 2 жыл бұрын
@@Handlessuck1 That would be an interesting concept. Like accessing file metadata using computed property access. Setting permissions using object descriptors (file descriptors). Classes would be programs specifically designed to create a certain kind of file, so VIM is a class whose constructor returns a new plaintext file object. The only problem is that *EVERY* file is allowed to have own function properties, which means they can come bundled with method scripts that aren't inherited from the prototype, possibly allowing arbitrary code execution lol
@giacomoflisi
@giacomoflisi 3 жыл бұрын
This whole channel is so good, I'm glad i stumbled upon this gem of the internet today!
@the_agent_z
@the_agent_z 3 жыл бұрын
same!
@dsi-films1264
@dsi-films1264 3 жыл бұрын
Same
@knightbeast4672
@knightbeast4672 2 жыл бұрын
well, I did today!1
@cat-.-
@cat-.- 3 жыл бұрын
Bruh, YT recommended this video to me today, I saw the channel name, I saw the video title, and I immediately subscribed
@aleksandermirowsky7988
@aleksandermirowsky7988 Жыл бұрын
This video is literally the most informative piece of media about this topic in the entire platform. Instantly subscribed to the channel. Great stuff.
@rjhornsby
@rjhornsby 3 жыл бұрын
with sincere admiration, between the art style and the narrator’s voice I fully expected him to end with “now, fire ze missiles!”
@BlueTac1992
@BlueTac1992 3 жыл бұрын
But I am le tired
@kevinalexander4959
@kevinalexander4959 3 жыл бұрын
so old school before even KZfaq was out and flash cartoons were all the rave!
@BlueTac1992
@BlueTac1992 3 жыл бұрын
@@kevinalexander4959 hell yeah, just like burnt face man
@iamworstgamer
@iamworstgamer Жыл бұрын
bro uploaded this content for absolutely free. you are a legend
@ahmedlimam2241
@ahmedlimam2241 3 жыл бұрын
I want youtube to start recommending this type of videos more! sadly I can't help but watch cat videos every now and then...
@codeIMperfect
@codeIMperfect 3 жыл бұрын
Go to the 3 dot menu against those videos and select 'Not Interested'. I know it'll be hard but you gotta do it😥
@ligamo2615
@ligamo2615 Жыл бұрын
This channel is actually amazing. I love it!
@wiri2391
@wiri2391 Жыл бұрын
Your visualisations are on point! Everything feels smooth. Thank you!
@3bdo3id
@3bdo3id Жыл бұрын
That is not the case when you try doing it yourself! I am trying just right now and file 3 is not left behind, I think that is a patch of the ubuntu that made this for now but I may return to edit this comm if I figure out what is the wrong
@googleuser8512
@googleuser8512 3 жыл бұрын
This is awesome. I'm so happy I got this recommended. Keep up the great work!
@sawcondeez
@sawcondeez 3 жыл бұрын
Great explanation and examples. Thanks for making this video! I like your terminal theme btw, very nice colours
@user-vr4mv4pg5u
@user-vr4mv4pg5u 3 жыл бұрын
man u are the best rare to find someone that explaines the subjects that good
@pasteancalin7826
@pasteancalin7826 3 жыл бұрын
This just popped up in my feed. Watched 4 minutes and I love it. Subscribed 🔥🔥
@tachonko5487
@tachonko5487 3 жыл бұрын
Ok I just found your channel thanks to your XSS vid, and it’s amazing ! You really helps to understand some complicated contexts, especially for someone who is new to this environment. Keep up the good work 👌
@mr_ehmed
@mr_ehmed 3 жыл бұрын
Much awaited ❤ i hope this playlist grows n grows 😍
@patrickdee7365
@patrickdee7365 3 жыл бұрын
Very smooth and well explained love it!
@XThexFenderX
@XThexFenderX 3 жыл бұрын
This is a hella cool video
@anirudhakumar2271
@anirudhakumar2271 Жыл бұрын
Bruh. This is amazin, you killin it
@0xbyt3z
@0xbyt3z 3 жыл бұрын
one of the best channels with quality content.
@MattMcT
@MattMcT 2 жыл бұрын
So good as always, pwn! Hope you get better and get plenty of rest 🍻
@artyomkurguzkin5271
@artyomkurguzkin5271 3 жыл бұрын
Seeing technical videos of such high quality is mind-blowing. My regards=)
@DarkMonsterGFX
@DarkMonsterGFX 3 жыл бұрын
Amazing vid sir! Please, keep them coming! :D
@ChildishBerbino
@ChildishBerbino 3 жыл бұрын
I appreciate you and your work so much. As someone with a learning disability, my learning curves are fucked to shit. Sometimes I'll go a month feeling like no progress had been made, then all in one jump every subject and related ones click. Watching your videos, speed this learning process up for me immensely, and I'm so grateful. I hope your Covid-19 is gone by now. We need you ❤️
@SEX_ON_DRUGS
@SEX_ON_DRUGS 3 жыл бұрын
loving this series so far :)))))00
@bartoszstaszewski6325
@bartoszstaszewski6325 3 жыл бұрын
This channel is amazing. I just love the graphics and how you explain those things. Wish you'd do more videos about linux filesystem, and low level stuff.
@andylib
@andylib 3 жыл бұрын
Crazy stuff as always 🔥
@karthibalaji3817
@karthibalaji3817 3 жыл бұрын
Awesome work mr.pwn !
@SuryaTejaKarra
@SuryaTejaKarra 3 жыл бұрын
Great find as always mate.
@beterax
@beterax 3 жыл бұрын
Amazing visual style!
@kennichdendenn
@kennichdendenn 2 жыл бұрын
Thanks, Rust, for closing files on drop (standard: when the variable goes out of scope), as do many others. Sometimes I think RAII is kinda the wrong term, as closing/deallocating/whatever on dropping your value seem equally if not more important in practice.
@sephirothbahamut245
@sephirothbahamut245 Жыл бұрын
RAII has always been the wrong term, but it caught on. And I guess C(lose)O(n)D(estruction) would remind too much Call of Duty
@thewelder3538
@thewelder3538 Жыл бұрын
Yup, let's all have the compiler do stuff for us because it's too complex to do it ourselves!! It's what makes the difference between a good coder who is aware of such things and people who need a runtime to remember all the things they forget because resource management is too complex for them. You might as well just advocate for gameSpaceInvaders.create(); gameSpaceInvaders.run() and have the compiler generate the entire thing for you. Coding and coding well is a skill, but NOT today, it's, let the runtime handle that, import some else's library, job done.
@jort93z
@jort93z Жыл бұрын
@@thewelder3538 It's a matter of efficiency. Why have people write the same code hundreds or thousands of times? Consumers (because that is who needs to pay for software at the end, even internal software) don't want to pay for developers writing boilerplate code over and over. You want working code the smallest possible amount of effort. Of course, it needs to be fast and safe as well, but nobody has time and money for developers to mess around and try to perfect every little thing. It's generally not that people couldn't do it, but simply that they don't want to.
@thewelder3538
@thewelder3538 Жыл бұрын
@@jort93z I'm not sure if you're actually arguing what you think you are. It's simple, if a class opens a file handle, it should close it. It has nothing to do with efficiency. Your arguing that the runtime should close the file handles that YOU forgot to close. This is like the ultimate lazy coders paradigm, where you rely on the runtime and compiler to fix all your bad code for you. Sure, there are always deadlines and stuff, but releasing a badly bugged product affects reputation WAY more than a release delay. The problem with many coders nowadays, is they have literally NO idea what is going on under the hood of the languages they are writing in. I think they should all do a stint writing x86 or ARM assembly because then you HAVE to take care and do things properly. None of this... whoopsie, I accidently left a file handle open, not to worry, the runtime will sort that for me, mentality. You do things right, or you resource leak and your program dies. Then, once you've got that level of understanding, apply it to a higher level and then you'll realise just how much nonsense it is letting a runtime close a file handle, just because it can. This applies to more than just file handles though, it applies to any resource. The same as a GOOD coder has no concept of a string, it's just a list of bytes. Dynamic containers, like vector/map/set etc, most have no idea what's actually going on. But work in assembly for a bit and then you realise how much pain and suffering these dynamic containers save you from.
@jort93z
@jort93z Жыл бұрын
​@@thewelder3538 "This is like the ultimate lazy coders paradigm, where you rely on the runtime and compiler to fix all your bad code for you" Well, or you look at it another way, you rely on the compiler/runtime, so you need to write less code for the same thing. Just because your code is less verbose, doesn't make it worse. If you know you can rely on the compiler/runtime, there is no need to write it out explicitly. Your problem is you seem to think that people just forget to close it. It isn't that people forget, but simply that people don't want to. Being stupid, and being lazy, are very different things. Generally, smart and lazy people are the best programmers.
@enrique4012
@enrique4012 3 жыл бұрын
That's why we use 'with open...' so it get closed when the code is finished.
@MakkaPakka7999
@MakkaPakka7999 2 жыл бұрын
python
@synacktra
@synacktra 2 жыл бұрын
that's why they made 'with' keyword so we don't fck up, another amazing thing is defer in golang.
@gorak9000
@gorak9000 2 жыл бұрын
That's all fine and good in python, but there's no such thing in C, and all the "real" code that does actual work is written mostly in C
@techheck3358
@techheck3358 Жыл бұрын
@@gorak9000 you’re watching this on KZfaq, on a website written in html, with effects written in JavaScript, with a backend of C++. Take your elitism elsewhere
@gorak9000
@gorak9000 Жыл бұрын
@@techheck3358 Uh, I'm not sure where you got this sense of "elitism" from, but thank you for re-enforcing my point that not all software is written in Python, so saying "use 'with' in Python" is not a solution to this issue. I'm just trying to quell the "python fanbois" that no, there actually do exist other languages out there that don't have "auto" file closing. So many "coders" these days think they can string 5 lines of python together, so now they're "software developers". I interviewed 5 or 6 such people in the last couple of weeks. I don't know wtf they are teaching in CS these days, but it's either not getting through to people, or CS education has really taken a nosedive in the last 5 or 6 years. You ask these "software developers" basic data structures questions, or complexity (big oh) questions, and they look at you with a blank stare like you're talking a foreign language.
@kericlapboards7737
@kericlapboards7737 3 жыл бұрын
Thank you for linking to the original blog!
@brold6111
@brold6111 3 жыл бұрын
You deserve way more subbs lol. You convinced me from the first video. Great job.
@nikolaisafronov3452
@nikolaisafronov3452 3 жыл бұрын
Wish you strength! Your videos are super, pls pls keep it up
@thomas.n.jordan5093
@thomas.n.jordan5093 3 жыл бұрын
so underrated, keep it up!
@niewazneniewazne1890
@niewazneniewazne1890 3 жыл бұрын
It makes sense to me except the exploit part at 7:04, we are piping to stdin of newgrp an echo command into a setuid binary/binary with permissions to write "/etc/sudoers"? I don't get the shell script. Also the OSX case is part of the semingly same "mistake", except it doesn't use exec(); except exec() is never used, and the linker should run with permissions of the target binary. 1:11 this is a very honest beginners mistake of "exec() runs a new program, so kernel has to clean up everything that made up the old process"(and this behavior can have usefull usecases).
@SteveTheNerd
@SteveTheNerd 3 жыл бұрын
Really good videos! It definitively makes me a better developer. I also like your video style with the hand drawn aestetics. What do you use to record your drawing? Just curious 😇
@tanned_cosines_
@tanned_cosines_ 3 жыл бұрын
i just started watching this series today wasn't expecting 3rd ep so soon btw
@callumery119
@callumery119 3 жыл бұрын
Nice PFP bro
@tanned_cosines_
@tanned_cosines_ 3 жыл бұрын
@@callumery119 commendable to you too, lol someone who notices :)
@nameless_9504
@nameless_9504 3 жыл бұрын
U did it worng it's btw >& this 😂😂
@Hobbitstomper
@Hobbitstomper 3 жыл бұрын
Got worried that your last pinned message was 2 weeks ago saying you got COVID. Had to sort the comments by date to see if you made other replies since then. Saw one from last week and then one from today. Glad you're still with us. I hope you're feeling better.
@PwnFunction
@PwnFunction 3 жыл бұрын
I'm good now, writing script for the next video :)
@monsieuralexandergulbu3678
@monsieuralexandergulbu3678 3 жыл бұрын
Nice drawings, i like your explanation, keep going!
@PwnFunction
@PwnFunction 3 жыл бұрын
Thank you, I will
@klaasweerstand1577
@klaasweerstand1577 3 жыл бұрын
Thanks for the warning, I will keep it in mind.
@Vlad-1986
@Vlad-1986 3 жыл бұрын
This guy seems cool. Top class teaching.
@doretox
@doretox 3 жыл бұрын
thanks liveoverflow for introducing me to this channel
@oliveira_mh
@oliveira_mh 3 жыл бұрын
Awesome vídeo, thank you!
@heyarvee
@heyarvee 3 жыл бұрын
Excellent explanation! 🔥 also, your terminal theme is sick! what theme is it?
@samarthverulkar4529
@samarthverulkar4529 Жыл бұрын
This is channel is addictive
@lahiruchathuranga343
@lahiruchathuranga343 3 жыл бұрын
We need more..this is so addictive
@g3tl0st30
@g3tl0st30 3 жыл бұрын
@filedescriptor a huge fan of him, since long time.
@andrewlainson7954
@andrewlainson7954 2 жыл бұрын
Love this content
@milkibearmilkibear
@milkibearmilkibear 2 жыл бұрын
Oh, that was good, I didn't knew that... THX!
@HaxorBird
@HaxorBird 3 жыл бұрын
1:15 I was also thinking of this guy. Nice video btw
@suman-majhi
@suman-majhi 3 жыл бұрын
So after this long time....this channel get recomend in everyone's homepage....I wish, I got this channel before
@RocketLR
@RocketLR 3 жыл бұрын
This was SO GOOOOD!
@RAZREXE
@RAZREXE 3 жыл бұрын
This channel is sooo dope
@callumery119
@callumery119 3 жыл бұрын
LOVE THESE VIDS
@ArbaouiBillel
@ArbaouiBillel 3 жыл бұрын
Amazing explanation keep going hero
@makaupp
@makaupp 2 жыл бұрын
You are smart. Subscribed :)
@hupa1a
@hupa1a Жыл бұрын
Very good one!
@conqu3red545
@conqu3red545 3 жыл бұрын
I really like your video style
@someguyfromanotherplanet5284
@someguyfromanotherplanet5284 Жыл бұрын
I love it that people call C a bad programming language then go on to write code like this without thoroughly checking.
@winstonlopez6117
@winstonlopez6117 3 жыл бұрын
Havent finished vid but at 1:22 the screen looks cool with the asian code running in background like the Matrix. NICE !
@odddellarobbia4
@odddellarobbia4 3 жыл бұрын
glad i found this on my recommendation
@hentie5371
@hentie5371 2 жыл бұрын
nice vid, subbed.
@SolarizedPhoenix
@SolarizedPhoenix Жыл бұрын
This has legit made me start closing files, even though I dont work with anything that needs security.
@kaprikornz
@kaprikornz 3 жыл бұрын
This is so cool 😍
@user-mh4sc1mt4h
@user-mh4sc1mt4h 2 жыл бұрын
I hope you will continue this series
@ranger.1
@ranger.1 3 жыл бұрын
bro ur goated!
@wilburthemango
@wilburthemango 3 жыл бұрын
great video!
@lap773
@lap773 3 жыл бұрын
Interesting content!
@userou-ig1ze
@userou-ig1ze 3 жыл бұрын
on recommended today, immediately subbed. Is there a way to scan for open handles with elevated privileges, that are 'not supposed to be there'?
@liviuq
@liviuq 3 жыл бұрын
Yeppers, your videos are so cool!
@nagitokomaeda3237
@nagitokomaeda3237 3 жыл бұрын
OOOOOOOOH THAT SOOOOOONG I REMEMBER IT subscribed
@megri3441
@megri3441 3 жыл бұрын
Too informative. Thx
@TorutheRedFox
@TorutheRedFox 2 жыл бұрын
Java actually has some edge cases that keeping a file open helps in, like, for example, temporarily adding a certificate to the certificate store without having permissions to actually write to it, because your CA is relatively recent and has compatibility issues with Java (talking about Let's Encrypt here lol) this works because Java keeps a copy of the file in memory until you close it that it writes any changes to, before dumping them into the file when you close it. but if that never happens, the file will stay resident in memory, and Java being Java will reuse that copy in memory rather than reloading it into memory when something else in the same vm tries to access that same file, that file being the Java certificate store in this case
@kebien6020
@kebien6020 2 жыл бұрын
I thought buffered IO was a thing in most programming languages?
@BCTAHbKA
@BCTAHbKA 2 жыл бұрын
هذا أفضل فيديو على الإطلاق
@dsaha1656
@dsaha1656 Жыл бұрын
this just blow my mind. How a simple mistake can open a backdoor to any system it ran on.
@assetaden6662
@assetaden6662 3 жыл бұрын
Respect for mahboiz who use with or using.
@chefnerd
@chefnerd 3 жыл бұрын
aaaaand subscribed :)
@trungthanhbp
@trungthanhbp 2 жыл бұрын
nice, keep it up xD
@kylegivler8372
@kylegivler8372 3 жыл бұрын
Thanks for sharing :D
@pu239
@pu239 2 жыл бұрын
That intro was really slick. Where and how did you make this?
@youri0soul
@youri0soul 3 жыл бұрын
i finished this video subscribed to the channel went to check more from your channel then realised that i have watched all your videos already now i feel what crack addicts feel :(
@soulninjadev
@soulninjadev 3 жыл бұрын
next liveoverflow 🔥🔥
@sakesyordi4234
@sakesyordi4234 2 жыл бұрын
Amazing
@ieg_offical4679
@ieg_offical4679 Жыл бұрын
Thanks for tutorial
@salmanmohammed8894
@salmanmohammed8894 3 жыл бұрын
Thanks for the great video, the terminal font looks awesome. What is it?
@whathefuckisthis
@whathefuckisthis 3 жыл бұрын
So using the method you showed would the normal user only be able to perform actions on that file? Or does it expose bigger vulnerabilities, like manipulating other root files? This was a really cool video! Loved when it all tied together with a real world example
@hardcorshik31
@hardcorshik31 2 жыл бұрын
You could edit the sudoers file and then you have admin access to the system
@jeanlasallevevo6315
@jeanlasallevevo6315 3 жыл бұрын
Heyo, could you share your terminal colorscheme? I've been looking for a contrasty/vibrant colorscheme for quite some time and yours looks absolutely amazing.
@TheRealFrankWizza
@TheRealFrankWizza 3 жыл бұрын
Devices are a file in the /dev/ directory, so on and so forth.
@fmobus
@fmobus 2 жыл бұрын
that's a beautiful font
@autofied
@autofied Жыл бұрын
Boss tNice tutorials mate, thanks
@DarshanShah10
@DarshanShah10 Жыл бұрын
What are the fonts you use? Quite aesthetic!
@maorhamami8106
@maorhamami8106 2 жыл бұрын
What about the time the process use the file? I mean it do close it but it takes time - users can still read the content during that time or am i missing something? Epic channel btw
@rubex.
@rubex. 3 жыл бұрын
Great video, maybe boost the volume a bit in your next video.
@gustavosaviano
@gustavosaviano Жыл бұрын
excellent video, thanks! btw, how do I setup my linux cli the same style as yours? (:
@mgabriel650
@mgabriel650 3 жыл бұрын
I subscribed.
@StolenPixel
@StolenPixel 3 жыл бұрын
amazing channel thank you so much for educating me and helping me learn more
@vikasvg
@vikasvg 3 жыл бұрын
Thanks
@ciberman
@ciberman 3 жыл бұрын
What kind of LiveOverflow is this channel. Jk, amazing content!! ❤️
How some functions can be Dangerous | bin 0x01
15:20
PwnFunction
Рет қаралды 140 М.
Dangerous Code Hidden in Plain Sight for 12 years
18:00
PwnFunction
Рет қаралды 1,6 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 88 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 22 МЛН
HTTP Parameter Pollution Explained
11:08
PwnFunction
Рет қаралды 250 М.
What is a File Format?
12:58
LiveOverflow
Рет қаралды 177 М.
Don't make random HTTP requests.
14:02
PwnFunction
Рет қаралды 381 М.
What Number Comes Next? - Numberphile
8:13
Numberphile
Рет қаралды 527 М.
Linux File System/Structure Explained!
15:59
DorianDotSlash
Рет қаралды 4 МЛН
What's inside a .EXE File?
8:27
Inkbox
Рет қаралды 412 М.
Randomness is Random - Numberphile
13:31
Numberphile
Рет қаралды 863 М.
one wrong npm package
19:27
PwnFunction
Рет қаралды 182 М.