I want to add a fact in your point that "sometimes hackers may hide the malicious files so that you can't see them by default." Even after you enable the "Show hidden files" option, sometimes they may hide it as a system file (by setting the -h and -s attribute to it). So if you're skeptical about such an item, make sure to enable the "Show hidden operating system files" as well.
@@cycrothelargeplanet No it isn't risky if you know what you're doing. If that is for destroying a Windows installation, then it's bad otherwise it's not if you want to hunt malware down.
@@random_person618No, I'm saying that is basically the same as saying "get gud so you're not bad" in a game. It doesn't address the concern, i.e. what is there to know so it won't be dangerous.
This got me the other day at university, was using windows server virtual machines to make a simple web server, couldn't figure out why index.html wasn't working until I remembered stupid hidden file extensions... and it was actually index.html.txt 😫
To be fair, most people when they would rename a file, they would include the extension and later get upset that Word would be unable to read their Invoice Tax 1996 as there was no association for that Invoice Tax 1996.doc file.
Microsoft doesn't care, so takes the easiest, often least secure, path. I retired 15 years ago, so have been able to go MS-free even though I got pretty good at resurrecting MS work stations by then, taking less than a week to bring my machine back from the dead pretty regularly. I could have gotten more than 50% more coding done if it hadn't been for MS trashing itself every few weeks. I got pretty good about doing my thinking and design while waiting for various recovery/restore and re-install programs to do their work. Meanwhile, a 15 year-old Mac with Intel CPUs & GPUs cooked itself and trashed the internal HDD. Once I got the HDD to the point of alive, it took just an hour to restore the backup and have my Mac back up to where it had been before, including passwords on sites I didn't remember wanting to access.
Also worth mentioning, file extensions are just labels, and they can be manipulated at will regardless of the underlying data. So you might run a .cmd file or something, but the rest of the payload may be contained in a file with extension .docx exactly like a normal document, when really it's just a .dll with the extension changed.
Windows uses the file extension to figure out what kind of file a file is, whereas Linux distros use the actual contents. I'm actually not too sure if Windows will allow you to link a non-DLL/LIB file.
@@xavvvvxdat least on arch i seem to remember all of my file managers using the file extension to open my files - how is it possible to figure out using just the contents unless you write a function for every possible file format (new ones come into existence too)
@@scrungpretty easy, if all your decoders return an error due to not being able to parse the file then the program knows that the file isnt encoded in a format that it is supposed to understand and it can pass an error onto the user.
I absolutely don't understand why file extentions aren't shown by default in windows. It's not annoying and soooo important and also useful (for example if you have two files of different type (like a word document and a pdf export of it) with the same name and have to find the right one by icon)
For beginners they cant easily disable files by o erwriting file types. Pros usually use different programs than explorer, so they dont card, for the rest you can enable it
@@Lofote do you mean accidentaly overwriting the file extention when renaming a file? That‘s not that much of a problem becauee the extention doesn‘t get highlighted when renaming
well you can select it manually after you press 'rename' and people who just got windows and don't know what file extensions do could just rename the whole thing and remove the extensions@@DerLung
I work in the antimalware industry! More common than changing file extensions or default programs for opening files, we edit local machine group policy to prevent execution on specific file types within a folder that we dedicate to malware. Also, to preserve file names to the extent possible (and to prevent execution and changing default program associations), we just add underscores to file extensions (.exe_, .js_, .scr_). I understand that given the sponsor you wouldn’t show how to edit defender settings, but you could have gone over how to use bitdefender to better protect yourself. Antiviruses have similar settings.
I think the main thing or key from this is don't download things willy-nilly over the internet, use extreme caution with links in email, texting, IM's etc. Always exercise caution with attachments. Only go to reputable trustworthy sources with a careful eye. As much as I like open sources that's where you really have to be careful because of too many hands accessing the source code. But that does not mean that someone can't still attach or inject a malicious code to a paid licensed version either. Buyer/ end user beware! You are your own first line of defense, watch dog and security. Pay attention to everything, because you really have to. All the more reason to have backups should one slip past you, in hopes that you can recover. Thanks for the video Theo.
I just love how ThioJoe makes the highest quality tech content on the platform He doesn't resort to clickbait or becoming a Linus clone He has his own style and I literally can't find anyone who makes similar content and at the same level of quality Keep up the good work
You also have ".jar" which is an executable java application. It's basically an executable version of a zip file, where java classes are stored within. Any code that is inside a ".jar" file will be executed and ran when you execute it.
Yes, I got some kind of malware trough a jar file. (Minecraft mod) It executet a powershell script which would have downloaded a RAT from github, fortunally that was blocked and the jar file itself „just“ stole my minecraft session token.
Also, docx, xlsx, pptx, etc are actually encoded as zip files. If you change the extension to zip you can see the bundle of files. This can be exploited, unknown office files should be opened in zip explorers before office.
One type of annoying virus that I got back in 2001 was )and it was called redbot or redcode or redsomething, it got very spread back then...) that the file would arrive to you as a DOUBLE extension file, but Windows (2000 or xp or 98 or me or whatever you used) would only show you the LAST one, hiding the second to last extension which was the actual extension. So, the OS would show you it was a JPG, for instance, and mark it with the icon of a picture, but when you tried to open it, it was actually a VB script and it WOULD ATTEMPT TO RUN IT as a VB script, instead of failing to open it as a JPG, and then you were fucked. That virus would scour through your Outlook contact and sent mail list and send itself to everyone. I had to send SO MANY apology mails to people because of it!
Sometimes it does take one slip up. If you ever run a file that closes and doesn't seem to do anything there is a chance that depending on where it came from it may steal passwords and other things and send them to some random person who you most likely never met or knew existed.
You shouldn't ever fully trust any file type really. If your picture viewer has a vulnerability, a hacker can take advantage of it by embedding malicious code to something like a JPEG. Video files, image files, sound files, game data files (it's not too uncommon for cracked games to have functions in them that allow them to load external files from the game directory and those are the real malware). Even text files aren't universally safe because theoretically a text editor (or its part, like a syntax highlighting library) can be susceptible to some kind of code injection.
nice drop bro, appreciate the warnings :) this stuff is really important. Your video helped me explain how to keep my parents safe and your videos helped us a lot in general really
Thanks for this. Might be good to revisit PDFs some day since the landscape seems to have changed. Like a lot of people read in-browser now, with stuff like Firefox's built in browser that I guess approaches reading differently, but I don't feel like there's strong confidence in what are the preferred routes for using those files
I wish you had mentioned in the summary at the end that technically at some level ANY file can become an issue if the program that opens it is ubiquitous enough and has a bug. This used to be a big problem although (maybe) DEP solved it back in the xp/vista days when MS had a bug that let a JPG run code (The GDI+ JPEG parsing vulnerability published in September 2004). With the amount of layers that need to fail for it to be an issue I wouldn't worry about it TOO much as long as you keep up to date on your updates. But it is a good reminder to keep up to date on your updates if nothing else.
@@henke37 True. Which is why I feel he should have mentioned it in the video. It's a layer that tries to solve the issue of accidentally running bad code. Like the mark of the web (that he mentions in the video), UAC, windows defender, and remembering to keep up to date on your updates are all layers. But even with all these layers it's (maybe) just one bug away from being an issue.
The correct answer to "Which Kinds of Files Can Be Viruses?" (the title of the video at the time of this writing) is actually: "Any file that can be opened." The files listed in this video are merely the ones that can perform malicious actions on their own, i.e. without tricking the program opening them into doing things it's not intended to. I think that's important to keep in mind, because failing to do so may lead to letting one's guard down at the wrong moment.
Some files can even infect your computer without being opened with the right vulnerability. Pretty sure it's been patched but Windows Explorer had a real nasty vulnerability that would allow ACE via rich text documents being thumbnailed.
@@mgord9518 That's correct. Files don't necessarily have to be explicitly opened by the user. Some applications may automatically open a file without user intervention (e.g. by Windows Explorer for the purpose of generating thumbnail as you mentioned). I hadn't really thought of that, but you're right: that's also opening the file and therefore a potential attack surface.
Important note: Windows can include meta characters into filenames, for example a right-to-left character. This can lead to characters in filenames being displayed in unusual orders. A common filename this is used in is something like nice-arcs.jpg is acutally a src file, not a jpg
0:04 not me i scan every file i download on the internet and ya know whatever.jpg could have a virus! also dont forget .jar files you need to watch out for those especialy if you play Minecraft.
I’m surprised you didn’t mention .jar files. I’ve heard they have been used a ton by hackers/viruses and every time I download one my pc tells me it could be dangerous and I have to manually tell it to keep the file every time.
@@underrated6902 The only reason I really know about them is because they are used for Minecraft mods. Other than that I haven’t really seen them used.
In fact, these things like jar files, but also msi files and certain kinds of cab files are all just archive types with a file association, which makes them exacutable. Note that jar files do not work on every system, because Java needs to be installed for them, which is not the default, and even msi and cab need Windows Installer to be there, but which is normally the case. All these are normal archive types and don't have a PE header like exe or dll and are never executable by themselves. Self executing archives do also exist however, which contain a full PE application binary followed by the actual archive behind it as a payload. The application simply has the task of unpacking the actual archive, which may be in the form of an installer like approach, but it can also be an application that automatically unpacks the archive into a temporary location and starts another application that was packed inside the archive.
@@underrated6902 ???? no they aren't. They are self containing (except for the JVM) java programs. They are nothing alike zip files, which is an archive format that uses compression
@@mega_gamer93 Yes they are. Jar files are just ZIP archives, with compiled class files inside it and a META-INF directory containing a MANIFEST.MF text file with extra information. Very simple. The trick is that the Windows registry has a java -jar command pre associated with the jar file extension. A thing created by the installer of the Java runtime environment.
Thanks for a thorough review. I wonder, if one has common sense, does one needs to run an antivirus software at all? I mean, there are huge privacy concerns - an antivirus runs all the time, has access to all of your files. Who knows what it’s doing with all that information…
DLLs can be a lot more dangerous than may be immediately obvious, you don't even need to directly do anything for there to be a problem. A malicious dll file in your download directory might be inadvertently used by some exe in your downloads that you run later, this is very dangerous if the exe is an installer running elevated calls into a malicious dll by accident. This is one reason why auto download exploits are a problem as the malicious file might cause trouble later even if it doesn't immediately cause a problem. You should never leave untrusted dlls in locations where programs might be run from. This can also be a problem with the temp directory so it is a good idea to clean out your temp directory regularly. Dlls in temp can be a general problem even if not malicious as poorly coded installers might leave dlls in the temp dir that interfere with other installers that also want to run from the temp directory. The Installers and dlls in temp problem is mostly an issue with older installers. More modern ones are coded better to try and avoid the temp dll problem. Microsoft over time has attempted to mitigate dll attacks but the solutions are not perfect.
for example, i can *literally* rename *"executable.exe"* to *_"executable.txt"_* _(or any other file extension)_ and still be able to *run it* under *command prompt* by normal means, the "executable.txt" will be opened in notepad because it has the .txt extension which windows will interpret it as a "text file" (even viewable in the preview pane in explorer)
@@johnpatrickadem6294 the exe is directly loaded into memory for the cpu to execute. So it contains cpu executable instructions, the txt will trigger notepad or a different program to read and parse
You did not mention HTA files, which are HTML applications. Although if I am right these don't work on modern Windows versions anymore, but on a bit older versions they worked and they are are basically just like VBS and JS files, because they have unrestricted system acces via VBScript or JScript, but then embeded in an HTML code and opening with a real window a bit like Electron applications do today, but then using Internet Explorer as their engine instead, since we are talking about a really old technology.
I would probably add jar files to the list purely because of how common it is to have the jdk installed. And for those who aren't familiar with the jdk or its executable, the jar file. Jar files are a combined executable and library, which is used in Java, Android, and Kotlin development. In other words, it's everywhere and can on a lot of devices (especially phones) run without you downloading the jdk manually.
12:55 the zip file itself can't store the "mark of the web", but if the zip file has that mark, all extracted files will inherit it if you use Windows' built in extractor. 7Zip among others doesn't mark the extracted files, so you should still be careful. The mark of the web is actually an alternate data stream on the file called "Zone.Identifier". It's text data and you can even open it in notepad. The easiest is to use the command prompt. Notepad my-downloaded-file.zip:Zone.Identifier
I remember when I learned that changing the file extension has nothing to do with what the file is, and you can freely change it back without ruining it. It was like The Matrix
I remember a great Win XP SP0 exploit where just hovering the mouse over an MP3 file could get you infected due to malformed ID3 tags and the mouse tip. Good times.
Hey Joe, have you done a video on the 'Hosts' file in many operating systems and some devices? It's quite handy and a lot of sites publish custom Hosts files to block online content and ads. A free alternative to spending money on ad blocking software.
Hosts file can be edited as admin and retains those changes and will not revert unless prompted. It is a root level DNS resolver pathway, not only on WinOS, but on MacOS and AndroidOS amongst many others. The only platform that locks out the user is iOS.
Thanks for the excellent video TJ ! Very well done as always. Clear, concise and to the point. Please keep up the amazing work. For I appreciate your content. !! 👍👍 ⭐️⭐️⭐️⭐️⭐️
For archived files, its pretty much unlimited. you are able to make a compressed folder and rename the 'zip' to just about anything, you just need a tool like 7zip, or winrar to open it.
One file type that I can definetly say is secure (because I am the one who wrote the file type specification) is .l2db (Lampe2020-DataBase), which is a simple, binary database. You can of course store malicious code in it (the same as you can in .zip files), but it is really non-trivial to execute that. And the format doesn't support encryption, so you cannot smuggle malicious stuff past a good antivirus inside one of those.
No file type is safe, it completely depends on implementation. If someone were to make a bad parser for your format, it could potentially lead to code execution. Of course this is primarily an issue with much more complicated file formats that probably have some feature regarding macros/scripting but anything is possible when buggy software is involved.
@@mgord9518 If the parser is safe the file is safe, but theoretically you could of course also make an SQL database file dangerous with the "right" vulnerabilities in the parser.
I would add a 6th and a 7th category. If an attacker knows that you use some outdated piece if software (including OS components) with a security hole allowing an attacker to execute any code it can be used to deliver malware. It can be a targeted attack specific to you, or can target everyone who is a registered user on a web page (forum, etc) about the outdated piece of software. I have also seen malicious code in source code form. Targeting people who would copy lots of code from questionable sources to their own solutions.
Nice video, I would however have added one extra thing to talk about the shortcuts. Inside a shortcut you aren't just limited to running other files, but you could make the shortcut point to something like 'C:\Program Files (x86)\[some web browser like IE]\*.exe [some website]/virus.bat' and then even without that file being on your system, that shortcut will download the file using Internet Explorer. With some extra editing via Notepad I think you might also be able to include the bad code right in the file without the use of other files or programs. Stay safe lol. Great video Thio
Every file can load a virus if your standard program is buggy enough. For example .pdf files were used many times to push malware because Adobe Acrobat pdf viewer has widespread use and is or was a buggy enough mess. For .jpg and .txt it's much harder as the typical standard viewers are much simpler and therefore easier to program without critical bugs, but that's no absolute guarantee.
The fact that you point out, the only file on good at coding in bat is considered a virus since I code viruses and I’m like one of the main productions of viruses using bat
In certain situations (e.g. software with buffer overflows, script injection volnurabilities, bugs causing denial of service, not checking input file size), ANY file (image, audio, video, ...) opened in such a program can be dangerous (although of course it's less common).
Fun fact. I had set the poweshell limitation i saw in his poweshell video and it breaks visual studio installer. It gives a completely arbitrary error, so if you are failing to install or upgrade visual studio after applying poweshell security settings, remove themand retry. It is to bad as it is easy to do a simple bat file that can temporarily clear and reset (run as admin) which means ms could have done the same since vs installer also requires admin.
Our lecturer showed us just how nuts a simple word macro is. Full remote access with some social engineering, and made stronger via obfuscation. Crazy.
Actually certain dll files can be run! In system32 a program called rundll32 can be used to run certain dll files. The run box is actually a dll. It is inside of C:\Windows\System32\shell32.dll. As said in the video they do contain multiple things. This one is also commonly known to contain a number of icons files. (When selecting an icon for a shortcut type it in. There is also a nirsoft program called iconextract). The command to open the run diagloge is actually rundll32.exe shell32.dll,#61 (61 shows what part of shell32 to open)
Thank you for all your content, as it is unassailable and very valued. So I pose the question: are use system, mechanic, ultimate for both virus, malware, system maintenance combination, suit. I know Bit Defender is a superior program for defense and monitoring, can you recommend a program for system maintenance that can be integrated into Bit Defender?
Windows' built in zip archive extraction code should probably add that "mark of the web" to files that are extracted from a zip file which also has that mark of the web.
Okay, you are extremely amazing because I not only didn’t know what type of files these were, and am always grateful for knowledge, but also I thought .zip files were safe Apparently not all that safe lol, I’ll only be opening those if they’re from trusted sources, like my mom after double checking she sent that.
in order to protect my kmspico from getting wiped by windows defender, i put it in a password protected zip file, and zipped that file again, without needing a password. If you wonder why: windows wipes any file that contains malicious code, or has its name listed in an archive(my own theory). I would zip my kms program with a password, and even though windows cant unzip it, it can see the names of the files, and still remove them. By adding one extra zipping, windows is unable to see those names.
7:30 In long term that looks like a really bad idea, associate extensions to Notepad is not the bad part, the bad part is that you get upto use double-click on files ... any application can change the association inthe future and since you are using double-click it will be able to be run. I mean: Better never do any double-click on any file or folder, better allways use contextual menu. If you get used to allways use double-click you can not be sure what will be done someday, double-click action can change from time to time without you knowing it. What looks like a folder could be something really bad, like a ransomware, etc.
Short answer. Anything that is an executable with any access to the OS/File System or is openable by an executable with a vulnerability that can be exploited using the payload of the file. JavaScript in the context of the browser is really only able to be a “virus” is if the js interpreter or the browser itself has a vulnerability that can give it access to anything beyond the browser like the host file system. JavaScript in the context of the Node.js language is a whole other story because it has access to the local file system and operating system.
Fun thing about unix-likes (e.g. macOS) is that the OS doesn't decide what to do with a file based on the extension (mostly) and instead uses magic numbers within a file. Can inspect the file properties to find out what it is, though.
Any file can be a virus if the program opening it has a suitable vulnerability Also unicode symbols with which you can make the extension appear in the middle of the name
One more file to look out for is .jar files. They aren't as common, though, as due to some bugs with windows and such usually you cannot open them with double click, unless you run jarfix. However, they are an executable, and if you like to mod minecraft specifically, they are the file type used, and, therefore, there are possibly viruses in them.
When I was new to computer & internet, My parent told me _beware_ _of_ _viruses._ Of course I'm a fool so I got a virus for the first time. _-the-_ _-phone-_ _-battery-_ _-died-_ After that incident, I avoided any kind of executable files. Still, I'm a fool so I downloaded some script to cheat at games. _got_ _my_ _account_ _stolen_ After that, I created new account('cause I didn't want to pay for *my* stuff). I'm less of a fool now so I hope I'd never run into *those* again.
Please add epub to the list. Unfortunately new versions of epubv3 (with the same extension) have the ability to contain and execute javascript. I was baffled by this decision, especially because of the legacy that pdf left behind.
One important thing is that you still should be suspicious of files you are waiting for. This happend to my mother. She requested some documents and got them via mail. She asked me for help, because office was having issues (it was cracked and the Crack broke and it took ages to open it). It was a word document. I was kinda suspicious and asked about the email. She requested some documents and it was an answer to that request and I thought computer noobs sending documents via word, instead of a PDF. I tried to open it and I got the same error. I realized that Windows defender silently deleted the file, because of an virus. I stopped and told her to call this person and ask them. As it turned out, they got hacked. This shows that you still need to be cautious when getting files from anyone. Also files could be altered. What I didn't knew that even PDF files could have macros. I knew that a PDF has some features but macros was new to me. What I want to know what files could break your privacy. I know that with music and video, Metadata could get pulled from the internet. I also know about Playlist files that open a webstream. These do break privacy, because they connect you to a server. But I'm not sure if there are certain pictures, movies or music files, that could show you the content but also connect to a server. Also there are some things missing. A zip file itself could be harmful. It could be a zip bomb. They work in a simple way. They have a huge amount of data extremely high compressed. Your computer will crash, because it exceeds every memory limit. It's more of a prankster file but opened at the wrong time, it could do some damage due to the crash. Also file extensions don't matter at all. These only matter for your OS and tells it to how handle the file. You could rename an archive file as .jpg and open it with an archive program and it works. It's up to the program to determine if it wants to open the file and to check its content. There is a trick and you can combine an image and an archive file. You can open the file as image and see the image and open it as archive and you see the archive. Programs might just look for the fike headers they can handle and ignore the rest. This way you can even hide a payload in plain sight.