rapid7/metasploit-framework — pull request #2922 by wchen-r7 (2014-01-26 18:57:22+00:00)
Title: Multi-threaded check command, plus aux scanner support

This PR addresses the following redmine tickets:

* **Multi-threaded support for check:** http://dev.metasploit.com/redmine/issues/8752
* **Aux scanner support:** http://dev.metasploit.com/redmine/issues/8753
* **Deprecate ms08_067_check:** http://dev.metasploit.com/redmine/issues/8755

It is also the final completion of this ticket:
http://dev.metasploit.com/redmine/issues/8737

## Usage:

Basically there are two ways to use this command:

**Example 1:**

```check [an IP or an IP range]```

**Example 2:**

```
> set [RHOST or RHOSTS] IP
> check
```

If you wish to have more threads, then do:

```set threads [number of threads]```

Please note: Having more threads may result in missed opportunities (meaning that even though a host is vulnerable, it may not be flagged).

## Verifications

Before you begin, please make sure you have the following for testing:

- [ ] A Windows XP box vulnerable to ms08-067
- [ ] A fake web server: ```ruby -run -e httpd . -p 8181```
- [ ] Have aux_scanner_check_test.rb for testing: https://gist.github.com/wchen-r7/f297c96881f073336208, you should probably place it under: auxiliary/scanner/http because this is a scanner module.

And now let's move on to these scenarios:

**Scenario 1: With ms08_067_netapi, set the RHOST and run check**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use exploit/windows/smb/ms08_067_netapi```
- [ ] Enter command: ```set rhost [IP]```
- [ ] Enter command: ```check```
- [ ] You should see the check run and flag your test box as vulnerable

**Scenario 2: With ms08_067_netapi, check multiple hosts**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use exploit/windows/smb/ms08_067_netapi```
- [ ] Enter command: ```check [range]``` (keep the range small or it will run for a long time)
- [ ] You should see the check run, and eventually flag your test box as vulnerable

**Scenario 3: With ms08_067_netapi, set threads, and run multiple hosts**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use exploit/windows/smb/ms08_067_netapi```
- [ ] Enter command: ```set threads 10```
- [ ] Enter command: ```check [range]``` (ideally try to keep the range small for faster testing)
- [ ] You should see the check to run faster.
- [ ] You should also see your test box flagged as vulnerable. However, if you set the threads too high, you might not see that.

**Scenario 4: With ms08_067_netapi, abort scanning while on a multi-threaded scan**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use exploit/windows/smb/ms08_067_netapi```
- [ ] Enter command: ```set threads 10```
- [ ] Enter command: ```check [range]``` (ideally try to keep the range small for faster testing)
- [ ] When the check starts to run, press [CTRL]+[C] to abort
- [ ] You should see "Caught interrupt from the console", and no more scan messages.

**Scenario 5: With ms08_067_netapi, run check without any arguments**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use exploit/windows/smb/ms08_067_netapi```
- [ ] Enter command: ```check```
- [ ] You should see an option validation error about "RHOST"

**Scenario 6: Run nodejs_pipelining.rb against the fake web server**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use auxiliary/dos/http/nodejs_pipelining```
- [ ] Enter command: ```set rport [fake web server PORT]```
- [ ] Enter command: ```check [fake web server IP]```
- [ ] You should see a check message

**Scenario 7: Run aux_scanner_check_test against the web server**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use [path to aux_scanner_check_test.rb]```
- [ ] Enter command: ```set rport [fake web server rport]```
- [ ] Enter command: ```check [web server IP]```
- [ ] You should see a check message

**Scenario 8: With aux_scanner_check_test, run check without any arguments```

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use [path to aux_scanner_check_test.rb]```
- [ ] Enter command: ```check```
- [ ] You should see an option validation error about "RHOSTS"

**Scenario 9: Run a module that does not support check at all**

- [ ] Start ```msfconsole```
- [ ] Enter command: ```use auxiliary/scanner/http/soap_xml```
- [ ] Enter command: ```set rhosts [IP]```
- [ ] Enter command: ```check```
- [ ] You should see: "This module does not support check."