-
Notifications
You must be signed in to change notification settings - Fork 463
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
Linux: add basic versions of linux.ip.Link and linux.ip.Addr plugins #1029
Conversation
…lag_names was set unnecessary
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.
This looks good to me, but I'll wait for @atcuno to verify this is all fine from a linux perspective... 5:)
@@ -281,3 +281,39 @@ | |||
) | |||
|
|||
ELF_MAX_EXTRACTION_SIZE = 1024 * 1024 * 1024 * 4 - 1 | |||
|
|||
# net_device_flags was not always an enum, so these hard coded values |
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 for the comment! This is fine, but much better since it's commented! 5:D
@@ -46,6 +46,7 @@ def __init__(self, *args, **kwargs) -> None: | |||
self.set_type_class("sock", extensions.sock) | |||
self.set_type_class("inet_sock", extensions.inet_sock) | |||
self.set_type_class("unix_sock", extensions.unix_sock) | |||
self.set_type_class("net_device", extensions.net_device) |
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.
Will this exist on all kernels, or should this be an optional set_type
(as a few lines below)?
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 it will exist - but it never hurts to double check! I'll look into it.
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 confirm net_device
exists at least from 2.6.30, so it should be safe.
if self.has_member("perm_addr"): | ||
raw_addr = self.perm_addr[0 : self.addr_len] | ||
else: # perm_addr is not found in older kernels | ||
raw_addr = parent_layer.read(self.dev_addr, self.addr_len, pad=True) |
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.
Liiiiiittle bit ugly, but it's only a line, so I guess that'll be ok. 5:S Can't think of how to improve it, so....
Closing in favor of #1079 by @gcmoreira |
volatilityfoundation#1029 * IP address conversion via renderers.coversion.* * Use MAC address internal size instead of hardcoded. * Read NET_DEVICE_FLAGS from enumeration
Hello!
This PR brings very basic versions
ip.Link
andip.Addr
plugins for linux which I hope to complete with the full suite of ip information, e.g.ip route show
,ip neigh show
, etc etc.They don't have smear protection yet, I can add that if it looks like this is the correct way of doing things. They are based on the vol2 plugin
ifconfig
but I've tried to include a little bit more information. I don't have a good selection of samples with very old kernels in them so I haven't done the path that using thedev_base
symbol rather thannet_namespace_list
yet.I've tested on kernels from v3 to v6 but I'd always welcome more testing! No doubt I've missed something somewhere.
Here is some example output from two different samples.