LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-13-2015, 04:05 PM   #1
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Rep: Reputation: 25
File browser thumbnails = code execution?


Hello,

I've recently had some random guy email me one of those typical and obvious "this email is urgent, please open the attached pdf for more information so that we can infect your PC and install a virus on it" type of emails. I found it suspicious since I haven't given that email out to anyone. Attached was a PDF file that I saved to my home folder and uploaded to VirusTotal for checking. While there were no threats detected, I still believe it's a possible virus because someone apparently uploaded the exact same file before me.

Thing is I wanted to delete the file afterwards, so I opened Thunar, browsed to the directory where I saved the file earlier and tried to delete it only to find out that Thunar was being stupid and peeked inside the file to generate a thumbnail.

Is it possible to get local code execution like this? I immediately disabled thumbnails, rebooted the PC and checked my /boot partition and boot sector for changes. I also looked for modified and new files in folders like /var/tmp, ~/.config/autostart, but couldn't find anything.

Should I still be worried?
 
Old 07-13-2015, 09:42 PM   #2
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
I presume the permissions on the file are something like 644. That would permit read and write for owner, read only for group and everyone else.
That does not permit code execution.
It would be incredibly insecure for a file browser to execute code when attempting to retrieve info about a file. I doubt there is a issue, but perhaps someone else sees a problem. Is it a accurate thumbnail or a generic pdf thumbnail?

This is a little bit why linux is more secure then windows... opening a file.pdf.sh does nothing if the permissions are (by default) set to 644. You can override this of course.
 
Old 07-13-2015, 11:39 PM   #3
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Original Poster
Rep: Reputation: 25
I'm sorry, I'm not worried about executing the file itself. I'm aware that the file was non-executable, and it was a PDF on its own since I opened it with hexdump. What I had in mind was that if there was a 0day exploit present within the file, could generating a thumbnail have triggered it?
 
Old 07-14-2015, 07:01 AM   #4
cepheus11
Member
 
Registered: Nov 2010
Location: Germany
Distribution: Gentoo
Posts: 286

Rep: Reputation: 91
Quote:
Originally Posted by displace View Post
What I had in mind was that if there was a 0day exploit present within the file, could generating a thumbnail have triggered it?
In theory, yes. But I would not worry too much about it if this e-mail was not specifically directed at you: The big malware campaigns do not target linux desktop users because of too low market share and too fragmented software environments. And the typical pdf exploits use adobe reader, while the code your file manager executes to generate the thumbnail comes probably from evince or poppler.
 
Old 07-14-2015, 09:33 AM   #5
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
Originally Posted by displace View Post
I'm sorry, I'm not worried about executing the file itself. I'm aware that the file was non-executable, and it was a PDF on its own since I opened it with hexdump. What I had in mind was that if there was a 0day exploit present within the file, could generating a thumbnail have triggered it?
Since a 0 day exploit rests on the fact that the exploit is unknown to the designer of the intended software, then yes, running any code anywhere on it is a risk. It could potentially have a 0 day for the file manager thunar, 0 day for gaining root privileges, etc.
After establishing that, then you touch on probability on what software.

Considering the incredibly small world of desktop linux computers ((most)linux servers don't use X right?) and that dangerous code is limited to that user account, the probability of a 0 day designed for a linux computer with a X server (gui) cannot be very high.

It's possible thunar uses another command to identify the file, like file which is used to determine file type. My man page explains how it determines file type, might be worth a read (man file)
 
Old 07-14-2015, 09:44 AM   #6
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Original Poster
Rep: Reputation: 25
Yeah, when I received the suspicious email I just replied and pretended I couldn't open the PDF file. I asked the lad to send me another file format in the hopes that I would be able to capture another potential 0day exploit and sent it to VirusTotal for analysis. While the lad did reply with a docx file this time, I first scanned it with VT and then opened it with a ZIP archiver to examine the XML contents. As it turned out the email was just another of those 419 scams.

I had seriously hoped that I was being targeted by som hacking company so I could fish for some new exploits. Damnit!!!!!!

Also, I never told anyone in particular I'm using linux.
 
Old 07-14-2015, 10:28 AM   #7
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
I've recently had some random guy email me
...
Yeah, when I received the suspicious email I just replied and pretended I couldn't open the PDF file.
Hopefully that wasn't with your real email. You just gave them something much more valuable - information that they have a live email address that responds.
 
Old 07-15-2015, 02:40 AM   #8
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Original Poster
Rep: Reputation: 25
Oh well, that's a derp I guess. In the worst case I'll be forced to do some more 419 scambaiting, but hopefully I won't hear from them again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] stopping execution of php code within a file in a broswer MrUmunhum Linux - Server 10 10-24-2012 06:57 AM
[SOLVED] Critical code needs atomic execution mbrose1994 Linux - Software 7 05-17-2011 03:44 PM
problem in uderstanding pthread execution in given code Harris_777 Programming 2 09-08-2010 11:07 PM
Does anyone know how konqueror generates file thumbnails? ManuPeng Programming 2 06-01-2007 05:20 PM
Deleting thumbnails from /root/thumbnails directory moxieman99 Linux - Newbie 3 10-19-2004 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration