rapid7/metasploit-framework — pull request #2316 by jvazquez-r7 (2013-09-01 04:59:25+00:00)
Title: Try to Fix use of datastore from Auxiliary::AuthBrute

This pull request tries to patch the Auxiliary::AuthBrute in probably a better way, avoiding the modification of the datastore options USERNAME and PASSWORD.

This patch is based on the study of the commit which introduced the dynamic modification of the datastore: https://github.com/rapid7/metasploit-framework/commit/7d626e3ad1a81ac93d0da33d43abd62729069531

This pull request tries to be a better patch than https://github.com/rapid7/metasploit-framework/pull/2297 , but feedback from @dmaloney-r7 / @jlee-r7 would be helpful in order to decide if land this one or #2297

Test after patch:

* telnet_login

```
msf auxiliary(telnet_login) > set USERNAME juan
USERNAME => juan
msf auxiliary(telnet_login) > set PASSWORD juan
PASSWORD => juan
msf auxiliary(telnet_login) > run

[*] 192.168.172.198:23 Telnet - [1/2] - Attempting: 'juan':''
[*] 192.168.172.198:23 TELNET - [1/2] - Banner: Debian GNU/Linux 6.0 debian login:
[*] 192.168.172.198:23 TELNET - [1/2] - Prompt: Password:
[*] 192.168.172.198:23 TELNET - [1/2] - Result: Login incorrect
[*] 192.168.172.198:23 Telnet - [2/2] - Attempting: 'juan':'juan'
[*] 192.168.172.198:23 TELNET - [2/2] - Banner: Debian GNU/Linux 6.0 debian login:
[*] 192.168.172.198:23 TELNET - [2/2] - Prompt: Password:
[*] 192.168.172.198:23 TELNET - [2/2] - Result: Last login: Thu Aug 29 16:25:12 CDT 2013 from juans-macbook-pro.local on pts/1 Linux debian 2.6.32-5-686 #1 SMP Fri May 10 08:33:48 UTC 2013 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. You have new mail.
[+] 192.168.172.198 - SUCCESSFUL LOGIN juan : juan
[*] Attempting to start session 192.168.172.198:23 with juan:juan
[*] Command shell session 1 opened (192.168.172.1:53574 -> 192.168.172.198:23) at 2013-08-31 23:40:32 -0500
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

```

* rlogin_login

```
msf auxiliary(rlogin_login) > set rHOSTS 192.168.172.198
rHOSTS => 192.168.172.198
msf auxiliary(rlogin_login) > set USERNAME juan
USERNAME => juan
msf auxiliary(rlogin_login) > set PASSWORD juan
PASSWORD => juan
msf auxiliary(rlogin_login) > run

[*] 192.168.172.198:513 - Starting rlogin sweep
[*] 192.168.172.198:513 rlogin - Attempting: 'juan':"" from 'root'
[*] 192.168.172.198:513 RLOGIN - Prompt: Password:
[*] 192.168.172.198:513 RLOGIN - Result:
[*] 192.168.172.198:513 rlogin - Attempting: 'juan':"juan" from 'daemon'
[*] 192.168.172.198:513 RLOGIN - Prompt: Password:
[*] 192.168.172.198:513 RLOGIN - Result: Last login: Sat Aug 31 23:44:28 CDT 2013 from Juans-MacBook-Pro.local on pts/2 Linux debian 2.6.32-5-686 #1 SMP Fri May 10 08:33:48 UTC 2013 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. You have new mail.
[+] 192.168.172.198:513, rlogin 'juan' successful with password "juan"
[*] Command shell session 1 opened (192.168.172.1:1022 -> 192.168.172.198:513) at 2013-08-31 23:50:26 -0500
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

```