|
| 1 | +## Vulnerable Application |
| 2 | + |
| 3 | +The R Services (rexecd, rlogind, and rshd) are a suite of unencrypted remote command/login services developed in the 1980s. |
| 4 | +These services are all but unused in modern computing, as they have been replace by telnet and ssh. |
| 5 | + |
| 6 | +The following was done on Kali linux: |
| 7 | + |
| 8 | + 1. `apt-get install rsh-server` which includes: `rexecd`, `rlogind` and `rshd`. |
| 9 | + 2. Start the service: `service openbsd-inetd start` |
| 10 | + |
| 11 | +## Verification Steps |
| 12 | + |
| 13 | + 1. Install and configure rexec |
| 14 | + 2. Start msfconsole |
| 15 | + 3. Do: `use auxiliary/scanner/rservices/rexec_login` |
| 16 | + 4. Do: `set rhosts` |
| 17 | + 5. Set any other credentials that will need to be set |
| 18 | + 6. Do: `run` |
| 19 | + |
| 20 | +## Scenarios |
| 21 | + |
| 22 | + A run against the configuration from these docs |
| 23 | + |
| 24 | + ``` |
| 25 | + msf > use auxiliary/scanner/rservices/rexec_login |
| 26 | + msf auxiliary(rexec_login) > set username test |
| 27 | + username => test |
| 28 | + msf auxiliary(rexec_login) > set password 'test' |
| 29 | + password => test |
| 30 | + msf auxiliary(rexec_login) > run |
| 31 | + |
| 32 | + [*] 127.0.0.1:512 - 127.0.0.1:512 - Starting rexec sweep |
| 33 | + [+] 127.0.0.1:512 - 127.0.0.1:512, rexec 'test' : 'test' |
| 34 | + [!] 127.0.0.1:512 - *** auxiliary/scanner/rservices/rexec_login is still calling the deprecated report_auth_info method! This needs to be updated! |
| 35 | + [!] 127.0.0.1:512 - *** For detailed information about LoginScanners and the Credentials objects see: |
| 36 | + [!] 127.0.0.1:512 - https://github.com/rapid7/metasploit-framework/wiki/Creating-Metasploit-Framework-LoginScanners |
| 37 | + [!] 127.0.0.1:512 - https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-HTTP-LoginScanner-Module |
| 38 | + [!] 127.0.0.1:512 - *** For examples of modules converted to just report credentials without report_auth_info, see: |
| 39 | + [!] 127.0.0.1:512 - https://github.com/rapid7/metasploit-framework/pull/5376 |
| 40 | + [!] 127.0.0.1:512 - https://github.com/rapid7/metasploit-framework/pull/5377 |
| 41 | + [*] Command shell session 2 opened (127.0.0.1:37489 -> 127.0.0.1:512) at 2017-04-27 20:56:54 -0400 |
| 42 | + [*] Scanned 1 of 1 hosts (100% complete) |
| 43 | + [*] Auxiliary module execution completed |
| 44 | + ``` |
| 45 | + |
| 46 | +## Confirming using NMAP |
| 47 | + |
| 48 | +Utilizing [rexec-brute](https://nmap.org/nsedoc/scripts/rexec-brute.html) |
| 49 | + |
| 50 | + ``` |
| 51 | + nmap -p 512 --script rexec-brute 127.0.0.1 |
| 52 | + |
| 53 | + Starting Nmap 7.40 ( https://nmap.org ) at 2017-04-27 21:23 EDT |
| 54 | + Nmap scan report for localhost (127.0.0.1) |
| 55 | + Host is up (0.000037s latency). |
| 56 | + PORT STATE SERVICE |
| 57 | + 512/tcp open exec |
| 58 | + | rexec-brute: |
| 59 | + | Accounts: |
| 60 | + | test:test - Valid credentials |
| 61 | + |_ Statistics: Performed 7085940 guesses in 629 seconds, average tps: 9231.6 |
| 62 | + ``` |
0 commit comments