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

Juniper post enum module #9614

Merged
merged 1 commit into from
Mar 6, 2018
Merged

Juniper post enum module #9614

merged 1 commit into from
Mar 6, 2018

Conversation

h00die
Copy link
Contributor

@h00die h00die commented Feb 23, 2018

This is a post module to enumerate configuration items from Juniper devices, similar to the Cisco one that exists.

This is a WIP, as the SSH sessions to ScreenOS devices are being debugged via #9519 .

Do you have a Juniper? Please test this out! I only have 2 devices, and they are ones I bought to write this module (non-production), so I'm unaware of newer OS changes to commands/output, or other fields that may be good to pull/save. Please post censored output and let me know what device and OS you tested against so we can add it to the documentation.

Requires #9524 and rapid7/metasploit-credential#129

Verification

  • Get a shell on a juniper junos/screenos at different priv levels (on JunOS: root=ssh shell, user=cli)
  • use post/juniper/gather/enum_juniper
  • set session [x]
  • set verbose true
  • run
  • Verify you get lots of pretty creds

If you want to take a look at the config on the device I tested, you can see it here and a no privileges account here

Check docs for output from my device and what fields are pulled/saved.

@h00die h00die changed the title [WIP] Juniper post enum module Juniper post enum module Mar 2, 2018
@h00die
Copy link
Contributor Author

h00die commented Mar 2, 2018

Removed WIP, more like ready for review and testing by others.

@busterb busterb self-assigned this Mar 6, 2018
@busterb busterb merged commit c7bbc6e into rapid7:master Mar 6, 2018
busterb added a commit that referenced this pull request Mar 6, 2018
@h00die
Copy link
Contributor Author

h00die commented Mar 6, 2018

Before I mirror this process for juniper, any feedback?

@h00die
Copy link
Contributor Author

h00die commented Mar 6, 2018

s/juniper/brocade/

ppp_hash = result[1].strip
print_good("PPTP username #{ppp_username} hash #{ppp_hash} via PAP")
cred = credential_data.dup
cred[:username] = ppp_username
Copy link
Member

Choose a reason for hiding this comment

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

in hindsight, does this need an address too?

Copy link
Member

Choose a reason for hiding this comment

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

oh never mind, this was good (it's set above)

@busterb
Copy link
Member

busterb commented Mar 6, 2018

Some of the code patterns made me think 'stripping after splitting the config fields is tedious'.

msjenkins-r7 pushed a commit that referenced this pull request Mar 7, 2018

This module has been tested on the following hardware/OS combinations.

* ScreenOS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@busterb I know youve answered this elsewhere, but what hardware and OS was your device so i can add it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@busterb can you give me screen output for the screenos to add to this doc?


This module will look for the follow parameters which contain credentials:

* ScreenOS
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@h00die need to add to this

radius_server = result[0].strip
print_good("radius server #{radius_server} password hash: #{radius_hash}")
cred = credential_data.dup
cred[:address] = radius_server
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@busterb I never figured this one out. When this adds to the DB and you run creds you get:

host         origin       service            public          private                                         realm  private_type
+----         ------       -------            ------          -------                                         -----  ------------
+1.1.1.1      1.1.1.1      1812/udp (radius)                  $9$Y-4GikqfF39JGCu1Ileq.PQ6AB1hrlMBIyKvWdV             Nonreplayable 

I think host should be radius_server and origin would be the IP of this box itself (192.168.1.5), however all my attempts to set one but not the other failed. Any insight?

@tdoan-r7
Copy link
Contributor

tdoan-r7 commented Mar 14, 2018

Release Notes

The post/juniper/gather/enum_juniper module has been added to the framework. It enumerates configuration items from Juniper devices, similar to the Cisco one that exists.

@tdoan-r7 tdoan-r7 added the rn-enhancement release notes enhancement label Mar 14, 2018
@h00die h00die deleted the juniper_post branch March 18, 2018 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants