Author Topic: AutoSandbox exclusion based on hash and not path?  (Read 7837 times)

0 Members and 1 Guest are viewing this topic.

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
AutoSandbox exclusion based on hash and not path?
« on: July 03, 2012, 01:42:13 PM »
Am i the only one who thinks path exclusion is bad? It would make a lot more sense to make hash exclusion that is path independent.

This way you solve two things at once:
1. Files that appear clean but auto-update into something bad, yet they remain excluded due to path
2. Installers/uninstallers that generate random named temporary file/folder data which never gets excluded properly even when found clean by the analysis of AutoSandbox (hash would probably be the same regardless)

Since AutoSandbox events aren't as densely processed as file scanning i think generating a secure hash for it should be no problem as far as CPU usage goes.

Or at least have hash exclusion as default and path exclusion being an optional choice to the end user if he choses to exclude something based on path.
Visit my webpage Angry Sheep Blog

Offline DavidR

  • Avast Überevangelist
  • Certainly Bot
  • *****
  • Posts: 89212
  • No support PMs thanks
Re: AutoSandbox exclusion based on hash and not path?
« Reply #1 on: July 03, 2012, 01:51:36 PM »
I think the problem is one of human readability in the exclusions list, who the h3ll knows what a hash number pertains to when/if there is no other information displayed.

The people who use avast are humans (hopefully) and not machines so they need visual clues to identify what they have excluded. Should they ever need/decide to remove the exclusion.
Windows 10 Home 64bit/ Acer Aspire F15/ Intel Core i5 7200U 2.5GHz, 8GB DDR4 memory, 256GB SSD, 1TB HDD/ avast! free 24.4.6112 (build 24.4.9067.762) UI 1.0.803/ Firefox, uBlock Origin, uMatrix/ MailWasher Pro/ Avast! Mobile Security

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
Re: AutoSandbox exclusion based on hash and not path?
« Reply #2 on: July 03, 2012, 02:45:59 PM »
Well you can still list them with path and filename but the hash would actually exclude it and path and filename would only be as reference to which file was excluded.

There aremany other things far less understandable than term "hash" so i don't see this as a big problem.
Visit my webpage Angry Sheep Blog

Offline igor

  • Avast team
  • Serious Graphoman
  • *
  • Posts: 11856
    • AVAST Software
Re: AutoSandbox exclusion based on hash and not path?
« Reply #3 on: July 03, 2012, 03:41:09 PM »
Well, it's not that simple.
Excluding a file by hash means you might need to enter a lot of hashes, instead of one folder - for example (so adding the hashes for all the temporary files an installer generates might be hard). Besides, to compute the hash, you need to have the file (so you can't set an exclusion in advance, for unknown files - like your own, you're gonna compile yourself).

Don't get me wrong, I suggested adding a possibility of a hash exclusion (and why only for AutoSandbox - it should be there for FileSystem Shield etc. as well) quite a while ago already. I'm just saying it's not a magical solution of all problems, it's got its own issues as well. But as an optional parameter for the exclusion - I'd like to have it there (though a reasonable UI design is a question).

Offline DavidR

  • Avast Überevangelist
  • Certainly Bot
  • *****
  • Posts: 89212
  • No support PMs thanks
Re: AutoSandbox exclusion based on hash and not path?
« Reply #4 on: July 03, 2012, 04:17:16 PM »
<snip>

There aremany other things far less understandable than term "hash" so i don't see this as a big problem.

It isn't the term hash, but the physical number being the only reference that I made my comment on, a user not knowing what file it was for.
Windows 10 Home 64bit/ Acer Aspire F15/ Intel Core i5 7200U 2.5GHz, 8GB DDR4 memory, 256GB SSD, 1TB HDD/ avast! free 24.4.6112 (build 24.4.9067.762) UI 1.0.803/ Firefox, uBlock Origin, uMatrix/ MailWasher Pro/ Avast! Mobile Security

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
Re: AutoSandbox exclusion based on hash and not path?
« Reply #5 on: July 03, 2012, 04:22:16 PM »
Igor, yes and no. That's why i said hash should be a default option since Auto Sandbox is always excluding single files but you could have an option to exclude by path manually. Kaspersky for example even goes so further you can exclude per threat name and other settings, meaning you can exclude it only under detection EICAT-TEST but not under anything else. I'm not expecting taht from avast! but i have found path exclusion to be very annoying several times with quite some installers and uninstallers. It kept on excluding files and installer kept on making new random filenames. And they were going like this forever untill i just killed it and excluded the darn thing manually.
Visit my webpage Angry Sheep Blog

Offline Lisandro

  • Avast team
  • Certainly Bot
  • *
  • Posts: 67194
Re: AutoSandbox exclusion based on hash and not path?
« Reply #6 on: July 03, 2012, 05:31:42 PM »
It kept on excluding files and installer kept on making new random filenames.
Wouldn't this be a malware behavior either? ???
The best things in life are free.

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
Re: AutoSandbox exclusion based on hash and not path?
« Reply #7 on: July 03, 2012, 06:31:49 PM »
It's not a malicious app or installer. Some installers just do this to avoid conflicts with other installers, so they generate random file names for its files.
Visit my webpage Angry Sheep Blog

Offline Lisandro

  • Avast team
  • Certainly Bot
  • *
  • Posts: 67194
Re: AutoSandbox exclusion based on hash and not path?
« Reply #8 on: July 03, 2012, 06:34:23 PM »
It's not a malicious app or installer.
I know... You need to say this to the antivirus engine...
The best things in life are free.

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
Re: AutoSandbox exclusion based on hash and not path?
« Reply #9 on: July 03, 2012, 07:50:50 PM »
Actually no. Here is how it goes now:

1. Installer executes and gets Auto Sandboxed
2. Installer creates temp_file1.tmp inside sandbox
3. Auto Sandbox finds nothing malicious and gives the Continue execution button
4. temp_file1.tmp is added to exclusion
5. Installer is executed again but this time it creates temp_file55.tmp
6. avast! Auto Sandboxes it again because the path is now different

This is how it should work:
1. Installer executes and gets Auto Sandboxed
2. Installer creates temp_file1.tmp inside sandbox
3. Auto Sandbox finds nothing malicious and gives the Continue execution button
4. temp_file1.tmp is excluded using hash value
5. Installer is executed again but this time it creates temp_file55.tmp
6. Installer works normally because the hash of temp_file1.tmp and temp_file55.tmp is most likely the same regardless of its filename

Other way would be to be aware of the parent/child app/files relationship and allow or block execution based on that. But hash exclusion would do the job for the time being.
Visit my webpage Angry Sheep Blog

Offline igor

  • Avast team
  • Serious Graphoman
  • *
  • Posts: 11856
    • AVAST Software
Re: AutoSandbox exclusion based on hash and not path?
« Reply #10 on: July 03, 2012, 08:05:59 PM »
The first part doesn't really make sense to me (with respect to the latest update at least).
If the installer is autosandboxed, then the installer itself (whose name is probably fixed) should be added to exclusions - not the child temp file created by the installer.
If it's the child file (or rather process) that gets autosandboxed, then the parent call is stalled and waits for the result - and when the result is OK, it continues (so there is no "executed again", it just goes on).

So I find it more likely that those two temp files are actually different (i.e. that the parent creates multiple child processes, each with a different executable).
If I'm wrong, let PK correct me, but I don't think you get any results (i.e. no exclusions either) from the child processes of already autosandboxed parents.


Edit: Or do you mean two unrelated executions of the same installer (possibly a couple of days later)? Then OK, it would make sense.
« Last Edit: July 03, 2012, 08:08:11 PM by igor »

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
Re: AutoSandbox exclusion based on hash and not path?
« Reply #11 on: July 03, 2012, 08:26:29 PM »
My mistake on that part which i found out after you pointed it out. Installer (parent) didn't get sandboxed, temp file (child) did. So it kept on sandboxing the temp files and excluding them and since filename generated by the installer was different each time, it was also sandboxed again because exclusion didn't apply anymore.

It's hard to reproduce such scenarios because such stuff usually all of te sudden doesn't work the same way or doesn't even get sandboxed anymore, probably due to cloud feedback that has changed in 1 day time period.
Visit my webpage Angry Sheep Blog

Offline pk

  • Avast team
  • Super Poster
  • *
  • Posts: 2078
Re: AutoSandbox exclusion based on hash and not path?
« Reply #12 on: July 03, 2012, 08:48:43 PM »
RejZoR is right, but I have some comments. Autosandbox is triggered only on the first suspicious file, i.e. all child processes are sandboxed automatically if the parent process is virtualized. What does it mean in fact? If the main installer is trusted, it usually unpacks a few/lot of files in temp folder. Every such executed app from temp will mean a garbage in our exclusion list. Autosandbox exclusion list will be probably improved in R4 update (say in ~3 months), there're several limitations in the current avast version I don't like (all paths are bound with volume letter, stored in avast5.ini, etc). I don't like hashes, because their computation is quite slow -- but I can realize combination of filepath & hashes (e.g. temp exclusions can be recognized by hashes, others by filepath). This won't fix all problems, but it'd help a lot. The other problem is with avast global exclusion list, we can think it over for R4 build.
« Last Edit: July 03, 2012, 08:51:25 PM by pk »

Offline RejZoR

  • Polymorphic Sheep
  • Serious Graphoman
  • *****
  • Posts: 9408
  • We are supersheep, resistance is futile!
    • RejZoR's Flock of Sheep
Re: AutoSandbox exclusion based on hash and not path?
« Reply #13 on: July 03, 2012, 09:43:00 PM »
Hashes are not THAT slow. I mean it's not like you get 100 apps sandboxed and excluded per second. If you get like 5 apps sandboxed per day and i'd say that is a fairly high number. I think even a 1GHz CPU would deal with that...
Visit my webpage Angry Sheep Blog

GTX66

  • Guest
Re: AutoSandbox exclusion based on hash and not path?
« Reply #14 on: July 03, 2012, 10:51:01 PM »
This auto sandbox is a real winner, whoever developed it must be playing in one. Microsoft Updates and Firefox should not be auto sand boxed.