2020-01-30 13:48:09 -05:00
|
|
|
## Vulnerable Application
|
2019-11-22 07:01:05 -06:00
|
|
|
|
2020-01-16 23:15:03 -06:00
|
|
|
This module determines if usernames are valid on a server running Apache with the `UserDir` directive enabled.
|
2020-01-30 13:48:09 -05:00
|
|
|
It takes advantage of Apache returning different error codes for usernames that do not exist and for usernames
|
|
|
|
|
that exist but have no `public_html` directory.
|
2019-12-10 20:58:14 -06:00
|
|
|
|
2020-01-16 23:15:03 -06:00
|
|
|
### Enabling `UserDir` on Ubuntu 16.04 with Apache installed
|
|
|
|
|
1. `sudo a2enmod userdir`
|
|
|
|
|
2. `sudo service apache2 restart`
|
2019-12-10 20:58:14 -06:00
|
|
|
|
2019-11-22 07:01:05 -06:00
|
|
|
## Verification Steps
|
|
|
|
|
|
|
|
|
|
1. Do: ```use auxiliary/scanner/http/apache_userdir_enum```
|
|
|
|
|
2. Do: ```set RHOSTS [IP]```
|
|
|
|
|
3. Do: ```set RPORT [PORT]```
|
|
|
|
|
4. Do: ```run```
|
2019-12-10 20:58:14 -06:00
|
|
|
|
2020-01-16 23:15:03 -06:00
|
|
|
## Scenarios
|
|
|
|
|
|
|
|
|
|
### Apache 2.4.18 on Ubuntu 16.04
|
2019-12-10 20:58:14 -06:00
|
|
|
|
2019-12-10 20:59:54 -06:00
|
|
|

|
2020-01-16 23:15:03 -06:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
msf5 > use auxiliary/scanner/http/apache_userdir_enum
|
|
|
|
|
msf5 auxiliary(scanner/http/apache_userdir_enum) > set rhosts alderaan
|
|
|
|
|
rhosts => alderaan
|
|
|
|
|
msf5 auxiliary(scanner/http/apache_userdir_enum) > run
|
|
|
|
|
|
|
|
|
|
[*] http://192.168.6.172/~ - Trying UserDir: ''
|
|
|
|
|
[*] http://192.168.6.172/ - Apache UserDir: '' not found
|
|
|
|
|
[*] http://192.168.6.172/~4Dgifts - Trying UserDir: '4Dgifts'
|
|
|
|
|
[*] http://192.168.6.172/ - Apache UserDir: '4Dgifts' not found
|
|
|
|
|
...
|
|
|
|
|
[*] http://192.168.6.172/~zabbix - Trying UserDir: 'zabbix'
|
|
|
|
|
[*] http://192.168.6.172/ - Apache UserDir: 'zabbix' not found
|
|
|
|
|
[*] http://192.168.6.172/~vagrant - Trying UserDir: 'vagrant'
|
|
|
|
|
[*] http://192.168.6.172/ - Apache UserDir: 'vagrant' not found
|
|
|
|
|
[+] http://192.168.6.172/ - Users found: backup, bin, daemon, games, gnats, irc, list, lp, mail, man, messagebus, news, nobody, proxy, sshd, sync, sys, syslog, uucp
|
|
|
|
|
[*] Scanned 1 of 1 hosts (100% complete)
|
|
|
|
|
[*] Auxiliary module execution completed
|
|
|
|
|
```
|