-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Alternate Data Streams. #1044
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much, this looks like it should make a good addition to the framework! There's a few bits to look at (mostly using cast
rather than getting the offset and constructing a new object on top of it), but otherwise looks good. As it's a windows plugin, I'd still like @iMHLv2 to give it a review too though...
So you can see how I somewhat expected things to be done by looking at the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above (sorry, I thought I'd posted this already), it does a lot of things manually which makes a great place for errors to sneak in. Rather than doing lots of offset maths out here, I'd much prefer to use the object model which is exactly what volatility is designed for. In the PR #1049 it gives an example of how I was expecting things to run in this...
…custom class (MFTAttribute)
Hello @ikelos, I've introduced your fix to the ADS plugin so you can include your fix when this code lands. I hope you'll be happy with those changes. Learned a lot again about the framework, thank you for all your comments 😊 Best regards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this looks much better!!! 5:D I'd prefer it if there was a little more error handling in places, but I'd be ok merging this as is if you really don't want to add the error handling, just let me know. Hopefully you're happier with it too? I think it's much more readable and easier to make sense of now... 5:)
Yeap let's make things clean ! :) I will propose some exception handling based on your remarks in the coming days ;) Many thanks. |
Thanks, I'm afraid another commit snuck in that conflicts with your pull request. If you could fix it up then we can get it merged in... 5:) |
Also please ensure the black formatter runs without issue, so the code formatting is consistent with the rest of the codebase... 5:) |
Hello @ikelos, Let me know what you think, I have the feeling that this is much cleaner... :) Example output.
Best regards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this looks very clean. Just a syntactical change to make it a little easier to read, and then just a little question about always disassembling what's found in the ADSes...
interfaces.renderers.Disassembly( | ||
content, 0, architecture.lower() | ||
) | ||
if architecture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be easier to read as:
disasm = interfaces.renderers.BaseAbsentValue
if architecture:
disasm = interfaces.renderers.Disassembly(content, 0, architecture.lower())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I get that our assumption is that ADS is most commonly used for hiding executable code, but could this not give a lot of false positives if the data stores in it is just data? Also there seems to be no limit on the amount of data that might be disabled? I assume files that are too large aren't stored in memory, but I just want to know the largest amount of data we might expect to find there, and how it might affect the output in volatility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand,
So, the ADS is mainly used legitimately by Microsoft to introduce for example the Zone.Identifier feature, which is a nice digital forensics clear text artefact to identify the origin of a file. This will be for me our first assumption. Indeed, the value of the ZoneID indicate whether a file is from the internet (3), trusted(2), untrusted(4) etc...The referer url might also be present.
This is a nice pivot point which is the reason for the Hexdump view in order for the analyst to check it in clear text.
A derived usage of this feature can indeed be from an adversary trying to hide malicous code like you said (our second assumption). Although there is some false positives when an ADS doesn't contain any clear text data, the analyst might want to check that the name of the ADS is a common data stream used by Windows and the disam view to identify potential code. But it not a common practice to put code in the ADS.
The largest amount of data you might expect per record is ~600 bytes or less for resident data (the remaining space left of the MFT entry which total size is 1024 bytes). This cannot be larger for a resident file. I think it will not affect the output in volatility3 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, all looks good, thanks!
Hello,
Just added a plugin next to MFTScan to extract ADS from the carved MFT records.
The ISF was also updated to include missing attributes.
Research : https://www.forensicxlab.com/posts/volads/
Best regards.