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

adding getOSandSMBproperties.py #550

Closed
wants to merge 9 commits into from
Closed

Conversation

maaaaz
Copy link

@maaaaz maaaaz commented Jan 2, 2019

Hello there, this PR is the answer to my own wish here #492 :)

This script will connect against a target (or list of targets) machine/s and export in CSV:

  • The OS version
  • The SMB properties:
    • SMBv1 support
    • Enabled shares
    • Trafic signature

This script is based on:

It uses the unicodecsv external module in order to be able to output utf-8 content in CSV with Python 2 (which is a pure nightmare otherwise).

The main usage of the script:

$ python getOSandSMBproperties.py -i <input_file> -d <domain> -u <username> -p <pass> -o <out.csv>

$ cat out.csv
"SERVER_IP";"SERVER_DOMAIN";"SERVER_NAME";"OS_VERSION";"SIGNING_REQUIRED";"SHARE_NAME";"SHARE_REMARK"
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"ADMIN$";"Remote Admin"
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"C$";"Default share"
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"IPC$";"Remote IPC"
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"NETLOGON";"Logon server share"
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"share";""
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"SYSVOL";"Logon server share"
"192.168.75.130";"ADYOLO";"DC01";"Windows Server 2012 R2 Datacenter Evaluation 9600";"true";"àéyoloshare";""

The next step is to optimize the processing with asynchronous execution, I'm thinking of using concurrent.futures (native module in Python 3, pip install futures in Python 2).

Cheers !

@anadrianmanrique
Copy link
Contributor

we merged in #1404 some similar functionality to this one.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants