Skip to content

Commit f07cd52

Browse files
committed
Msftidy!
1 parent c220053 commit f07cd52

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

modules/auxiliary/scanner/smb/smb_login.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def run_host(ip)
7272
print_brute(:level => :vstatus, :ip => ip, :msg => "Starting SMB login bruteforce")
7373

7474
domain = datastore['SMBDomain'] || ""
75-
75+
7676
if accepts_bogus_logins?(domain)
7777
print_error("#{smbhost} - This system accepts authentication with any credentials, brute force is ineffective.")
7878
return
@@ -111,9 +111,8 @@ def check_login_status(domain, user, pass)
111111
datastore['SMB::Native_OS'],
112112
datastore['SMB::Native_LM'],
113113
{:use_spn => datastore['NTLM::SendSPN'], :name => self.rhost})
114-
115114
# Windows SMB will return an error code during Session Setup, but nix Samba requires a Tree Connect:
116-
simple.connect("\\\\#{datastore['RHOST']}\\IPC$")
115+
simple.connect("\\\\#{datastore['RHOST']}\\IPC$")
117116
status_code = 'STATUS_SUCCESS'
118117
rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e
119118
status_code = e.get_error(e.error_code)
@@ -127,14 +126,14 @@ def check_login_status(domain, user, pass)
127126
end
128127

129128
# If login is succesful and auth_user is unset
130-
# the login was as a guest user.
129+
# the login was as a guest user.
131130
def accepts_guest_logins?(domain)
132131
guest = false
133132
user = Rex::Text.rand_text_alpha(8)
134133
pass = Rex::Text.rand_text_alpha(8)
135134

136135
guest_login = ((check_login_status(domain, user, pass) == 'STATUS_SUCCESS') && simple.client.auth_user.nil?)
137-
136+
138137
if guest_login
139138
@accepts_guest_logins['rhost'] ||=[] unless @accepts_guest_logins.include?(rhost)
140139
report_note(
@@ -152,7 +151,7 @@ def accepts_guest_logins?(domain)
152151
end
153152

154153
# If login is successul and auth_user is set
155-
# then bogus creds are accepted.
154+
# then bogus creds are accepted.
156155
def accepts_bogus_logins?(domain)
157156
user = Rex::Text.rand_text_alpha(8)
158157
pass = Rex::Text.rand_text_alpha(8)
@@ -205,8 +204,8 @@ def try_user_pass(domain, user, pass)
205204
report_creds(domain,user,pass,true)
206205
elsif datastore['VERBOSE']
207206
print_status(output_message % "GUEST LOGIN")
208-
end
209-
end
207+
end
208+
end
210209
when *@correct_credentials_status_codes
211210
print_status(output_message % "FAILED LOGIN, VALID CREDENTIALS" )
212211
report_creds(domain,user,pass,false)

0 commit comments

Comments
 (0)