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

Documentation of auxiliary scanner modules #9310

Merged
merged 45 commits into from Feb 24, 2018
Merged

Conversation

vishalkg
Copy link
Contributor

Following modules have been documented:

  1. http:

    • webdav_scanner
    • verb_auth_bypass
    • webdav_website_content
    • wordpress_login_enum
    • ssl dir_webdav_unicode_bypass cert
    • dir_scanner
  2. smb

    • pipe_auditor
    • pipe_dcerpc_auditor
    • smb2
    • smb_enumshares
  3. mysql

    • mysql_login
    • mysql_version
  4. msmsql

    • mssql_ping
    • mssql_idf
    • mssql_sql
  5. discovery

    • ipv6_neighbor
    • udp_probe
    • udp_sweep
  6. dcerpc

    • endpoint_mapper
    • hidden
    • management
    • tcp_dcerpc_auditor


## Scenarios

**Running the scanner**
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets change this line to

### Example Windows 2003, and Windows 7 Targets

Copy link
Contributor Author

@vishalkg vishalkg Dec 28, 2017

Choose a reason for hiding this comment

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

Hey @h00die, I am supposed to make these changes in my fork, correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup. When you push the changes to your branch, the PR will automatically update

@@ -0,0 +1,76 @@
## Description

The hidden scanner connects to a given range of IP addresses and try to locate any RPC services that are not listed in the Endpoint Mapper and determine if anonymous access to the service is allowed.
Copy link
Contributor

Choose a reason for hiding this comment

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

try to tries
determine to determines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

**Running the scanner**
```
msf > use auxiliary/scanner/dcerpc/endpoint_mapper
msf auxiliary(endpoint_mapper) > show options
Copy link
Contributor

Choose a reason for hiding this comment

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

since you show setting the options, no need to show a show options. You can save 10 lines 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.

Done.

**Running the scanner**
```
msf > use auxiliary/scanner/dcerpc/hidden
msf auxiliary(hidden) > show options
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for show options

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

msf auxiliary(hidden) >
```

As you can see, despite the simple setup, we still gathered some additional information about one of our targets.
Copy link
Contributor

Choose a reason for hiding this comment

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

this line can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

2. Do: ```set RHOSTS [IP]```
3. Do: ```run```

Let the default dictionary included in Metasploit set, set our target, and let the scanner run.
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line


```
> use auxiliary/scanner/http/dir_scanner
msf auxiliary(dir_scanner) > show options
Copy link
Contributor

Choose a reason for hiding this comment

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

remove


## Scenarios

**Running the scanner**
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of this line, if you are scanning a specific box (like metasploitable 2) call that out here so someone could reproduce the same results. Typically we do this under triple # so that it makes a sub heading

msf auxiliary(dir_scanner) >
```

A quick scan has turned up a number of directories on the target server that could be certainly investigated further.
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

msf auxiliary(dir_scanner) >
```

A quick scan has turned up a number of directories on the target server that could be certainly investigated further.
Copy link
Contributor

Choose a reason for hiding this comment

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

For modules like this which are generic enough, i like to include documentation on using other "industry standard" tools which could also be used. In this case, I think showing the equivalent command in dirb would be useful.
See https://github.com/h00die/metasploit-framework/blob/b2f9bbc43c100709009e8a6d6a2050a0fec02eb3/documentation/modules/auxiliary/scanner/x11/open_x11.md#confirming as an example

@h00die
Copy link
Contributor

h00die commented Dec 16, 2017

Not done with edits, but this is also why its nice to have the docs divided up between different PRs so its not overwhelming (to review, and then to edit the review comments). Plus we could land as soon as some are ready and not e held up by others.

In general pretty good, you should be able to notice the pattern: remove options line, and the bold line under scenarios.

If there is an industry standard tool, add a quick show of how to use that as another way of verifying results. I didn't mark the dcerpc ones, but nmap most likely also has an equivalent. See https://github.com/h00die/metasploit-framework/blob/b2f9bbc43c100709009e8a6d6a2050a0fec02eb3/documentation/modules/auxiliary/scanner/x11/open_x11.md#confirming as an example.

I'll get some time later to review some more, but feel free if you get time to edit those other docs before i get to them.

Thanks for all these, big help!!!!

@h00die
Copy link
Contributor

h00die commented Dec 16, 2017

Typically also you'll want to make a new branch in your own repo instead of using 'metasploit-framework', just a tip for the future!

[*] Scanned 55 of 55 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(endpoint_mapper) >
```
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be another good candidate for the 'verify' section of showing the equivalent with nmap: https://nmap.org/nsedoc/scripts/msrpc-enum.html

[*] Scanned 256 of 256 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(cert) >
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Another good candidate for a 'verify' section: https://nmap.org/nsedoc/scripts/ssl-cert.html

@@ -0,0 +1,66 @@
## Description

The WebDAV extension in Microsoft Internet Information Services (IIS) 5.1 and 6.0 allows remote attackers to bypass URI-based protection mechanisms, and list folders or read, create, or modify files, via a %c0%af (Unicode / character) at an arbitrary position in the URI, as demonstrated by inserting %c0%af into a "/protected/" initial pathname component to bypass the password protection on the protected\ folder, aka "IIS 5.1 and 6.0 WebDAV Authentication Bypass Vulnerability," a different vulnerability than CVE-2009-1122. More info about this vulnerability can be found [here](http://cve.mitre.org/cgi-bin/cvename.cgi?name=2009-1535).
Copy link
Contributor

Choose a reason for hiding this comment

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

change "/protected/" to `/protected/`


The WebDAV extension in Microsoft Internet Information Services (IIS) 5.1 and 6.0 allows remote attackers to bypass URI-based protection mechanisms, and list folders or read, create, or modify files, via a %c0%af (Unicode / character) at an arbitrary position in the URI, as demonstrated by inserting %c0%af into a "/protected/" initial pathname component to bypass the password protection on the protected\ folder, aka "IIS 5.1 and 6.0 WebDAV Authentication Bypass Vulnerability," a different vulnerability than CVE-2009-1122. More info about this vulnerability can be found [here](http://cve.mitre.org/cgi-bin/cvename.cgi?name=2009-1535).

CVE: CVE-2009-1535
Copy link
Contributor

Choose a reason for hiding this comment

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

can be removed

@@ -0,0 +1,66 @@
## Description

The WebDAV extension in Microsoft Internet Information Services (IIS) 5.1 and 6.0 allows remote attackers to bypass URI-based protection mechanisms, and list folders or read, create, or modify files, via a %c0%af (Unicode / character) at an arbitrary position in the URI, as demonstrated by inserting %c0%af into a "/protected/" initial pathname component to bypass the password protection on the protected\ folder, aka "IIS 5.1 and 6.0 WebDAV Authentication Bypass Vulnerability," a different vulnerability than CVE-2009-1122. More info about this vulnerability can be found [here](http://cve.mitre.org/cgi-bin/cvename.cgi?name=2009-1535).
Copy link
Contributor

Choose a reason for hiding this comment

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

Change "here" for the link to be the CVE name, i think that will look slightly better.


## Scenarios

**Running the scanner**
Copy link
Contributor

Choose a reason for hiding this comment

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

replace with version of OS that was scanned

**Running the scanner**
```
msf > use auxiliary/scanner/smb/smb2
msf auxiliary(smb2) > show options
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.


## Scenarios

**Running the scanner**
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace with "### Uncredentialed"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

[*] Auxiliary module execution completed
msf auxiliary(smb_enumshares) >
```

Copy link
Contributor

Choose a reason for hiding this comment

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

add "### Credentialed"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

[*] Scanned 16 of 16 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(smb_enumshares) >
```
Copy link
Contributor

Choose a reason for hiding this comment

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

@h00die
Copy link
Contributor

h00die commented Dec 16, 2017

ok, all done first pass. This will shrink the PR a little with all the "options" gone.
After you go through and make all these changes, i'll do a 2nd pass to look for spelling/grammar/syntax as well.

@vishalkg
Copy link
Contributor Author

Hi @h00die,

I appreciate all the review effort by you. I will do the required changes in some days and let you know at the earliest.

@h00die
Copy link
Contributor

h00die commented Jan 4, 2018

Were you done updating everything, or should I wait on this.

@vishalkg
Copy link
Contributor Author

vishalkg commented Jan 6, 2018

A few more left, will be done by next week.

@h00die
Copy link
Contributor

h00die commented Jan 23, 2018

No need to mark each done individually. When you commit the change the comment will get hidden implying you fixed it. Just let me know when they're all done

@h00die
Copy link
Contributor

h00die commented Feb 3, 2018

@vishalkg just wanted to check in on how it was going. I know this was a BIG undertaking, so it can take a while to get things all patched up. To save some time, you can put all the changes into one commit, no need to do a commit per edit. That may also help.

@h00die
Copy link
Contributor

h00die commented Feb 24, 2018

@vishalkg just checking in again, its been over a month. I don't want to see all this work go to waste, so I may start doing some of the touchups to get it landed, but just wanted to check in again first.

@h00die h00die merged commit c13e024 into rapid7:master Feb 24, 2018
h00die added a commit that referenced this pull request Feb 24, 2018
@h00die
Copy link
Contributor

h00die commented Feb 24, 2018

Had a few edits I went ahead and just did myself to go ahead and get this landed: c56d796 and 15a29a1

There are still a few places I think the docs could be expanded to show how other tools can verify the data, however this has been too long to not get landed.

If you get time to do any more, send them in smaller batches and we should be able to get it all landed quicker.

Thanks for all the work, these docs are great!!!!

@h00die
Copy link
Contributor

h00die commented Feb 24, 2018

Release Notes

This PR adds a bunch of new module docs for aux scanner modules.

msjenkins-r7 pushed a commit that referenced this pull request Feb 26, 2018
@tdoan-r7 tdoan-r7 added the rn-no-release-notes no release notes label Mar 1, 2018
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