Skip to content
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

Get DHCP lease ips from /var/lib On Linux based operating systems #960

Closed
AlonHaviv1 opened this issue Dec 1, 2024 · 2 comments · Fixed by #965
Closed

Get DHCP lease ips from /var/lib On Linux based operating systems #960

AlonHaviv1 opened this issue Dec 1, 2024 · 2 comments · Fixed by #965
Assignees
Labels
core Related to a core component of dissect.target enhancement New feature or request linux Related to Linux support/features

Comments

@AlonHaviv1
Copy link

AlonHaviv1 commented Dec 1, 2024

On various Linux based network managers, the DHCP leases are stored on various files.

For example, in NetworkManager, The DHCP lease ip are stored in /var/lib/NetworkManager/\*.lease.
In dhclient, these are stored in /var/lib/dhcp/dhclient.leases.

Those are sample of a better solution to finding Target Ip, instead of parsing syslog, which in some cases could be a more resource intensive task.

@Horofic
Copy link
Contributor

Horofic commented Dec 2, 2024

Hey @AlonHaviv1 thank you for opening this issue! This is indeed the the case. At the moment, we are carefully moving away from the current implementation in network_managers.py that has this behaviour.

I think this would be a good addition in the new Linux network manager implementation found here. Although you might still want to parse some lines in the syslog or messages as a fallback when the paths you named fail to reveal a DHCP lease.

Lastly, is this something you are willing to pick up in the form of a pull-request?

@Horofic Horofic added enhancement New feature or request linux Related to Linux support/features epic:linux capabilities epic:network interfaces plugin core Related to a core component of dissect.target labels Dec 2, 2024
@JSCU-CNI
Copy link
Contributor

JSCU-CNI commented Dec 4, 2024

We added a temporary solution for lease files in #965. We leave it up to you @Horofic to decide how this would fit in the new Linux network plugin structure. For now this adds support for target.ips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to a core component of dissect.target enhancement New feature or request linux Related to Linux support/features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants