rapid7/metasploit-framework — pull request #4364 by todb-r7 (2014-12-11 17:19:25+00:00)
Title: Modules should respect bruteforce_speed again

This adds a bruteforce_speed attribute to the base login scanner, and adds the option to every LoginScanner module. It's a little more expressive than the old style of bruteforce_speed; now, modules have the option of setting their own idea of what is "slow" or "fast" between logins, ranging from 0 (very slow) to 5 (no waits).

## Validation

- [ ] Fire up trusty old Metasploitable, make sure the hostname `metasploitable` is in your `/etc/hosts`
- [ ] Create a password file containing the passwords, `%w{foo bar msfadmin baz}`. Save it to `/tmp/p.txt`.
- [ ] start up msfconsole with the following resource script:

````
sleep 1
date
use auxiliary/scanner/telnet/telnet_login
set USERNAME msfadmin
set PASS_FILE /tmp/p.txt
set RHOSTS metasploitable
set BRUTEFORCE_SPEED 5
run
date
sleep 1
set BRUTEFORCE_SPEED 1
run
date
exit -y
````

- [ ] On the first run, see that the first three attempts take very little time.
- [ ] On the second run, see that the next round (with BRUTEFORCE_SPEED set to 1) takes at least 30 seconds; the first attempt should happen right away, then 15 pause, then second attempt, then 15 second pause, then the last and successful attempt.

- [ ] Test other modules to taste, but they all should behave the same way.
- [ ] New Rspec tests don't cause Travis to fail.