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

Extract obsolete operating systems from LDAP #41

Merged
merged 9 commits into from
Mar 14, 2024

Conversation

Shad0wC0ntr0ller
Copy link
Contributor

@Shad0wC0ntr0ller Shad0wC0ntr0ller commented Sep 24, 2023

Extract enabled obsolete operating systems from LDAP

nxc ldap dcip -u user -p password -M obsolete

image

@zblurx
Copy link
Collaborator

zblurx commented Sep 29, 2023

Hey, I love this idea
However for parsing purpose, choosing arrow as the separator is not great (how can you awk the output ?)
What about machinename (10.10.10.1) : OS name ?
Or maybe a module option to set a delimiter or even a csv output file ?

@Shad0wC0ntr0ller
Copy link
Contributor Author

Shad0wC0ntr0ller commented Sep 29, 2023

@zblurx you know, that’s a great point that has not been brought to my attention before. I will update the module in an hour or so. Thanks for the good call out.

but I will say, you don’t need to do any awk or grep, etc because it saves all the hostnames to a file for you already. But I get the point

@Shad0wC0ntr0ller
Copy link
Contributor Author

@zblurx I have made the adjustment. I also went ahead and added Server 2012 as that's less than a couple of weeks away. Finally i updated the output path from cme to nxc.

@NeffIsBack
Copy link
Contributor

Nice! Also it would probably be nice to give some feedback to the user about the file you are saving the output to. Something like sam and lsa dump do

@Shad0wC0ntr0ller
Copy link
Contributor Author

Shad0wC0ntr0ller commented Sep 29, 2023

There is an info statement that shows where the file is saved to in the output already.

image

Are you saying you want them to get added to a database like this ? Or at least print the number of obsolete hosts found ?

image

@NeffIsBack
Copy link
Contributor

Oh my bad, missed that line. Just wanted to have the file path in some output but you already thought of that😄

@Marshall-Hallenbeck Marshall-Hallenbeck changed the base branch from main to develop October 2, 2023 21:54
hostname_parts = answers[0][0].split('.')
domain = ".".join(hostname_parts[1:])

home = Path.home()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a more conventional way to get the logs folders in NXC -> log_folder_path = os.path.join(os.path.expanduser("~/.nxc"), "logs")

@evildrummer
Copy link

Maybe adding the pwdlastset of the host? So you know it if the host is "kind a active"

@zblurx
Copy link
Collaborator

zblurx commented Oct 3, 2023

Maybe adding the pwdlastset of the host? So you know it if the host is "kind a active"

Excellent idea. I don't know if there is a more relevant LDAP attribute to see if the host is still active so this one can be good.
As an module parameter or by default ?

@Shad0wC0ntr0ller
Copy link
Contributor Author

Shad0wC0ntr0ller commented Oct 3, 2023

@evildrummer @zblurx Excellent ideas, I will look into this later today !
I don't want to make the output to long on each line though , ill need to find a good format to include everything and still be readable.

@evildrummer
Copy link

@Shad0wC0ntr0ller
Maybe just output hosts with a timestamp below 30 days. That's the the time we're computer passwords change. And add a parameter to get all hosts. Even with a super old timestamp

@Marshall-Hallenbeck
Copy link
Collaborator

@Shad0wC0ntr0ller can you update the single quote usage to be double quotes, and also add this module to the e2e tests command file (tests/e2e_commands.txt)?

@NeffIsBack
Copy link
Contributor

@Shad0wC0ntr0ller any update on this?

@Shad0wC0ntr0ller
Copy link
Contributor Author

Sorry guys been busy with other things, ill get this handled by EOD today

@NeffIsBack
Copy link
Contributor

Sorry guys been busy with other things, ill get this handled by EOD today

Awesome, but no pressure, justed wanted to check :)

@NeffIsBack NeffIsBack added this to the v1.2.0 milestone Nov 4, 2023
@Marshall-Hallenbeck Marshall-Hallenbeck changed the base branch from develop to main November 13, 2023 15:18
@Marshall-Hallenbeck
Copy link
Collaborator

@Shad0wC0ntr0ller did you want to get this up to date and working? We'd like to include it in the v1.2 release if you have time :)

@Shad0wC0ntr0ller
Copy link
Contributor Author

I will try to make the needed updates over the next couple of days. Thank you

@Shad0wC0ntr0ller
Copy link
Contributor Author

Sorry for the delay, I have updated the script it will now include the pwdlastset variable. let me know if there's any more adjustments you would like to see. thank you

Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
Updated separator in output 

Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
change cme to nxc

Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
Added Server 2012 to the vuln list

Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
Add pwdLastSet

Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
change ' to "

Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
Signed-off-by: Shad0wC0ntr0ller <90877534+Shad0wC0ntr0ller@users.noreply.github.com>
Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice addition! Thanks again for you work

@NeffIsBack NeffIsBack added tested reviewed code Label for when a static code review was done labels Mar 14, 2024
@NeffIsBack
Copy link
Contributor

Working flawlessly:
image

@NeffIsBack NeffIsBack merged commit 31aff31 into Pennyw0rth:main Mar 14, 2024
1 check passed
@enj5oy
Copy link

enj5oy commented Mar 16, 2024

@Shad0wC0ntr0ller hello, can you explain when this info can help?

@evildrummer
Copy link

@enj5oy it was a request from me. In PenTests you always check fir legacy or unsupported systems for the client.
It could also be a quick overview for easy targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new module reviewed code Label for when a static code review was done tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants